function windowsize(sidcat)
{

window.open("sizechart.asp?sidcat="+sidcat+"", 'newpage','scrollbars=yes,status=no,width=300,height=300');

}

function windowmeasurement()
{
window.open("measurementchart.asp", 'newpage','scrollbars=yes,status=no,width=300,height=300');

}
function incqty(txtquantity)
{
	var q = parseInt(txtquantity.value);
	q = q + 1;
	if(q > 20)
		q = 20;
	txtquantity.value=q;
}
function calcship(selbox,orderform,supval,pos)
{
	orderform.action='shipcalendar.asp?calc=yes';
	orderform.supid.value=supval;
	orderform.position.value=pos;
	orderform.submit();
}
function showcal(pos)
{
	document.getElementById("divcal"+pos).style.visibility='visible';
}
function opencal(orderdate,shipdate,deliverydate,w,h,prodtitle,shiptype)
{
	window.open("/calendar.asp?orderdate="+orderdate+"&shipdate="+shipdate+"&deliverydate="+deliverydate+"&prodtitle="+prodtitle+"&shiptype="+shiptype+"", 'ShipCalendar','scrollbars=yes,status=no,width='+w+',height='+h+'');
}
function viewsizechart(idprod)
{
	window.open("/sizechart.asp?idprod="+idprod+"", 'SizeChart','scrollbars=yes,status=no,width=300,height=300');
}
function hidecal(pos)
{
	document.getElementById("divcal"+pos).style.visibility='hidden';
}
function validateNumeric(field) 
{
	var valid = "0123456789."
	var ok = "yes";
	var temp;
	for (var i=0; i<field.value.length; i++) 
	{
		temp = "" + field.value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") 
			ok = "no";
	}
	if (ok == "no") 
	{
		alert("Please enter a numeric value");
		field.value = 1;
		field.focus();
		field.select();
		return false;
	}
}


	function showdiv(divname)
	{
		
		document.getElementById(divname).style.visibility="visible";
	}
	
	 function hidediv(divname)
	{
		document.getElementById(divname).style.visibility="hidden";
	}
function validsearch(searchfm)
{
	if(searchfm.searchfield.value=='')
	{
		window.alert('Please type a keyword');
		searchfm.searchfield.focus();
		return false;
	}
	return true;
}
function validnews(newsfm)
{
	if(newsfm.txtname.value=='')
	{
		window.alert('You missed name');
		newsfm.txtname.focus();
		return false;
	}
	if(newsfm.txtemail.value=='')
	{
		window.alert('You missed email');
		newsfm.txtemail.focus();
		return false;
	}
	else
	{
		if(!checkEmail(newsfm.txtemail))
			return false;
	}
}
function decqty(txtquantity)
{
	var q = parseInt(txtquantity.value);
	q = q - 1;
	if(q < 1)
		q = 1;
	txtquantity.value=q;
}
function validateqty(txtquantity)
{
	if(txtquantity.value == "" || txtquantity.value == 0)
	{
		window.alert("Sorry! Quantity can not be 0.")
		txtquantity.focus();
		return false;
	}
	validateNumeric(txtquantity);
}
function addtocart(idProd,txtqty,prodcolor,e)
{	
	if(e != 0)
	{
		var i = prodcolor.selectedIndex;
		if(i==0)
		{
			window.alert('Please select color');
			prodcolor.focus();
		}
		else
		{
		var s = prodcolor.options[i].value;
		window.location.href = '/addtocart.asp?idProduct='+idProd+'&txtquantity='+txtqty.value+'&productcolor='+s;
		}
	}
	else
	{
	window.location.href = '/addtocart.asp?idProduct='+idProd+'&txtquantity='+txtqty.value;
	}
}

function buygiftcard(idGift,GiftFrom,GiftTo)
{	
	if(GiftFrom.value=="")
	{
		window.alert("You missed From name");
		GiftFrom.focus();
		return false;
	}
	if(GiftTo.value=="")
	{
		window.alert("You missed To name");
		GiftTo.focus();
		return false;
	}
	return true;
}

function detailsgiftcard(idGift)
{
	window.location.href = '/buygiftcard.asp?idGift='+idGift;
}

function updateqty(idCart,txtqty,type,strsize,txtqty1,txtqty2)
{
	var total;
	

	
	if(txtqty.value == "" || txtqty.value == 0)
	{
		window.alert("Sorry! Quantity can not be 0.");
		txtqty.focus();
	}
	else
	{
	  if (type == "no")
	  {
		 // alert(eval(txtqty));
	    window.location.href ='shopping-cart.asp?sts=no&idCartRow='+idCart+'&txtqty='+eval(txtqty.value);
		
	  }
	  else
	  {
		total =  (txtqty1 - txtqty2) + parseInt(txtqty.value)
		//alert('shopping-cart.asp?total='+ total +'&size='+strsize+'&sts='+type+'&idCartRow='+idCart+'&txtqty='+txtqty.value);
		 window.location.href ='shopping-cart.asp?total='+ total +'&size='+strsize+'&sts='+type+'&idCartRow='+idCart+'&txtqty='+eval(txtqty.value);
	  }
   }
}
function setshipprice(shiplist)
{
window.location.href='shopping-cart.asp?shipment='+shiplist;
}
function checkaccept(cartdet,path)
{

	var saved=0;
	if(! document.cartdet.accept.checked)
 	{
   		alert("Please accept the store policy");
		document.cartdet.accept.focus();
		return false;
  	}
	else
	{
		if(document.cartdet.chkchangeship1.value=="yes")
		{
			if(! document.cartdet.chkchangeship.checked)
			{
				if(confirm("You are using saved address info for you order"))
					//window.location.href=path+"/pre-checkout.asp";  
					window.location.href=path+"/checkout.asp";  
				else
				{
					document.cartdet.chkchangeship.focus();
					return false;
				}
			}
			else
				saved=1;
		}
	}
	
	//document.cartdet.action=path+"/pre-checkout.asp?saved="+saved; 
	document.cartdet.action=path+"/checkout.asp?saved="+saved; 
	return true;
	//window.location.href=path+"/checkout.asp?saved="+saved; 
}
function clearcart(idcart,saveorder,cartitems)
{
	if (cartitems >= 1 && saveorder!= "" )
	{
		if(confirm("This action may delete your saved information of order "+ saveorder))
			window.location.href ='shopping-cart.asp?clearcart=yes&idCart='+idcart+'&ido='+saveorder;
		else
			return false;
	}
	else
		window.location.href ='shopping-cart.asp?clearcart=yes&idCart='+idcart;
}
function cancelorder(pval,ido)
{
	if(confirm("This action may delete your saved information of order "+ ido))
		window.location.href='cancelationoforder.asp?pval=yes&ido='+ido+'';
	else
		return false;
}
function  restvalues(custlog)
{
custlog.reset();

}
function checknews(newsfm)
{
	if(newsfm.txtname.value == "")
	{
		window.alert("You missed name");
		newsfm.txtname.focus();
		return false;
	}
	/*if (newsfm.txtemail.value =="")
	{
		window.alert("You missed email address");
		newsfm.txtemail.focus();
		return false;
	}*/
	else
	{
		if(!checkEmail(newsfm.txtname))
			return false;
	}
	return true;
}
function checkusr(custlog)
{

	if(custlog.email)
	{
		if (custlog.email.value =="")
		{
			window.alert("You missed email address");
			custlog.email.focus();
			return false;
		}
		else
		{
			if(!checkEmail(custlog.email))
				return false;
		}
	}
	else
	{
		if (custlog.username.value =="")
		{
			window.alert("You missed email address");
			custlog.username.focus();
			return false;
		}
		else
		{
			if(!checkEmail(custlog.username))
				return false;
		}
	}
		
		if (custlog.password.value =="")
		{
			window.alert("You missed  password");
			custlog.password.focus();
			return false;
		}
		return true;
}

function checkordfrm(orderform,idcust,checkoutfirst)
{
	/*if (orderform.nametitle.selectedIndex == 0)
	{
		window.alert("You missed title ");
		orderform.nametitle.focus();
		return false;
	}*/
	//alert(checkoutfirst);
	
	if (orderform.name.value =="")
	{
	window.alert("You missed name ");
	orderform.name.focus();
	return false;
	}
	if (orderform.lastname.value =="")
	{
	window.alert("You missed last name");
	orderform.lastname.focus();
	return false;
	}
	/*if (orderform.phone.value =="")
	{
	window.alert("You missed phone");
	orderform.phone.focus();
	return false;
	}*/
	if (document.orderform.email.value =="")
	{
	window.alert("You missed email");
	orderform.email.focus();
	return false;
	}
	else
	{
		if(!checkEmail(orderform.email))
			return false;
	}
	if(checkoutfirst != 2 )
	{
	
	if(idcust == 0)
	{
		if (orderform.password.value =="")
		{
			window.alert("You missed password");
			orderform.password.focus();
			return false;
		}
		else
		{
			h = orderform.password.value.length;
			x = orderform.password.value;
	
			for( i=0;i<h;i++)
			{
			 
				if (  h < 6 )
				{
								alert(" Password can't be less than 6" + " characters");
								orderform.password.focus();
								orderform.password.select();
								return false;
				}
				/*var valid = "0123456789"
				var okn = "yes";
				var temp;
				for (var i=0; i<orderform.password.value.length; i++) 
				{
					temp = "" + orderform.password.value.substring(i, i+1);
					if(temp=="\'" || temp=="\"")
					{	
						okn = "no";
						alert("The character \',\" is not allowed in password");
						orderform.password.focus();
						orderform.password.select();
						return false;
					}
					if (valid.indexOf(temp) == "-1") 
						okn = "no";
				}
				var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
				var oka = "num";
				var temp;
				for (var i=0; i<orderform.password.value.length; i++) 
				{
					temp = "" + orderform.password.value.substring(i, i+1);
					if (valid.indexOf(temp) == "-1") 
						oka = "alp";
				}*/
			}
			/*if(okn=="yes" || oka == "num")
			{
				alert("Password should be Alphanumeric");
				orderform.password.focus();
				orderform.password.select();
				return false;
			}*/
		}
		if (orderform.cpassword.value =="")
		{
		window.alert("You missed confirm password");
		orderform.cpassword.focus();
		return false;
		}
		if (orderform.cpassword.value !=orderform.password.value)
		{
		window.alert("Confirm password and password should be same");
		orderform.cpassword.value="";
		orderform.password.value="";
		orderform.password.focus();
		return false;
		}
	}
	}
	
	if(checkoutfirst == 0 || checkoutfirst == 2)
	{
		if (orderform.address1.value =="")
		{
		window.alert("You missed address1");
		orderform.address1.focus();
		return false;
		}
		if (orderform.city.value =="")
		{
		window.alert("You missed city");
		orderform.city.focus();
		return false;
		}
		if (orderform.stateCode.value == "" )
		{
		window.alert("You missed state");
		orderform.stateCode.focus();
		return false;
		}
		if (orderform.countryCode.value =="")
		{
		window.alert("You missed country");
		orderform.countryCode.focus();
		return false;
		}
		
		if (orderform.zip.value =="")
		{
		window.alert("You missed zip");
		orderform.zip.focus();
		return false;
		}
		if (orderform.shipname.value =="")
		{
		window.alert("You missed ship name");
		orderform.shipname.focus();
		return false;
		}
		if (orderform.shiplastname.value =="")
		{
		window.alert("You missed ship last name");
		orderform.shiplastname.focus();
		return false;
		}
		if (orderform.shpAddress1.value =="")
		{
		window.alert("You missed shipping address1");
		orderform.shpAddress1.focus();
		return false;
		}
		
		if (orderform.shpCity.value =="")
		{
		window.alert("You missed shipping  city");
		orderform.shpCity.focus();
		return false;
		}
		if (document.orderform.shpStateCode.value == "" )
		{
		window.alert("You missed shipping state");
		orderform.shpStateCode.focus();
		return false;
		}
		if (orderform.shpCountryCode.value =="")
		{
		window.alert("You missed shipping  country code");
		orderform.shpCountryCode.focus();
		return false;
		}
		if (orderform.shpZip.value =="")
		{
		window.alert("You missed shipping  zip");
		orderform.shpZip.focus();
		return false;
		}
		if(orderform.tax[0].checked)
		{
			if(orderform.certno.value == "")
			{
				window.alert("You missed tax exempt certification no");
				orderform.certno.focus();
				return false;
			}
		}
	}
	return true;
}
function checkordfrmgift(orderform,idcust,checkoutfirst)
{
	/*if (orderform.nametitle.selectedIndex == 0)
	{
		window.alert("You missed title ");
		orderform.nametitle.focus();
		return false;
	}*/
	if (orderform.name.value =="")
	{
	window.alert("You missed name ");
	orderform.name.focus();
	return false;
	}
	if (orderform.lastname.value =="")
	{
	window.alert("You missed last name");
	orderform.lastname.focus();
	return false;
	}
	
	if (document.orderform.email.value =="")
	{
	window.alert("You missed email");
	orderform.email.focus();
	return false;
	}
	else
	{
		if(!checkEmail(orderform.email))
			return false;
	}
	if(checkoutfirst != 2 )
	{
	if(idcust == 0)
	{
		if (orderform.password.value =="")
		{
			window.alert("You missed password");
			orderform.password.focus();
			return false;
		}
		else
		{
			h = orderform.password.value.length;
			x = orderform.password.value;
	
			for( i=0;i<h;i++)
			{
			 
				if (  h < 6 )
				{
								alert(" Password can't be less than 6" + " characters");
								orderform.password.focus();
								orderform.password.select();
								return false;
				}
				/*var valid = "0123456789"
				var okn = "yes";
				var temp;
				for (var i=0; i<orderform.password.value.length; i++) 
				{
					temp = "" + orderform.password.value.substring(i, i+1);
					if(temp=="\'" || temp=="\"")
					{	
						okn = "no";
						alert("The character \',\" is not allowed in password");
						orderform.password.focus();
						orderform.password.select();
						return false;
					}
					if (valid.indexOf(temp) == "-1") 
						okn = "no";
				}
				var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
				var oka = "num";
				var temp;
				for (var i=0; i<orderform.password.value.length; i++) 
				{
					temp = "" + orderform.password.value.substring(i, i+1);
					if (valid.indexOf(temp) == "-1") 
						oka = "alp";
				}*/
			}
			/*if(okn=="yes" || oka == "num")
			{
				alert("Password should be Alphanumeric");
				orderform.password.focus();
				orderform.password.select();
				return false;
			}*/
		}
		if (orderform.cpassword.value =="")
		{
		window.alert("You missed confirm password");
		orderform.cpassword.focus();
		return false;
		}
		if (orderform.cpassword.value !=orderform.password.value)
		{
		window.alert("Confirm password and password should be same");
		orderform.cpassword.value="";
		orderform.password.value="";
		orderform.password.focus();
		return false;
		}
	}
	}
	if(checkoutfirst == 0 || checkoutfirst == 2)
	{
		if (orderform.address1.value =="")
		{
		window.alert("You missed address1");
		orderform.address1.focus();
		return false;
		}
		if (orderform.city.value =="")
		{
		window.alert("You missed city");
		orderform.city.focus();
		return false;
		}
		if (orderform.stateCode.value == "" )
		{
		window.alert("You missed state code");
		orderform.stateCode.focus();
		return false;
		}
		if (orderform.countryCode.value =="")
		{
		window.alert("You missed country code");
		orderform.countryCode.focus();
		return false;
		}
		
		if (orderform.zip.value =="")
		{
		window.alert("You missed zip");
		orderform.zip.focus();
		return false;
		}
		if (orderform.shipname.value =="")
		{
		window.alert("You missed ship name");
		orderform.shipname.focus();
		return false;
		}
		if (orderform.shiplastname.value =="")
		{
		window.alert("You missed ship last name");
		orderform.shiplastname.focus();
		return false;
		}
		if (orderform.shpAddress1.value =="")
		{
		window.alert("You missed shipping address1");
		orderform.shpAddress1.focus();
		return false;
		}
		
		if (orderform.shpCity.value =="")
		{
		window.alert("You missed shipping  city");
		orderform.shpCity.focus();
		return false;
		}
		if (document.orderform.shpStateCode.value == "" )
		{
		window.alert("You missed shipping state");
		orderform.shpStateCode.focus();
		return false;
		}
		if (orderform.shpCountryCode.value =="")
		{
		window.alert("You missed shipping  country code");
		orderform.shpCountryCode.focus();
		return false;
		}
		
		
		
		if (orderform.shpZip.value =="")
		{
		window.alert("You missed shipping  zip");
		orderform.shpZip.focus();
		return false;
		}
	}
	return true;
}
 function assign_values(orderform,idcust,subscriber)
      {
      if(document.orderform.separateShipping.checked)
	   {
	    orderform.shipname.value=document.orderform.name.value;
		orderform.shiplastname.value=document.orderform.lastname.value;
	    orderform.shpAddress1.value=document.orderform.address1.value;
		orderform.shpAddress2.value=document.orderform.address2.value;
		orderform.shpCity.value=document.orderform.city.value;
		//orderform.shpState.value=document.orderform.state.value;
		orderform.shpZip.value=document.orderform.zip.value;
		orderform.shpStateCode.value=document.orderform.stateCode.value;
		orderform.shpCountryCode.value=document.orderform.countryCode.value;
		if(idcust != 0)
	  	{
			orderform.addresslist.selectedIndex=0;
			orderform.addresstype.checked=false;
			document.getElementById("addressbook").style.visibility='hidden';
			document.getElementById("addressbook").style.position='absolute';
	  	}
	  }
	  else
	  {
		  orderform.shipname.value="";
		  orderform.shiplastname.value="";
		  orderform.shpAddress1.value="";
		  orderform.shpAddress2.value="";
		  orderform.shpCity.value="";
		 // orderform.shpState.value="";
		  orderform.shpZip.value="";
		  orderform.shpStateCode.value="";
		  orderform.shpCountryCode.value="US";
	  }
	
	 
    }
	
	function assign_regvalues(registryform)
      {
      if(document.registryform.separateShipping.checked)
	   {
	    registryform.shpAddress1.value=document.registryform.address1.value;
		registryform.shpAddress2.value=document.registryform.address2.value;
		registryform.shpCity.value=document.registryform.city.value;
		registryform.shpState.value=document.registryform.state.value;
		registryform.shpZip.value=document.registryform.zip.value;
		registryform.shpStateCode.value=document.registryform.stateCode.value;
		registryform.shpCountryCode.value=document.registryform.countryCode.value;
		
		
	  }
	  else
	  {
	  registryform.shpAddress1.value="";
	  registryform.shpAddress2.value="";
	  registryform.shpCity.value="";
	  registryform.shpState.value="";
	  registryform.shpZip.value="";
	  registryform.shpStateCode.value="";
	  registryform.shpCountryCode.value="US";
	  	  
	  }
    }
	
	function checkregistryfrm(orderform)
	{
		if (orderform.regreason.selectedIndex == 0)
		{
			window.alert("You missed Reason for registry ");
			orderform.regreason.focus();
			return false;
		}
		if (orderform.regMonth.selectedIndex == 0 || orderform.regDay.selectedIndex == 0 || orderform.regYear.selectedIndex == 0 )
		{
			window.alert("You missed Date of occasion ");
			orderform.regMonth.focus();
			return false;
		}
		
		if (orderform.name.value =="")
		{
			window.alert("You missed name ");
			orderform.name.focus();
			return false;
		}
		if (orderform.lastname.value =="")
		{
			window.alert("You missed last name");
			orderform.lastname.focus();
			return false;
		}
		if (orderform.regpassword.value =="")
		{
		window.alert("You missed registry access password");
		orderform.regpassword.focus();
		return false;
		}
		if (orderform.address1.value =="")
		{
		window.alert("You missed address1");
		orderform.address1.focus();
		return false;
		}
		if (orderform.city.value =="")
		{
		window.alert("You missed city");
		orderform.city.focus();
		return false;
		}
		/*if (orderform.state.value != "" & orderform.stateCode.value != "" )
		{
		window.alert("No need to enter both state and state code");
		orderform.state.value =""
		orderform.stateCode.value=""
		orderform.state.focus();
		return false;
		}*/
		if (orderform.zip.value =="")
		{
		window.alert("You missed zip");
		orderform.zip.focus();
		return false;
		}
		
		if (orderform.countryCode.value =="")
		{
		window.alert("You missed country code");
		orderform.countryCode.focus();
		return false;
		}
		
		
		if (orderform.shpAddress1.value =="")
		{
		window.alert("You missed shipping address1");
		orderform.shpAddress1.focus();
		return false;
		}
		
		if (orderform.shpCity.value =="")
		{
		window.alert("You missed shipping  city");
		orderform.shpCity.focus();
		return false;
		}
		if (orderform.shpState.value != "" & document.orderform.shpStateCode.value != "" )
		{
		window.alert("No need to enter both shipping state and state code");
		orderform.shpState.value =""
		orderform.shpStateCode.value=""
		orderform.shpState.focus();
		return false;
		}
		if (orderform.shpZip.value =="")
		{
		window.alert("You missed shipping  zip");
		orderform.shpZip.focus();
		return false;
		}
		if (orderform.shpCountryCode.value =="")
		{
		window.alert("You missed shipping  country code");
		orderform.shpCountryCode.focus();
		return false;
		}
		return true;
	}

function checkcredit(saveorder)
{
	if (saveorder.cardNumber.value =="")
	{
		window.alert("You missed credit card number ");
		saveorder.cardNumber.focus();
		return false;
	}
		
		
	return true;
}
function validgiftpurchase(cardform,psaved,pidorder)
{
	if(psaved==1)
		cardform.action = 'orderfinalization_saved.asp?saved='+psaved+'&idOrder='+pidorder+'';
	if (cardform.cardNumber.value =="")
	{
		window.alert("You missed credit card number ");
		cardform.cardNumber.focus();
		return false;
	}
	//return checkcardcode(cardform);
	
	if(checkcardcode(cardform))
	{
		return checkbilladdr(cardform);
	}
	else
	return false;
}
function checkreg(cutR,custid,stat)
{
	/*if (cutR.nametitle.selectedIndex == 0)
	{
		window.alert("You missed title ");
		cutR.nametitle.focus();
		return false;
	}*/
	if (cutR.firstname.value =="")
	{
	window.alert("You missed first name ");
	cutR.firstname.focus();
	return false;
	}
	if (cutR.lastname.value =="")
	{
	window.alert("You missed last name");
	cutR.lastname.focus();
	return false;
	}
	
	if(custid == 0 )
	{
		if (cutR.email.value =="")
		{
		window.alert("You missed email");
		cutR.email.focus();
		return false;
		}
		else
		{
			if(!checkEmail(cutR.email))
				return false;
		}
		if (cutR.password.value =="")
		{
		window.alert("You missed password");
		cutR.password.focus();
		return false;
		}
		else
		{
			h = cutR.password.value.length;
			x = cutR.password.value;
	
			for( i=0;i<h;i++)
			{
			 
				if (  h < 6 )
				{
								alert(" Password can't be less than 6" + " characters");
								cutR.password.focus();
								cutR.password.select();
								return false;
				}
				var valid = "0123456789"
				var okn = "yes";
				var temp;
				for (var i=0; i<cutR.password.value.length; i++) 
				{
					temp = "" + cutR.password.value.substring(i, i+1);
					if(temp=="\'" || temp=="\"")
					{	
						okn = "no";
						alert("The character \',\" is not allowed in password");
						cutR.password.focus();
						cutR.password.select();
						return false;
					}
					if (valid.indexOf(temp) == "-1") 
						okn = "no";
				}
				var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
				var oka = "num";
				var temp;
				for (var i=0; i<cutR.password.value.length; i++) 
				{
					temp = "" + cutR.password.value.substring(i, i+1);
					if (valid.indexOf(temp) == "-1") 
						oka = "alp";
				}
			}
			if(okn=="yes" || oka == "num")
			{
				alert("Password should be Alphanumeric");
				cutR.password.focus();
				cutR.password.select();
				return false;
			}
		}
		if (cutR.cpassword.value =="")
		{
		window.alert("You missed confirm password");
		cutR.cpassword.focus();
		return false;
		}
		if (cutR.cpassword.value !=cutR.password.value)
		{
		window.alert("Confirm password and password should be same");
		cutR.cpassword.value="";
		cutR.password.value="";
		cutR.password.focus();
		return false;
		}
	}
	if(stat == 1)
	{
		if (cutR.address1.value =="")
		{
		window.alert("You missed address1");
		cutR.address1.focus();
		return false;
		}
		if (cutR.city.value =="")
		{
		window.alert("You missed city");
		cutR.city.focus();
		return false;
		}
		if (cutR.stateCode.value == "" )
		{
		window.alert("You missed state ");
		cutR.stateCode.value="";
		cutR.stateCode.focus();
		return false;
		}
		if (cutR.CountryCode.value =="")
		{
		window.alert("You missed country ");
		cutR.CountryCode.focus();
		return false;
		}
		
		if (cutR.zip.value =="")
		{
		window.alert("You missed zip");
		cutR.zip.focus();
		return false;
		}
	}
	return true;
}	

function checkmodify(modCust)
{
	/*if (modCust.nametitle.selectedIndex ==0)
	{
		window.alert("You missed title ");
		modCust.nametitle.focus();
		return false;
	}*/
	if (modCust.firstname.value =="")
	{
	window.alert("You missed first name ");
	modCust.firstname.focus();
	return false;
	}
	if (modCust.lastname.value =="")
	{
	window.alert("You missed last name");
	modCust.lastname.focus();
	return false;
	}
			
	
	if (modCust.password.value =="")
	{
	window.alert("You missed password");
	modCust.password.focus();
	return false;
	}
	else
	{
		h = modCust.password.value.length;
			x = modCust.password.value;
	
			for( i=0;i<h;i++)
			{
			 
				if (  h < 6 )
				{
								alert(" Password can't be less than 6" + " characters");
								modCust.password.focus();
								modCust.password.select();
								return false;
				}
				var valid = "0123456789"
				var okn = "yes";
				var temp;
				for (var i=0; i<modCust.password.value.length; i++) 
				{
					temp = "" + modCust.password.value.substring(i, i+1);
					if(temp=="\'" || temp=="\"")
					{	
						okn = "no";
						alert("The character \',\" is not allowed in password");
						modCust.password.focus();
						modCust.password.select();
						return false;
					}
					if (valid.indexOf(temp) == "-1") 
						okn = "no";
				}
				var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
				var oka = "num";
				var temp;
				for (var i=0; i<modCust.password.value.length; i++) 
				{
					temp = "" + modCust.password.value.substring(i, i+1);
					if (valid.indexOf(temp) == "-1") 
						oka = "alp";
				}
			}
			if(okn=="yes" || oka == "num")
			{
				alert("Password should be Alphanumeric");
				modCust.password.focus();
				modCust.password.select();
				return false;
			}
	}
	if (modCust.cpassword.value =="")
	{
	window.alert("You missed confirm password");
	modCust.cpassword.focus();
	return false;
	}
	if (modCust.cpassword.value !=modCust.password.value)
	{
	window.alert("Confirm password and password should be same");
	modCust.cpassword.value="";
	modCust.password.value="";
	modCust.password.focus();
	return false;
	}
	if (modCust.address1.value =="")
	{
	window.alert("You missed address1");
	modCust.address1.focus();
	return false;
	}
	if (modCust.city.value =="")
	{
	window.alert("You missed city");
	modCust.city.focus();
	return false;
	}
	if (modCust.stateCode.value == "" )
	{
	window.alert("You missed statecode");
	modCust.stateCode.value=""
	modCust.stateCode.focus();
	return false;
	}
	
	if (modCust.CountryCode.value =="")
	{
	window.alert("You missed country ");
	modCust.CountryCode.focus();
	return false;
	}
	
	if (modCust.zip.value =="")
	{
	window.alert("You missed zip");
	modCust.zip.focus();
	return false;
	}

	return true;
}	
function checksaveorder(saveorder,otype)
{ 
	if(otype == 0)
	{
		var strva="";
	  	var res;
		if (saveorder.ShoppingType.value == 1)
		{
			//strva="Do you want to proceed with checkout";
			//res=confirm(strva);	
			res=true;
			if (!res)
				return false;
			if(saveorder.idPayment.value=="10")
			{	saveorder.action='giftcardpurchase.asp';
			}
			if(saveorder.idPayment.value=="5")
			{	saveorder.action='savingcheckorderdetails.asp';
			}
		}
	  	if (saveorder.ShoppingType.value==2)
		{
			strva="Do you want to save your order";	
			res=confirm(strva);	
			if(!res){return false;}
		}
		return true;
	}
	else
	{
		if(saveorder.idPayment.value=="10")
		{	saveorder.action='save_giftcardpurchase.asp';
		}
	}
}

function windowprint(idprd)
{
window.open("print-product-details.asp?idProd="+idprd+"", 'newpage','scrollbars=yes,status=no,width=690,height=600');

}
function checkemailfm(emailfm)
{
    if (emailfm.firstName.value =="")
	{
	window.alert("You missed  name ");
	emailfm.firstName.focus();
	return false;
	}
	
	 if (emailfm.email.value =="")
	{
	window.alert("You missed from email ");
	emailfm.email.focus();
	return false;
	}
	else
	{
		if(!checkEmail(emailfm.email))
			return false;
	}
	 if (emailfm.toemail.value =="")
	{
	window.alert("You missed to email ");
	emailfm.toemail.focus();
	return false;
	}
    else
	{
		if(!checkEmail(emailfm.toemail))
			return false;
	}

	
	return true;
}
function deleteproduct(idWish,currentPage)
{

   var res;	
   res=confirm("Do you want to delete this product from wishlist " );	
	if (res)
	{
	window.location.href="customerwishlist.asp?delete=yes&idWish="+idWish+"&curPage="+currentPage;
	}
}
function windowopen1(idprd,imgw,imgh)
{
	var imgwidth,imgheight;
	imgwidth=parseInt(imgw)+100;
	imgheight=parseInt(imgh)+150;
	//imgcolor = document.getElementById('enlarge').value
	//ext		 = document.getElementById('ext').value
	//window.open("/viewproductimage.asp?idProd="+idprd+"&color="+imgcolor+"&ext="+ext, 'newpage1','scrollbars=yes,status=no,width='+imgwidth+',height='+imgheight+'');
	window.open("/viewproductimage.asp?idProd="+idprd+"&color=&ext=", 'newpage1','scrollbars=yes,status=no,width='+imgwidth+',height='+imgheight+'');
}
	function windowopenGIFT(idprd,imgw,imgh)
	{
	var imgwidth,imgheight;
	imgwidth=parseInt(imgw)+100;
	imgheight=parseInt(imgh)+100;
	if (parseInt(imgwidth) < 250 )
	{
	imgwidth=250;
	}
	
	window.open("/viewgiftimage.asp?idProd="+idprd+"", 'newpage1','scrollbars=no,status=no,width='+imgwidth+',height='+imgheight+'');
	
	}
	
	/*function showcouponNo(ptype,couponNo)
	{
		var i = ptype.selectedIndex;
		var v = ptype.options[i].value;
		if(v=="10")
			alert("Please do not put your Gift Certificate number on the coupon box underneath.  We will provide your area to supply Gift Certificate number on the next page!");
	}*/
	function showcouponNo(frm,subscribe)
	{
		var i = frm.idPayment.value;
		if(i=="10")
		{
			frm.cardType.disabled=true;
			frm.cardNumber.disabled=true;
			frm.cardcode.disabled=true;
			frm.expMonth.disabled=true;
			frm.ExpYear.disabled=true;
			frm.giftcardNumber.disabled=false;
			frm.giftcardNumber.focus();
			frm.cardNumber.value='';
			frm.cardcode.value='';
			frm.expMonth.selectedIndex=0;
			frm.ExpYear.selectedIndex=0;
			document.getElementById("chk").style.visibility = 'hidden';
			document.getElementById("chk").style.position = 'absolute';
			frm.billname.disabled=true;
			frm.billmiddlename.disabled=true;
			frm.billlastname.disabled=true;
			frm.billaddress1.disabled=true;
			frm.billaddress2.disabled=true;
			frm.billcity.disabled=true;
			frm.billstateCode.disabled=true;
			frm.billzip.disabled=true;
			frm.billcountryCode.disabled=true;
			//frm.giftcardmessage.disabled=false;
			//frm.specialinstruction.disabled=true;
		}
		else if(i=="5")
		{
			frm.cardType.disabled=true;
			frm.cardNumber.disabled=true;
			frm.cardcode.disabled=true;
			frm.expMonth.disabled=true;
			frm.ExpYear.disabled=true;
			//frm.giftcardNumber.disabled=false;
			//frm.giftcardNumber.focus();
			frm.cardNumber.value='';
			frm.cardcode.value='';
			frm.expMonth.selectedIndex=0;
			frm.ExpYear.selectedIndex=0;
			frm.billname.disabled=true;
			frm.billmiddlename.disabled=true;
			frm.billlastname.disabled=true;
			frm.billaddress1.disabled=true;
			frm.billaddress2.disabled=true;
			frm.billcity.disabled=true;
			frm.billstateCode.disabled=true;
			frm.billzip.disabled=true;
			frm.billcountryCode.disabled=true;
			document.getElementById("chk").style.visibility = 'visible';
			document.getElementById("chk").style.position = 'static';
			
			//frm.giftcardmessage.disabled=false;
			//frm.specialinstruction.disabled=true;
		}			
		else
		{
			frm.cardType.disabled=false;
			frm.cardNumber.disabled=false;
			frm.cardcode.disabled=false;
			frm.expMonth.disabled=false;
			frm.ExpYear.disabled=false;
			frm.giftcardNumber.disabled=true;
			frm.giftcardNumber.value='';
			document.getElementById("chk").style.visibility = 'hidden';
			document.getElementById("chk").style.position = 'absolute';
			frm.cardType.focus();
			frm.billname.disabled=false;
			frm.billmiddlename.disabled=false;
			frm.billlastname.disabled=false;
			frm.billaddress1.disabled=false;
			frm.billaddress2.disabled=false;
			frm.billcity.disabled=false;
			frm.billstateCode.disabled=false;
			frm.billzip.disabled=false;
			frm.billcountryCode.disabled=false;
			//frm.giftcardmessage.disabled=true;
			//frm.specialinstruction.disabled=false;
		}
	}
	function checkpayment(payment,otype,subscribe)
	{ 
		if(payment.idPayment.value=="10")
		{	//saveorder.action='save_giftcardpurchase.asp';
			if (payment.giftcardNumber.value =="")
			{
				window.alert("You missed gift certificate number ");
				payment.giftcardNumber.focus();
				return false;
			}
			
			if (payment.giftcardNumber.value.length !=15)
			{
				window.alert("Your gift certificate number is wrong!! ");
				payment.giftcardNumber.focus();
				payment.giftcardNumber.select();
				return false;
			}
		}
		else if(payment.idPayment.value=="9")
		{
			if (payment.cardNumber.value =="")
			{
				window.alert("You missed credit card number ");
				payment.cardNumber.focus();
				return false;
			}
			if(checkcardcode(payment))
			{
				return checkbilladdr(payment);
			}
			else
			return false;
		}
		/*if(subscribe == 1)
		{
			var level=0
			if(payment.level1.checked) level = level + 1
			if(payment.level2.checked) level = level + 1
			if(payment.level3.checked) level = level + 1
			if(payment.level4.checked) level = level + 1
			if(level > 1)
			{
					window.alert("You can not subscribe multiple levels");
					payment.level1.focus();
					return false;
					
			}
		}*/
	}
	function checkpaymentgift(paymentgift,otype)
	{ 
			if (paymentgift.cardNumber.value =="")
			{
				window.alert("You missed credit card number ");
				paymentgift.cardNumber.focus();
				return false;
			}
			if(checkcardcode(paymentgift))
			{
				return checkbilladdr(paymentgift);
			}
			else
				return false;
			
	}
	function checkEmail(emailAddr)
	{
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailAddr.value))
		{
			return (true)
		}
		alert("Invalid E-mail Address! Please re-enter.")
		emailAddr.focus();
		emailAddr.select();
		return false;
	}
	
	
	
	
	/*for event registration*/
	function checkregEvent(cutR)
	{
	/*if (cutR.nametitle.selectedIndex == 0)
	{
		window.alert("You missed title ");
		cutR.nametitle.focus();
		return false;
	}*/
	if (cutR.firstname.value =="")
	{
	window.alert("You missed first name ");
	cutR.firstname.focus();
	return false;
	}
	if (cutR.lastname.value =="")
	{
	window.alert("You missed last name");
	cutR.lastname.focus();
	return false;
	}
	
	
	if (cutR.email.value =="")
	{
	window.alert("You missed email");
	cutR.email.focus();
	return false;
	}
	else
	{
		if(!checkEmail(cutR.email))
			return false;
	}
	
	if (cutR.address1.value =="")
	{
	window.alert("You missed address1");
	cutR.address1.focus();
	return false;
	}
	if (cutR.city.value =="")
	{
	window.alert("You missed city");
	cutR.city.focus();
	return false;
	}
	
	if (cutR.stateCode.value == "" )
	{
	window.alert("You missed state ");
	//cutR.state.value =""
	cutR.stateCode.value=""
	cutR.stateCode.focus();
	return false;
	}
	if (cutR.CountryCode.value =="")
	{
	window.alert("You missed country ");
	cutR.CountryCode.focus();
	return false;
	}
	
	if (cutR.zip.value =="")
	{
	window.alert("You missed zip");
	cutR.zip.focus();
	return false;
	}
	
		if (cutR.occasion.value =="")
	{
	window.alert("You missed occasion");
	cutR.occasion.focus();
	return false;
	}
		if (cutR.occasiondate.value =="")
	{
	window.alert("You missed occasiondate");
	cutR.occasiondate.focus();
	return false;
	}
			
	
	
	return true;
}	


function deleteevent(idWish,currentPage)
{
   var res;	
   res=confirm("Do you want to delete this person " );	
	if (res)
	{
	window.location.href="viewevents.asp?delete=yes&idWish="+idWish+"&curPage="+currentPage;
	}
}
function loadAddress(orderform)
{
	orderform.action='';
	orderform.submit();
	
}

function setcolorimg(i,ext,imgcolor,fileexists,pno)
{
	if(ext != "m")
		opener.document.addtocartfm.productcolor.value=i;//+"~"+ext;
	else
		opener.document.addtocartfm.productcolor.value=i;
	if (fileexists == "True" )
	{	
		//document.getElementById('enlarge').value = i;
		//document.getElementById('detimage').src = '/uploadimages/'+imgcolor;
		//document.getElementById('ext').value = ext;
	}
	window.close();
}
function showaddress(ptype)
{
	if (ptype == "a")
	{
		document.getElementById("addressbook").style.visibility='visible';
		document.getElementById("addressbook").style.position='static';
		document.orderform.separateShipping.checked = false;
	}

}
function openccinfo()
{
	window.open('/cc-info.asp','Learnmore','scrollbars=yes,status=no,width=700,height=600');
}
function checkcardcode(frm)
{
	
	if(frm.cardType.value != "Discover")
	{
	if (frm.cardcode.value =="" )
	{
		window.alert("You missed security code");
		frm.cardcode.focus();
		return false;
	}
	}
	if(frm.cardType.value == "A" && frm.cardcode.value.length != 4 )
	{
		window.alert("CC security code should be 4 digit");
		frm.cardcode.focus();
		return false;
	}
	if(frm.cardType.value == "M" && frm.cardcode.value.length != 3 )
	{
		window.alert("CC security code should be 3 digit");
		frm.cardcode.focus();
		return false;
	}
	if(frm.cardType.value == "V" && frm.cardcode.value.length != 3 )
	{
		window.alert("CC security code should be 3 digit");
		frm.cardcode.focus();
		return false;
	}
	return true;
}

function loginforum()
{
	document.frmForum.submit();
}
function windowopenphoto(imagename,imgw,imgh)
{
var imgwidth,imgheight;
imgwidth=parseInt(imgw)+50;
imgheight=parseInt(imgh)+110;
window.open("viewphoto.asp?filename="+imagename+"&width="+imgwidth+"&height="+imgheight+"", 'newpage1','scrollbars=yes,status=no,width='+imgwidth+',height='+imgheight+'');
}
function shownews(idn,tot,inc)
{	
	if(inc == 1)
		idn = parseInt(document.getElementById("divnumber").value) + 1;
	else if(inc == 0)
		idn = parseInt(document.getElementById("divnumber").value) - 1;
	if (idn < tot && idn >= 0)
	{
		if(document.getElementById("subcat"+idn))
		{
			document.getElementById("subcat"+idn).style.visibility 	= 'visible';
			document.getElementById("subcat"+idn).style.position		= 'static';
			for(i = 0; i<tot; i++)
			{
				if (idn != i)
				{
					if(document.getElementById("subcat"+i))
					{
						document.getElementById("subcat"+i).style.visibility 	= 'hidden';
						document.getElementById("subcat"+i).style.position		= 'absolute';
					}
				}
			}
			document.getElementById("divnumber").value = idn;
		}
	}
	
}

function opencolorwin(idprd,ndesign)
{
	window.open("/color-swatch.asp?idProd="+idprd+"&ndes="+ndesign+"", 'newpage1','scrollbars=yes,status=yes,width=650,height=500');
}
function setcustomcolorimg(i,ext,imgcolor,fileexists,pno)
{
	eval("opener.document.addtocartfm.designs"+pno).value=i;	
	window.close();
//	 eval("document.quotedetail."+tota).value=ptot;	
}

function windowopenimage(idprd,imgw,imgh,ino)
{
	var imgwidth,imgheight;
	imgwidth=parseInt(imgw)+100;
	imgheight=parseInt(imgh)+150;
	//imgcolor = document.getElementById('enlarge').value
	//ext		 = document.getElementById('ext').value
	//window.open("/viewproductimage.asp?idProd="+idprd+"&color="+imgcolor+"&ext="+ext, 'newpage1','scrollbars=yes,status=no,width='+imgwidth+',height='+imgheight+'');
	window.open("/viewproductimage.asp?idProd="+idprd+"&color=&ext=&ino="+ino+"", 'newpage1','scrollbars=yes,status=no,width='+imgwidth+',height='+imgheight+'');
}

function setdefimg(img)
{
	document.getElementById('defimg').src = "/uploadimages/" + img;

}
function opencolorwinprod(idprd)
{
	window.open("/prod-color-swatch.asp?idProd="+idprd, 'newpage1','scrollbars=yes,status=yes,width=600,height=500');
}

function checkcustomcart(frm,d1,d2,d3,d4,d5)
{
	if(d1 == 1)
	{
		if(frm.designs1.selectedIndex==0)
		{
			alert('Please Select ' + frm.designtitle1.value);
			frm.designs1.focus();
			return false;
		}
	}
	if(d2 == 1)
	{
		if(frm.designs2.selectedIndex==0)
		{
			alert('Please Select ' + frm.designtitle2.value);
			frm.designs2.focus();
			return false;
		}
	}
	if(d3 == 1)
	{
		if(frm.designs3.selectedIndex==0)
		{
			alert('Please Select ' + frm.designtitle3.value);
			frm.designs3.focus();
			return false;
		}
	}
	if(d4 == 1)
	{
		if(frm.designs4.selectedIndex==0)
		{
			alert('Please Select ' + frm.designtitle4.value);
			frm.designs4.focus();
			return false;
		}
	}
	if(d5 == 1)
	{
		if(frm.designs5.selectedIndex==0)
		{
			alert('Please Select ' + frm.designtitle5.value);
			frm.designs5.focus();
			return false;
		}
	}
	return true;
}
function windowimage(frm,imageurl,orgimg,color)
{
	frm.productcolor.value = color;
	//window.document.getElementById("mainimg").src= "uploadimages/" + imageurl;
	//window.document.getElementById("mainimghref").href="uploadimages/OriginalProductImages/" + orgimg;
	//window.open("/viewcolorimg.asp?imgurl="+imageurl+"&color="+color+"", 'newpage1','scrollbars=yes,status=yes,width=400,height=400');
}

function checkbilladdr(orderform)
{
	if (orderform.billname.value == "" )
	{
	window.alert("You missed name ");
	orderform.billname.focus();
	return false;
	}
	/*if (orderform.middlename.value =="")
	{
	window.alert("You missed middle name");
	orderform.middlename.focus();
	return false;
	}*/
	if (orderform.billlastname.value =="")
	{
	window.alert("You missed last name");
	orderform.billlastname.focus();
	return false;
	}
	if (orderform.billaddress1.value =="")
	{
	window.alert("You missed address1");
	orderform.billaddress1.focus();
	return false;
	}
	if (orderform.billcity.value =="")
	{
	window.alert("You missed city");
	orderform.billcity.focus();
	return false;
	}
	if (orderform.billstateCode.value == "" )
	{
	window.alert("You missed state code");
	orderform.billstateCode.focus();
	return false;
	}
	if (orderform.billzip.value == "" )
	{
	window.alert("You missed zip code");
	orderform.billzip.focus();
	return false;
	}
	if (orderform.billcountryCode.value =="")
	{
	window.alert("You missed country code");
	orderform.billcountryCode.focus();
	return false;
	}
	return true
}
function  viewgiftcard(idGiftTrans,curpage,searchfrom,searchto)
{
window.open("giftcertificate.asp?idTrans="+idGiftTrans+"",'newpage','scrollbars=no,status=no,width=925,height=500');
}
function  showsizewindow()
{
window.open("/size-popup.asp",'newpage','scrollbars=no,status=no,width=625,height=450');
}
function checknorequest()
{
    if (document.requestfm.firstName.value =="")
	{
	window.alert("You missed First Name ");
	document.requestfm.firstName.focus();
	return false;
	}
	if (document.requestfm.lastName.value =="")
	{
	window.alert("You missed Last Name ");
	document.requestfm.lastName.focus();
	return false;
	}
	 if (document.requestfm.email.value =="")
	{
	window.alert("You missed Email ");
	document.requestfm.email.focus();
	return false;
	}
	else
	{
		if(!checkEmail(document.requestfm.email))
			return false;
	}
	if (document.requestfm.details.value =="")
	{
	window.alert("You missed Details ");
	document.requestfm.details.focus();
	return false;
	}

	
	return true;
}
// Function to show text box when customsize is selected
function prdCustomsize()
{
	

 	if(document.fromproddetail.productsize.value.toUpperCase()=="CUSTOM")
	{
		document.getElementById("txtCustSize").style.visibility="visible";
		document.getElementById("txtCustSize").style.position="static";
	}
	else
	{
		//document.getElementById("txtCustSize").style.visibility="hidden";
		//document.getElementById("txtCustSize").style.position="absolute";
	}
}
function checkvalues(frm)
{
	if (frm.Custom.value =="")
		{
		window.alert("You missed Custom design");
		frm.Custom.focus();
		return false;
		}
		
		if (frm.locn.value =="")
		{
		window.alert("You missed Location of embroidery");
		frm.locn.focus();
		return false;
		}
	totfields = frm.nooffields.value;
	for(var i = 1; i <=totfields;i++ )
	{
		if(window.document.getElementById("text"+i).value == "")
		{
			alert("You missed text " + i);
			window.document.getElementById("text"+i).focus();
			return false;
		}
		if(window.document.getElementById("threadcolor"+i).value == "")
		{
			alert("You missed thread color " + i);
			window.document.getElementById("threadcolor"+i).focus();
			return false;
		}
	}
	

	return true;
}
function adddesign()
{
	var frm;
	frm = window.document.fromproddetail
	if (frm.Custom.value =="")
		{
		window.alert("You missed Custom design");
		frm.Custom.focus();
		return false;
		}
		if (frm.locn.value =="")
		{
		window.alert("You missed Location of embroidery");
		frm.locn.focus();
		return false;
		}
	totfields = frm.nooffields.value;
	for(var i = 1; i <=totfields;i++ )
	{
		if(window.document.getElementById("text"+i).value == "")
		{
			alert("You missed text " + i);
			window.document.getElementById("text"+i).focus();
			return false;
		}
		if(window.document.getElementById("threadcolor"+i).value == "")
		{
			alert("You missed thread color " + i);
			window.document.getElementById("threadcolor"+i).focus();
			return false;
		}
	}
	
frm.action="mydesign.asp";
frm.submit();

//window.document.location.href="mydesign.asp;
	//return true;
}

function goDesigncart(intidMydesign,intpid,intsizeId)
{
	var frm;
	frm = window.document.fromproddetail
	//frm.idMydesign.value=intidMydesign
	//alert("adddesigncart.asp?idsizedtes=" + intsizeId + "&pid=" + intpid + "&idMydesign="+intidMydesign+ "");
	frm.action="adddesigncart.asp?idsizedtes=" + intsizeId + "&pid=" + intpid + "&idMydesign="+intidMydesign+ "";
	frm.submit();

//window.document.location.href="mydesign.asp;
	//return true;
}

function uploaddesign(field,fvalue,frm)
{//alert(frm);
	if (window.document.fromproddetail.locn.value =="")
		{
			window.alert("Please enter location before uploading your custom design.");
			window.document.fromproddetail.locn.focus();
			return false;
		}
	else
		{
//document.modprd.elements.details.value = "" + idContent.document.body.innerHTML + "";
			window.open("upload-design.asp?idcat="+field+"&imod="+fvalue+"", 'newpage','scrollbars=yes,status=no,width=600,height=400');
		}
}
