<!--

 	function OpenWin(link)
	{
		 window.open("show_product.asp?pid="+link,'myWindow', 'toolbar=no, menubar=no,scrollbars=no, resizable=yes, location=no, directories=no,width=450, height=500,top=150,left=150')
  	}

	function ss(w,id){window.status=w;return true;}
	function cs(){window.status='';}

 function disabled_it(CustomerId)
    {

      var text_box_state =document.getElementById("topay_"+CustomerId).disabled;
      if (text_box_state==true)
        {
          document.getElementById("topay_"+CustomerId).disabled = false
        }
      else
        {
          document.getElementById("topay_"+CustomerId).disabled = true
          document.getElementById("topay_"+CustomerId).value = 0

        }

    }

 function checkUpd_kvoua(form1)
    {

      var upd_date =document.getElementById("upd_date").value;
      form1.upd_date_form.value = upd_date
      var r=confirm("?האם אתה מעוניין לעדכן את ההזמנה")
      if (r==true)
        {

        }
      else
        {
          return false;
        }

    }



 function check_hazmana()
    {
      var r=confirm("?האם אתה מעוניין לעדכן את ההזמנה")
      if (r==true)
        {

        }
      else
        {
          return false;
        }

    }



 function delete_hazmana()
    {
      var r=confirm("?האם אתה מעוניין למחוק את פריט המבצע מהזמנתך")
      if (r==true)
        {

        }
      else
        {
          return false;
        }

    }

 function check_mivtza()
    {
      var r=confirm("?האם הינך מאשר הוספת פריט מבצע להזמנה שלך")
      if (r==true)
        {

        }
      else
        {
          return false;
        }

    }

 function checkHakpaha()
    {

      var d = new Date();
      var today = new Date(d.getYear(),d.getMonth(),d.getDate());

      var NextHalukaDay =cDate(document.getElementById("NextHalukaDay").value);
      //alert(NextHalukaDay)
      var hak_date =cDate(document.getElementById("hak_date").value);
      var h_days = document.getElementById("h_days").value;

      if(hak_date<NextHalukaDay){
        alert(" ! אינך יכול להקפיא הזמנות לתאריכים הקודמים לתאריך החלוקה הקרוב");
        document.getElementById("hak_date").select();
        return false;
        }

			if (document.getElementById("h_days").value == "")
			{
				alert("!חובה לבחור מספר ימים להקפאה");
				document.getElementById("h_days").focus();
				return false;
			}


    }



 function bitul_checkHakpaha()
    {

      var d = new Date();
      var today = new Date(d.getYear(),d.getMonth(),d.getDate());

      var bitul_hak_date =cDate(document.getElementById("bitul_hak_date").value);
      var bitul_h_days = document.getElementById("bitul_h_days").value;

      if(bitul_hak_date<today){
        alert(".אינך יכול לבטל הקפאה לתאריכים קודמים");
        document.getElementById("bitul_hak_date").select();
        return false;
        }

			if (document.getElementById("bitul_h_days").value == "")
			{
				alert("!חובה לבחור מספר ימים לביטול הקפאה");
				document.getElementById("bitul_h_days").focus();
				return false;
			}

    }


 function MessageForm()
    {

			if (document.getElementById("content").value == "")
			{
				alert("!נא למלא תוכן בשדה ההודעה");
				document.getElementById("content").focus();
				return false;
			}

    }

 function personalForm()
    {

			if (document.getElementById("content").value == "")
			{
				alert("!נא למלא תוכן בשדה פרטים לשינוי");
				document.getElementById("content").focus();
				return false;
			}

    }

 function check_last_chiuv()
    {

      var s_date =cDate(document.getElementById("s_date").value);
      var e_date = cDate(document.getElementById("e_date").value);
       if(s_date >= e_date){
        alert("לא ניתן לבחור תאריך התחלה גדול יותר מתאריך סיום לדו'ח");
        document.getElementById("s_date").focus();
        return false;
        }


    }


function cDate(str)
{
 var d;
 d= Date.parse(str.substr(3,2)+"/"+str.substr(0,2)+"/"+str.substr(6,4));
 return new Date(d);
}

 function checkMashov()
    {


    }

	function addFavs()
	{
		var url=document.location.href;
		var title=document.title;
		if (document.all) {
			// i.e.
			window.external.AddFavorite(url, title);
		} else if (window.sidebar) {
			// ns6 & mozilla
			window.sidebar.addPanel(title, url, "");
		}
	}

	function setAsHomepage(id)
	{
		if (document.all) { //i.e.
			document.getElementById(id).style.behavior="url(#default#homepage)";
			document.getElementById(id).setHomePage("http://www.pokerface.co.il");
		}
		else { // all other browsers: ns6, ff etc...
			alert("To set a homepage in Netscape or Mozilla browsers drag the link to the \"Home\" button.");
		}
	}

	function moveMenu(id)
	{
		for (el = document.getElementById(id+"mainMenu"), left=0; el.tagName != "BODY";  el=el.offsetParent)
			left += el.offsetLeft;
		right = document.body.scrollWidth - left - document.getElementById(id+"mainMenu").offsetWidth;
		document.getElementById(id+"Container").style.right = right;
	}
//-->



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

  function checkLogin()
  {
			if (document.getElementById("loginForm").email.value == "")
			{
				alert("!נא למלא שם משתמש");
				document.getElementById("loginForm").email.focus();
				return false;
			}
			if (document.getElementById("loginForm").email.value.length < 2)
			{
				alert("!שם המשתמש חייב להיות באורך של לפחות 2 תוים");
				document.getElementById("loginForm").email.focus();
				return false;
			}
			pass=document.getElementById("loginForm").password.value;
			if (pass == "")
			{
				alert("!נא למלא סיסמה");
				document.getElementById("loginForm").password.focus();
				return false;
			}
			if (pass.length < 5)
			{
				alert("!הסיסמה חייבת להיות באורך של לפחות 6 תוים ויכולה להכיל אותיות באנגלית וספרות בלבד");
				document.getElementById("loginForm").password.focus();
				return false;
			}
			chrs="0123456789abcdefghijklmnopqrstuvwxyz";
			pass_ok=true;
			for (i=0; i<pass.length; i++)
			{
				if (chrs.indexOf(pass.charAt(i).toLowerCase()) == -1)
				{
					pass_ok=false;
					break;
				}
			}
			if (!pass_ok)
			{
				alert("!הסיסמה חייבת להיות באורך של לפחות 6 תוים ויכולה להכיל אותיות באנגלית וספרות בלבד");
				document.getElementById("loginForm").password.focus();
				return false;
			}
    return true;
  }
