ns4=(document.layers)? true:false
ie4=(document.all)? true:false

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

HM_NS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko")) ? true : false;
   HM_DOM = (document.getElementById) ? true : false;
   HM_NS4 = (document.layers) ? true : false;
    HM_IE = (document.all) ? true : false;
   HM_IE4 = HM_IE && !HM_DOM;
   HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
  HM_IE4M = HM_IE4 && HM_Mac;
 HM_Opera = (navigator.userAgent.indexOf("Opera")!=-1);
 HM_Konqueror = (navigator.userAgent.indexOf("Konqueror")!=-1);

HM_IsMenu = !HM_Opera && !HM_Konqueror && !HM_IE4M && (HM_DOM || HM_NS4 || HM_IE4);

HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";
function getReal(xy,el){
   if((HM_IE)||(HM_DOM)){
      Pos=(xy=="x")?el.offsetLeft:el.offsetTop;
	 
      if ((HM_IE)&&(!HM_Mac)&&(el.tagName)&&
          (el.tagName.toUpperCase()=="TABLE")&&
          (el.border)&&(el.border>0)) Pos++;
      tmpEl=el.offsetParent;
      while(tmpEl!=null){
         Pos+=(xy=="x")?tmpEl.offsetLeft:tmpEl.offsetTop;
         if ((HM_IE)&&(!HM_Mac)&&(tmpEl.tagName)&&
             (tmpEl.tagName.toUpperCase()=="TABLE")&&
             (tmpEl.border)&&(tmpEl.border>0)) Pos++;
         tmpEl=tmpEl.offsetParent;
      }
   }else{
      Pos=(xy=="x")?el.x:el.y;
	   
   }
     if (HM_IE&&HM_Mac) {
	   Pos+=(xy=="x")?parseInt(document.body.currentStyle.marginLeft) :
		parseInt(document.body.currentStyle.marginTop);
	   }

   return Pos;
}

function findXY(xory,placename) {
   var thePlacer = HM_DOM ? document.getElementById(placename) : 
                   HM_IE ? document.all(placename) : document.images[placename];
				   
   retVal=getReal(xory,thePlacer);
   return retVal;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function setpos(id)
{
if (ns4) 
	{
	
	document.layers[id].left=findXY('x','poslayer')
	document.layers[id].top=findXY('y','poslayer')+5
	//document.layers[id].visibility = "show"
	}
else 
	if (ie4) 
	{
	//document.all[id].style.visibility = "visible"
	document.all[id].style.left=findXY('x','poslayer')
	document.all[id].style.top=findXY('y','poslayer')+5
	}
}

function showlayer(id)
{
if (ns4) 
	{
	document.layers[id].visibility = "show"
	}
else 
	if (ie4) 
	{
	document.all[id].style.visibility = "visible"
	}
}

function hidelayer(id)
{
if (ns4) 
	{
	document.layers[id].visibility = "hide"
	}
else 
	if (ie4) 
	{
	document.all[id].style.visibility = "hidden"
	}
}


function PassFlashname(){
	//Set hidden field values
	document.getElementById("hdnFinish").value = finish;
	document.getElementById("hdnColor").value = color;
	document.getElementById("hdnSize").value = size;
	imagename = productname+'_'+finish+'_'+color+'.jpg'
	var flsh = document.getElementById('productmovie');
	if(flsh){
		try{
			flsh.SetVariable("imagename",imagename);
		}catch(ex){
			flsh = document.getElementById('embproductmovie');
			flsh.SetVariable("imagename",imagename);
		}
	}
}

function PassFlash_color(thiscolor){
	if(color!=thiscolor)
	{
		color = thiscolor
		PassFlashname();
	}
	
}

function PassFlash_finish(){
	index = document.forms['Form1'].elements['ddlFinishes'].selectedIndex
	finishval = document.forms['Form1'].elements['ddlFinishes'].options[index].value;
	index+=1
	if(finishval!='')
	{
		for(i=0;i<=document.forms['Form1'].elements['ddlFinishes'].length - 1;i++)
		{
			j = i+1
			if(index==j)
				showlayer('finishlayer'+j)
		else
				hidelayer('finishlayer'+j)
		}
		color = eval('defaultfinishcolor'+index)
			
		finish = finishval
		PassFlashname();
	}
}

function PassFlash_size(){
	index = document.forms['Form1'].elements['ddlSizes'].selectedIndex
	size = document.forms['Form1'].elements['ddlSizes'].options[index].value;
	PassFlashname()
}

function addprod()
{
alert('This product has been added to your shopping cart')
document.location = 'collection_2a.htm'
}

function openpop(htmname,name,h,w)
{
	window.open(htmname,name,"height="+h+",width="+w+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,textbar=no,resizable=yes,top=50,left=50");


}

function openpop1(htmname,name,h,w)
{
	window.open(htmname,name,"height="+h+",width="+w+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,textbar=no,resizable=yes,top=50,left=50");

}

function modelesswin(url,mheight,mwidth)
{
	if (document.all&&window.print) //if ie5
		eval('window.showModelessDialog(url,"","help:0;scrollbars=0;resizable:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
	else
		eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,resizable=0,scrollbars=0")')
}

function enterNumeric(objControl)
{
	//var RegExp = /'|"/i;
	//alert(objControl.value.match(RegExp))
	if(objControl == undefined)	// for decimal places
	{
		if((event.keyCode < 96 || event.keyCode > 105) && (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode!=46 && event.keyCode!=8 && event.keyCode!=37 && event.keyCode!=39 && event.keyCode !=9 && event.keyCode != 116 && event.keyCode!=35 && event.keyCode!=36))
		{
			event.keyCode = 0
			return false;
		}			
	}
	else	// no decimal places
	{
		if((event.keyCode < 96 || event.keyCode > 105) && (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode!=46 && event.keyCode!=8 && event.keyCode!=37 && event.keyCode!=39 && event.keyCode != 190 && event.keyCode != 110 && event.keyCode !=9 && event.keyCode != 116 && event.keyCode!=35 && event.keyCode!=36) || (event.keyCode == 190 && objControl.value.indexOf(".") != -1) || (event.keyCode == 110 && objControl.value.indexOf(".") != -1))
		{
			event.keyCode = 0
			return false;
		}
	}
	return true;
}

function changebgcolor(idv){document.getElementById(idv).style.visibility = "visible";}
function restorebgcolor(idv){document.getElementById(idv).style.visibility = "hidden";}
function openwindow(){open.frames();}
function showsubmenu(id){if(document.getElementById(id).style.display == "none") document.getElementById(id).style.display = "inline"; else document.getElementById(id).style.display = "none";}
function onlogin() {alert('Gems Club member login is not active.');return false;}