var hands = [1,2,3,4,5];
var chand = ( String(location).match(/account/) ) ? 2 : hands[Math.floor(Math.random()*hands.length)];
var payorderurl = "";

var clang = "en";
if ( String(location).match(/\/(\w\w)\//) ) {
	clang = RegExp.$1;
}

//-----------------------------------------------------------------------------------------
var FillTdMenu_Color="";
var FillTdMenu_Bg="_/bg_menu03.gif";
var FillTdSubMenu_Color="#999999";

var if_NN6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko") );
var if_NN  = (document.layers) ? true : false;
var if_IE  = (document.all) ? true : false;
var if_OP = ( navigator.userAgent.indexOf("Opera") != -1 ) ? true : false;
var active = 0;
var closeTimeout = 1000;
var timerID;
var opened = -1;
var SubOpen=0;
//-----------------------------------------------------------------------------------------
function nameIt(id)
	{
	if (if_IE)	{return eval('document.all["'+id+'"].style');}
	else		{if  (if_NN6 || if_OP) {var temp = document.getElementById(id); return temp.style;}
			 else return eval('document.layers["'+id+'"]');}
	}
//function nameImg(id,id2)
//	{
//	if (if_IE)  	{return eval('document.images["'+id2+'"]');}
//	else		{if (if_NN6) {var temp = document.getElementsByName(id2); return temp[0];}
//			 if (id) return eval('document["'+id+'"].document.images["'+id2+'"]');
//			 else return eval('document.images["'+id2+'"]');}
//	}
function nameCell(id) {
	if (if_IE) {
		return eval('document.all["'+id+'"]');
	} else {
		if  (if_NN6 || if_OP) {
			return document.getElementById(id);
		} else {
			return eval('document["'+id+'"]' );
		}
	}
}
//-----------------------------------------------------------------------------------------
function closebox(num)
	{
	var did = "MENU" + num;
	temp = nameIt(did);
	temp.visibility = 'hidden';
	opened = -1;
	UNCOLOR(num);
	}
//-----------------------------------------------------------------------------------------
function openbox(num)
	{
	if  (num != 999)
		{
		var did = "MENU" + num;
		temp = nameIt(did);
		if (!temp) return;

		temptitle = nameCell("MENUTITLE"+num);
		if ( temptitle && temptitle.offsetWidth ) {
			tempimg = nameCell("MENUIMG"+num);
			if ( tempimg ) {
				tempimg.width = 180 - temptitle.offsetWidth - 10;
			}
		}

		temp.visibility = 'visible';
		if  (opened != -1) closebox( opened );
		opened = num;
		COLOR(num);
		}
	else	{closebox(opened);}
	}
//-----------------------------------------------------------------------------------------
function openboxPause()
	{
	if  (!active) clearTimeout(timerID);
	active=1;
	}
function closeboxPause()
	{
	active = 0;
	timerID = setTimeout('openbox(999)', closeTimeout);
	}
//-----------------------------------------------------------------------------------------
function OPEN(n)
	{
  	if (SubOpen==n && opened != -1) {
    	openboxPause();
    }
    else {
  	  openbox(n);
  	  openboxPause();
  	  SubOpen=n;
    }
	}
function CLOSE(n)
	{
	if (!active) return;
	SubOpen=0;
	closebox(n);
	closeboxPause();
	}
//-----------------------------------------------------------------------------------------
function COLOR(n)
	{
	var temp=nameCell("COLOR"+n);
	if (temp && FillTdMenu_Color) 	{temp.bgColor=FillTdMenu_Color; temp.style.cursor = "default";}
	if (temp && FillTdMenu_Bg) 	{temp.style.backgroundImage="url("+FillTdMenu_Bg+")"; temp.style.cursor = "default";}
	}
function UNCOLOR(n)
	{
	var temp=nameCell("COLOR"+n);
	if (temp && FillTdMenu_Color) 	temp.bgColor="";
	if (temp && FillTdMenu_Bg) 	temp.style.backgroundImage="";
	}
//-----------------------------------------------------------------------------------------
function FILL(id)	{var temp = nameCell(id); temp.bgColor=FillTdSubMenu_Color; temp.style.cursor = "hand";}
function UNFILL(id)	{var temp = nameCell(id); temp.bgColor = "";}
function GOTO(url) {document.location.href = url;}
//-----------------------------------------------------------------------------------------

function doresize () {
	ww = ( window.innerWidth ) ? window.innerWidth : ( document.body && document.body.clientWidth ) ? document.body.clientWidth : 0;
	if ( ww != 0 ) {
		mtable = nameIt("MAIN");
		if ( !mtable ) return;
		if ( ww*0.8 > 1000 ) {
			res = 1000;
		} else {
			res = "80%";
		}
		mtable.width = res;
		document.cookie = "width=" + res + "; path=/;";
	}
}
function odoc (url) {
	window.open(url,'h','width=800,height=600, toolbar=no,resizable=yes,scrollbars=no,status=yes');
	return false;
}
