<!--
function setimg(src)
{
	document.getElementById("image").src = src;
}

function printorder(id,sid,flag){window.open("printorder.asp?sid=" + sid + "&id=" + id + "&printorder=" + flag,null,"width=620, height=450, scrollbars=1");}

function validateFormOrder()
{
	var num;
	num=new String(document.order1.idnum.value);
	if(document.order1.fname.value=="")
	{
		alert("Insert first name");
		document.order1.fname.focus();
		return false;
	}
	if(document.order1.lname.value=="")
	{
		alert("Insert last name");
		document.order1.lname.focus();
		return false;
	}
							
	if(isNaN(document.order1.idnum.value))
		{
		alert("Insert ID number");
		document.order1.idnum.focus();
		return false;
		}
							
	if(document.order1.address.value=="")
	{
	alert("Insert address");
	document.order1.address.focus();
	return false;
	}
										
	if(document.order1.phone.value=="")
	{
		alert("Insert phone number");
		document.order1.phone.focus();
		return false;
	}
									
	if(!validMail(document.order1.email.value))
	{
	alert("Insert email");
	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("Insert name on card");
		document.order1.cardname.focus();
		return false;
		}
								
		document.order1.idnumcard.value=num;
								
		if(document.order1.idnumcard.value=="")
		{
		alert("Insert ID number");
		document.order1.idnumcard.focus();
		return false;
		}
								
		if(document.order1.cardnum.value=="")
		{
		alert("Insert card number");
		document.order1.cardnum.focus();
		return false;
		}
								
		if(document.order1.backnum.value=="")
		{
		alert("Insert Card Verification Value");
		document.order1.backnum.focus();
		return false;
		}							
	}
	if(!document.all["tak"].checked)
	{
		alert("Please accept terms of the site");
		document.all["tak"].focus();
		return false;
	}															
	document.order1.submit();
	return true;
}

function cardshow()
{
	for(var i=0;document.getElementsByName("tdcard").length > i ;i++)
		document.getElementsByName("tdcard").item(i).style.display="";
}
function cardhide()
{
	for(var i=0;document.getElementsByName("tdcard").length > i ;i++)
		document.getElementsByName("tdcard").item(i).style.display="none";
}
//////////ORDER///
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;
}
function deleteItem(id)
{
	if(window.confirm("Are you sure?"))
		window.location.href="deleteItem.asp?id=" + id;
}
////////////

function GoNewsLetter()
{
	if(document.form111.fname.value=="")
	{
	alert("Insert first name");
	document.form111.fname.focus();
	return false;
	}
	if(document.form111.lname.value=="")
	{
	alert("Insert last name");
	document.form111.lname.focus();
	return false;
	}
	if(!validMail(document.form111.email.value))
	{
	alert("Insert valid email");
	document.contact.form111.focus();
	return false;
	}	
	document.form111.submit();
	return true;
}

function validLogIn()
{
	if(document.form11.uname.value=="")
	{
	alert("Insert user name");
	document.form11.uname.focus();
	return false;
	}
	if(document.form11.pass.value=="")
	{
	alert("Insert password");
	document.form11.pass.focus();
	return false;
	}
	document.form11.submit();
	return true;
}

function enlarge(id, imagenumber){window.open("enlarge.asp?imagenumber=" + imagenumber + "&id=" + id,null,"width=450, height=450, scrollbars=0");}

function validNumber()
{
	if(event.keyCode < 48 || event.keyCode >57) event.keyCode=0;
}

function requery(currentpage, category)
{
	window.location.href="catalog.asp?category=" + category + "&currentpage=" + currentpage;
}
function requeryS(currentpage, q)
{
	window.location.href="search.asp?currentpage=" + currentpage + "&q=" + q;
}
function addToFavorites(url)
{
	window.external.AddFavorite('http://' + url,'Site name');
}

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 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 validform()
{
	if(document.contact.fname.value=="")
	{
	alert("Insert first name");
	document.contact.fname.focus();
	return false;
	}
	if(document.contact.lname.value=="")
	{
	alert("Insert last name");
	document.contact.lname.focus();
	return false;
	}
	
	if(document.contact.email.value=="")
	{
	alert("Insert valid email");
	document.contact.email.focus();
	return false;
	}
	if(!validMail(document.contact.email.value))
	{
	alert("Insert valid email");
	document.contact.email.focus();
	return false;
	}	
	
	/*if(document.contact.phone.value=="")
	{
	alert("נא לרשום טלפון");
	document.contact.phone.focus();
	return false;
	}*/
	document.contact.submit();
	return true;
}
//-->