// JavaScript Document

function menuAnim(tab)
{
	
	//document.getElementById(tab).style.cursor = "hand";
	document.getElementById(tab).style.backgroundColor = "yellow";
	document.getElementById(tab).style.color = "black";
	
	
}

function menuOut(tab)
{
	
	//document.getElementById(tab).style.cursor = "default";
	document.getElementById(tab).style.backgroundColor = "grey";
	document.getElementById(tab).style.color = "yellow";
	
}
var a = 0;
function moveTest()
{
	
   document.getElementById("rightImage").style.left = a
   if (a > 800)
   {
      
   }
   else
   {
     a = a + 10
	 window.setTimeout("moveTest()", 1);
   }
   
}

var topInfoAdder = 1;
var infoString = "Specialist Electrical Contractors";
var infoDisplayString = "";
/*function topInfoAnim()
{
	if (navigator.appName == "Netscape")
	{
		document.getElementById("topInfoTableData").style.opacity = 0.8;
	}
	else
	{
		document.getElementById("topInfoTableData").filters[0].opacity = 80;
	}
	
	
	infoDisplayString = infoString.substr(0, topInfoAdder);
	document.getElementById("topInfoTableData").innerHTML = infoDisplayString;
	if (topInfoAdder == infoString.length)
	{
		topInfoAdder = 1;
		clearTimeout(tickerRepeat);
		window.setTimeout("fadeOut('topInfoTableData','topInfoAnim()')", 2000);
		
	}
	else
	{
	   topInfoAdder++;
	   var tickerRepeat = window.setTimeout("topInfoAnim()", 20);
	}
	
}*/
var fadeCounter = 0;
var fading = false;
function fadeIn(theElement)
{
	fading = true;
	  
		   
	document.getElementById(theElement).style.opacity = fadeCounter / 100;
	

	  
	
	if (fadeCounter < 100)
	{
		   fadeCounter++;
	       window.setTimeout("fadeIn('" + theElement + "')", 1);
	} 
	else
    {
      fadeCounter = 100;
	  window.setTimeout("fadeOut('" + theElement + "')", 4000);
      
	}

}

function fadeOut(theElement)
{
	fading = true;
	document.getElementById(theElement).style.opacity = fadeCounter / 100;
	
	if (fadeCounter > 0)
	{
		   fadeCounter--;
	       window.setTimeout("fadeOut('" + theElement + "')", 1);
	} 
	else
    {
      fadeCounter = 0;
	  fading = false;
	  window.setTimeout("runSlideShow()", 1000);
      
	}

		
}



var showShow;
showShow = false;
var theSlide = 0;

function runSlideShow()
{
	
	if (showShow)
	{
	   if (navigator.appName == "Netscape")
	   {

	   }

       if (theSlide < 4) 
       {
          theSlide++;
       }
       else
       {
          theSlide = 0;
       }
  
       if (navigator.appName != "Netscape")
       {
          document.getElementById("homeImg").style.filter="blendTrans(duration=2)";
          document.getElementById("homeImg").filters.blendTrans(duration=2).Apply();
          document.getElementById("homeImg").filters.blendTrans.Play();
		  document.getElementById("homeImg").src = slidePicArray[theSlide].src;
		  
		  window.setTimeout("runSlideShow()", 5000);
       }
	   else
	   {	   
	   
		   document.getElementById("homeImg").style.opacity = 0;
		   fadeCounter = 0;
		   document.getElementById("homeImg").src = slidePicArray[theSlide].src;
		   fadeIn("homeImg");
	   }
     
    }
    else
    {
 	   theSlide = 0;   
	   
    }
   
 


}

var topRightInfoArray = new Array();
topRightInfoArray[0] = 'Clean Room Installation - HVAC Systems';
topRightInfoArray[1] = 'LV Switchboard - Air Conditioning';

topRightInfoArray[2] = 'Environmental Monitoring - Power Metering';

var trMes = 0;
var trMesCounter = 0;
function topRightInfoAnim()
{

	if (trMes < topRightInfoArray[trMesCounter].length)
	{
	   trMes++;
	   document.getElementById("topRightInfoTableData").innerHTML = topRightInfoArray[trMesCounter].substr(0, trMes);
	   window.setTimeout("topRightInfoAnim()", 10);
	}
	else
	{
	   if (trMesCounter < 2)
	   {
		   trMesCounter++;
	   }
	   else
	   {
	       trMesCounter = 0;	
	   }
	   trMes = 0;
	   window.setTimeout("topRightInfoAnim()", 5000);
	}
	
	
	

}

