var menu_timer = null;
var show_menu = null;
var preloadFlag = false;

function preloadmenuImages(path) {
	if (document.images) {
		head_r2_c2_ = newmenuImage(path, "head_r2_c2_");
		head_r2_c3_ = newmenuImage(path, "head_r2_c3_");
		head_r2_c4_ = newmenuImage(path, "head_r2_c4_");
		head_r2_c5_ = newmenuImage(path, "head_r2_c5_");
		head_r2_c6_ = newmenuImage(path, "head_r2_c6_");
		side_r3_c1_ = newmenuImage(path, "side_r3_c1_");
		side_r4_c1_ = newmenuImage(path, "side_r4_c1_");
		side_r5_c1_ = newmenuImage(path, "side_r5_c1_");
		side_r8_c1_ = newmenuImage(path, "side_r8_c1_");
		side_r9_c1_ = newmenuImage(path, "side_r9_c1_");
		side_r10_c1_ = newmenuImage(path, "side_r10_c1_");
		side_r11_c1_ = newmenuImage(path, "side_r11_c1_");
		side_r12_c1_ = newmenuImage(path, "side_r12_c1_");
		side_r13_c1_ = newmenuImage(path, "side_r13_c1_");
		side_r14_c1_ = newmenuImage(path, "side_r14_c1_");
		side_r15_c1_ = newmenuImage(path, "side_r15_c1_");
		side_r16_c1_ = newmenuImage(path, "side_r16_c1_");
		side_r17_c1_ = newmenuImage(path, "side_r17_c1_");
		foot_r2_c2_  = newmenuImage(path, "foot_r2_c2_");

		preloadFlag = true;
	}
}

function cpreloadmenuImages(path) {
	if (document.images) {
		head_r2_c4_ = newmenuImage(path, "head_r2_c4_");
		head_r2_c5_ = newmenuImage(path, "head_r2_c5_");
		head_r2_c6_ = newmenuImage(path, "head_r2_c6_");
		side_r3_c1_ = newmenuImage(path, "side_r3_c1_");
		side_r4_c1_ = newmenuImage(path, "side_r4_c1_");
		side_r5_c1_ = newmenuImage(path, "side_r5_c1_");
		foot_r2_c2_ = newmenuImage(path, "foot_r2_c2_");
		preloadFlag = true;
	}
}

function newmenuImage(path, arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = path + "/img/" + arg + ".gif";
		return rslt;
	}
}
function menuImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=1; i < menuImages.arguments.length; i+=2) {
			document[menuImages.arguments[i]].src = menuImages.arguments[0] + "/img/" + menuImages.arguments[i+1] + ".gif";
		}
	}
}

function MM_reloadPage(init)
{
  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_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=MM_findObj(n,d.layers[i].document);
	}

  if(!x && document.getElementById)
	{
		x=document.getElementById(n); 
	}

	return x;
}

function MM_LayersTimer()
{
	menu_timer = setTimeout('MM_hideLayer()', 500);
}


function MM_showLayer(menu_name)
{
  var i, obj;

	if(show_menu != null && show_menu != menu_name)
	{
		if ((obj=MM_findObj(show_menu))!=null)
		{
			if (obj.style){ 
   			obj.style.visibility = 'hidden';
			}
			else{
				obj.visibility = 'hide';
			}
		}	
	}

	if(menu_timer != null)
	{
		clearTimeout(menu_timer);
		menu_timer = null;
	}
	

	if((menu_name != null) && ((obj = MM_findObj(menu_name)) != null)) 
	{
			if (obj.style){ 
   			obj.style.visibility = 'visible';
			}
			else{
				obj.visibility = 'show';
			}
			show_menu = menu_name;
	}
}

function MM_hideLayer()
{
	if(show_menu != null)
	{
		if((obj=MM_findObj(show_menu))!=null)
		{
			if (obj.style){ 
   			obj.style.visibility = 'hidden';
			}
			else{
				obj.visibility = 'hide';
			}
		}	
	}
}
