
var $mediaFiles = '';
function initMedia() {(

function($) {var imgList = [];$.extend({preload: 

function(imgArr, option) {var setting = $.extend({init: 

function(loaded, total) {},loaded: 

function(img, loaded, total) {},loaded_all: 

function(loaded, total) {}}, option);var total = imgArr.length;var loaded = 0;setting.init(0, total);for(var i in imgArr) {imgList.push($("<img />").attr("src", imgArr[i]).load(
function() {loaded++;setting.loaded(this, loaded, total);if(loaded == total) {setting.loaded_all(loaded, total);}}));}}});})(jQuery);if($('#media')){$mediaFiles = $('#media').children();$('#media').html('<div class="mediaBtn" id="mediaBtnP" onClick="prevMedia()">&lt;</div><div id="mediaHolder"><div id="mediaHolderContainer"></div></div><div class="mediaBtn" id="mediaBtnN" onClick="nextMedia()">&gt;</div>');setMediaArrows(0,$($mediaFiles).length);$($mediaFiles).each(

function(index) {
	$(this).attr({width:250, height:190});
	$(this).css({display:'inline'});
	
	$(this).appendTo('div#mediaHolderContainer');
	
	if($(this).attr('alt').length > 5) {
		//gotoyt
		//alert($(this).html());
		var a = $('<a/>').attr('href', 'http://www.youtube.com/watch?v='+$(this).attr('alt'));
		$(a).attr('target', '_blank');//'+$(this).attr('src')+'
		$(a).html('<img src="img/media/videoOverlay.gif" width="250" height="190" />');
		$(a).css({display:'inline-block',width:'250px',height:'190px', backgroundImage: 'url('+$(this).attr('src')+')'});
		$(this).replaceWith(a);
	}
	
	$count++;});
	$('#mediaHolderContainer').css({width:($count*250)+'px'});
	}}

function resetMedia() {$count = 0}var feedCount=0;

function refreshFeed() { $('#camimg').html(''); $('#refresh').hide();var img = new Image();$(img).load(

function () {$(this).hide();$('#camimg').append(this);$(this).fadeIn('fast');setTimeout(

function() { $('#refresh').fadeIn('fast'); }, 500);}).error(

function () {$('#refresh').fadeIn('fast');}).attr('src', 'img/feed/webcam.php?t='+(feedCount++));}var $count = 0;

function prevMedia(){$('#mediaHolderContainer').stop();var amount = 250;if(parseInt($('#mediaHolderContainer').css('marginLeft'))+250 > 0) {amount = 250-(parseInt($('#mediaHolderContainer').css('marginLeft'))+250);}$('#mediaHolderContainer').animate({marginLeft: '+='+amount}, 500, 

function() {setMediaArrows(_curmed-1);if(parseInt($('#mediaHolderContainer').css('marginLeft')) > 0){$('#mediaHolderContainer').animate({marginLeft:'0px'},100);}})}

function nextMedia(){$('#mediaHolderContainer').stop();var amount = 250;if(parseInt($('#mediaHolderContainer').css('marginLeft'))-250 < -(($count-2)*250)) {amount = (parseInt($('#mediaHolderContainer').css('marginLeft')) + (($count-1)*250))}$('#mediaHolderContainer').animate({marginLeft: '-='+amount}, 500, 

function() {setMediaArrows(_curmed+1);if(parseInt($('#mediaHolderContainer').css('marginLeft')) < -(($count-2)*250)){$('#mediaHolderContainer').animate({marginLeft:-(($count-1)*250)+'px'},100);}})};var _medcnt = 0;var _curmed = 0;

var preservemax = 0;
function setMediaArrows(_trgt,_max){
	_medcnt = $($mediaFiles).length-1;
	//alert(_trgt+"/"+_medcnt);
	if(_trgt < 0) _trgt = 0;
	if(_trgt > $($mediaFiles).length) _trgt = _medcnt;
	_curmed = _trgt;
	$('#mediaBtnP').html('&lt;');
	$('#mediaBtnN').html('&gt;');
	if(_trgt <= 0) $('#mediaBtnP').html('');
	if(_trgt >= _medcnt) $('#mediaBtnN').html('');
	if(_medcnt == 0) $('#mediaBtnP').html('');
	if(_medcnt == 0) $('#mediaBtnN').html('');
}
var curPage = "";var pageListener = null;var buildvar = 0;

function initFlash(e){if(String(e.success) != 'true'){$('body').css({overflow:'auto'});var to = $('#sitemap').html();setHtml();$('#sitemap').html(to);initNavigation();}}

function initHtml(e){buildvar++;if(buildvar == 2) {$('body').css({overflow:'auto'});var to = $('#sitemap').html();setHtml();$('#sitemap').html(to);initNavigation();}}$().ready(

function(){buildvar++;if(buildvar == 2) {$('body').css({overflow:'auto'});var to = $('#sitemap').html();setHtml();$('#sitemap').html(to);initNavigation();}});

function setHtml(){$('#flashContent').html('<div id="page"><div id="header"><table cellpadding="0" cellspacing="0" border="0" style="width:100%; height:60px"><tr><td bgcolor="#000000" width="127"><a href="#/collective" target="_self" id="header_logo"><img src="img/header/logo_flc.jpg" alt="Festina Lente Collective" width="127" height="60" border="0" /></a></td><td style="background:url(img/header/link_bg.jpg) repeat-x;" align="left" valign="top"><table cellpadding="0" cellspacing="0" border="0"><tr><td style="width:100px;height:29px;"><a href="#/media" target="_self" id="header_link1"><img src="img/header/link_flm.jpg" alt="Festina Lente Media" width="100" height="30" border="0" /></a></td></tr><tr><td style="width:100px;height:29px;"><a href="#/fashion" target="_self" id="header_link2"><img src="img/header/link_flf.jpg" alt="Festina Lente Fashion" width="100" height="30" border="0" /></a></td></tr></table></td><td bgcolor="#000000" width="60" align="center" valign="middle" style="background-image:url(img/header/link_bg_sm.jpg)"><table cellpadding="0" cellspacing="5" border="0"><tr><td width="20" height="20"><a href="gotofacebook" target="_blank" id="sm_facebook"><img src="img/header/social_facebook.jpg" width="20" height="20" border="0" /></a></td><td width="20" height="20"><a href="gototwitter" target="_blank" id="sm_twitter"><img src="img/header/social_twitter.jpg" width="20" height="20" border="0" /></a></td></tr><tr><td width="20" height="20"><a href="gotoyoutube" target="_blank" id="sm_youtube"><img src="img/header/social_youtube.jpg" width="20" height="20" border="0" /></a></td><td width="20" height="20"><a href="gotovimeo" target="_blank" id="sm_vimeo"><img src="img/header/social_vimeo.jpg" width="20" height="20" border="0" /></a></td></tr></table></td></tr></table></td></tr></table></div><div id="feed" onclick="refreshFeed()"><div id="camimg"><img src="img/feed/webcam.php" width="318" height="140" alt="webcam feed" border="0" /></div><div id="refresh"></div></div><div id="menu"></div><div id="submenus"><div id="submenuL"></div><div id="submenuR"></div></div><div id="content"><div id="contentHolder"></div></div><div id="news"><div id="contentHolder"></div></div><div id="media"></div><div id="sitemap"></div></div>');

$(document).bind("contextmenu",

function(e){return false;});}$linksOrg = '';

function initNavigation(){if(pageListener == null){$linksOrg = $('#sitemap').html();pageListener = setInterval('initNavigation()', 100);}if(!document.location.toString().match("#")) {document.location = "#/collective/";return;}if(curPage != document.location.toString()){curPage = document.location.toString();curTarget = curPage.split("#");curTarget = curTarget[curTarget.length-1];$links = $linksOrg.split(' target="_self"').join('');$links = $links.split('http://www.festinalentecollective.com/collective').join('#/collective');$links = $links.split('http://www.festinalentecollective.com/media').join('#/media');$links = $links.split('http://www.festinalentecollective.com/fashion').join('#/fashion');$links = $links.split(curTarget+'">').join(curTarget+'">&raquo; ');$('#sitemap').html($links);$('#sitemap A').each(

function(index) {$lt = $(this).html();if(String($lt).length > 20) $lt = $lt.substr(0,17)+'...';$lt = $lt.split(' ...').join('...');$(this).html($lt)});var pageContent = "";$.ajax({type: "POST",dataType: "xml",url: "html_feed/index.php",data: "get="+curTarget,success: 

function(msg){if($(msg).find('forcepath').text() == "1") window.location = $(msg).find('goto').text();resetMedia();$('#scrollMenu').remove();$('#submenuL').show();$('#submenuR').show();$('#content').show();$('#news').show();$('#media').show();$PATH = $(msg).find('goto').text().split("/");

if($PATH[1] == "collective"){
	$('#header_logo').attr({href:'#/collective/'});
	$('#header_logo').html('<img src="img/header/logo_flc.jpg" alt="Festine Lente Collective Logo" border="0" />');
	$('#header_link2').attr({href:'#/media/'});
	$('#header_link2').html('<img src="img/header/link_flm.jpg" alt="Festine Lente Media Link" border="0" />');
	$('#header_link1').attr({href:'#/fashion/'});
	$('#header_link1').html('<img src="img/header/link_flf.jpg" alt="Festine Lente Fashion Link" border="0" />');
}
if($PATH[1] == "media"){
	$('#header_logo').attr({href:'#/media/'});
	$('#header_logo').html('<img src="img/header/logo_flm.jpg" alt="Festine Lente Media Logo" border="0" />');
	$('#header_link1').attr({href:'#/collective/'});
	$('#header_link1').html('<img src="img/header/link_flc.jpg" alt="Festine Lente Collective Link" border="0" />');
	$('#header_link2').attr({href:'#/fashion/'})
	;$('#header_link2').html('<img src="img/header/link_flf.jpg" alt="Festine Lente Fashion Link" border="0" />');
}
if($PATH[1] == "fashion"){
	$('#header_logo').attr({href:'#/fashion/'});
	$('#header_logo').html('<img src="img/header/logo_flf.jpg" alt="Festine Lente Fashion Logo" border="0" />');
	$('#header_link1').attr({href:'#/collective/'});
	$('#header_link1').html('<img src="img/header/link_flc.jpg" alt="Festine Lente Collective Link" border="0" />');
	$('#header_link2').attr({href:'#/media/'});
	$('#header_link2').html('<img src="img/header/link_flm.jpg" alt="Festine Lente Media Link" border="0" />');
}
var smArr = Array("twitter","vimeo","facebook","youtube");for(i=0;i<4;i++) {$('#sm_'+smArr[i]).hide();if($(msg).find(smArr[i]).text() != "none") {$('#sm_'+smArr[i]).show();$('#sm_'+smArr[i]).attr({href:$(msg).find(smArr[i]).text()});}}$('#menu').html($(msg).find('menu').text());$('#submenuL').html($(msg).find('submenuL').text());$('#submenuR').html($(msg).find('submenuR').text());$('#content #contentHolder').html($(msg).find('contentHolder1').text());$('#news #contentHolder').html($(msg).find('contentHolder2').text());$('#media').html($(msg).find('media').text());if($('#submenuL').text() == "none") $('#submenuL').hide();if($('#submenuR').text() == "none") $('#submenuR').hide();if($('#content #contentHolder').text() == "none") $('#content').hide();if($('#news #contentHolder').text() == "none") $('#news').hide();if($('#media').text() == "none"){$('#media').hide();}else{initMedia();}if($('#content #contentHolder p').text().indexOf('/>') != -1 || $('#content #contentHolder p').text().indexOf('</A>') != -1) $('#content #contentHolder p').html($('#content #contentHolder p').text());if($('#news #contentHolder p').text().indexOf('/>') != -1 || $('#news #contentHolder p').text().indexOf('</A>') != -1) $('#news #contentHolder p').html($('#news #contentHolder p').text());var short = $('#menuScrollerL').height();if(short < $('#menuScrollerR').height()) short = $('#menuScrollerR').height();if(short<100) $('#menuScrollerL').height(120);$('#submenuL').height($('#menuScrollerL').height()+10);$('#submenuR').height($('#menuScrollerL').height()+10);$('#submenus').height($('#menuScrollerL').height()+15);if($('#menuScrollerR').height() > $('#menuScrollerL').height()+20) setmenuScrollerR($('#menuScrollerL').height());}});}}var scrollerHeight = 0;

function setmenuScrollerR(short) {scrollerHeight = $('#menuScrollerR').height();var menuContent = $('#menuScrollerR').html();$('#menuScrollerR').empty();$('#menuScrollerR').append('<div id="menuHolder"></div>');$('#menuScrollerR').css({position:'relative',height:(short-35)+'px', overflow:'hidden'});$('#menuScrollerR #menuHolder').html(menuContent);$('#submenuR').height($('#submenuR').height()-20);$('#submenus').append('<div id="scrollMenu"><img src="img/submenu/down.gif" border="0" style="cursor:pointer" onClick="startScroll(\'up\')"/><img src="img/submenu/up.gif"border="0" style="cursor:pointer" onClick="startScroll(\'down\')"/></div>');$('#scrollMenu').css({float:'right',width:'159px',height:'19px',marginTop:'1px'});if($('#submenuL').height() < 100) {$('#menuScrollerR').height(85);$('#submenuL').height(130);$('#submenuR').height(110);$('#submenus').height(135);}}

function startScroll(dir){if(dir == "up"){var goTo = parseInt($('#menuHolder').css('marginTop'))-50;if(goTo < -(parseInt($('#menuHolder').height()) - parseInt($('#menuScrollerR').height()))) goTo = -(parseInt($('#menuHolder').height()) - parseInt($('#menuScrollerR').height()));$('#menuHolder').animate({marginTop: goTo},500);}if(dir == "down"){var goTo = parseInt($('#menuHolder').css('marginTop'))+50;if(goTo > 0) goTo = 0;$('#menuHolder').animate({marginTop: goTo},500);}}
