function DeleteLogo(){
	if(confirm("? האם אתה בטוח כי ברצונך להסיר את הלוגו"))
	{
		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("? האם אתה בטוח כי ברצונך למחוק את ה" + 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 validateShipping(theForm){
	if (theForm.fname.value == ""){
		alert("שם פרטי הוא שדה חובה");
		theForm.fname.focus();
		return false;
	}
	if (theForm.lname.value == ""){
		alert("שם משפחה הוא שדה חובה");
		theForm.lname.focus();
		return false;
	}
	if (theForm.address.value == ""){
		alert("כתובת היא שדה חובה");
		theForm.address.focus();
		return false;
	}
	if (theForm.HouseNumber.value == ""){
		alert("אנא הכנס מספר בית");
		theForm.HouseNumber.focus();
		return false;
	}
	if (theForm.city.value == ""){
		alert("עיר היא שדה חובה");
		theForm.city.focus();
		return false;
	}
	if (theForm.zip.value == ""){
		alert("מיקוד הוא שדה חובה");
		theForm.zip.focus();
		return false;
	}
	if (theForm.phone.value == ""){
		alert("טלפון הוא שדה חובה");
		theForm.phone.focus();
		return false;
	}
return true;
}


function validateContact(theForm){
	if (theForm.fname.value == ""){
		alert("שם פרטי הוא שדה חובה");
		theForm.fname.focus();
		return false;
	}
	if (theForm.email.value == ""){
		alert("דואר אלקטרוני הוא שדה חובה");
		theForm.email.focus();
		return false;
	}
	if (theForm.subject.value == ""){
		alert("נושא ההודעה הוא שדה חובה");
		theForm.subject.focus();
		return false;
	}
return true;
}


function validateCreditCard(theForm){
	if (document.getElementById('onote1') != null){
			if (theForm.onote1.value == "" || theForm.onote2.value == "")
			{
				alert("הזמנת כוללת פנקסים, אנא הזן את המספור עבור פנקסים אלה");
				theForm.onote1.focus();
				return false;
			}
	}

	if (theForm.cardnum.value == ""){
		alert("מספר הכרטיס הוא שדה חובה");
		theForm.cardnum.focus();
		return false;
	}
	if (theForm.cardmonth.value == "" || theForm.cardyear.value == ""){
		alert("תוקף הכרטיס הוא שדה חובה");
		return false;
	}
	if (theForm.digit.value == ""){
		alert("אנא הכנס 3 ספרות אחרונות בגב הכרטיס");
		theForm.digit.focus();
		return false;
	}
 
 
 if (theForm.TotalShipping.value == ""){
	alert("אנא הזן אופן משלוח");
	document.formCart.Shipm.focus();
	return false;
}
	
theForm.subbut.value='...אנא המתן';
theForm.subbut.disabled=true;
document.getElementById("aftera").style.display='block';
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.getElementById("TotalB").innerHTML="---";
		document.Oform.TotalShipping.value="";	
		document.Oform.TotalAmount.value="";
		document.Oform.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.getElementById("TotalB").innerHTML=Math.round((document.Oform.TotalAmount.value/1.155)*Math.pow(10,2))/Math.pow(10,2);
		document.Oform.ShippingMethod.value=document.formCart.Shipm.options[document.formCart.Shipm.selectedIndex].id;
	}
}