jsHover = function() {
	var hEls = document.getElementById("mainmenu").getElementsByTagName("LI");
	for (var i=0, len=hEls.length; i<len; i++) {
		hEls[i].onmouseover=function() { this.className+=" jshover"; }
		hEls[i].onmouseout=function() { this.className=this.className.replace(" jshover", ""); }
	}
}
if(window.attachEvent && navigator.userAgent.indexOf("Opera")==-1) window.attachEvent("onload", jsHover);

var UA=navigator.userAgent;
is_gecko=/gecko/i.test(UA);
is_opera=/opera/i.test(UA);
is_mac=/mac_powerpc/i.test(UA);
is_ie=/msie/i.test(UA)&&!is_opera&&!is_gecko&&!is_mac;
is_nn4=(document.layers)?true:false;

function change_host(o) {
	document.location.assign('http://'+o.options[o.selectedIndex].value);
	return true;
}
function goTo(where) {
	 document.location.reload(where);
	 return false;
}

function set_color_pic(val,pth)
{
	document.goodspic.src=pth;
	document.basket.gcolor.selectedIndex=val
}

function set_color_pics(val,pth1,pth2,pth3,pth4)
{
	if(val.selectedIndex==0) val.selectedIndex=1;
	
	document.goodspic.src=pth1+Base64.encode(pth2+val.selectedIndex+pth3)+pth4;
}

function checkterms(err)
{
	var f=document.regfrm;
	if(!f.terms.checked)
	{
	alert(err);
	return false;
	}
	return true;
}

function set_lang(lng,pth)
{
	document.location.assign(pth+lng.options[lng.selectedIndex].value+'/');
}

function popupWindow(goLocation,wname,wdth,hght,toolbr)
{
 var v=parseInt(navigator.appVersion);
 isNetscape=navigator.appName.indexOf('Netscape')>=0;
 isExplorer=navigator.appName.indexOf('Explorer')>=0;

 var ww = wdth;
 var wh = hght;

 positionCode='';
 if(v>=4)
 {
  if(isExplorer) positionCode='left='+(screen.width/2-ww/2)+',top='+(screen.height/2-wh/2)+',';
  if(isNetscape) positionCode='screenX='+(screen.width/2-ww/2)+',screenY='+(screen.height/2-wh/2)+',';
 }

var menu;
if(toolbr!='') menu='menubar=1,toolbar=1,';
else menu='menubar=0,toolbar=0,';

 newWindow=window.open(goLocation,wname,
 'width='+ww+',height='+wh+','+
 positionCode+
 'location=0,'+menu+
 'scrollbars=1,'+
 'status=1,'+
 'resizable=1');
  if(v>=3) newWindow.focus();
  return false;
}

function ShowPhotos(pth,goods)
{
	popupWindow(pth+'&goods='+goods+'&act=1','wname',990,770,'');
}

function makesame(ca)
{
	if(document.regfrm.billsame.checked)
	{
		document.regfrm.jcountry.selectedIndex=document.regfrm.pcountry.selectedIndex;
		document.regfrm.jcity.value=document.regfrm.pcity.value;
		if(ca=='_ca' || ca=='_uk') document.regfrm.jprovince.value=document.regfrm.pprovince.value;
		document.regfrm.jindex.value=document.regfrm.pindex.value;
		document.regfrm.jaddress.value=document.regfrm.paddress.value;
	}
}

function PayPalSubmit() {
	document.paypalform.submit();
}

function startPayPal(pth) {
	popupWindow(pth+'blank.html','ppWnd',800,580,'');
	document.paypalform.target='ppWnd';
	return false;
}