
function preload() 
{
  if (!document.images) return;
  var ar = new Array();
  var arguments = preload.arguments;
  for (var i = 0; i < arguments.length; i++) 
  {
    ar[i] = new Image();
    ar[i].src = arguments[i];
  }
}
function reloadPage(init) 
{
  if (init==true) with (navigator) 
  {
  	if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
  	{
    	document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; 
  	}
  }
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) 
  	location.reload();
}
reloadPage(true);





var timerID = null;
var dropNumState = null;

n = (document.layers) ? 1:0
ie = (document.all) ? 1:0

function closeall()
{
	for(h=0; h<dropNumState.length; h++)
	{	
		if(dropNumState[h] == 1)
		{
			if(ie)
			{
				document.getElementById("dropdown"+(h+1)).style.display="none";
			}
			else if(n)
			{
				document.getElementById("dropdown"+(h+1)).style.display="none";
			}
			else
			{
				document.getElementById("dropdown"+(h+1)).style.display="none";
			}
			dropNumState[h] = 0;
		}
	}
}

function openclose(drop,count)
{
	dropNumState = new Array(count);
	
	for(i=0; i<count; i++)
	{
		dropNumState[i] = 0;
		if (drop=="dropdown"+(i+1))
		{ 
			dropstate = dropNumState[i];
		}
	}

	if (ie) // Close all sub menus in IE
	{
		for(j=1; j<=count; j++)
			document.getElementById("dropdown"+j).style.display="none"; 
	}
	else if (n) // Close all sub menus in Netscape
	{ 
		for(j=1; j<=count; j++)
			document.getElementById("dropdown"+j).style.display="none";
	}
	else // Close all sub menus in all other browsers
	{
		for(j=1; j<=count; j++)
			document.getElementById("dropdown"+j).style.display="none"; 
	}
	
	for(m=0; m<count; m++)
		dropNumState[m] = 0;

	clearTimeout(timerID);
	
	if (dropstate==0)
	{
		if (ie)
			document.getElementById(drop).style.display="block"; 
		else if (n)
			document.layers[drop].display="block"
		else
			document.getElementById(drop).style.display="block";

		for(k=0; k<count; k++)
		{	
			if(drop=="dropdown"+(k+1))
				dropNumState[k]=1;
		}
	}
}


function swapImgRestore() 
{
	var i,x,a=document.sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
		x.src=x.oSrc;
	clearTimeout(timerID);
	timerID = setTimeout("closeall()", 4);
}
function preloadImages() 
{
  	var d=document; 
  	if(d.images)
  	{ 
  		if(!d.p) 
  			d.p=new Array();
    	
  		var i,j=d.p.length,a=preloadImages.arguments; 
    	
    	for(i=0; i<a.length; i++)
    		if (a[i].indexOf("#")!=0)
    		{ 
    			d.p[j]=new Image; d.p[j++].src=a[i];
    		}
  	}
}
function findObj(n, d) 
{
	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=findObj(n,d.layers[i].document); 
  	
  	return x;
}
function swapImage() 
{
	var i,j=0,x,a=swapImage.arguments; 
	document.sr=new Array; 
	
	for(i=0;i<(a.length-2);i+=3)
   		if ((x=findObj(a[i]))!=null)
   		{
   			document.sr[j++]=x; 
   			if(!x.oSrc) 
   				x.oSrc=x.src; 
   				x.src=a[i+2];
   		}
}