<!--
///////////BASKET///////////////
function del(id){window.location.href="orderDelItem.asp?id=" + id;}
function order(){window.location.href="validuser.asp";}
function continueshopping(){window.location.href="default.asp";}
function validcharscter(){if(event.keyCode < 48 || event.keyCode > 57) event.keyCode=0;}
function updateQ(id,name)
{
	var collection="quantity" + name;
	if(document.all[collection].value!="")
		window.location.href="basketUpdateQ.asp?id=" + id + "&quantity=" + document.all[collection].value;
}
					
function plus(id)
{
	var collection="quantity" + id;
	document.all[collection].value=parseInt(document.all[collection].value) + 1;
}
					
function minus(id)
{
	var collection="quantity" + id;
	if(parseInt(document.all[collection].value)>1)
		document.all[collection].value=parseInt(document.all[collection].value) - 1;
}
/////////////VALID USER////////////

function tak()
{
window.open("permit1.asp",null,"height=500px, width=700px,scrollbars=1");
}
function cardshow()
{
	for(var i=0;document.getElementsByName("tdcard").length > i ;i++)
		if(document.getElementsByName("tdcard").item(i).style.display=="none")
			document.getElementsByName("tdcard").item(i).style.display="";
		else
			document.getElementsByName("tdcard").item(i).style.display="none";	
}
function cardhide()
{
	for(var i=0;document.getElementsByName("tdcard").length > i ;i++)
		if(document.getElementsByName("tdcard").item(i).style.display=="")
			document.getElementsByName("tdcard").item(i).style.display="none";
		else
			document.getElementsByName("tdcard").item(i).style.display="";	
}

function sendorder()
{
	if(document.order.email.value=="")
		{
		alert("נא להכניס דוא\"ל");
		document.order.email.focus();
		return false;
		}
	document.order.submit();					
}

function validMail(strEmail) //if valid mail - return true
{
	var r, re;
	var email = new String(strEmail);
	re = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ig;
	if(email.search(re)==0) 
		return true;
	else
		return false;	
}

function validateForm()
{
var num;
num=new String(document.order1.idnum.value);
if(document.order1.fname.value=="")
{
	alert("נא להכניס שם פרטי");
	document.order1.fname.focus();
	return false;
}
if(document.order1.lname.value=="")
{
	alert("נא להכניס שם משפחה");
	document.order1.lname.focus();
	return false;
}
/*
if(isNaN(document.order1.idnum.value))
	{
		alert("נא להכניס תעודת זהות (רק מספרים)");
		document.order1.idnum.focus();
		return false;
	}
										
if(num.length<9)
	{
		alert("נא להכניס תעודת זהות 9 ספרות בלבד");
		document.order1.idnum.focus();
		return false;
	}
*/
if(document.order1.town.value=="")
	{
		alert("נא להכניס עיר");
		document.order1.town.focus();
		return false;
	}
						
if(document.order1.address.value=="")
	{
		alert("נא להכניס כתובת");
		document.order1.address.focus();
		return false;
	}
										
if(document.order1.phone.value=="")
	{
		alert("נא להכניס טלפון");
		document.order1.phone.focus();
		return false;
	}
							
if(document.order1.email.value=="")
	{
		alert("נא להכניס דוא\"ל");
		document.order1.email.focus();
		return false;
	}
							
if(!validMail(document.order1.email.value))
	{
		alert("נא להכניס דוא\"ל לא תקין");
		document.order1.email.focus();
		return false;
	}
							
var collection;
collection = document.all["radio1"];
for (i=0;i<collection.length;i++)
	{
	if (collection[i].checked)
		radiovalue=collection[i].value;
	}
	if(radiovalue=="card")
	{
		if(document.order1.cardname.value=="")
		{
		alert("נא להכניס שם בעל הכרטיס");
		document.order1.cardname.focus();
		return false;
		}
								
		document.order1.idnumcard.value=num;
		/*		
		if(document.order1.idnumcard.value=="")
		{
		alert("נא להכניס תעודת זהות");
		document.order1.idnumcard.focus();
		return false;
		}
		*/		
		if(document.order1.cardnum.value=="")
		{
		alert("נא להכניס מספר כרטיס(ספרות בלבד)");
		document.order1.cardnum.focus();
		return false;
		}
								
		if(document.order1.backnum.value=="")
		{
		alert("נא להכניס המספר שמודפס בגב הכרטיס");
		document.order1.backnum.focus();
		return false;
		}
							
	}
	if(!document.all["tak"].checked)
	{
		alert("נא לסמן תנאי הרשמה");
		document.all["tak"].focus();
		return false;
	}															
	document.order1.submit();
	return true;
}
				
				
///////////////////////////////////
function printflash(src, w, h)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'" VIEWASTEXT>');
document.write('<param name="movie" value="'+src+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="opaque">');
document.write('<embed src="'+src+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" wmode="opaque">');
document.write('</object>');	
}
function printorder(id,printorder)
{
window.open("printorder.asp?id=" + id + "&printorder=" + printorder,null,"width=620, height=450, scrollbars=1")
}
function addtocart(id){window.location.href="addtocart.asp?id=" + id;}
function enlarge(id){window.open("enlarge.asp?id=" + id,null,"width:450, height=450, scrollbars=0");}

function validMail(strEmail) //if valid mail - return true
{
	var r, re;
	var email = new String(strEmail);
	re = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/ig;
	if(email.search(re)==0) 
		return true;
	else
		return false;	
}

function validC()
{
	if(document.contact.fname.value=="")
	{
	alert("נא לרשום שם פרטי");
	document.contact.fname.focus();
	return false;
	}
	if(document.contact.lname.value=="")
	{
	alert("נא לרשום שם משפחה");
	document.contact.lname.focus();
	return false;
	}
	
	if(document.contact.email.value=="")
	{
	alert("נא לרשום אי-מייל");
	document.contact.email.focus();
	return false;
	}
	if(!validMail(document.contact.email.value))
	{
	alert("נא לרשום אי-מייל");
	document.contact.email.focus();
	return false;
	}
	document.contact.submit();
	return true;
}
//-->
