if(window.event +"" == "undefined") event = null;
 function HM_f_PopUp(){return false};
 function HM_f_PopDown(){return false};
 popUp = HM_f_PopUp;
 popDown = HM_f_PopDown;


 HM_PG_MenuWidth = 150;
 HM_PG_FontFamily = "Verdana,sans-serif";
 HM_PG_FontSize = 8;
 HM_PG_FontBold = 0;
 HM_PG_FontItalic = 0;
 HM_PG_FontColor = "blue";
 HM_PG_FontColorOver = "white";
 HM_PG_BGColor = "#DDDDDD";
 HM_PG_BGColorOver = "#FFCCCC";
 HM_PG_ItemPadding = 4;

 HM_PG_BorderWidth = 0;
 HM_PG_BorderColor = "black";
 HM_PG_BorderStyle = "solid";
 HM_PG_SeparatorSize = 1;
 HM_PG_SeparatorColor = "#000000";

 HM_PG_ImageSrc = "HM_More_black_right.gif";
 HM_PG_ImageSrcLeft = "HM_More_black_left.gif";

 HM_PG_ImageSrcOver = "HM_More_white_right.gif";
 HM_PG_ImageSrcLeftOver = "HM_More_white_left.gif";

 HM_PG_ImageSize = 5;
 HM_PG_ImageHorizSpace = 0;
 HM_PG_ImageVertSpace = 2;

 HM_PG_KeepHilite = true; 
 HM_PG_ClickStart = 0;
 HM_PG_ClickKill = false;
 HM_PG_ChildOverlap = -1;
 HM_PG_ChildOffset = 0;
 HM_PG_ChildPerCentOver = null;
 HM_PG_TopSecondsVisible = .5;
 HM_PG_StatusDisplayBuild =0;
 HM_PG_StatusDisplayLink = 0;
 HM_PG_UponDisplay = null;
 HM_PG_UponHide = null;
 HM_PG_RightToLeft = true;

 HM_PG_CreateTopOnly = 1;
 HM_PG_ShowLinkCursor = 1;
 HM_PG_NSFontOver = false;

 //HM_a_TreesToBuild = [2];


/*     **************** popUp()***************       */
function popUp(url)
{
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}

function popUpWindow(url)
{
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin";
}

/*     **************** checkselect()***************       */
function checkselect(form)
{
	var i = document.getElementById("select2").selectedIndex;
	if (document.getElementById("select2").options[i].value=='Bracelets')
	{
		hide_item("crt");
		hide_item("trs");
	}
	else
	{
		show_item("crt");
		show_item("trs");
	}
	
	ShowWeightOptions();
}
		
/*     **************** checkselect2()***************       */
function checkselect2()
{
	if (f2.select2.selectedIndex==4)
	{
		crt.style.display="none";
		trs.style.display="none";
	}
	else
	{
		crt.style.display="";
		trs.style.display="";
	}
}

/*     **************** StripBlanks()***************       */
function StripBlanks(S)  
{
  var start = 0;
  var end = 0 ;
  if (S.length == 0) return S;
  while (start < S.length && S.substring(start, start+1) == " ") start++;
  if (start>=S.length) return "";
  end = S.length - 1;
  while (end > start && S.substring(end, end+1) == " ") end-- ;
  if (end == start && S.substring(start, start+1) == " ") return "";
  return S.substring(start, end+1);
} 

/*     **************** EmptyTest()***************       */  
  function EmptyTest (form,str)
{
   Ctrl=form;
   if (Ctrl.value == "")
   {
      validatePrompt(Ctrl,str);
      return(false);
   }
   else
      return (true);
}
 
 /*     **************** validatePrompt()***************  */   
function validatePrompt(Ctrl,promptStr)
{
   alert(promptStr);
   Ctrl.focus();
   return;
}


/*     **************** CheckNumber()***************       */ 
function CheckNumber(num,str)
{
   var i=0;
    
   if (num.length==0)  {
      alert(str);
      return false;
   }
   while (i<num.length) {
      if (num.substring(i,i+1)>"9" || num.substring(i,i+1)<"0" ) {
         alert(str); 
         return false;
      }
      i++ ;
   }
 
   return true ;
}


/*     **************** checkEmail()***************       */
function checkEmail(strEmail)
{
  if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(strEmail)){
	return (true);
  }
  alert("Invalid E-mail Address! Please re-enter.");
  return (false);
}


/*     **************** checkAffiliateForm()***************       */
function checkAffiliateForm(form){
	
	if (form.Name.value==""){
		alert ("Please insert Site Name !");        
		form.Name.focus();          
		return(false);
	}else if (form.Password.value==""){
		alert ("Please choose a Password");        
		form.Password.focus();          
		return(false);         
	}else if (form.Password.value.length<6){
		alert ("Password should be at least 6 characters.");        
		form.Password.focus();          
		return(false);         
	}else if (form.Site.value==""){
		alert ("Please insert Site URL !");        
		form.Site.focus();          
		return(false);  
	}else if (form.Address1.value==""){
		alert ("Please insert Mailing Address  !");        
		form.Address1.focus();          
		return(false);         
	}else if (form.Contact_Name.value==""){
		alert ("Please insert Contact Name !");        
		form.Contact_Name.focus();          
		return(false);               
	}else if (form.Tel_No2.value==""){
		alert ("Please insert Contact Phone Number  !");        
		form.Tel_No2.focus();          
		return(false);         
	}else if (form.Email.value==""){
		alert ("Please insert Email  !");        
		form.Email.focus();          
		return(false);   
	}else if (!checkEmail(form.Email.value)){
		form.Email.focus();          
		return(false);   
	
	}else {return true;}
}


/*     **************** checkValue()***************       */
function checkValue(obj){
	if(obj.checked){
		f1.cmdSubmit.disabled = false;
	}else{
		f1.cmdSubmit.disabled = true;
	}
}

/*     **************** checkthis()***************       */
function checkthis(){
   if (f1.c1.checked==false)
   {
       alert("To proceed you have to accept the terms and conditions");
       return false;
   }
   return true;

}


/*     **************** checkWireForm()***************       */
function checkWireForm(form){
	
	
	if (form.bFname.value==""){
		alert ("Please insert your first Name !");        
		form.bFname.focus();          
		return(false);   
	}else if (form.bLname.value==""){
		alert ("Please insert your last Name !");        
		form.bLname.focus();          
		return(false);   
	}	
	else if (form.bAddress1.value==""){
		alert ("Please insert Address  !");        
		form.bAddress1.focus();          
		return(false);         
	}else if (form.bCity.value==""){
		alert ("Please insert City !");        
		form.bCity.focus();          
		return(false);               
	}else if (form.bPhoneNumber.value==""){
		alert ("Please insert billing phone number !");        
		form.bPhoneNumber.focus();          
		return(false);   	      
	}
	else if (form.sPhoneNumber.value==""){
		alert ("Please insert day time phone number !");        
		form.sPhoneNumber.focus();          
		return(false);   	      
	}else if (form.bZip.value==""){
		res=confirm("It is highly recommended to fill the zip code value \n If you don't have a zip code continue without filling this field. \n Continue with no zip?");		
		if (res == true)
			f1.submit();
		else   
		{
			form.bZip.focus();          
			return(false);
		}   	      
	}
		
	else {return true;}
}


/*     **************** checkBasketform()***************       */
	function checkBasketform()
	{
	for (i=0;i<f1.elements.length;i++)
	{
		if (f1.elements[i].type=='radio' && (f1.elements[i].value=='UK' || f1.elements[i].value=='USA') && f1.elements[i].checked==true) 
		{
		//alert('SS'+f1.elements[i].name.substring(8,20)+f1.elements[i].value);
		//alert(document.getElementById('SS'+f1.elements[i].name.substring(8,20)+f1.elements[i].value).selectedIndex);
		if (document.getElementById('SS'+f1.elements[i].name.substring(8,20)+f1.elements[i].value).selectedIndex==0)
		//if (f1.elements[i].selectedIndex==0&&f1.elements[i].name!='rates')
		{
			alert("Please Select a Finger Size for this Ring");
			document.getElementById('SS'+f1.elements[i].name.substring(8,20)+f1.elements[i].value).focus();
			//f1.elements[i].focus();
			return false;
		}
		}
		
	}
	return true;
	}


/*     **************** popUp2()***************       */
function popUp2(url) {
sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
self.name = "mainWin";
}


/*     **************** OpenPopUp()***************       */
function OpenShowDiamondWin(id,itype)
{
	window.open('ShowDiamond.asp?itype='+itype+'&id='+id,"Diamonds","height=600,width=800,scrollbars=1,toolbar=0,status=0,resizable=0,menubar=0")
}


/*     **************** checkMemberForm()***************       */
function checkMemberForm(form){
	
	if (form.Email.value==""){
		alert ("Please insert Email Address !");        
		form.Email.focus();          
		return(false);   
	}else if (!(checkEmail(form.Email.value))){			
			form.Email.focus();          
			return(false);   				
	}else if (form.F_Name.value==""){
		alert ("Please insert First Name  !");        
		form.F_Name.focus();          
		return(false);         
	}else if (form.L_Name.value==""){
		alert ("Please insert Last Name !");        
		form.L_Name.focus();          
		return(false);               
	}else if (form.Password.value==""){
		alert ("Please choose a Password");        
		form.Password.focus();          
		return(false);         
	}else if (form.Password.value.length<6){
		alert ("Password should be at least 6 characters.");        
		form.Password.focus();          
		return(false);         
	}else if (form.Country_ID.value==""){
		alert ("Please choose a Country");        
		form.Country_ID.focus();          
		return(false);        

	}else {return true;}
}


/*     **************** gosubmit()***************       */

 function gosubmit(jtype)
 {
  f1.JewelrySubTypeId.value=jtype;
  
  if(jtype==20) //band type ring - no main diamond
	f1.CS.value = "";
  
  f1.submit();
 }
 
  
/*     **************** OpenPopUp()***************       */

function OpenPopUp(id)
{
	window.open('ShowBigjewelries.asp?id='+id,"jewelries","height=450,width=700,scrollbar=0,toolbar=0,status=0,resizable=0,menubar=0")
}

/*     **************** OpenPopUp2()***************       */

function OpenPopUp2(id)
{
	window.open('ShowBigjewelries2.asp?id='+id,"jewelries","height=450,width=700,scrollbar=0,toolbar=0,status=0,resizable=0,menubar=0")
}

/*     **************** MakeWin()***************       */

function MakeWin(passedURL,pWidth,pHeight){
	window.open(passedURL,"","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,left=200,top=100,resizable=1,width=" + pWidth + ",height=" + pHeight)
}


/*     **************** checkCheckOutForm()***************       */

function checkCheckOutForm(form){
	
	
	if (form.bFname.value==""){
		alert ("Please insert your first Name !");        
		form.bFname.focus();          
		return(false);   
	}else if (form.bLname.value==""){
		alert ("Please insert your last Name !");        
		form.bLname.focus();          
		return(false);   
	}	
	else if (form.bAddress1.value==""){
		alert ("Please insert Address  !");        
		form.bAddress1.focus();          
		return(false);         
	}else if (form.bCity.value==""){
		alert ("Please insert City !");        
		form.bCity.focus();          
		return(false);               
	}else if (form.bPhoneNumber.value==""){
		alert ("Please insert billing phone number !");        
		form.bPhoneNumber.focus();          
		return(false);   	      
	}
	else if (form.sPhoneNumber.value==""){
		alert ("Please insert day time phone number !");        
		form.sPhoneNumber.focus();          
		return(false);   	      
	}
	else if (form.CCNum.value==""){
		alert ("Please insert Credit Card Number !");        
		form.CCNum.focus();          
		return(false);   
	}else if (form.CCName.value==""){
		alert ("Please insert Name on Card  !");        
		form.CCName.focus();          
		return(false);
		
	}else if (form.slcCCType.value==-1){
		alert ("Please insert Type of Card  !");        
		form.slcCCType.focus();          
		return(false);
	}else if (form.CSCNumber.value==""){
		alert ("Please insert your CSC Number  !");        
		form.CSCNumber.focus();          
		return(false);
	}else if (form.bZip.value==""){
		res=confirm("It is highly recommended to fill the zip code value \n If you don't have a zip code continue without filling this field. \n Continue with no zip?");		
		if (res == true)
			f1.submit();
		else   
		{
			form.bZip.focus();          
			return(false);
		}   	      
	}
	else {f1.submit();}
}

/*     **************** checkAddPaymentForm()***************       */

function checkAddPaymentForm(form,balance,layAway){
	
	var result = true;

	 if (form.CCNum.value==""){
		alert ("Please insert Credit Card Number !");        
		form.CCNum.focus();          
		result = false;   
	}
	if (form.paySum.value==""){
		alert ("Please insert amount of payment in US$ !");        
		form.paySum.focus();          
		result = false;	
	}
	if (form.slcCCType.value==-1){
		alert ("Please insert Type of Card  !");        
		form.slcCCType.focus();          
		result = false;
	}
	if (form.CSCNumber.value==""){
		alert ("Please insert your CSC Number  !");        
		form.CSCNumber.focus();          
		result = false;
	}
	if (eval(form.paySum.value)>balance){
		alert ("The amount is more than the balance due (US$ " + balance +") !");        
		form.paySum.focus();          
		result = false;
	}
	if (balance>=150){
		if (eval(form.paySum.value)<150){
			alert ("The amount is less than the minimum (US$ 150) !");        
			form.paySum.focus();          
			result = false;
		}
	}
	if(layAway){
			var ok=confirm("Are you sure you want to charge your credit card now ? \n This is not authorization !");
			if(ok==false)
				result = false;
	}
	if (submitted) 
		{
		  alert("Your transaction is being submitted but the connection to the Manager Service is taking longer than usual  - please be patient. Click OK to continue the submission.")
				   
		  return (false);
		} 
		
	if(result)
	{		
		f1.submit();
		submitted = true; 
		return (true);	
		
	}	
	else
		return false;
	
}



/***************** openWinCSC()****************/

function openWinCSC()
		{
		 win=open("csc.htm","csc","width=300,height=400,status=yes,scrollbars=yes,left=50,top=50")
		}
/***************** openWinCSC_sp()****************/

function openWinCSC_sp()
		{
		 win=open("csc_sp.htm","csc","width=300,height=400,status=yes,scrollbars=yes,left=50,top=50")
		}
/***************** openWinAmex()****************/
function openWinAmex()
		{
		 win=open("amx.htm","amx","width=300,height=400,status=yes,scrollbars=yes,left=50,top=50")
		}
/***************** openWinAmex_sp()****************/
function openWinAmex_sp()
		{
		 win=open("amx_sp.htm","amx","width=300,height=400,status=yes,scrollbars=yes,left=50,top=50")
		}


/******************** OpenPopUp()***************/
function OpenPopUp(id,itype)
{
	window.open('ShowDiamond.asp?itype='+itype+'&id='+id,"Diamonds","height=450,width=700,scrollbars=1,toolbar=0,status=0,resizable=0,menubar=0")
}

 var isNav, isIE, tempChar1, tempChar,tempWidth,tempalignLeft;
 tempalignLeft = 0;
 
 if (parseInt(navigator.appVersion) >=4 ){
	 if (navigator.appName =="Netscape" ){
				isNav = true;
		}
	else{
				isIE = true;		
		}
   } 

/***************** checkWinSize()****************/
function checkWinSize(){
	if(isNav){
		tempChar1 = window.innerWidth
	}
	else{
		document.write ("<body>");
		tempChar1 = document.body.clientWidth;
		document.write ("</body>");
	}
	tempChar1 =(tempChar1 - 710)/2;
	return tempChar1;
}

/*tempalignLeft = checkWinSize();

document.write ("<style>");
document.write ("#Explanation{position:absolute;visibility:hidden;top:105;left:"+(tempalignLeft+0)+"}");
document.write ("#AvailabelDiamond{position:absolute;visibility:hidden;top:135;left:"+(tempalignLeft+10)+"}");
document.write ("#UnAvailabelDiamond{position:absolute;visibility:hidden;top:135;left:"+(tempalignLeft+110)+"}");
document.write ("</style>");*/



/*     **************** OpenWin()***************       */
function OpenWin (PageSource)
{
   window.open (PageSource,'','width=770 height=400 scrollbars=yes')
}



var colorVar
colorVar=""


var tempImage

tempImage="nothing"

var ShapeNum=0

if(navigator.appVersion.substring(0,1)>=3)
{

var tempGifon = new Image();
tempGifon.src = "../images/nothing.gif";

var S1on = new Image();
S1on.src = "../images/images-search/S1on.gif";
var S2on = new Image();
S2on.src = "../images/images-search/S2on.gif";

}



/*     **************** OffImage2()***************       */
function OffImage2(Shape,Place)
{   
  OffImg="../images/images-search/S"+ Shape+".gif";
	document["S" + Shape].src=OffImg;
	if (parseInt(ShapeNum) == 1)
		document.f1.CS.checked=false;
	else
		document.f1.CS[parseInt(Place)].checked=false;
}


/*     **************** OnImage2()***************       */
function OnImage2(Shape,Place)
{	
	ShapeOn=Shape+"on";	
	OnImg="../images/images-search/S"+ShapeOn+".gif";
	document["S" + Shape].src=OnImg;
	tempImage=Shape;
	if (parseInt(ShapeNum) == 1)
		document.f1.CS.checked=true;	
	else
		document.f1.CS[parseInt(Place)].checked=true;
	
}


/*     **************** check()***************       */
function check(Shape,Place)
{
	
	if (parseInt(ShapeNum) == 1)
	{
		if (document.f1.CS.checked)
		{
			OnImage2(Shape,Place);
		}else{
			OffImage2(Shape,Place);
			}
	}else{
		if (document.f1.CS[parseInt(Place)].checked)
		{
			OnImage2(Shape,Place);			
		}else{
			OffImage2(Shape,Place);			
			
		}
	}	
}



/*     **************** checkOff()***************       */
function checkOff(Shape,Place)
{	
		if (document.f1.CS[parseInt(Place)].checked)
		{
			
			document.f1.CS[parseInt(Place)].checked = false;
			
		}
}



/*     **************** ChangeImage2()***************       */
function ChangeImage2(Shape,Place,on){			

	if (on){		
		if (tempImage!=Shape){
	       tempImg="../images/images-search/S"+Shape+"on.gif";
	       document["S" + Shape].src = tempImg;
		}
	}else{
			if (parseInt(ShapeNum) == 1)
				temp=document.f1.CS.checked;
			else
				temp=document.f1.CS[parseInt(Place)].checked;
		if (!temp){
		   tempImg="../images/images-search/S"+Shape+".gif";
		   document["S" + Shape].src = tempImg;
		}
	}
}



/*     **************** priceSearch()***************       */
function priceSearch(fprice,tprice){
	
		//reset all fields
		for (i=0;i<f1.elements.length;i++)
		{
		if(f1.elements(i).type=="text")
			f1.elements(i).value=""
		
		if( (f1.elements(i).type=="select-one") && (f1.elements(i).name != "JewelryMetalId") )
			f1.elements(i).options(0).selected=true
		}
		
		
		document.f1.fprice.value=fprice;
		document.f1.tprice.value=tprice;
		//alert(document.f1.JewelType.options[document.f1.JewelType.selectedIndex].value);
		gosubmit(document.f1.JewelType.options[document.f1.JewelType.selectedIndex].value);
		
}

/*     **************** shapeSearch()***************       */
function shapeSearch(shape){
	
		document.f1.CS.value=shape;
		document.f1.fprice.value="-1";
		document.f1.tprice.value="";
		document.f1.submit();
	}

/*     **************** checkanniv()***************       */
function checkanniv(type,metalID){

	if(eval(type==20))
	{
		document.location.href = "../anniversary_jewelry/Match_Jewelry_Action.asp?wizard=Locked&OccasionType2=2&JewelryTypeId=4&JewelrySubTypeId=20&Fprice=-1&tPrice=&JewelryMetalId="+metalID+"&IS_FOR_ANNIVERSIRY=1"
	}
}

/*     **************** priceConvert()***************       */
function priceConverte(price){

	var newPrice = 0;
	var rates_list=document.getElementById("rates");
	var str = rates_list.options[rates_list.selectedIndex].value;
	var rate = eval(str.substring(0,str.indexOf(',')));
	var update = str.substring(str.indexOf(',')+1,str.indexOf('#'));
	var code = str.substring(str.indexOf('#')+1);
	newPrice = Math.round(rate * price);
	
	newStr=newPrice.toString();
	
	if(newStr.length>=4) // add "," before three last digits
	{
		temp=newStr.substring((newStr.length)-3);
		newPrice=newStr.substring(0,(newStr.length)-3)+","+temp;
	}
	
	document.getElementById("price").value = code + " " + newPrice ;
	document.getElementById("update_date").value = update ;
	if(document.getElementById("convertedPrice"))
		document.getElementById("convertedPrice").style.visibility="visible" ;
	if(document.getElementById("rateUpdate"))
		document.getElementById("rateUpdate").style.visibility="visible" ;
	
}
/*     **************** priceConvert2()***************       */
function priceConverte2(price){

	var newPrice = 0;
	var rates_list=document.getElementById("rates");
	var str = rates_list.options[rates_list.selectedIndex].value;
	var rate = eval(str.substring(0,str.indexOf(',')));
	var update = str.substring(str.indexOf(',')+1,str.indexOf('#'));
	var code = str.substring(str.indexOf('#')+1);
	newPrice = Math.round(rate * price);
	
	newStr=newPrice.toString();
	
	if(newStr.length>=4) // add "," before three last digits
	{
		temp=newStr.substring((newStr.length)-3);
		newPrice=newStr.substring(0,(newStr.length)-3)+","+temp;
	}
	
	document.getElementById("price").value = code + " " + newPrice ;	
	document.getElementById("update_date").value = update ;
	
}
/*     **************** checkQsearck()***************       */

function checkQsearck(form)
{
	
	var shapelen = form.Shape.length;
	var selectFlag=0;
	
	if ( (form.select2.selectedIndex==8)&&(form.JID.value=='') ) // user didn't select a product to search
		{
			alert ("Please select product");
			form.select2.focus();
			return false;
		}
	                         
	for (var i=0;i<shapelen;i++)
		{						
			if (form.Shape.options(i).selected)
				selectFlag = 1;
													 		
		}
		
	if(form.select2.selectedIndex==4) // braclets
		selectFlag = 1;
	
	//alert(selectFlag);
	 if ((selectFlag==0)&&(form.JID.value==''))
		{
			
			alert ("Please select shape");
			form.Shape.focus();
				return false;
			
		}
		
	else
		
		return true;
}

/*     **************** checkQsearck2()***************       */

function checkQsearck2(){
	if (f2.select2.selectedIndex==8) // user didn't select a product to search
		{
		alert ("Please select product");
		return false;
		}
	else                             // selected product( ok )
		return true;
}

/*     **************** checkPayment()***************       */

function checkPayment(item,amount){
	
	minAmount = amount*0.05;
	if(minAmount < 150)
		minAmount=150;
		
	if (eval(item.value)<minAmount) // less than minimum 5%/150$  payment
		{
			alert ("The minimum amount for the payment is: US$ " + minAmount);
			item.focus();
			return false;
		}
	else                             // payment( ok )
		item.form.submit();
}

/* ******************check checkbox************************           */

function checkCbox(form,num)
{
	var flagC=0;	
	for (i=0;i<form.elements.length;i++)
	{
		if(form.elements(i).type=="checkbox")
			if(form.elements(i).checked)
				flagC = 1;										
	}
	if (flagC==1)
	{
		return true;
	}
	else
	{	
		if (num == 1)		
			alert("please select a setting !!");
		else
			alert("please select a diamond !!");	
		return false;
	}

}

/* ******************set_shapes for quick search************************           */
function set_shapes(form)
{
	//alert(form);
	var shapelen = form.Shape.length;
	if (form.Shape.selectedIndex==0)
	{	
		
		for (var i=1;i<shapelen;i++)
		{						
			form.Shape.options(i).selected=false;							 		
		}
	}


}


/* ******************SelectAll*****************************/
function SelectAll(form)
{
	
	
	for (var i=0;i<form.length;i++)
	{
		if (form.elements(i).checked)
		{
			form.elements(i).checked = false;
		}
		else
			form.elements(i).checked = true;
		
	}

}
/* ******************get_select_value**********************/
function get_select_value(obj)
{
	var sel_opt=obj.options.selectedIndex;
	return obj.options[sel_opt].value;
}
/*******************openModalImage*************************/

function openModalImage(settingID,strSettingName)
{
	
	window.open("../include/showBigImagesInc.asp?id=" + settingID + "&amp;settingName=" + strSettingName ,null, "height=630,width=450,top=50, left=50, status=no,toolbar=no,menubar=no,location=no")
}
/*******************openModalImage for Firefox*************/

function openModalImage_ff(settingID,strSettingName)
{
	
	window.open("../include/showBigImages_ff.asp?id=" + settingID + "&amp;settingName=" + strSettingName ,null, "height=630,width=450,top=50, left=50, status=no,toolbar=no,menubar=no,location=no")
}

/*******************PUWindow*************************/
function PUWindow(url) {
	sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=450');
	self.name = "mainWin";
}
/*******************PUWindow*************************/
function SWindow(url) {
	var params,screenHeigth, screenWidth, winTop, winLeft;
	screenHeigth=screen.height;
	screenWidth=screen.width;
	winLeft=screenWidth-50;
	params='toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=5,height=5,left=' + winLeft;
	sealWin=window.open(url,"win",params);
	self.name = "mainWin";
}
/*******************CreateControl*************************/
function CreateFlashControl(DivID, CLSID, ObjectID,
                       WIDTH, HEIGHT, URL, bgcolor)
{
	var d = document.getElementById(DivID);
	var html='<object classid=' + CLSID + ' id=' + ObjectID +
    ' width=' + WIDTH + ' height=' + HEIGHT +'><param name="movie" value=' + URL + '><param name="quality" value="high">';
    html+='<param name="movie" value=' + URL + '/><param name="wmode" value="opaque" />';
    html+='</object>';
	d.innerHTML =html;
  
}
/*******************check_QS_form*************************/
function check_QS_form()
{
var sel=document.getElementById("sel_product");
var s_index=sel.options.selectedIndex;
if(sel.options[s_index].value=="")
	{
		alert("Please Select a Product");
		return false;
	}
	
sel=document.getElementById("sel_budget");	
s_index=sel.options.selectedIndex;
if(sel.options[s_index].value=="0")
	{
		alert("Please Select Budget");
		return false;
	}
return true;
}
/*******************************************************/
function get_list_chose(list_name)
 {
	var opt=document.getElementById(list_name).selectedIndex;
	var val=document.getElementById(list_name).options[opt].value;
	return val;
 }
 /*******************************************************/
function set_list_chose(list_name,val)
 {
	var list_o=document.getElementById(list_name).options;
	for(var i=0;i<list_o.length-1;i++)
		{
			if(list_o[i].value==val)
				list_o[i].selected=true;
		}
 }
/*******************************************************/
function clear_reg_email()
{
document.getElementById("reg_email").value="";
}
/*******************************************************/
function clear_tb(tb_name)
{
document.getElementById(tb_name).value="";
}
/*******************************************************/
function reg(reg_page,div_name)
{
var url, tb_name, email;
if(div_name=='email_reg')
	tb_name='reg_email';
else
	tb_name='reg_email_bottom';
email=document.getElementById(tb_name).value;
if(checkEmail(email))
	{
		url="http://www.diamonds-usa.com/pages/quickregaction.asp?email=" + email + "&page=" + reg_page + "&div=" + div_name;
		SWindow(url);
	}
}
/*******************************************************/
function get_reg_results(msg,div_name)
{ 
document.getElementById(div_name).innerHTML=msg;
}
/*******************************************************/
function match_diamond_to_settings(set_id, metal_id)
{
	var url="../diamonds/loose_diamonds.asp?wizard=Jewelries&amp;Jid=" + set_id + "&amp;MetalId=" + metal_id + "&amp;JMask=10000";
	document.location.replace(url);
}
/*******************************************************/
function set_focus(element_id)
{
	document.getElementById(element_id).focus();
}
/*******************************************************/
function hide_item(item_id)
{
	document.getElementById(item_id).style.display="none";
}
/*******************************************************/
function show_item(item_id)
{
	document.getElementById(item_id).style.display="";
}
/*******************************************************/
function validate_sweapstakes_form ( )
{
		valid = true;
        if (document.getElementById("UserName").value == "" || document.getElementById("UserName").value == "Name" )
        {
                alert ( "Please fill in your full name." );
                valid = false;
        }
		if(! checkEmail(document.getElementById("UserEmail").value))
        {
                valid = false;
        }
        if ( document.getElementById("terms").checked == false )
        {
                alert ( "Please check the Terms & Conditions box." );
                valid = false;
        }
        return valid;
}