var feverPR = function(){
    var animationLoaded=false;
	var podArr=new Array();
	var animationInSpeed="slow";
	var animationOutSpeed="fast";
	var animationLogoInSpeed=8000;
	
    return {
        init : function(){	
			//$(document).pngFix(); 
		
			$('input[type="text"]').each(function(){

				this.value = $(this).attr('title');
				$(this).addClass('text-label');
			
				$(this).focus(function(){
					if(this.value == $(this).attr('title')) {
						this.value = '';
						$(this).removeClass('text-label');
					}
				});
			
				$(this).blur(function(){
					if(this.value == '') {
						this.value = $(this).attr('title');
						$(this).addClass('text-label');
					}
				});
			});
		
            // Options for SuperBGImage
            $.fn.superbgimage.options = {
                id: 'superbgimage', // id for the container
                z_index: 0, // z-index for the container
                inlineMode: 0, // 0-resize to browser size, 1-do not resize to browser-size
                showimage: 1, // number of first image to display
                vertical_center: 1, // 0-align top, 1-center vertical
                transition: 1, // 0-none, 1-fade, 2-slide down, 3-slide left, 4-slide top, 5-slide right, 6-blind horizontal, 7-blind vertical, 90-slide right/left, 91-slide top/down
                transitionout: 1, // 0-no transition for previous image, 1-transition for previous image
                randomtransition: 0, // 0-none, 1-use random transition (0-7)
                showtitle: 0, // 0-none, 1-show title
                slideshow: 0, // 0-none, 1-autostart slideshow
                slide_interval: 5000, // interval for the slideshow
                randomimage: 0, // 0-none, 1-random image
                speed: 'slow', // animation speed
                preload: 0, // 0-none, 1-preload images
                onShow: feverPR.superbgimage_show, // function-callback show image
                onClick: feverPR.superbgimage_click // function-callback click image
            };
            
            $("#btn_next").click(function(){ feverPR.superbgimage_click() });
			
			$("#contentToggle").mouseover(function(){ feverPR.hideContent() });
			$("#contentToggle").mouseout(function(){ feverPR.showContent() });
			
			podArr = feverPR.getPods();
			
			//defaults - moved into homepage only
			//podArr[podArr.length] = new feverPR.podObj("main_menu", "left", 0, 0, "left");
			//podArr[podArr.length] = new feverPR.podObj("pod_twitter", "top", 0, 272, "bottom");
			//podArr[podArr.length] = new feverPR.podObj("body_content", "top", 0, 100, "top");
			
			if ($('body').attr('id')=="homepage") {
				podArr[podArr.length] = new feverPR.podObj("main_menu", "left", 0, 0, "left");
				podArr[podArr.length] = new feverPR.podObj("pod_twitter", "top", 0, 242, "bottom");
				podArr[podArr.length] = new feverPR.podObj("body_content", "top", 0, 70, "top");
				podArr[podArr.length] = new feverPR.podObj("pod_show_and_tell", "top", 0, 227, "bottom");
				podArr[podArr.length] = new feverPR.podObj("pod_idea_of_week", "left", 0, 614, "right");
			
			} else if ($('body').attr('id')=="facts") {
				if (!$.browser.msie || ($.browser.msie && parseInt(jQuery.browser.version)>=8)) {
					$('html,body').css('overflow','visible');
				}
				// enable tabs, uses jquery.tools
				$("#flowpanes").scrollable({size: 1}).circular().mousewheel(400).navigator({
					navi: "#flowtabs",
					naviItem: 'a',
					activeClass: 'current'
				});
				$('#btn_further_facts').click(feverPR.getFurtherFact);
				feverPR.getFurtherFact();
			
			} else if ($('body').attr('id')=="feed") {
				if (!$.browser.msie || ($.browser.msie && parseInt(jQuery.browser.version)>=8)) {
					$('html,body').css('overflow','visible');
				}
				//
			
			} else if ($('body').attr('id')=="family") {
				if (!$.browser.msie || ($.browser.msie && parseInt(jQuery.browser.version)>=8)) {
					$('html,body').css('overflow','visible');
				}
				podArr[podArr.length] = new feverPR.podObj("pod_recruit", "left", 0, 16, "left");
				feverPR.loadFamily();
			
			} else if ($('body').attr('id')=="folio") {
				if (!$.browser.msie || ($.browser.msie && parseInt(jQuery.browser.version)>=8)) {
					$('html,body').css('overflow','visible');
				}
				function fadeFolio(){
				  // fade in folio boxes one by one
				  var i=0, elements=$('.pod_folio'), length=elements.length;
				  function fade(){
					 elements.eq(i++).fadeIn(1500);
					 if(i<=length)
					   setTimeout(arguments.callee, 300);
				  }
				  fade(500);
				}
				// set z-index of mask 
				$('#mask').css('z-index',5000);
				
				setTimeout(fadeFolio, 2000);
				podArr[podArr.length] = new feverPR.podObj("pod_experience", "left", 0, 40, "bottom");
				/*$('#btn_say_what_next').click(function() {
					feverPR.getSayWhat('next');							   
				});
				$('#btn_say_what_previous').click(function() {
					feverPR.getSayWhat('previous');							   
				});
				feverPR.getSayWhat('next');	*/
				//
			
			} else if ($('body').attr('id')=="findus") {
				if (!$.browser.msie || ($.browser.msie && parseInt(jQuery.browser.version)>=8)) {
					$('html,body').css('overflow','visible');
				}
				feverPR.loadFindUs();
			}
			
			// work out start positions
			var winHeight = $(window).height();
			var winWidth = $(window).width();
			
			for (var x=0;x<podArr.length;x++) {
				var p_t = $("#"+podArr[x].pod);
				if (podArr[x].pos=="left") {
					var size=0-p_t.offset().left-p_t.outerWidth();
				} else if (podArr[x].pos=="top") {
					var size=0-p_t.offset().top-p_t.outerHeight();
				} else if (podArr[x].pos=="right") {
					var size=winWidth+p_t.outerWidth();
				} else if (podArr[x].pos=="bottom") {
					var size=winHeight+p_t.outerHeight();
				}
				p_t.css(podArr[x].pos,size);
				podArr[x].startPos=size;
				p_t.css("visibility","visible");
			}
        
            // initialise SuperBGImage
            $('#thumbs1').superbgimage();
        },
        getAnimationSpeed : function(speedType) {
			if (speedType=="in") {
            	return animationInSpeed;
			} else if (speedType=="out") {
				return animationOutSpeed;
			} else if (speedType=="logoIn") {
				return animationLogoInSpeed;
			}
        },
        getPods : function() {
            return podArr;
        },
        getAnimationLoaded : function() {
            return animationLoaded;
        },
        setAnimationLoaded : function() {
            animationLoaded=true;
        },
		podObj : function(_pod, _cssPos, _start, _end, _pos) {
			 this.pod = _pod;
			 this.cssPos = _cssPos;
			 this.startPos = _start;
			 this.endPos = _end;
			 this.pos = _pos;
		},
        superbgimage_show : function(img) {
        	
            $('#superbgimage').css('background', 'none');
            if (!feverPR.getAnimationLoaded()) {
				setTimeout("feverPR.showContent()", 500);	
                feverPR.setAnimationLoaded();
            }
        },
        superbgimage_click : function(img) {
            $('#thumbs').nextSlide();
        },
		showContent : function() {
			podArr = feverPR.getPods();
		  
			animateLogo = function() {
				$("#header").fadeIn({"opacity":1},{duration: feverPR.getAnimationSpeed("logoIn")});
			}
			
			for (var x=0;x<podArr.length;x++) {
				var posObj = function(_pos, _endPos) {
					if (_pos=="left") {
						this.left = _endPos;
					} else if (_pos=="top") {
						this.top = _endPos;
					}						 
				}
				var myObj = new posObj(podArr[x].cssPos,podArr[x].endPos+'px');
				if (x!=(podArr.length-1)) {
					$("#"+podArr[x].pod).stop().animate(myObj, feverPR.getAnimationSpeed("in"));
				} else {
					$("#"+podArr[x].pod).stop().animate(myObj,  feverPR.getAnimationSpeed("in"), function(){
						animateLogo();
						if (!$.browser.msie || ($.browser.msie && parseInt(jQuery.browser.version)>=8)) {
	 						$('html,body').css('overflow','visible');
						}
					});
				}
			}
			
		},
		hideContent : function() {
			podArr = feverPR.getPods();
			
			function hidePods() {
		
				for (var x=0;x<podArr.length;x++) {
					var posObj = function(_pos, _startPos) {
						if (_pos=="left") {
							this.left = _startPos;
						} else if (_pos=="top") {
							this.top = _startPos;
						}						 
					}
					var myObj = new posObj(podArr[x].cssPos,podArr[x].startPos+'px');
					$("#"+podArr[x].pod).stop().animate(myObj, feverPR.getAnimationSpeed("out"));
				}
			}
		  
			$("#header").fadeOut(feverPR.getAnimationSpeed("out"), hidePods);
		},
		getFurtherFact : function() {
			$.ajax({
				type: "POST",
				url: "/fever/rpc/further_facts.cfm",
				success: function(fact) {
					if ($("#btn_further_facts").css('visibility')=="hidden") {
						$("#ff_text").html(fact)
						$("#ff_text").css("visibility","visible").fadeIn("fast");
						$("#btn_further_facts").css("visibility","visible").fadeIn("fast");
					} else {
						$("#btn_further_facts").fadeOut("fast");
						$("#ff_text").fadeOut("fast",function() {
							$("#ff_text").html(fact)
							$("#ff_text").fadeIn("fast");
							$("#btn_further_facts").fadeIn("fast");
						});
					}
				}
			});
		},
		getSayWhat : function(dir) {
			$.ajax({
				type: "POST",
				url: "/fever/rpc/say_what.cfm",
				data: "dir="+dir,
				success: function(sayWhat) {
					if ($("#pod_say_what").css('visibility')=="hidden") {
						$("#pod_say_what").html(sayWhat)
						$("#pod_say_what").css("visibility","visible").fadeIn("fast");
					} else {
						$("#pod_say_what").fadeOut("fast",function() {
							$("#pod_say_what").html(sayWhat)
							$("#pod_say_what").fadeIn("fast");
						});
					}
				}
			});
		},
		isValidEmail : function(str) {
			var filter=/^.+@.+\..{2,3}$/
			return (filter.test(str))
		},
		checkMailingListForm : function() {
			var fname = $("input#txtNameFirst").val();
			var lname = $("input#txtNameLast").val();
			var company = $("input#txtCompany").val();
			var email = $("input#txtEmail").val();
			var mlid = $("input#mlid").val();
			var siteid = $("input#siteid").val();
			var isVerified = $("input#isVerified").val();
			
			if (fname == "" || fname==$("input#txtNameFirst").attr('title')) {
				$("input#txtNameFirst").css({border:"1px solid #FF0000"});
				$("input#txtNameFirst").focus();
				return false;
			} else {
				$("input#txtNameFirst").css({border:"0"});
			}
			if (lname == "" || lname==$("input#txtNameLast").attr('title')) {
				$("input#txtNameLast").css({border:"1px solid #FF0000"});
				$("input#txtNameLast").focus();
				return false;
			} else {
				$("input#txtNameLast").css({border:"0"});
			}
			if (email == "" || (email != "" &&!feverPR.isValidEmail(email))) {
				$("input#txtEmail").css({border:"1px solid #FF0000"});
				$("input#txtEmail").focus();
				return false;
			} else {
				$("input#txtEmail").css({border:"0"});
			}
			
			var dataString = 'fname='+ fname + '&lname='+ lname + '&company=' + company +'&email=' + email +'&mlid=' + mlid +'&siteid=' + siteid +'&isVerified=' + isVerified;
			$.ajax({
				type: "POST",
				url: "/fever/rpc/mailing_list.cfm",
				data: dataString,
				success: function(msg) {
					$("#mail_form").fadeOut("fast");
					$("#description").fadeOut("fast",function() {
						$("#description").html(msg)
						$("#description").fadeIn("fast");
					});
					$("#pod_mail").animate({ 
						height: "62px"
					}, 800 );
				}
			});
		},
		loadFamily : function() {
			var currentBodyHeight = $('#body_content').height();
			$("#family_text").show();
			
			$("ul#family_navigation li").click(function(){
				
				//Set Variables
				var details = $(this).find('a').attr("href").split("|");
				var imageTitle=details[1];
				var imageSRC=details[0];
				var imgDesc = $(this).find('.family_content').html();
				
				if ($(this).is(".active")) {
					return false;
				} else {
					var currentTextHeight = $("#family_text").height();
					
					$("#family_text").animate({ opacity: 0 }, 250 , function() { 
						$("#family_text").html(imgDesc).animate({ opacity: 1 }, 800 );
						$("#body_content").animate({ height: currentBodyHeight+$("#family_text").height()+12+"px" }, 250);
						$("#family_portrait img").attr({ src: '/tasks/render/medium/index.cfm?fileid='+imageSRC+'&ext=.jpg'});
						$("#family_portrait a").attr({title : imageTitle, href : '/tasks/render/file/?fileID='+imageSRC+'&ext=.jpg'});
						Shadowbox.setup(); 
					});
				}
				
				$("ul#family_navigation li").removeClass('active');
				$(this).addClass('active');
				return false; 
			
			}) .hover(function(){  
				$(this).addClass('hover'); 
				}, function() {
				$(this).removeClass('hover');
			});
			
			callFirst=function(){
				$("ul#family_navigation li:first").trigger("click");	
			}
			
			setTimeout(callFirst,1000);	
			
			$("ul.thumb li").hover(function() {
				$(this).css({'z-index' : '200000'});
				$(this).find('img').addClass("hover").stop()
					.animate({
						marginTop: '-50px', 
						marginLeft: '-50px', 
						top: '50%', 
						left: '50%', 
						width: '90px', 
						height: '90px'
					}, 200);
				
				} , function() {
				$(this).css({'z-index' : '0'});
				$(this).find('img').removeClass("hover").stop()
					.animate({
						marginTop: '0', 
						marginLeft: '0',
						top: '0', 
						left: '0', 
						width: '56px', 
						height: '56px'
					}, 400);
			}); 
		},
		loadFindUs : function() {
			
			var map = new GMap2($("#map").get(0));
			var feverHQ = new GLatLng(0,0);
			feverHQ = new GLatLng(0,0);
			map.setCenter(feverHQ, 15);
			var bounds = new GLatLngBounds();
			// locations
			var markerInfo = [];
			markerInfo [0] = ['<p>Fever lives here</p><hr /><p class="map_infoAddress">22 Redan Place W2 4SA</p>', "Fever", new GLatLng(51.515258,-0.189242)];
			markerInfo [1] = ['<p>Celeb chef posh lunches</p><hr /><p class="map_infoAddress">8 Porchester Gardens W2 4DB</p>', "Le Cafe Anglais", new GLatLng(51.513803,-0.187797)];
			markerInfo [2] = ['<p>Guilt-free yumminess</p><hr /><p class="map_infoAddress">42 Westbourne Grove W2 5SH</p>', "Planet Organic", new GLatLng(51.515566,-0.190418)];
			markerInfo [3] = ['<p>For ladies who lunch</p><hr /><p class="map_infoAddress">202-204 Westbourne Grove W11 2RH</p>', "Nicole Fahri 202", new GLatLng(51.514373,-0.200468)];
			markerInfo [4] = ['<p>Rice ball anybody?</p><hr /><p class="map_infoAddress">19 Westbourne Grove W2 4UA</p>', "Arancina", new GLatLng(51.515688,-0.189238)];
			markerInfo [5] = ['<p>Not as bad as AA Gill makes out</p><hr /><p class="map_infoAddress">208-212 Westbourne Grove W11 2RH</p>', "Daylesford Organic", new GLatLng(51.514524,-0.19937)];
			markerInfo [6] = ['<p>Where Gwynie goes for smoothies</p><hr /><p class="map_infoAddress">25 Westbourne Grove W2 4YN</p>', "Fresco", new GLatLng(51.515674,-0.189357)];
			markerInfo [7] = ['<p>Great pints. Great food</p><hr /><p class="map_infoAddress">80 Chepstow Road W2 5BE</p>', "Prince Bonaparte", new GLatLng(51.517453,-0.195875)];
			markerInfo [8] = ['<p>Arguably London\'s best Italian</p><hr /><p class="map_infoAddress">39 Chepstow Place W2 4TS</p>', "Assaggi", new GLatLng(51.51336,-0.194538)];
			var markers = [];
			// custom icon
			var markerIcon = new GIcon(G_DEFAULT_ICON);
			markerIcon.image = "/fever/includes/themes/fever/images/mapping/blue-dot.png";
			markerIcon.shadow = null;
			markerIcon.iconSize = new GSize(12, 21);
			markerIcon.iconAnchor = new GPoint(6, 21);
			markerOptions = { icon:markerIcon };
		
			for (var i = 0; i < markerInfo.length; i++) {
				if (i==0) {
					markerIcon.image = "/fever/includes/themes/fever/images/mapping/markerSmall_fever.png";
				} else {
					markerIcon.image = "/fever/includes/themes/fever/images/mapping/markerSmall.png";
				}
				marker = new GMarker(markerInfo[i][2],markerOptions);
				map.addOverlay(marker);
				bounds.extend(markerInfo[i][2]);
				markers[i] = marker;
			}
			
			var control_smallMap = new GSmallMapControl();
			var control_mapType = new GMapTypeControl();
			map.addControl(control_smallMap);
			//map.addControl(control_mapType);
			window.setTimeout(function() {
				map.setCenter(bounds.getCenter());
				map.setZoom(map.getBoundsZoomLevel(bounds)+0);
			}, 1000);
			
			$(markers).each(function(i,marker){
				$("<li />")
					.html("- "+markerInfo[i][1])
					.click(function(){
						displayPoint(marker, i);
					})
					.appendTo("#pod_favourites ul");
				
					GEvent.addListener(marker, "click", function(){
					displayPoint(marker, i);
				});
			});
			
			$("#map_info").appendTo(map.getPane(G_MAP_FLOAT_SHADOW_PANE));
			
			function displayPoint(marker, i){
				$("#map_info").hide();
				
				// reset them all then highlight selected one
				$("#pod_favourites ul li")
					.css({ 'background-color' : '#FFF' });
				$("#pod_favourites ul li:eq("+i+")")
					.css({ 'background-color' : '#FFF9BF' });
				
				var moveEnd = GEvent.addListener(map, "moveend", function(){
					var markerOffset = map.fromLatLngToDivPixel(marker.getLatLng());
					$("#map_info")
						.html(markerInfo[i][0])
						.fadeIn()
						.css({ top:markerOffset.y-2, left:markerOffset.x-6 });
				
					GEvent.removeListener(moveEnd);
				});
				map.panTo(marker.getLatLng());
			}
			
			var myPano;
			
			function initialise() {
			  var FEVER = new GLatLng(51.515273,-0.189235);
			  var myPOV = { yaw:-100.00, pitch:-3, zoom:1.9 }
			  panoramaOptions = { latlng:FEVER, pov:myPOV };
			  myPano = new GStreetviewPanorama(document.getElementById("pano"), panoramaOptions);
			  GEvent.addListener(myPano, "error", handleNoFlash);
			}
			
			function handleNoFlash(errorCode) {
			  if (errorCode == FLASH_UNAVAILABLE) {
				alert("Error: Flash doesn't appear to be supported by your browser");
				return;
			  }
			}  
			initialise();	
		}
    }
}();
    
$(document).ready(feverPR.init);

var feverFolio = function(){
	var lastId;
	var mySlideShow;
	var mediumSlideShow;
	var thumbSlideShowActive=true;
	// positions for each overlay 
    var positions = [  
        [0,0], 
        [0,440], 
        [320,0], 
        [320,440]
    ];	
	var count = 0;	
	var windowsOpen = 0 ;
    return {
        init : function(){	
			feverFolio.setupExperience();
			feverFolio.loadFolioBoxes();
			//setTimeout("feverFolio.startThumbSlideShow()",5000);
		},
		setupExperience : function() {
			$("#pod_experience a[rel]").overlay({
				  oneInstance  : true, 
				  closeOnClick : true, 
				  expose       : { 
					  color     : '#000', 
					  loadSpeed : 200, 
					  opacity   : 0.8 
				  },
				  top		   : 60
			});
		},
		loadFolioBoxes : function() {
			
			$(".pod_folio").each(function(i) {
										  
				var newId = i+1;
				if (newId < 5) {
					$("#slideshow"+newId).click(function(){
						var id = this.id.slice(this.id.length-1,this.id.length);
						feverFolio.openAll(id);
					});
				}
				
			});
			 
			// setup triggers for folio boxes
			$(".pod_folio a[rel]").each(function(i) {
				// use number from rel attr to get position for overlay from positions array (1 of 4 positions)
				var positionMarker = $(this).attr("rel").substring(15,16);
				$(this).overlay({
					// common configuration for each overlay
					oneInstance: false, 
					closeOnClick: false, 
					onBeforeLoad: function() { 
						// grab wrapper element inside content 
						var wrap = this.getContent().find(".overlayContent"); 
						wrap.css({ 'display': 'none' });
						// load the page specified in the trigger 
						wrap.load(this.getTrigger().attr("href"));
						
						$("#pi_closeall").click(feverFolio.closeAll);
						$("#i_closeall").click(feverFolio.closeAll);
						$("#v_closeall").click(feverFolio.closeAll);
						$("#q_closeall").click(feverFolio.closeAll);
					},
					onLoad: function() { 
						Cufon.replace('#folio_win_header h2', {hover: false,fontFamily: 'ITC Avant Garde Gothic Std Bold'});
						var wrap = this.getContent().find(".overlayContent"); 
						wrap.fadeIn(300);
						windowsOpen++;
						if (windowsOpen==2) {
							feverFolio.startMediumImageSlideShow()
						}
					},
					onClose : function() {
						windowsOpen--;
						
						if(windowsOpen==0) {
							$('#mask').hide();
							thumbSlideShowActive=true;
							//feverFolio.startThumbSlideShow();
							feverFolio.stopMediumImageSlideShow()
						}
					},
					// setup custom finish position
					top: positions[positionMarker][0],
					left: positions[positionMarker][1],
					// use default effect as 'apple' effect cannot be positioned within container div correctly.
					effect: 'default'
				});
			});	
		},
		getRandom : function() {
			var rand_no=Math.ceil(10*Math.random());
			if (rand_no==lastId) {
				feverFolio.getRandom();
			}
			lastId=rand_no;
			return rand_no;
		},
		thumbSlideShow : function (id) {
			var $active = $('#slideshow'+id+' IMG.active');
			
			if ( $active.length == 0 ) $active = $('#slideshow'+id+' IMG:last');
			var $next =  $active.next().length ? $active.next() : $('#slideshow'+id+' IMG:first');
		
			$active.addClass('last-active');
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1500, function() {
				$active.removeClass('active last-active');
			});
		},
		mediumSlideShow : function () {
			var $active = $('#slideshowM IMG.active');
			if ( $active.length == 0 ) $active = $('#slideshowM IMG:last');
			var $next =  $active.next().length ? $active.next() : $('#slideshowM IMG:first');
			$active.addClass('last-active');
			$next.css({opacity: 0.0})
				.addClass('active')
				.animate({opacity: 1.0}, 1500, function() {
				$active.removeClass('active last-active');
			});
		},
		changeThumbImage : function() {
			var rand_no=feverFolio.getRandom();
			feverFolio.thumbSlideShow(rand_no);
		},
		stopThumbSlideShow : function() {
			if (typeof (thumbSlideShow)!="undefined") {
				clearInterval(thumbSlideShow);
			}
			thumbSlideShowActive=false;
		},
		startThumbSlideShow : function() {
			if (thumbSlideShowActive) {
				thumbSlideShow=setInterval("feverFolio.changeThumbImage()",2000);
			}
		},
		stopMediumImageSlideShow : function() {
			clearInterval(mediumSlideShow);
		},
		startMediumImageSlideShow : function() {
			callSlideShow=function() {
				feverFolio.mediumSlideShow()
			}
			mediumSlideShow=setInterval("callSlideShow()",5000);
		},
		openAll : function(i) { 
		
			//Get the screen height and width
			var maskHeight = $(document).height();
			var maskWidth = $(window).width();
			var doc = $('#mask').offset();
			var doc2 = $('#mask').position();
		
			//Set height and width to mask to fill up the whole screen
			$('#mask').css({'width':maskWidth,'height':maskHeight,'zIndex':1,left:doc2.left+'px',top:doc2.top+'px'});
			
			//transition effect	
			$('#mask').fadeTo("slow",0.7);	
			$('#mask').fadeIn(500,function() {
				$(".folio"+i+" a[rel]").each(function() { 
					$(this).overlay().load()
				}); 
			});	
			feverFolio.stopThumbSlideShow();
		},
		closeAll : function() { 
			$(".pod_folio a[rel]").each(function() { 
				$(this).overlay().close(); 
			}); 
			$('#mask').hide();
			//feverFolio.startThumbSlideShow();
		}
	}
}();
$(document).ready(feverFolio.init);
