
// preload navigation images:

        if (document.images) {

		about_on = new Image();
                about_on.src = "images/about_on.gif";
                about_off = new Image();
                about_off.src = "images/about_off.gif";
                
                services_on = new Image();
		services_on.src = "images/services_on.gif";
		services_off = new Image();
                services_off.src = "images/services_off.gif";
                
                sectors_on = new Image();
		sectors_on.src = "images/sectors_on.gif";
		sectors_off = new Image();
                sectors_off.src = "images/sectors_off.gif";
                
                news_on = new Image();
		news_on.src = "images/news_on.gif";
		news_off = new Image();
                news_off.src = "images/news_off.gif";
                
		careers_on = new Image();
		careers_on.src = "images/careers_on.gif";
		careers_off = new Image();
		careers_off.src = "images/careers_off.gif";
		
		search_on = new Image();
		search_on.src = "images/search_on.gif";
		search_off = new Image();
		search_off.src = "images/search_off.gif";
		

		
                
                
                
                
             
               
                 
 		tab1_on = new Image();
 		tab1_on.src = "images/tab1_on.png";
 		tab1_off = new Image();
 		tab1_off.src = "images/tab1_off.png";
 		tab1_bg = new Image();
 		tab1_bg.src = "images/image1.jpg";
 
 		tab2_on = new Image();
 		tab2_on.src = "images/tab2_on.png";
 		tab2_off = new Image();
 		tab2_off.src = "images/tab2_off.png";
 		tab2_bg = new Image();
 		tab2_bg.src = "images/image2.jpg";
 
 		tab3_on = new Image();
 		tab3_on.src = "images/tab3_on.png";
 		tab3_off = new Image();
 		tab3_off.src = "images/tab3_off.png";
 		tab3_bg = new Image();
 		tab3_bg.src = "images/image3.jpg";
 
               
                 
 }
                         
 function hiLite(imgID,changeID) {
                         
         if (document.images) {
         showText(imgID,changeID);
 		return true;
         }
 		
 }
 
 //global variables for the timer
 timerStop = 0;
 timerCount = 0;
 currentPanel = '';
 loopArray = new Array('tab1','tab2','tab3');
 //loopBGArray = new Array('image1.jpg','image2.jpg','image3.jpg');
 loopTabArray = new Array('tab1','tab2','tab3');
 
 function showText(srcElement,changeID){
 	panel = document.getElementById(srcElement+'Text');
 	panelBackground = document.getElementById('background');
 	switch(srcElement){
 		case 'tab1': panelBackground.style.backgroundImage = "url(images/image1.jpg)"; break;
 		case 'tab2': panelBackground.style.backgroundImage = "url(images/image2.jpg)"; break;
 		case 'tab3': panelBackground.style.backgroundImage = "url(images/image3.jpg)"; break;
 
 		default: if(timerStop != 0) panelBackground.style.backgroundImage = "url(images/image0.jpg)"; break;
 	}
 	
 	//console.debug(srcElement+'Text');
 	if(panel!=null){
 		
 		if(panel.style.display=='block'){
 			//IF THE TIMES RUNNING AND WE MOUSEOVER
 			//THE PANEL THE TIMER SHOWED DON'T TURN IT OFF
 			//JUST RESET THE TIMER
 			if(timerStop == 0){
 			timerStop = 1;
 			}
 			else{
 			//turn the panel off and restart the timer
 			panel.style.display = (panel.style.display=='block') ? 'none' : 'block';
 			panelBackground.style.backgroundImage = (panel.style.display=='none') ? "url(images/image0.jpg)" : background.style.backgroundImage;
 			document.images[srcElement].src = eval(changeID + ".src");
 			timerStop = 0;
 			timerCount = 0;
 			}
 		}
 		else{
 		//turn the panel on and stop the timer
 		hideAllPanels();
         document.images[srcElement].src = eval(changeID + ".src");
 		panel.style.display = 'block';
 		timerStop = 1;
 		}
 	}
 	else{
         document.images[srcElement].src = eval(changeID + ".src");
 	}
 }
 
 function hideAllPanels(){
 	for($i=0;$i<loopArray.length;$i++){
 		nextPanel=document.getElementById(loopArray[$i]);
 		nextPanel.style.display = 'none';
 		document.images[loopTabArray[$i]].src = eval(loopTabArray[$i] + '_off' + ".src");
 	}
 }
 
 function timeEvent(){
 	//console.debug('timed event fired');
 	//keep a track of the timer count - it gets reset by the the hiLite function
 	realCount = timerCount;
 	
 	if(timerStop==0){
 		/* turn off*/;
 		lastCount = (timerCount==0) ? 2 : timerCount-1;
 		//console.debug('time finished - '+realCount+' working with  - '+timerCount);
 
 		imgID = loopTabArray[lastCount];
 		changeID = loopTabArray[lastCount]+'_off';
 		document.images[imgID].src = eval(changeID + ".src");
 		
 		hiLite(imgID,changeID);
 		
 		/* turn on*/
 		imgID = loopTabArray[realCount];
 		changeID = loopTabArray[realCount]+'_on';
 		hiLite(imgID,changeID);
 		
 		timerCount = (realCount==2) ? 0 : realCount+1;
 		//console.debug('time finished - '+timerCount+' stop - '+timerStop);
 		timerStop = 0;
 	}
 //	console.debug('time finished - '+timerCount+' stop - '+timerStop);
 	window.setTimeout('timeEvent()',10000);
}


//dropdown menu js for Internet Explorer
sfHover = function() {
	var sfEls = document.getElementById("nav");
	if(!sfEls) return false;
    sfEls = sfEls.getElementsByTagName("LI");
	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function hideSelectBox(){
    document.getElementById('quickLinks').style.visibility = 'hidden';
}
function showSelectBox(){
    document.getElementById('quickLinks').style.visibility = 'visible';
}