
// 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";
                
                partners_on = new Image();
		partners_on.src = "/images/partners_on.gif";
		partners_off = new Image();
                partners_off.src = "/images/partners_off.gif";
                
                news_on = new Image();
		news_on.src = "/images/news_on.gif";
		news_off = new Image();
                news_off.src = "/images/news_off.gif";
                
		clients_on = new Image();
		clients_on.src = "/images/clients_on.gif";
		clients_off = new Image();
		clients_off.src = "/images/clients_off.gif";
		
		resources_on = new Image();
		resources_on.src = "/images/resources_on.gif";
		resources_off = new Image();
		resources_off.src = "/images/resources_off.gif";

		contact_on = new Image();
		contact_on.src = "/images/contact_on.gif";
		contact_off = new Image();
		contact_off.src = "/images/contact_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.gif";
  		tab1_off = new Image();
  		tab1_off.src = "/images/tab1_off.gif";
  		tab1_bg = new Image();
  		tab1_bg.src = "/images/image1.jpg";
  
  		tab2_on = new Image();
  		tab2_on.src = "/images/tab2_on.gif";
  		tab2_off = new Image();
  		tab2_off.src = "/images/tab2_off.gif";
  		tab2_bg = new Image();
  		tab2_bg.src = "/images/image2.jpg";
  
  		tab3_on = new Image();
  		tab3_on.src = "/images/tab3_on.gif";
  		tab3_off = new Image();
  		tab3_off.src = "/images/tab3_off.gif";
  		tab3_bg = new Image();
  		tab3_bg.src = "/images/image3.jpg";
  		
  		tab4_on = new Image();
  		tab4_on.src = "/images/tab4_on.gif";
  		tab4_off = new Image();
  		tab4_off.src = "/images/tab4_off.gif";
  		tab4_bg = new Image();
  		tab4_bg.src = "/images/image4.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','tab4');
  //loopBGArray = new Array('image1.jpg','image2.jpg','image3.jpg','image4.jpg);
  loopTabArray = new Array('tab1','tab2','tab3','tab4');
  
  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;
  		case 'tab4': panelBackground.style.backgroundImage = "url(images/image4.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) ? 3 : 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==3) ? 0 : realCount+1;
  		//console.debug('time finished - '+timerCount+' stop - '+timerStop);
  		timerStop = 0;
  	}
  //	console.debug('time finished - '+timerCount+' stop - '+timerStop);
  	window.setTimeout('timeEvent()',10000);
}