// greenhouse public CUSTOM JavaScript configuration - unique to site , 'jquery'
// to use full prototype 'lib/prototype.js'
	var aCustomBaseIncludes = ['x_core','x_event','moo/prototype.lite','moo/moo.fx','moo/moo.fx.pack','greenhouse/gh.ajax'];
		Loader.load(aCustomBaseIncludes, 'includes/client/');

	var aCustomIncludes = ['sifr','tween']; 
		Loader.load(aCustomIncludes, 'custom/public/includes/client/');
	
	var sFullPath = String(document.location);
	var SITEBASE = sFullPath.substr(0,sFullPath.lastIndexOf('/')+1 );
	
		function _initPage(){
			preSetHeaderEffect();
			preSetSignUpEffect();
			if(typeof sIFR == "function" && !bolPrint){
					// add any specifications for flash text header here
					
					// Home Page
					sIFR.replaceElement(named({sSelector:".newslistheading h1", sFlashSrc:"custom/flash/fonts/itc_officina_italicB.swf", sColor:"#CC0000", sLinkColor:"#222222", sBgColor:"none", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0", sWmode:"transparent"}));
					sIFR.replaceElement(named({sSelector:".offerheading h2", sFlashSrc:"custom/flash/fonts/itc_officina_italicB.swf", sColor:"#CC0000", sLinkColor:"#222222", sBgColor:"none", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0", sWmode:"transparent"}));
					
					sIFR.replaceElement(named({sSelector:".header h1", sFlashSrc:"custom/flash/fonts/itc_officina_book.swf", sColor:"#660000", sLinkColor:"#222222", sBgColor:"none", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:1, sFlashVars:"textalign=left&offsetTop=0", sWmode:"transparent"}));
					sIFR.replaceElement(named({sSelector:".header h2", sFlashSrc:"custom/flash/fonts/itc_officina_italicB.swf", sColor:"#660000", sLinkColor:"#222222", sBgColor:"none", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:1, sFlashVars:"textalign=left&offsetTop=0", sWmode:"transparent"}));

					sIFR.replaceElement(named({sSelector:".subhead h2", sFlashSrc:"custom/flash/fonts/itc_officina_book.swf", sColor:"#660000", sLinkColor:"#222222", sBgColor:"none", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:1, sFlashVars:"textalign=left&offsetTop=0", sWmode:"transparent"}));
					sIFR.replaceElement(named({sSelector:".subhead h3", sFlashSrc:"custom/flash/fonts/itc_officina_book.swf", sColor:"#666666", sLinkColor:"#222222", sBgColor:"none", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:1, sFlashVars:"textalign=left&offsetTop=0", sWmode:"transparent"}));

				};

			  return true;
		};

		
		// --------------
		// OPEN CLOSE HEADER REALTED
		var fxExpandHeight;var fxExpandSWF; var fxExpandForm;var fxShowForm;   
		   
		function preSetSignUpEffect(){};                    
		function preSetHeaderEffect(){
		   fxExpandHeight = new fx.Height('header', {duration: 500 }); 
		   fxExpandSWF = new fx.Height('headerSWF', {duration: 500 }); 
		}
		
		function _expand(div, h){  
			fxExpandHeight = new fx.Height(div, {duration: 350, onComplete:_onHeaderTweenComplete});//header  
			fxExpandSWF = new fx.Height('headerSWF', {duration: 349});
			var curH = xHeight(div);
			fxExpandHeight.custom(curH, h);
			fxExpandSWF.custom(xHeight('headerSWF'),h); 
		   //alert("_expand("+div+", "+h+")");  
		}  
		
		function _onHeaderTweenComplete(){ 
			var h = xHeight('header');
			//setFlashVariables("headerSWF", h); 
			document.getElementById('flashcontent').style.height = "100%";
			//xHeight('headerSWF',h);
		}

		// --------------
		// GOOGLE RELATED
		function trackFileDownload(sUrl, sName, w, h){
				urchinTracker(sUrl);// may want to strip file extension
			var sWinName = (null != sName)? sName : 'Download ' ;
			var sW = (null != w)? w : '200';
			var sH = (null != h)? h : '200';
				_newWindow(sUrl,sWinName,sW,sH,1,0,0,0,0,1,1);

		}
		
	  function openNode(bol, id) {
			outerDiv = document.getElementById('node_'+id);
			innerDiv = document.getElementById('holder_'+id);
			button = document.getElementById('button_'+id);
			var nodeH = xHeight(innerDiv);
			var curH = xHeight(outerDiv);
			button.className = (curH != 0)? 'open button' : 'close button';
			var start = (curH != 0)? nodeH : 0;
		  var end = (curH != 0)? 0 : nodeH;
			//alert(bol+', '+nodeH+', '+start+', '+end);
		  var nodeTween = new Tween(outerDiv.style,'height',Tween.strongEaseOut,start,end,0.3,'px');
		  var a = new Object();
			a.onMotionFinished = function(){
				// ? change display to hidden?
				//node.style.display = none;

			};									
			nodeTween.addListener(a);

			nodeTween.start();

			return false;
		}


	// PRINT
	function printSearchResults(sExtraParams){
		sExtraParams = (String(sExtraParams) == "undefined" ? "default.asp?" :  sExtraParams);
			
		var strPrintLink = sExtraParams + "&print=1";
		//alert("New window:"+strPrintLink);
		_newWindow(strPrintLink,'printWindow',780,600,0,1,1,1,1,1,1,0,0);
	}

