// All the functions I need
//----------------------------------------------------------------------------------------------------------

LightImages = new Array('Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_01.png','Animations/Light_02.png','Animations/Light_03.png','Animations/Light_04.png','Animations/Light_05.png','Animations/Light_06.png','Animations/Light_07.png','Animations/Light_08.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png','Animations/Light_00.png')
	thisLight = 0
	LightCt = LightImages.length

	function rotateLight() {
		if (document.images) {
			thisLight++
			if (thisLight == LightCt) {
				thisLight = 0
				return rotateLight()
			}
			document.Light.src=LightImages[thisLight]
		  	setTimeout("rotateLight()", 300)
	  	}
	}


//--------------------------------------------------------------------------------------------------------------------------------

MiddleTBImages = new Array('Animations/TB_00.png','Animations/TB_01.png','Animations/TB_02.png','Animations/TB_03.png','Animations/TB_03.png','Animations/TB_03.png','Animations/TB_03.png','Animations/TB_03.png','Animations/TB_0301.png','Animations/TB_0302.png','Animations/TB_0303.png','Animations/TB_00.png','Animations/TB_00.png','Animations/TB_00.png','Animations/TB_04.png','Animations/TB_05.png','Animations/TB_06.png','Animations/TB_07.png','Animations/TB_08.png','Animations/TB_08.png','Animations/TB_08.png','Animations/TB_08.png','Animations/TB_08.png','Animations/TB_0801.png','Animations/TB_0802.png','Animations/TB_0803.png','Animations/TB_00.png','Animations/TB_00.png','Animations/TB_00.png','Animations/TB_0901.png','Animations/TB_0902.png','Animations/TB_0903.png','Animations/TB_0904.png','Animations/TB_10.png','Animations/TB_10.png','Animations/TB_10.png','Animations/TB_10.png','Animations/TB_10.png','Animations/TB_11.png','Animations/TB_11.png','Animations/TB_11.png','Animations/TB_11.png','Animations/TB_11.png','Animations/TB_11.png','Animations/TB_11.png','Animations/TB_10.png','Animations/TB_1001.png','Animations/TB_1002.png','Animations/TB_1003.png','Animations/TB_00.png','Animations/TB_00.png')
	thisTB = 0
	MiddleTBCt = MiddleTBImages.length

function rotateTB() 
{
	if (document.images) 
	{
		thisTB++
		if (thisTB == MiddleTBCt) 
		{
			thisTB = 0
			return rotateTB()
		}

			if(MiddleTBImages[thisTB] == 'Animations/TB_11.png')
			{			
			document.MiddleTB.src=MiddleTBImages[thisTB];
			document.TopTB.src='Animations/TB_Top_01.png';				
			document.BottomTB.src='Animations/TB_Bottom_01.png';

			}	else	
				{
				document.MiddleTB.src=MiddleTBImages[thisTB]
				document.TopTB.src='Animations/TB_Top_00.png';		
				document.BottomTB.src='Animations/TB_Bottom_00.png';		
				}

		setTimeout("rotateTB()", 300)
	}
}

//----------------------------------------------------------------------------------------------------------
var Product;
function downloadAC(Product)
{

if(Product == "AC")
	{
	self.location.href = "Demos/AC.zip";
	}

if(Product == "TB")
	{
	self.location.href = "Demos/TB.zip";
	}
	
if(Product == "EG")
	{
	self.location.href = "Demos/EG.zip";
	}
}
//------------------------------------------------------------------------------------------------------------
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
//-------------------------------------------------------------------------------------------------------

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
	
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-------------------------------------------------------------------------------------------------------


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


//-------------------------------------------------------------------------------------------------------
function hideLoad(){
//document.write('<div id="load" style="position:absolute; width:100%; height:100%; z-index:14; left: 0px; top: 0px; background-color: #000000; layer-background-color: #000000; border: 1px none #000000;"> <table width="100%" height="400" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle"><img src="animations/animaload.gif"></td></tr></table></div>')
timer = setTimeout("MM_showHideLayers('loading','','hide')",3000)
return false

}
//-------------------------------------------------------------------------------------------------------

function stoperror(){
return true
}
window.onerror=stoperror

//-------------------------------------------------------------------------------------------------------
function ResetEmail()
{
document.addMessage.from.value = "";
}		 
//----------------------------------------------------------------------------------------
function ResetText()
{
document.addMessage.message.value = "";
document.addMessage.counter.value = "0";
document.getElementById('counter').innerHTML.value = "0";
}		
//---------------------------------------------------------------------------------------
function SetCounter() {
document.addMessage.counter.value=document.addMessage.message.value.length;
}
//---------------------------------------------------------------------------------------