
function openprices()
 {
 ww = open('prices.asp','endwin','width=550,height=420,top=100,left=100,menubar=1,scrollbars=yes,status=yes,resizable=yes');
 }

	function verifydel(url)
	{
		ans=confirm("? האם אתה בטוח ")
		if(ans)
			document.location.href=url
	}


var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

function enlarge(which,e){
//Render image code for IE 4+ and NS6
if (ie||ns6){
crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
if (crossobj.style.visibility=="hidden"){
crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
crossobj.innerHTML='<div align=right id=drag ><b onClick=closepreview()>&nbsp;<a style="font-family: David; font-size: 10pt; color: #FFFFFF; text-decoration: none; font-weight: bold"  href=javascript:void(0);>X</a>&nbsp;</b></div><img src="'+which+'">'
crossobj.style.visibility="visible"
}
else
crossobj.style.visibility="hidden"
return false
}
//Render image code for NS 4
else if (document.layers){
if (document.showimage.visibility=="hide"){
document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
document.showimage.document.close()
document.showimage.left=e.x
document.showimage.top=e.y
document.showimage.visibility="show"
}
else
document.showimage.visibility="hide"
return false
}
//if NOT IE 4+ or NS 4, simply display image in full browser window
else
return true
}

function closepreview(){
crossobj.style.visibility="hidden"
}



//drag drop function for NS 4////
/////////////////////////////////

var nsx,nsy,nstemp

function drag_dropns(name){
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for IE 4+ and NS6////
/////////////////////////////////

function drag_drop(e){
if (ie&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx
crossobj.style.top=tempy+e.clientY-offsety
}
return false
}

function initializedrag(e){
if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
offsetx=ie? event.clientX : e.clientX
offsety=ie? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
    	
    	
    	function IsLegalDigits(str)
		{
  		var legal = 1;
  		var i;
  		for (i=0; i<str.length; i++) 
  		{
    	  ch = str.substring(i,i+1)
    	  if (i==0 && ch=="0")
    	  {
    	  	legal=0
    	  	break
    	  }	
    	 	if (ch !="0" && ch !="1" && ch !="2" && ch !="3" && ch !="4" && ch !="5" && ch !="6" && ch !="7" && ch !="8" && ch !="9") 
    			{
      			legal = 0
      			break
    			}
  	    }
  		 return legal
		} //end function
		
    	function islegaldata(form)
    	{
    		if(form.BasketQty.value=="")
    		{
    			alert("עליך לציין כמות למוצר שברצונך להזמין")
    			form.BasketQty.focus()
    			return false;
    		}
    		if(!IsLegalDigits(form.BasketQty.value))
  			{
    			alert("הערך שהצבת בכמות אינו חוקי- מספר גדול מ-0 בלבד")
   				form.BasketQty.focus()
 			    return false;
  			}
  		form.submit()
  		return false;
	
    	} //end function
    	
    	
    	
function IsLegalEmail(form)
{
   if (form.email.value == ""){
    alert("יש להזין אימייל")
    form.email.focus()
    return false
 }
 ok = 0
  email = form.email.value
  for (i=0; i<email.length; i++) {
    ch = email.substring(i,i+1)
    if (ch == "@" && i!=0 && i!=email.length-1) {
      ok = 1
    }
    if((ch>="א" && ch<="ת")) {
      ok = 0
      break
    }
  }
  if(ok == 0) {  
    alert("כתובת דואר אלקטרוני אינה חוקית")
    form.email.focus()
    return false;
  } 
 form.submit()
  return false
}