function DeleteLogo(){
	if(confirm("Are you sure you want to remove the image ?"))
	{
		document.form1.logoname.value="";
		document.form1.textLogoposx.value="0";
		document.form1.textLogoposy.value="0";
		document.getElementById("dLogo").innerHTML="";
	}
	else
	{
		return false;
	}
}

function DelItem(ItemType){
	if(confirm("Are you sure you want to delete the " + ItemType))
		return true;
	else
		return false;
}

function popcal(str)
{
openWin = window.open("/Scripts/Calendar/Calendar.asp?date_field="+str,"Calendar","top=200,left=100, width=225, height=220, buttons=no,scrollbars=no,location=no,menubar=no,resizable=yes,status=no,directories=no,toolbar=no");
openWin.focus();
}

function validateContact(theForm){
	if (theForm.fname.value == ""){
		alert("First name is a required field!");
		theForm.fname.focus();
		return false;
	}
	if (theForm.email.value == ""){
		alert("Email address is a required field!");
		theForm.email.focus();
		return false;
	}
	if (theForm.subject.value == ""){
		alert("Subject is a required field");
		theForm.subject.focus();
		return false;
	}
return true;
}


function validateShipping(theForm){
	if (theForm.fname.value == ""){
		alert("First name is a required field!");
		theForm.fname.focus();
		return false;
	}
	if (theForm.lname.value == ""){
		alert("Last name is a required field!");
		theForm.lname.focus();
		return false;
	}
	if (theForm.address.value == ""){
		alert("Address name is a required field!");
		theForm.address.focus();
		return false;
	}
	if (theForm.city.value == ""){
		alert("City is a required field");
		theForm.city.focus();
		return false;
	}

	if (theForm.zip.value == ""){
		alert("Zip is a required field");
		theForm.zip.focus();
		return false;
	}
	if (theForm.phone.value == ""){
		alert("Phone is a required field");
		theForm.phone.focus();
		return false;
	}
return true;
}

function validateCreditCard(theForm){
	if (theForm.owner.value == ""){
		alert("Owner Name is a required field!");
		theForm.owner.focus();
		return false;
	}

	//if (theForm.cardtype.value == "0"){
	//	alert("Card Type is a required field!");
	//	theForm.cardtype.focus();
	//	return false;
	//}

	if (theForm.cardnum.value == ""){
		alert("Card Number is a required field!");
		theForm.cardnum.focus();
		return false;
	}
	if (theForm.cardmonth.value == "" || theForm.cardyear.value == ""){
		alert("Expiration Date are required fields !");
		return false;
	}
	if (theForm.digit.value == ""){
		alert("Verification Namber is a required field!");
		theForm.digit.focus();
		return false;
	}
	if (theForm.TotalShipping.value == ""){
	alert("Please select Shipping method.");
	document.formCart.Shipm.focus();
	return false;
	}

theForm.subbut.value='Please Wait...';
theForm.subbut.disabled=true;
document.getElementById("aftera").style.display='block';
return true;
}


function validatePaypal(){
	if (document.formCart.Shipm.value=="-"){
		alert("Please select Shipping method.");
		document.formCart.Shipm.focus();
		//return false;
	}
	else { document.paypal_form.submit(); }
//return true;
}


function giveanswer(qn)
{
qn.style.display=qn.style.display == "none" ? "" : "none"
}
function realTime(RX)
{
RX = new RegExp(RX);
if(!RX.test(String.fromCharCode(event.keyCode)))return false;
}

function Upgrade(quant){
  for (var i=0; i< opener.form1.quantity.options.length; i++){
     if(opener.form1.quantity.options[i].text==quant){
       opener.form1.quantity.options[i].selected=true;
      break; 
      }
  }
  opener.form1.submit();
  window.close();
}

function CalcShip()
{	
	if (document.formCart.Shipm.value=="-")
	{
		document.getElementById("TotalS").innerHTML="---";
		//document.all.TotalB.innerHTML="---";
		document.Oform.TotalShipping.value="";	
		document.Oform.TotalAmount.value="";
		document.Oform.ShippingMethod.value="";

		document.paypal_form.TotalShipping.value="";	
		document.paypal_form.TotalAmount.value="";
		document.paypal_form.ShippingMethod.value="";

	}
	else
	{
		var a=parseFloat(document.Oform.Total.value)+parseFloat(document.formCart.Shipm.value);
		document.Oform.TotalAmount.value=Math.round(a*Math.pow(10,2))/Math.pow(10,2);
		document.Oform.TotalShipping.value=document.formCart.Shipm.value;
		document.getElementById("TotalS").innerHTML=Math.round(a*Math.pow(10,2))/Math.pow(10,2);
		// document.all.TotalB.innerHTML=Math.round((document.Oform.TotalAmount.value)*Math.pow(10,2))/Math.pow(10,2);
		document.Oform.ShippingMethod.value=document.formCart.Shipm.options[document.formCart.Shipm.selectedIndex].id;

		document.paypal_form.TotalAmount.value=Math.round(a*Math.pow(10,2))/Math.pow(10,2);
		document.paypal_form.TotalShipping.value=document.formCart.Shipm.value;
		document.paypal_form.ShippingMethod.value=document.formCart.Shipm.options[document.formCart.Shipm.selectedIndex].id;

	}
}
