var targetFade=new Array(); 
var currentFade=new Array();
var targetY=new Array(); 
var currentY=new Array();
var yp=0;
var current=255;

function fadeSetup()
	{	
	for (var lp=0;lp<document.CFORM.NUMPICS.value;lp++)
		{
		currentFade[lp]=0;
		targetFade[lp]=0;
		currentY[lp]=64;
		targetY[lp]=64;
		}

	targetFade[0]=100;
	targetY[0]=0;
	yp=0;
	t=setTimeout("runFade()",17);
	current=255;
	}

function runFade()
	{
	for (var lp=0;lp<document.CFORM.NUMPICS.value;lp++)
		{
		if (currentFade[lp]<targetFade[lp]) 
			{			
			currentFade[lp]+=12;
			dest="PIC"+lp;
			document.getElementById(dest).style.visibility="visible";		
			if (currentFade[lp]>=targetFade[lp]) 
				{
				currentFade[lp]=targetFade[lp];
				} 
			}

		if (currentFade[lp]>targetFade[lp]) 
			{
			currentFade[lp]-=12;
			if (currentFade[lp]<=targetFade[lp]) {currentFade[lp]=targetFade[lp]} 
			}

		if (currentY[lp]<targetY[lp]) 
			{			
			currentY[lp]+=12;
			if (currentY[lp]>=targetY[lp]) {currentY[lp]=targetY[lp]} 
			}

		if (currentY[lp]>targetY[lp]) 
			{
			currentY[lp]-=12;
			if (currentY[lp]<=targetY[lp]) {currentY[lp]=targetY[lp]} 
			}

		if (currentFade[lp]==100) 
			{
			dest="INFOBOX"+lp;
			document.getElementById(dest).style.visibility="visible";		
			dest="PIC"+lp;
			} 
	
		if (currentFade[lp]==0) 
			{
			dest="PIC"+lp;
			document.getElementById(dest).style.visibility="hidden";		
			} 

		dest="PIC"+lp;
		fadeVal=currentFade[lp];
		document.getElementById(dest).style.opacity=fadeVal/100;
		document.getElementById(dest).style.filter="alpha(opacity="+fadeVal+")";

		dest="LINKBOX"+lp;
		yVal=currentY[lp];
		document.getElementById(dest).style.backgroundPosition="0px "+yVal+"px";
		}

	clearTimeout(t);
	t=setTimeout("runFade()",17);
	}
	
function switchPic(str)
	{
	if (str != current)
		{
		current=str;
		for (var lp=0;lp<document.CFORM.NUMPICS.value;lp++)
			{
			targetFade[lp]=0;
			targetY[lp]=64;
	
			dest="INFOBOX"+lp;
			document.getElementById(dest).style.visibility="hidden";
			}
	
		targetFade[str]=100;
		targetY[str]=0;
		}
	}

function gotoAssist()
	{
	document.ssid.supportSessionId.value = document.ssid.supportSessionId.value.replace(/[^0-9]/g, ''); 

	if (document.ssid.name.value.length==0)
		{
		alert("Error:- You must complete the 'Customer Name' field");
		document.ssid.name.focus();
		}
	else if (document.ssid.supportSessionId.value.length==0)
		{
		alert("Error:- You must complete the 'Support Key' field");
		document.ssid.supportSessionId.focus();
		}
	else if (document.ssid.supportSessionId.value.length<9 || document.ssid.supportSessionId.value.length>9)
		{
		alert("Error:- Invalid 'Support Key'");
		document.ssid.supportSessionId.focus();
		}
	else
		{
		document.ssid.submit();
		}
	}
