// JavaScript Document

var Univers55 = {
  src: '/flash/Univers55.swf'
};

var Univers65 = {
  src: '/flash/Univers65.swf'
};

sIFR.delayCSS  = false;
sIFR.debugMode = false;
sIFR.activate(Univers55, Univers65);

sIFR.replace(Univers55, { selector: 'h1' ,
			 css: [
			  '.sIFR-root { text-align: left; font-weight: normal; color:#fbaf33; font-size:22px;   }'
			]});

sIFR.replace(Univers55, { selector: 'h2.orange' ,
			 css: [
			  '.sIFR-root { text-align: left; font-weight: normal; color:#fbaf33; font-size:18px;  }'
			  ,'a { text-decoration: none; font-weight: normal; }'
			  ,'a:link { color: #fbaf33; }'
			  ,'a:hover { color: #fbaf33; }'
			]});
sIFR.replace(Univers55, { selector: 'h2' ,
			 css: [
			  '.sIFR-root { text-align: left; font-weight: normal; color:#58595b; font-size:18px;  }'
			  ,'a { text-decoration: none; font-weight: normal; }'
			  ,'a:link { color: #58595b; }'
			  ,'a:hover { color: #5d5d60; }'
			]});

sIFR.replace(Univers55, { selector: 'h3.sIFR-highlightText' ,
			 css: [
			  '.sIFR-root { text-align: left; font-weight: normal; font-size:16px; margin:0; padding:0; }'
				,'a { text-decoration: none; font-weight: bold; }'
			  ,'a:link { color: #fbaf33; }'
			  ,'a:hover { color: #fbaf33; }'], wmode: 'transparent'});
sIFR.replace(Univers55, { selector: 'h3' ,
			 css: [
			  '.sIFR-root { text-align: left; font-weight: normal; font-size:16px; margin:0; padding:0;  }'
			  ,'a { text-decoration: none; font-weight: bold; }'
			  ,'a:link { color: #414042; }'
			  ,'a:hover { color: #fbaf33; }'], wmode: 'transparent'});
sIFR.replace(Univers65, { selector: 'h4' ,
			 css: [
			  '.sIFR-root { text-align: left; font-weight: bold; font-size:16px; margin:0; padding:0;  }'
			  ,'a { text-decoration: none; }'
			  ,'a:link { color: #ffffff; }'
			  ,'a:hover { color: #ffffff; }'
			] , wmode: 'transparent'});
sIFR.replace(Univers65, { selector: 'h5' ,
			 css: [
			  '.sIFR-root { text-align: left; font-weight: normal; font-size:13px; margin:0; padding:0; color: #414042; }'], wmode: 'transparent'});

// '.sIFR-root { text-align: left; font-weight: bold; color:#636466; font-size:18px;   }'

/**
		initialization routine.  Check for a cookie and if it exists.  Change the size to its value;
	*/
	function initialize(rootDirectory){
		if (document.cookie.indexOf('sizeOfFont') != -1){
			changeTextSize(document.cookie.split('sizeOfFont=')[1]);
		}
	}
	
	/**
		Changes the fontSize attribute of all <p> and <li> tags.
		@param size the size (in px) to which the fontSize should change
	*/
	/*function changeTextSize(size){
		var realSize = (size + "px");
		var ps = document.getElementsByTagName('p');
		var lis = document.getElementsByTagName('li');
		var adds = document.getElementsByTagName('address');
		//var spans = document.getElementsByTagName('span');
		for(var i = 0; i < ps.length; i++) {
			ps[i].style['fontSize'] = realSize;
		}
		for(var i = 0; i < lis.length; i++) {
			lis[i].style['fontSize'] = realSize;
		}
		for(var i = 0; i < adds.length; i++) {
			adds[i].style['fontSize'] = realSize;
		}
		document.cookie = "size="+size;
	}*/
	
	function changeTextSize(size){
	
	  size = size - 1; // so as to match array indices
	 	if(document.styleSheets){
			switch(size){
				case 0:
					document.styleSheets[1].disabled=true;
					document.styleSheets[2].disabled=false;
				break;
				case 1:
					document.styleSheets[1].disabled=false;
					document.styleSheets[2].disabled=true;
				break;
				default:
					document.styleSheets[1].disabled=true;
					document.styleSheets[2].disabled=true;
				
			}
			document.cookie = 'sizeOfFont='+(size+1)+'; path=/';
	  	}
	}
	
	function setupPrint(){
		window.print();	
	}
	
	function mail(){
		document.mailForm.submit();		
	}
	
    var oldBackgroundImageOfParent = "";
	function changeLI(passedRef){
		oldBackgroundImageOfParent = passedRef.parentNode.style['backgroundImage'];
		passedRef.parentNode.style['backgroundImage']="url(/images/icon_mainNavSelected.gif)";
	}
	function revertLI(passedRef){
		passedRef.parentNode.style['backgroundImage']=oldBackgroundImageOfParent;
	}
	/**
        Hover state for biolisting
    */
    function changeBioListingShow(bioListing){
        bioListing.firstChild.firstChild.style['visibility']='visible';
    }
    function changeBioListingHide(bioListing){
        bioListing.firstChild.firstChild.style['visibility']='hidden';
    }
    
	var oldBackgroundColorOfParent = "";
	function changeBackgroundColorOfParent(selfRef, color){
		oldBackgroundColorOfParent = selfRef.parentNode.style['backgroundColor'];
		selfRef.parentNode.style['backgroundColor']=color;
	}
	function revertBackgroundColorOfParent(selfRef){
		selfRef.parentNode.style['backgroundColor']=oldBackgroundColorOfParent;
	}
	
	function performSifr(rootDirectory){
		  //<[CDATA[
		/* Replacement calls. Please see documentation for more information. */
		
		/*if(typeof sIFR == "function"){
		
		// This is the preferred "named argument" syntax
			//sIFR.replaceElement(named({sSelector:"body h1", sFlashSrc:"Univers55R.swf", sColor:"#000000", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:20, nPaddingBottom:20, sFlashVars:"textalign=center&offsetTop=6"}));
		
		// This is the older, ordered syntax
            sIFR.replaceElement("h1", (rootDirectory+"Univers55R.swf"), "#fbaf33", "#000000", "#FFFFFF", "#FFFFFF", 0, 0, 0, 0);
			sIFR.replaceElement("h2", (rootDirectory+"Univers55R.swf"), "#000000", null, null, null, 0, 0, 0, 0);
			sIFR.replaceElement("h4", (rootDirectory+"Univers55B.swf"), "#FFFFFF", "#FFFFFF", "#414042", "#fcb034", 0, 0, 0, 0, null, null, "transparent");
			sIFR.replaceElement("h3.grey", (rootDirectory+"Univers55B.swf"),"#636466", "#000000", "#919195", "#DCDCDC", 0, 0, 0, 0, null, null, "transparent");
			sIFR.replaceElement("h3", (rootDirectory+"Univers55B.swf"), "#636466", null, null, null, 0, 0, 0, 0, null);
		};*/
		
		/*
		NEW sIFR activation code */
		/*var Univers55 = {
		  src: 'http://pi.karo.com/flash/Univers55.swf'
		};
		
		sIFR.delayCSS  = false;
		sIFR.debugMode = false;
		
		sIFR.activate(Univers55);
		sIFR.replace(Univers55, { selector: 'h4' ,
					 css: [
					  '.sIFR-root { text-align: left; font-weight: normal; }'
					  ,'a { text-decoration: none; }'
					  ,'a:link { color: #000000; }'
					  ,'a:hover { color: #CCCCCC; }'
					]});
		*/
		
		
		//]]>
	}
