﻿function ProductsSwitch(val)
{
XtblProductsClose = document.getElementById("tblProductsClose");
XtblProductsOpen  = document.getElementById("tblProductsOpen");

if(val=="open")
{
XtblProductsClose.style.display = "none";
XtblProductsOpen.style.display = "block";
}
else
{
XtblProductsClose.style.display = "block";
XtblProductsOpen.style.display = "none";
}
}
     function trim(inputString) {
            // Removes leading and trailing spaces from the passed string. Also removes
            // consecutive spaces and replaces it with one space. If something besides
            // a string is passed in (null, custom object, etc.) then return the input.
        if (typeof inputString != "string") { return inputString; }
        var retValue = inputString;
        var ch = retValue.substring(0, 1);
        while (ch == " ") { // Check for spaces at the beginning of the string
        retValue = retValue.substring(1, retValue.length);
        ch = retValue.substring(0, 1);
        }
         ch = retValue.substring(retValue.length-1, retValue.length);
        while (ch == " ") { // Check for spaces at the end of the string
          retValue = retValue.substring(0, retValue.length-1);
          ch = retValue.substring(retValue.length-1, retValue.length);
         }
        while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
          retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
        }
        return retValue; // Return the trimmed string back to the user
        } // Ends the "trim" function



   function checkidnum(idnum){
     
     while (isNaN(idnum) || idnum.length<9){
        //alert("הכנס תעודת זהות תקינה כולל ספרת ביקורת")
        return false;
        //idnum="0"+idnum;
    }
    idnum1=idnum.substr(0,1)*1;
    idnum2=idnum.substr(1,1)*2;
    idnum3=idnum.substr(2,1)*1;
    idnum4=idnum.substr(3,1)*2;
    idnum5=idnum.substr(4,1)*1;
    idnum6=idnum.substr(5,1)*2;
    idnum7=idnum.substr(6,1)*1;
    idnum8=idnum.substr(7,1)*2;
    idnum9=idnum.substr(8,1)*1;
 
    if (idnum1>9) idnum1=(idnum1%10)+1
    if (idnum2>9) idnum2=(idnum2%10)+1
    if (idnum3>9) idnum3=(idnum3%10)+1
    if (idnum4>9) idnum4=(idnum4%10)+1
    if (idnum5>9) idnum5=(idnum5%10)+1
    if (idnum6>9) idnum6=(idnum6%10)+1
    if (idnum7>9) idnum7=(idnum7%10)+1
    if (idnum8>9) idnum8=(idnum8%10)+1
    if (idnum9>9) idnum9=(idnum9%10)+1
 
    var sumval=idnum1+idnum2+idnum3+idnum4+idnum5+idnum6+idnum7+idnum8+idnum9;
 
    sumval=sumval%10
    if (sumval>0){
       // alert("הכנס תעודת זהות תקינה כולל ספרת ביקורת")
        return false;
    }
 
  return true;
}

function lock_open()
{

window.open ("http://www.locker-ambin.co.il/lockerambin/pages/Lock_Demo.aspx",
"Lock_Demo","menubar=0,resizable=0,width=510,height=330"); 
}
function aron_open()
{
;
window.open ("http://www.locker-ambin.co.il/lockerambin/pages/Aron_Demo.aspx",
"Aron_Demo","menubar=0,resizable=0,width=770,height=503"); 
}

