<!-- // hide from older browsers

var $Jstuff = jQuery.noConflict();
var stayOpen = false;
var theheight = '125px';
var themenuheight = '120px';
var FA_pausefade;

function FadeTheObj(objname,opacity,endopacity,fadeinc) {
	
		if (opacity < endopacity) {
			/* current image not faded up fully yet...so increase its opacity */
			Objfader(AllocObj(objname),opacity);
			opacity += fadeinc; /* was 10 *///alert(opacity);
			window.setTimeout("FadeTheObj(\""+objname+"\","+opacity+","+endopacity+","+fadeinc+")", 50);  /* wae 30 */
		} else {
			Objfader(AllocObj(objname),endopacity);
		}

}


function FadeTheObjDown(objname,opacity,endopacity,fadeinc) {
	
		if (opacity > endopacity) {
			/* current image not faded up fully yet...so increase its opacity */
			Objfader(AllocObj(objname),opacity);
			opacity -= fadeinc; /* was 10 *///alert(opacity);
			window.setTimeout("FadeTheObj(\""+objname+"\","+opacity+","+endopacity+","+fadeinc+")", 50);  /* wae 30 */
		} else {
			Objfader(AllocObj(objname),endopacity);
			setObjDisplay(objname,'none'); 
			setObjVis(objname,'hidden'); 
		}

}



function onloadfunction() {

	    if (gDoAnimation == true){
				/*
				Objfader(AllocObj("splashbox"),'0');
				setObjDisplay("splashbox",'inline');
				FadeTheObj("splashbox",0,100,3);
				*/

				/*setObjVis("menuclear",'hidden'); 
				setObjVis("footer",'hidden'); 
	
		        setObjVis("page",'visible'); 
		        FadeTheObj("page",0,100,3);
	
				Objfader(AllocObj("content"),'0');
				setObjDisplay("content",'inline');
				FadeTheObj("content",0,100,3);
				
				$Jstuff("#content").css({"zIndex":"1"});
				
				FA_goto = window.setTimeout("GoToPageWithMenu()", 4500);  */
	    }
	    else
	    {
	    	if ( gDoSlideShow) {runSlideShow();}
	    	FA_pausefade = window.setTimeout("LoadTheFlowUp()", 500);

	    }

 
}

function BodyClick(){
	/* if splashbox visible allow click */
	
	if (document.getElementById("splashbox")){
			var objs = document.getElementById("splashbox");

		if (objs.style.visibility != "hidden")
			{
				GoToPage();
			}
	}
	
}

function GoToPageWithMenu(){
	
	alert('kk');
	clearTimeout(FA_goto);
	clearTimeout(FA_pausefade);


	//setObjVis("page",'visible'); 
	//FadeTheObj("page",0,100,3);

	//setObjDisplay("bannerbox",'inline'); 
	//FadeTheObj("bannerbox",0,100,10);

	setObjVis("menuclear",'visible'); 
	setObjDisplay("menuclear",'inline'); 
	FadeTheObj("menuclear",0,100,10);
	

	
	//FadeTheObjDown("splashbox",100,0,50);

	//setObjDisplay("content",'inline'); 
	//runSlideShow();
	/*	

	setObjDisplay("bannerbox",'inline'); 
	FadeTheObj("bannerbox",0,100,10);
	
	setObjDisplay("menu",'inline'); 
	FadeTheObj("menu",0,100,10);
	
	*/
	setObjVis("footer",'visible'); 
	
	setObjDisplay("footer",'block'); 
	FadeTheObj("footer",0,100,10);
	
	
	//setObjVis("page",'visible'); 
	//FadeTheObj("page",0,100,3);

	
	//setObjDisplay("splashbox",'none'); 
	//setObjVis("splashbox",'hidden'); 
	/*
	setObjDisplay("splashboxwrapper",'none'); 
	setObjVis("splashboxwrapper",'hidden'); 
	*/	
		
	
}




function GoToPage(){
	
	clearTimeout(FA_goto);
	clearTimeout(FA_pausefade);
	
	
		
	FadeTheObjDown("splashbox",100,0,50);

	setObjDisplay("content",'inline'); 
	runSlideShow();
	/*	

	setObjDisplay("bannerbox",'inline'); 
	FadeTheObj("bannerbox",0,100,10);
	
	setObjDisplay("menu",'inline'); 
	FadeTheObj("menu",0,100,10);
	
	setObjDisplay("footer",'block'); 
	FadeTheObj("footer",0,100,10);
	*/
	
	setObjVis("page",'visible'); 
	FadeTheObj("page",0,100,3);

	
	setObjDisplay("splashbox",'none'); 
	setObjVis("splashbox",'hidden'); 
	/*
	setObjDisplay("splashboxwrapper",'none'); 
	setObjVis("splashboxwrapper",'hidden'); 
	*/
	

	
		
	
}

 

 
function sliderInfoPanelFunction(theText,theURL){
	
   if (theText.indexOf("rel=") > 0){
   }
   
   
	//$Jstuff("#infopanel").css({"filter":"alpha(opacity=70)","opacity":"0.7"});	
	//$Jstuff("#infopanel").animate({ "height": theheight},500, "swing");
	//oldheight = $Jstuff("#infopanelText").css("height");
	
	/* insert new text */
	$Jstuff("#infopanelText").html(theText);

	newheight = $Jstuff("#infopanelText").height()+"px";
	//alert("New height "+newheight);

	//$Jstuff("#infopanelwrapper").css({"height": "300px"});
	$Jstuff("#infopanelwrapper").animate({"height": newheight}, 500, "swing",function(){SliderInfoPanelShowTextFunction();} );
	
}

function SliderInfoPanelShowTextFunction(){
	$Jstuff("#infopanelText").animate({opacity: 1.0}, 600, "swing");	
}

function sliderInfoPanelEmpty(){
	
	/* Trick to pause before moving on */
	//alert('empty');
	//$Jstuff("#infopanel").animate({opacity: 0.85}, 20, "swing",function(){sliderInfoPanelEmptyCore();})
	   	
	
}
	

function sliderInfoPanelEmptyCore(){
   if (stayOpen == false)
	{
	    /* $Jstuff("#cpp").css({"background":"#0000ff"}); */
		//$Jstuff("#infopanel").animate({"opacity": "0", "height": "0px"},500, "swing");
	}
	
}

$Jstuff(document).ready(function(){
	
	 onloadfunction();
	 
	/* At load time make sure initial info panel is correct height*/
	newheight = $Jstuff("#infopanelText").height()+"px";
	$Jstuff("#infopanelwrapper").animate({"height": newheight}, 500, "swing",function(){SliderInfoPanelShowTextFunction();} );


	 //$Jstuff(".widget_twitter").html('k'+$Jstuff(".widget_twitter").html() );
	
 	if ( $Jstuff("#archive_button").length > 0 ){   	
	    	$Jstuff('#archive_button')
    			.animate({ marginLeft: 0 }, 4000)
    			.animate({"opacity": "show"}, 1000 , "swing"); 	
	 		}
	    	
	if ( $Jstuff("#twitter_link").length > 3000 ){   	
	    	$Jstuff('#twitter_link')
    			.animate({ marginLeft: 0 }, 4000)
    			.animate({"opacity": "show"}, 1000 , "swing"); 	
	 		}
	 		
	/* For angled menus we control roll overs using JS. */
	/* Use the rel attrribute for posn.  Look in header.php for x distribution of sprite */
	/* Note use of backgroundPosition and backgroundPositionX so we cope with IE and FF */
	
	currentBGPosition = $Jstuff("#background-menu").css("backgroundPosition");
	currentBGPositionArray = currentBGPosition.split(" ");
	currentBGPositionX = $Jstuff("#background-menu").css("backgroundPositionX");
	currentBGPositionY = $Jstuff("#background-menu").css("backgroundPositionY");	
	
	$Jstuff(".angle-menu").hover(function() {
		adjustFact = $Jstuff(this).attr( 'rel' );
		if ($Jstuff(this).css('backgroundPosition')) { 
			newPos = currentBGPositionArray[0]+" "+adjustFact;
			$Jstuff("#background-menu").css({"backgroundPosition":newPos}); }
		else { $Jstuff(this).css({"backgroundPositionY":adjustFact}); }
		  
	}, function() {
		if ($Jstuff(this).css('backgroundPosition')) { 
			newPos = currentBGPosition;
			$Jstuff("#background-menu").css({"backgroundPosition":newPos}); }
		else { $Jstuff(this).css({"backgroundPositionY":currentBGPositionY}); }

	});

/*
	
$Jstuff("#digital-design").hover(function() {
	adjustFact="-90px";
	if ($Jstuff(this).css('backgroundPosition')) { 
		newPos = currentBGPositionArray[0]+" "+adjustFact;
		$Jstuff("#background-menu").css({"backgroundPosition":newPos}); }
	else { $Jstuff(this).css({"backgroundPositionY":adjustFact}); }
	  
	}, function() {
	if ($Jstuff(this).css('backgroundPosition')) { 
		newPos = currentBGPosition;
		$Jstuff("#background-menu").css({"backgroundPosition":newPos}); }
	else { $Jstuff(this).css({"backgroundPositionY":currentBGPositionY}); }

	});
	

$Jstuff("#digital-services").hover(function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":"-180px"});
	}, function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":currentBGPositionY});
	});


$Jstuff("#print-design").hover(function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":"-270px"});
	}, function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":currentBGPositionY});
	});


$Jstuff("#print-services").hover(function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":"-360px"});
	}, function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":currentBGPositionY});
	});


$Jstuff("#about-us").hover(function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":"-450px"});
	}, function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":currentBGPositionY});
	});


$Jstuff("#photography").hover(function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":"-540px"});
	}, function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":currentBGPositionY});
	});

$Jstuff("#art-resource").hover(function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":"-630px"});
	}, function() {
	  $Jstuff("#background-menu").css({"backgroundPositionY":currentBGPositionY});
	});
*/

	
   /*$Jstuff("#content").click(function(event){
      $Jstuff(".wpcf7-response-output").animate({"opacity": "hide"}, 1000 , "swing"); 
   });
   */
	
 });

function sliderInfoPanelEmptyCheckOverImage(){
}

function sliderInfoPanelEmptyAndLoad(theText,theURL){
	
	/*Set loading */
	//$Jstuff("#infopanelText").html('<div id="central-load-indicator"><img src="http://www.fetherstonhaugh.com/script/FA_web_assets/store/wp/wp-content/themes/Fetherstonhaugh/images/ajax-loader.gif" /></div>');

	//sliderInfoPanelFunction(theText,theURL);
	//alert($Jstuff("#infopanel").opacity );
	//$Jstuff("#infopanelText").slideToggle("fast");
	$Jstuff("#infopanelText").animate({"opacity": "0"},400, "swing",function(){sliderInfoPanelFunction(theText,theURL);});
	//$Jstuff("#infopanel").animate({"opacity": "0", "height": "0px"},100, "swing",function(){sliderInfoPanelFunction(theText,theURL);});
}




function EmptyText (){
	$Jstuff("#infopanel").html('');
}

function LayerUp(){
	
    $Jstuff("#content").css({"zIndex":"1"});
    $Jstuff("#bannerbox").css({"zIndex":"10"});
    $Jstuff("#menu").css({"zIndex":"100"});
    $Jstuff("#footer").css({"zIndex":"100"});
    $Jstuff("#content").fadeIn(1);

	$Jstuff("#content").css({"display":"inline"});
    if(typeof window.LoadTheFlow == 'function') {
    	LoadTheFlow();
    	}
};

function LoadTheFlowUp(){

    if (typeof LoadTheFlow=="function")
    	{
    		LoadTheFlow();
    		}

};

this.imagePreviewJQ = function(){	
	/* CONFIG */
		
		xOffset = 100;
		yOffset = 30;
		
		midscreen=document.documentElement.clientHeight/2;
		
	/* END CONFIG */
	$Jstuff("a.fapreview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
            $Jstuff("#fapreview").html("");
            //$Jstuff("#iframeID").attr("src","");
			$Jstuff("body").append("<div id='fapreview'><iframe id='iframeID' src='"+ this.href +"' alt='Image preview' width='700px' height='600px' />"+ c +"</div>");								 
		$Jstuff("#fapreview")
			.css("top",(e.pageY - xOffset + 30) + "px")
			.css("left","100px")
			.slideDown("normal");						
    },
	function(){
		this.title = this.t;		
		$Jstuff("#fapreview").remove();
    });	
	$Jstuff("a.fapreview").mousemove(function(e){
		$Jstuff("#fapreview")
			.css("top",(e.pageY - xOffset + 30) + "px")
			.css("left","100px");
	});			
};


function doShadowLink(thisa) {
	$Jstuff('#sb-container').css({"top":"0px"});
	$Jstuff('#sb-overlay').css({"top":"0px"});

	/*Iphone special case */
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) 
		{
	     	return true;
		}

	else
		{
		
			$Jstuff('#'+thisa).click();
			return false;
		}

}




$Jstuff.fn.stop = function(){
    this.each(function(){
        $Jstuff.dequeue(this, "fx");
    });
    return this;
};


// -->


