﻿<!--
function b(){window.history.go(-1);}

function payments(){window.open("payments.html",null,"width=450, height=450, scrollbars=1");}
function massa(){window.open("massa.html",null,"width=533, height=150, scrollbars=0, Raised=center, top=300");}

function requery(currentpage)
{
	document.form13.currentpage.value=currentpage;
	document.form13.submit();
}
function requeryS(currentpage, direction)
{
	document.form13.currentpage.value=currentpage;
	if(direction=="up")
		document.form13.sort.value="0";
	else
		document.form13.sort.value="1";
	document.form13.submit();
}


function addDiamondToBasket()
{
	var i = document.getElementsByName("item_").length;
	var a = "0";
	for(var j=0; j < i ;j++)
		{
		if(document.getElementsByName("item_").item(j).checked)
			a+= "," + document.getElementsByName("item_").item(j).name;
		} 
	if(a!="0")
	{
		document.basket.itemid.value=a;
		document.basket.ishi.value="0";
		document.basket.submit();
	}
	else
	{
		alert("נא לבחור מוצר");	
		return false;
	}	
}
function addDiamondToIshi()
{
	var i = document.getElementsByName("item_").length;
	var a = "0";
	for(var j=0; j < i ;j++)
		{
		if(document.getElementsByName("item_").item(j).checked)
			a+= "," + document.getElementsByName("item_").item(j).name;
		} 
	if(a!="0")
	{
		document.basket.itemid.value=a;
		document.basket.ishi.value="1";
		document.basket.submit();
	}
	else
	{
		alert("נא לבחור מוצר");	
		return false;
	}	
}


function printorder(id,printorder)
{
window.open("printorder.asp?id=" + id + "&printorder=" + printorder,null,"width=620, height=450, scrollbars=1");
}

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.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("נא לסמן תנאי הרשמה");
		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";
}

function validcharscter(){if(event.keyCode < 48 || event.keyCode > 57) event.keyCode=0;	}
function terms(){window.open("terms.asp",null,"width=600, height=650, scrollbars=1");}

function del(id)
{
	if(window.confirm("?אתה בטוח שברצונך למחוק"))
		window.location.href="basket_delitem.asp?id=" + id;
}
function del_ishi(id)
{
	if(window.confirm("?אתה בטוח שברצונך מוצר זה מהתיק האישי"))
		window.location.href="ishi_delitem.asp?id=" + id;
}
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 printRoller(){window.open("roller.htm",null,"width=510, height=450, scrollbars=0");}
function printOval(){window.open("oval.htm",null,"width=520, height=450, scrollbars=0");}

function hidenote(){document.getElementById("tooltip2").style.visibility="hidden";}
function shownote(txt)
{
	document.getElementById("tooltip2").style.pixelLeft = event.clientX + document.body.scrollLeft - 100;
	document.getElementById("tooltip2").style.pixelTop	= event.clientY + document.body.scrollTop + 15;
	document.getElementById("tooltip2").innerHTML=txt;
	document.getElementById("tooltip2").style.visibility="visible";
}


function validsearch()
{
	if(document.form1.q.value=="")
	{
		alert("נא להכניס מילת חיפוש");
		document.form1.q.focus();
		return false;
	}
	document.form1.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 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 validform()
{
	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(!validMail(document.contact.phone.value))	
	if(document.contact.phone.value=="")
	{
	alert("נא לרשום מספר טלפון או נייד");
	document.contact.phone.focus();
	return false;
	}	
	
	
	document.contact.submit();
	return true;
}

function checkform()
{
	if(document.reg.full_name.value=="")
	{
	alert("נא לרשום שם מלא");
	document.reg.full_name.focus();
	return false;
	}
	
	
	if(document.reg.phone.value=="")
	{
	alert("נא לרשום מספר טלפון או נייד");
	document.reg.phone.focus();
	return false;
	}	
	
	if(document.reg.email.value=="")
	{
	alert("אנא הכנס כתובת דואר אלקטרוני");
	document.reg.email.focus();
	return false;
	}
	
	if(document.reg.password.value=="")
	{
	alert("אנא הכנס סיסמא");
	document.reg.password.focus();
	return false;
	}
	
	document.reg.submit();
	return true;
}

function open_popup(url,W,H,name)
{

	if(W == undefined) W = "600";
	if(H == undefined) H = "600";
	
	var left = (screen.width/2)-(W/2);
	var top = (screen.height/2)-(H/2);

	window.open(url,name,'status=no,menubar=no,resizable=no,scrollbars=yes,top='+top+',left='+left+',width='+W+',height='+H);
}
//-->
