

var Pic1a = new Image;
var Pic1b = new Image;
var Pic2a = new Image;
var Pic2b = new Image;
var Pic3a = new Image;
var Pic3b = new Image;
var Pic4a = new Image;
var Pic4b = new Image;
var Pic5a = new Image;
var Pic5b = new Image;

var Pic10a = new Image;
var Pic10b = new Image;
var Pic11a = new Image;
var Pic11b = new Image;
var Pic12a = new Image;
var Pic12b = new Image;
var Pic13a = new Image;
var Pic13b = new Image;
var Pic14a = new Image;
var Pic14b = new Image;
var Pic15a = new Image;
var Pic15b = new Image;
var Pic50a = new Image;
var Pic50b = new Image;

var Pic100a = new Image;
var Pic100b = new Image;

Pic1a.src = "images\\button\\mainbutton_new_09.gif";
Pic1b.src = "images\\button\\mainbutton_new_roll_09.gif";
Pic2a.src = "images\\button\\mainbutton_new_10.gif";
Pic2b.src = "images\\button\\mainbutton_new_roll_10.gif";
Pic3a.src = "images\\button\\mainbutton_new_11.gif";
Pic3b.src = "images\\button\\mainbutton_new_roll_11.gif";
Pic4a.src = "images\\button\\mainbutton_new_12.gif";
Pic4b.src = "images\\button\\mainbutton_new_roll_12.gif";
Pic5a.src = "images\\button\\mainbutton_new_13.gif";
Pic5b.src = "images\\button\\mainbutton_new_roll_13.gif";

Pic10a.src = "images\\mainP\\images_25.gif";
Pic10b.src = "images\\mainP\\images_25_roll.gif";
Pic11a.src = "images\\mainP\\images_27.gif";
Pic11b.src = "images\\mainP\\images_27_roll.gif";
Pic12a.src = "images\\mainP\\voice_massege_07.gif";
Pic12b.src = "images\\mainP\\voice_massege_07_roll.gif";
Pic13a.src = "images\\mainP\\images_31.gif";
Pic13b.src = "images\\mainP\\images_31_roll.gif";
Pic14a.src = "images\\mainP\\images_33.gif";
Pic14b.src = "images\\mainP\\images_33_roll.gif";
Pic15a.src = "images\\mainP\\images_34.gif";
Pic15b.src = "images\\mainP\\images_34_roll.gif";

Pic50a.src = "images\\play.gif";
Pic50b.src = "images\\play_roll.gif";

Pic100a.src = "images\\button\\11_03.gif";
Pic100b.src = "images\\button\\11_03_down.gif";

startday = new Date();
clockStart = startday.getTime();
function initStopwatch() 
{ 
		var myTime = new Date(); 
        var timeNow = myTime.getTime();  
        var timeDiff = timeNow - clockStart; 
        this.diffSecs = timeDiff/2000;
        return(this.diffSecs); 
} 
function send_data(num){
if (num==5) return false;
}
function re(){
       document.getElementById("loading").style.visibility='hidden';
       document.getElementById("site").style.visibility='visible'; 
}
function sendMail(what,OK){
if (document.form1.thesubject.value=="")
	{document.form1.thesubject.focus();
	alert("הקלד את נושא האימייל");}
else
{document.form1.target="";
	document.form1.newval.value=what;
	document.form1.method="POST";
	document.form1.leftS.value=OK;
	document.form1.action="index.asp";
	document.form1.submit();}	
}
function getSecs() 
{ 
        var mySecs = initStopwatch(); 
        var mySecs1 = ""+mySecs; 
        mySecs1= mySecs1.substring(0,mySecs1.indexOf("."));
        myMinutes=0.1

        mySecs1=myMinutes - mySecs1
        window.setTimeout('getSecs()',4000);
				
        if (mySecs1<=0) 
        {window.close();}
}
function findt1(id,outer,inner,lft,where)
{
	document.form1.target="";
	document.form1.id.value=id;
	document.form1.newval.value=outer;
	document.form1.valCat.value=inner;
	document.form1.leftS.value=lft;
	document.form1.action=where+".asp";
	document.form1.submit();
}
function findt3(id,outer,inner,lft,where)
{	if (document.form1.themsg.value==""){
	alert("נא למלא ברכה");
	document.form1.themsg.focus();
	}else{
	document.form1.target="";
	document.form1.id.value=id;
	document.form1.newval.value=outer;
	document.form1.valCat.value=inner;
	document.form1.leftS.value=lft;
	document.form1.Method="POST";
	document.form1.action=where+".asp";
	document.form1.submit();}
}
function Clients(outer,inner,where)
{
	document.form1.target="";
	document.form1.newval.value=outer;
	document.form1.valCat.value=inner;
	document.form1.action=where+".asp";
	document.form1.submit();
}
function findt2(id,outer,inner,lft,where)
{
	document.form1.target="";
	document.form1.id.value=id;
	document.form1.newval.value=outer;
	document.form1.valCat.value=inner;
	document.form1.leftS.value=lft;
	document.form1.Method="POST";
	document.form1.action="https://www.nato.co.il/"+where+".asp";
	document.form1.submit();
}
function checkit(leng){
document.form1.txtbox1.value="";document.form1.twd1.maxLength=leng;
twdCount(document.form1.txtbox1,document.form1.twd1,leng);
}
function OnceChanged(){
var rd=getr(document.form1.radio1);
idthcash=null;if(rd==2){idthcash="cash";}else{idthcash="bank";}
document.form1.target="checkbo";
document.form1.action="chashbnk.asp?idthcash="+idthcash;
document.form1.submit();
}
function checkiska(){
if(document.getElementById("kreditCat").value==12){
	document.getElementById("newtotal").style.visibility='';
	document.getElementById("total").value='';
	var rd=getr(document.form1.radio1);
	idthcash=null;if(rd==2){idthcash="cash";}else{idthcash="bank";}
	document.form1.target="checkbo";
	document.form1.action="chashbnk.asp?idthcash="+idthcash;
	document.form1.submit();
	}
else{
	document.getElementById("newtotal").style.visibility='hidden';	
	document.getElementById("total").value='0';
	var rd=getr(document.form1.radio1);
	idthcash=null;if(rd==2){idthcash="cash";}else{idthcash="bank";}
	document.form1.target="checkbo";
	document.form1.action="chashbnk.asp?idthcash="+idthcash;
	document.form1.submit();
	}
}
function changeMe(id,outer,inner,lft)
{document.form1.target="";
	document.form1.id.value=id;
	document.form1.newval.value=outer;
	document.form1.valCat.value=inner;
	document.form1.leftS.value=lft;
	document.form1.action="index.asp";
	document.form1.submit();
}
function changeTam(id,outer,inner,lft)
{document.form1.target="";
	document.form1.id.value=id;
	document.form1.newval.value=outer;
	document.form1.valCat.value=inner;
	document.form1.leftS.value=lft;
	document.form1.method="POST";
	document.form1.action="index.asp";
	document.form1.submit();
}
function Change(pg,the,where)
{document.form1.target="";
	document.form1.id.value=pg;
	document.form1.newval.value=the;
	document.form1.method="POST";
	document.form1.action=where+".asp";
	document.form1.submit();
}
function CheckOut(){
document.frmNew.Imout.value="Natocheckout";
document.frmNew.action="index.asp";
document.frmNew.submit();
}
function twdCount(field,cntfield,maxlimit) {
if (field.value.length > maxlimit)
    field.value = field.value.substring(0, maxlimit);
else{
    cntfield.value = maxlimit - field.value.length;
    if(cntfield.value<=56){document.getElementById("moreThen70").style.visibility="visible";
        document.form1.moreThen70.value="מעבר ל - 70 תווים - יחושב כשתי הודעות";}
    else {document.getElementById("moreThen70").style.visibility="hidden";
        document.form1.moreThen70.value="";}    
    }
}
function openNwin(strs,x,y){
openwin('include/'+strs+'.asp',document.all.dynamsg1.html,x,y);
}
function searches(pg,the,where)
{
	if (document.form1.searchtxt.value==""){alert("אנא הקלד מילת חיפוש או חלק ממנה");document.form1.searchtxt.focus();return false;}
	if (document.form1.searchtxt.value.length<=1){alert("מילת החיפוש צריכה להיות יותר מאות אחת");document.form1.searchtxt.focus();return false;}
	document.form1.id.value=pg;
	document.form1.newval.value=where;
	document.form1.valCat.value=the;
	document.form1.submit();
}
function tree(where,pg,to,the,id)
{
	document.form1.id_tat.value=pg;
	document.form1.Level.value=the;
	document.form1.act.value=to;
	document.form1.id.value=id;
	document.form1.action=where+".asp";
	document.form1.submit();
}
function lot(where,the,ct,num)
{
	window.open(where+".asp?id="+the+"&link="+ct+"&num="+num,'','resizable=1,scrollbars=1,menubar=1');
}
function openwin(strs,ids,w,h){
var window_handle=window.open(strs+"?pic="+ids,'mywwind','width='+w+',height='+h+',top=20,left=20,resizable=no scrollbars=no toolbar=no channelmode=no fullscreen=no');}function changeL(what){
window.top.location=what+".asp";}
var confirmMsg  = '?האם אתה רוצה למחוק את הרשומה \n ';
function gets2(num,what,title)
{
document.form1.id.value=num;
if (what=="delete")
	if (confirmLink(this,title)){
		document.form1.act.value=what;
		document.form1.submit();}
	else
	return false;					
}
function SetSign(){
document.form1.signum1.value=document.form1.cell1.value;
document.form1.signum.value=document.form1.cell.value;
}
function gets(num,what,title)
{
document.form1.theidsubs.value=num;
if (what=="delete")
	if (confirmLink(this,title)){
		document.form1.changeme.value=what;
		document.form1.newval.value="Theclients";
		document.form1.Category.value="";
		document.form1.counter.value="";
		document.form1.action="Myclients.asp";
		document.form1.submit();}
	else
	return false;					
}
function confirmLink(mylink, str)
{if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
    return false;
    }
    var is_confirmed = confirm(confirmMsg  + str);
    if (is_confirmed) {
        mylink.href += '&is_js_confirmed=1';    }
    return is_confirmed;
}
function openwin1(strs,ids,num,w,h){
var mynewwind=window.open(strs+"?pic="+ids+"&num="+num,'mynewwind','width='+w+',height='+h+',top=200,left=300,resizable=no scrollbars=no toolbar=no channelmode=no fullscreen=no');}function gets1(num,what)
{document.form1.id.value=num;
document.form1.act.value=what;
document.form1.submit();}

function findPosX(obj,obj2)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
		//obj2.style.left=curleft;
	return curleft;
	//alert(curleft);
}
function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
function thecalend(){
ggPosX=findPosX(document.getElementById("thedate"),'')-50;ggPosY=findPosY(document.getElementById("thedate"))-150;
show_calendar('form1.thedate');
//document.getElementById("whatvalue").style.display="none";
}
function thecalend1(obj,input){
ggPosX=findPosX(obj,'')-50;ggPosY=findPosY(obj)-150;
show_calendar(input);
}
function sendAct(what,OK){var rd1="";
var rd=getr(document.form1.radio3);
if(what!="Sendsms"){
rd1=getr(document.form1.radio2);}
if (what=="Sendsms" && rd1=="" && document.form1.txtbox1.value=="")
	{document.form1.txtbox1.focus();
	alert("הקלד את ההודעה");}
else	
if (rd=="after" && document.form1.thedate.value=="")
	{document.form1.thedate.focus();
	alert("הקלד תאריך בפורמט 00/00/0000");}
else
if(rd=="after" && !stringFilter(document.form1.thedate,"1234567890/"))
	{document.form1.thedate.focus();
	alert("הקלד תאריך בפורמט 00/00/0000");}
else	
if (rd=="after" && document.form1.thetime.value=="")
	{document.form1.thetime.focus();
	alert("הקלד שעה בפורמט 00:00");}	
else
if(rd=="after" && !stringFilter(document.form1.thetime,"1234567890:"))	
	{document.form1.thetime.focus();
	alert("הקלד שעה בפורמט 00:00");}
else
{document.form1.newval.value=what;
	document.form1.method="POST";
	document.form1.leftS.value=OK;
	document.form1.action="index.asp";
	document.form1.submit();}
}
	

function newmem(getto,whereto){
var at=document.form1.email.value.indexOf("@");
var dot=document.form1.email.value.indexOf(".");
if (document.form1.fname.value=="")
	{document.form1.fname.focus();
	alert("הקלד שם פרטי");}
else	
if (document.form1.fname.value!="" && !stringFilter(document.form1.fname,"אבגדהוזחטיכלמנסעפצקרשםתןךףץabcdefghijklmnopqrstuvwxyz'` "))
	{document.form1.fname.focus();
	alert("הקלד שם פרטי אותיות בלבד");}
else	
if (document.form1.lname.value=="")
	{document.form1.lname.focus();
	alert("הקלד שם משפחה");}
else	
if (document.form1.lname.value!="" && !stringFilter(document.form1.lname,"אבגדהוזחטיכלמנסעפצקרשתםןךףץabcdefghijklmnopqrstuvwxyz'` "))
	{document.form1.lname.focus();
	alert("הקלד שם משפחה אותיות בלבד");}
//else	
//if (document.form1.address.value=="")
//	{document.form1.address.focus();
//	alert("הקלד כתובת");}	
else	
if (document.form1.cell.value=="" || document.form1.cell1.value=="none")
	{document.form1.cell.focus();
	alert("הקלד מס' טל' סלולארי כולל קידומת");}	
else	
if (!stringFilter(document.form1.cell,"1234567890"))
	{document.form1.cell.focus();
	alert("הקלד מספרים בלבד");}
else	
if (document.form1.cell.value.length<7)
	{document.form1.cell.focus();
	alert("הטלפון הסלולארי אינו תקין");}				
else	
if (document.form1.comp_name.value=="")
	{document.form1.comp_name.focus();
	alert("הקלד שם עסק");}	
else	
if (document.form1.comp_address.value=="")
	{document.form1.comp_address.focus();
	alert("הקלד כתובת העסק");}	
else	
if (document.form1.city.value=="")
	{document.form1.city.focus();
	alert("הקלד עיר");}	
else	
if (document.form1.phone.value=="" || document.form1.phone1.value=="none")
	{document.form1.phone.focus();
	alert("הקלד מס' טל' של העסק כולל קידומת");}
else	
if (!stringFilter(document.form1.phone,"1234567890"))
	{document.form1.phone.focus();
	alert("הקלד מספרים בלבד");}	
else	
if (document.form1.phone.value.length<7)
	{document.form1.phone.focus();
	alert("הטלפון בעסק אינו תקין");}							
else	
if(document.form1.email.value==""){
	alert("הקלד כתובת אימייל");
	document.form1.email.focus();}
else	
if((at==-1)||(dot==-1)){
	alert("כתובת האימייל אינה נכונה - בדוק שוב");
	document.form1.email.focus();}	
else	
if (document.form1.signum.value=="")
	{document.form1.signum.focus();
	alert("הקלד מס' לחתימה טלפונית");}
else	
if (!stringFilter(document.form1.signum,"1234567890"))
	{document.form1.signum.focus();
	alert("הקלד מספרים בלבד");}
else	
if (document.form1.signum.value.length<7)
	{document.form1.signum.focus();
	alert("המספר אינו תקין");}			
else	
if (document.form1.username.value=="")
	{document.form1.username.focus();
	alert("בחר שם מתמש");}	
else	
if (document.form1.password.value=="")
	{document.form1.password.focus();
	alert("בחר סיסמא");}
else	
if (document.form1.password.value.length!=6)
	{document.form1.password.focus();
	alert("הסיסמא צריכה להיות  6 תווים בלבד");}			
else
{document.form1.newval.value=getto;
	document.form1.method="POST";
	document.form1.leftS.value=whereto;
	document.form1.valCat.value="nonepic";
	document.form1.action="https://www.nato.co.il/index.asp";
	document.form1.submit();}
}
function printstick(){
document.form1.newval.value="stickall";
document.form1.action="kreditIn.asp";
document.form1.leftS.value=1;
document.form1.valCat.value="nonepic";
document.form1.target="";
document.form1.submit();
}
function CheckMem(what){
if (document.form2.userM.value=="")
	{document.form2.userM.focus();
	alert("נא הקלד שם משתמש");
	return false;}	
else
if (document.form2.passM.value=="")
	{document.form2.passM.focus();
	alert("נא הקלד סיסמא");
	return false;}	
else
{document.form1.newval.value=what;
	document.form2.action="https://www.nato.co.il/index.asp";
	//document.form2.action="index.asp";
	document.form2.method="POST";
	document.form2.submit();}	
}
function send(where){
var at=document.form1.email.value.indexOf("@");
var dot=document.form1.email.value.indexOf(".");
if (document.form1.fname.value=="")
	{alert("מלא שם פרטי");
	document.form1.fname.focus();}
else	
if (document.form1.lname.value=="")
	{document.form1.lname.focus();
	alert("מלא שם משפחה");}
else	
if (document.form1.cell1.value=="")
	{document.form1.cell1.focus();
	alert("בחר קידומת טל' סלולארי");}
else	
if (document.form1.cell.value=="")
	{document.form1.cell.focus();
	alert("מלא מס' סלולארי");}
else	
if (!stringFilter(document.form1.cell,"1234567890"))
	{document.form1.cell.focus();
	alert("הקלד מספרים בלבד");}	
else	
if(document.form1.email.value==""){
	alert("הקלד כתובת אימייל");
	document.form1.email.focus();}
else	
if((at==-1)||(dot==-1)){
	alert("כתובת האימייל אינה נכונה - בדוק שוב");
	document.form1.email.focus();}	
else	
if(document.form1.txt.value==""){
	alert("מלא פרטים");
	document.form1.txt.focus();}	
else
{
document.form1.method="POST";
document.form1.action="Registration.asp";
document.form1.submit();}
}
function changename(what){
var rd=getr(document.form1.radio1);
if (rd=="person"){
if(what==" ") what="ענת ישראלי";
document.form1.flname.value=what;}
else{
if(what=="משפחת ") what="משפחת ישראלי";
document.form1.flname.value=what;}
}
function set_tatmahlaka(){

	var optionObj1 = new Array(200);
	iii=1;
	xxx=1;
	for(xxx=1;xxx<200;xxx++) {
	document.form1.proj_name.options[1]=null;}
	for (ixz=1;ixz<100;ixz++) {
	if (document.form1.compN.value==mahlaka[ixz]) {
	optionObj1[iii] = Option(tatmahlaka[ixz], tatmahlakavalue[ixz]);
	document.form1.proj_name.options[iii]=optionObj1[iii];
	iii=iii+1;
	}}
}
function findprice(sess){
if (sess!=""){
var rd=getr(document.form1.rdvoice);var value=null;
if (rd=="phone_s"){value=4;}
else{value=5;}document.form1.FindVoice.value=value;
document.form1.target="Voices";
document.form1.action="include/numsVoice.asp";
document.form1.submit();
}}
function MakeAct(what){
var rd=getr(document.form1.radio1);
if (rd!=""){
document.form1.all.showwhatdo.style.visibility='visible';
document.form1.all.submit4.style.visibility='hidden';
document.body.scroll='auto';
document.form1.WhatAct.value=what;}
}
function getr(radio1)
{
var value=null;
for (var i=0;i<radio1.length;i++){
	if(radio1[i].checked){value=radio1[i].value;break;}
	}
return value;
}	
function MeinMem(where,to)
{
if (document.form1.fname_s.value=="")
	{document.form1.fname_s.focus();
	alert("מלא שם פרטי");}
else	
if (document.form1.lname_s.value=="")
	{document.form1.lname_s.focus();
	alert("מלא שם משפחה");}
else	
if(document.form1.cell_s.value==""){
	alert("מלא טלפון סלולארי מספרים בלבד");
	document.form1.cell_s.focus();}
else	
if(document.form1.cell_s.value.length!=7){
	alert("מספר ההסלולארי שהקלדת אינו תקין-בדוק שוב");
	document.form1.cell_s.focus();}
else	
if(!stringFilter(document.form1.cell_s,"1234567890")){
	alert("מלא טלפון סלולארי מספרים בלבד");
	document.form1.cell_s.focus();}		
else	
if  (document.form1.category_s.value=="none" || document.form1.category_s.value=="0")
	{document.form1.category_s.focus();
	alert("בחר קטגוריה");}	
else
{document.form1.leftS.value=where;
document.form1.valCat.value="nonepic";
document.form1.method="POST";
document.form1.action=to+".asp";
document.form1.submit();}	
}
function checks(){
var rd=getr(document.form1.radio1)
if (rd=="0"){
document.getElementById("Thebnk").style.visibility='visible';
//document.form1.pay_num.value="1";
document.form1.target="checkbo";
document.form1.action="chashbnk.asp?idthcash=ashray";
document.form1.submit();
//document.getElementById("ashray").style.visibility='visible';
//calcs(document.form1.total2.value);
}
else
if (rd=="1"){
//document.getElementById("ashray").style.visibility='hidden';
document.getElementById("Thebnk").style.visibility='visible';
//document.form1.pay_num.value="1";
document.form1.target="checkbo";
document.form1.action="chashbnk.asp?idthcash=bank";
document.form1.submit();
//calcs(document.form1.total2.value-(document.form1.total2.value*0.03));
}
else 
if (rd=="2"){
document.getElementById("Thebnk").style.visibility='visible';
//document.getElementById("ashray").style.visibility='hidden';
//document.form1.pay_num.value="1";
document.form1.target="checkbo";
document.form1.action="chashbnk.asp?idthcash=cash";
document.form1.submit();
//calcs(document.form1.total2.value);
}}
function stringFilter (input,sts) 
{s = input.value;
filteredValues = sts;     
var i,f,d;
var returnString = "";
for (i = 0; i < s.length; i++) {  
	var c = s.charAt(i);
if (filteredValues.indexOf(c) == -1) 
	returnString += c;
}f = returnString;
if (f=="")
	return  d=true;
}
function cleanAll(){
    document.getElementById("txtbox1").value="";
}
function clean(){
document.form1.reset();
}
function thedate(d1,d2)
{
var a1,a2;
var today=new Date();
a2=today.getFullYear();
a1=today.getMonth();
a1=a1+1;
if (d1>=a1 && d2>=a2)
	{return ff=true;}
else	
if (d1<a1 && d2>a2)	
	{return ff=true;}
else
	{return ff=false;}
}
function sendkred(){
var rd=getr(document.form1.radio1)
if (rd==null){
alert("בחר צורת תשלום");
return false;
}

var at=document.form1.email.value.indexOf("@");
var dot=document.form1.email.value.indexOf(".");

if (document.form1.fname.value=="")
	{document.form1.fnameNo.value="חובה";
	document.form1.fname.focus();return false;}
else	
if (document.form1.fname.value!="" && !stringFilter(document.form1.fname,"אבגדהוזחטיכלמנסעפצקרשםתןךףץabcdefghijklmnopqrstuvwxyz'` "))
	{document.form1.fname.focus();
	document.form1.fnameNo.value="אותיות בלבד";return false;}
else	
if (document.form1.lname.value=="")
	{document.form1.lname.focus();
	document.form1.lnameNo.value="חובה";return false;}
else	
if (document.form1.lname.value!="" && !stringFilter(document.form1.lname,"אבגדהוזחטיכלמנסעפצקרשםתןךףץabcdefghijklmnopqrstuvwxyz'` "))
	{document.form1.lname.focus();
	document.form1.lnameNo.value="אותיות בלבד";return false;}
else	
if (document.form1.comp_address.value=="")
	{document.form1.comp_address.focus();
	document.form1.comp_addressNo.value="חובה";return false;}
else	
if (document.form1.city.value=="")
	{document.form1.city.focus();
	document.form1.cityNo.value="חובה";return false;}
else		 
if (document.form1.comp_name.value=="")
	{document.form1.comp_name.focus();
	document.form1.comp_nameNo.value="חובה";return false;}	
else		 
if (document.form1.phone.value=="")
	{document.form1.phone.focus();
	document.form1.phoneNo.value="חובה";return false;}
else		 
if (!stringFilter(document.form1.phone,"1234567890"))
	{document.form1.phone.focus();
	document.form1.phoneNo.value="מספרים בלבד";return false;}
else		 
if (document.form1.phone.value.length<7)
	{document.form1.phone.focus();
	document.form1.phoneNo.value="מס' לא תקין";return false;}					
else		 
if (document.form1.cell.value=="")
	{document.form1.cell.focus();
	document.form1.cellNo.value="חובה";return false;}	
else		 
if (!stringFilter(document.form1.cell,"1234567890"))
	{document.form1.cell.focus();
	document.form1.cellNo.value="מספרים בלבד";return false;}
else		 
if (document.form1.cell.value.length<7)
	{document.form1.cell.focus();
	document.form1.cellNo.value="מס' לא תקין";return false;}		
else		 
if (document.form1.signum.value=="")
	{document.form1.signum.focus();
	document.form1.signumNo.value="חובה";return false;}	
else		 
if (!stringFilter(document.form1.signum,"1234567890"))
	{document.form1.signum.focus();
	document.form1.signumNo.value="מספרים בלבד";return false;}		
else		 
if (document.form1.signum.value.length<7)
	{document.form1.signum.focus();
	document.form1.signumNo.value="מס' לא תקין";return false;}	
else		 
if (document.form1.email.value=="")
	{document.form1.email.focus();
	document.form1.emailNo.value="חובה";return false;}	
else	
if((at==-1)||(dot==-1)){
	document.form1.emailNo.value="אימייל לא נכון";
	document.form1.email.focus();return false;}		
else		 
if (document.form1.username.value=="")
	{document.form1.username.focus();
	document.form1.usernameNo.value="חובה";return false;}
else		 
if (document.form1.password.value=="")
	{document.form1.password.focus();
	document.form1.passwordNo.value="חובה";return false;}
else		 
if (document.form1.password.value.length<6)
	{document.form1.password.focus();
	document.form1.passwordNo.value="סיסמא 6 תווים";return false;}	
else		 
if (document.form1.total.value=="")
	{document.form1.total.focus();
	alert("נא למלא סכום עבור עיסקה חד פעמית");return false;}
else		 
if (!stringFilter(document.form1.total,"1234567890."))
	{document.form1.total.focus();
	alert("סכום רק מספרים ו/או נקודה עשרונית");return false;}	
//if (rd!="0"){
else
		findt2('','checkin','nonepic','1','KreditIn');
//		}
/*else{		 
	if (document.form1.card_name.value=="0"){
		alert("אנא בחר כרטיס אשראי");
		document.form1.card_name.focus();return false;}	
	else
	if (document.form1.card_owner.value==""){
		alert("אנא מלא שם בעל הכרטיס");
		document.form1.card_owner.focus();return false;}
	else
	if (document.form1.id_num.value=="" || ! stringFilter (document.form1.id_num,"1234567890")){
		alert("אנא מלא מספר ת.ז - רק מספרים");
		document.form1.id_num.focus();return false;}
	else
	if (document.form1.card_num.value=="" || ! stringFilter (document.form1.card_num,"1234567890")){
		alert("אנא מלא מספר הכרטיס - רק מספרים");
		document.form1.card_num.focus();return false;}	
	else
	if (!thedate(document.form1.validdate.value,document.form1.validdate1.value)){
		alert("כרטיס האשראי שלך פג תוקף - אנא בדוק שוב");return false;}
	else
	if (document.form1.backNum.value=="" || ! stringFilter (document.form1.backNum,"1234567890")){
		alert("אנא מלא את הספרות בגב הכרטיס");
		document.form1.backNum.focus();return false;}
	else{
		findt2('','checkin','nonepic','1','KreditIn');
		}
}*/}
function sherut(cl,cl1){maam=document.form1.maam.value;	
var tots=eval(cl1/(cl*maam));
var total=number_format(tots, 0, '.', ',');
if (total=="NaN")document.form1.countsM1.value="בלתי מוגבל";
else document.form1.countsM1.value=total;
}
function calcs(cl,input){
if (!stringFilter(input,"1234567890")){
	input.focus();
	alert("ניתן להקליד רק מספרים");}
else{counts=input.value;maam=document.form1.maam.value;	
var tots=eval(counts*cl*maam);
var total=number_format(tots, 2, '.', ',');
if (total==0)document.form1.sumM.value="חינם";
else document.form1.sumM.value=total + " ₪ כולל מע''מ";document.form1.total.value=total;}
}
function number_format(a, b, c, d) {
	// number_format(number, decimals, comma, formatSeparator)
	if (isNaN(parseInt(a))) return "NaN";
	a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
	e = a + '';
	f = e.split('.');
	if(!f[0]) f[0] = '0';
	if(!f[1]) f[1] = '';
	if(f[1].length < b){
		g = f[1];
		for(i = f[1].length + 1; i <= b; i++) {
			g += '0';
		}
		f[1] = g;
	}
	if(d != '' && f[0].length > 3) {
		h = f[0];
		f[0] = '';
		for(j = 3; j < h.length; j += 3) {
			i = h.slice(h.length - j, h.length - j + 3);
			f[0] = d + i +  f[0] + '';
		}
		j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
		f[0] = j + f[0];
	}
	c = (b <= 0) ? '': c;
	return f[0] + c + f[1];
}
function forms(num,decimal)
{ 
   if (isNaN(parseInt(num))) return "NaN";
var tmpNum = num;
var iSign = num < 0 ? -1 : 1;		
tmpNum *= Math.pow(10,decimal);
tmpNum = Math.round(Math.abs(tmpNum))
tmpNum /= Math.pow(10,decimal);
tmpNum *= iSign;					
var tmpNumStr = new String(tmpNum);
return tmpNumStr;		
}
function findPicCategory(input,what){
var rd=getr(document.form1.ctegpic);
if(rd=="gen"){i=1;}else{i=29;}
input.value=i;
document.getElementById("chpics").src="images/Credits/"+input.value+".jpg";
}
function changepic(input,what){
var rd=getr(document.form1.ctegpic);
if (rd=="gen"){picnums1=1;picnums=28;}else{picnums1=29;picnums=55;}
var i=input.value;
var z,x;
if (what=="plus"){
x=++i;
if (x>picnums) x=picnums1;
input.value=x;
}
else{
z=--i;
if(z<picnums1) z=picnums;
input.value=z;
}
document.getElementById("chpics").src="images/Credits/"+input.value+".jpg";
}
function addCat(input,num){
if (input.value!=""){
document.forms['form1'].category_s.options[0] = new Option(input.value,num);
document.forms['form1'].category_s.selectedIndex=0;
document.form1.newcategory2.value=input.value;
input.value="";}
}
function checkdatetime(what,OK){
var rd1="";var x= new Date();months=x.getMonth()+1;xx=x.setTime(x.getDate()+4);
var olddate=document.form1.thedate.value.substring(2,0);
var oldMonth=document.form1.thedate.value.substring(5,3);
var chcks=document.form1.thetime.value.indexOf(':',2);
if(xx>=32 && xx<=35){
    if(months<parseInt(oldMonth)){
        olddate=xx-parseInt(olddate);}
}
var rd=getr(document.form1.radio3);
if(what!="Sendsms" && what!="SendVoice" && what!="SendFax"){
rd1=getr(document.form1.radio2);}
if (what=="Sendsms" && rd1=="" && document.form1.txtbox1.value=="")
	{document.form1.txtbox1.focus();
	alert("הקלד את ההודעה");}
else	
if ((rd=="after" && document.form1.thedate.value=="") || (rd=="after" &&document.form1.thedate.value=="00/00/0000"))
	{document.form1.thedate.focus();
	alert("הקלד תאריך בפורמט 00/00/0000");}
else
if(rd=="after" && !stringFilter(document.form1.thedate,"1234567890/"))
	{document.form1.thedate.focus();
	alert("הקלד תאריך בפורמט 00/00/0000");}
else
if(rd=="after" && olddate>xx || (rd=="after" && (xx-4>olddate)) )
	{document.form1.thedate.focus();
	alert(" !! תאריך לא חוקי\n המערכת מאפשרת שליחה דחויה \n ! עד 4 ימים מיום כתיבת ההודעה \n כמו כן בדוק שהתאריך שהכנסת\n אינו קטן מתאריך של היום");}	
else	
if ((rd=="after" && document.form1.thetime.value=="") || (rd=="after" && document.form1.thetime.value.length<5))
	{document.form1.thetime.focus();
	alert("הקלד שעה בפורמט 00:00");}	
else
if((rd=="after" && !stringFilter(document.form1.thetime,"1234567890:")) || (rd=="after" && chcks!=2))
	{document.form1.thetime.focus();
	alert("הקלד שעה בפורמט 00:00");}
else
return true;
}
function sendExampSms(what,OK,num){
if (!checkdatetime(what,OK)) return false;
else{
document.form1.Method="POST";
document.form1.id.value=num;
document.form1.action="include/SendTestSms.asp";
document.form1.target="_blank";
document.form1.submit();
}}
function sendExampVoice(what,OK,num){
var rd=getr(document.form1.rdvoice);
if (rd==null){alert("בחר טלפון קווי או נייד"); return false;}
else{
document.form1.Method="POST";
document.form1.id.value=num;
document.form1.action="include/SendTestVoice.asp?rd="+rd;
document.form1.target="_blank";
document.form1.submit();
}}
function openwinVoice(strs,ids,x,y){
var rd=getr(document.form1.rdvoice);
var window_handle=window.open(strs+"?pic="+ids+"&rd="+rd,'mywwind','width='+x+',height='+y+',top=20,left=20,resizable=no scrollbars=no toolbar=no channelmode=no fullscreen=no');
}
function sendExampFax(num){
if(document.form1.sellnum.value==""){alert("נא למלא מספר פקס");document.form1.sellnum.focus();}
else
if(document.form1.thefaxfile.value==""){alert("בחר קובץ");document.form1.thefaxfile.focus();}
else{
document.form1.Method="POST";
document.form1.id.value=num;
document.form1.action="include/SendTestFax.asp";
document.form1.target="_blank";
document.form1.submit();}
}
function sendAct(what,OK){
if (!checkdatetime(what,OK)) return false;
else{
findt1('','SendSms','nonepic','1','SendMyList');
}}
function sendForVoiceGroup(what,OK){
var rd=getr(document.form1.rdvoice);
if (rd==null){alert("בחר טלפון קווי או נייד"); return false;}
else
if (!checkdatetime(what,OK)) return false;
else{
findt1('','SendVoice','nonepic','1','Tools');
}}
function sendForFaxGroup(what,OK){
if(document.form1.thefaxfile.value==""){alert("בחר קובץ");document.form1.thefaxfile.focus();return false;}
else
if(document.form1.tester.value=="Wrong"){alert("!! המערכת מאפשרת שליחת עד 500 פקסים בלבד בו זמנית");return false;}
else
if (!checkdatetime(what,OK)) return false;
else
if(document.form1.FaxTestOk.value=="0"){
alert("הינך חייב לבצע שליחת נסיון\n לצורך בדיקת מספר דפי הפקס");
return false;
}
else{
findt1('','FaxGroup','nonepic','1','Tools');
}}
function myclients(){
document.form1.target="clint";
document.form1.action="include/nums.asp";
document.form1.submit();}
function myclientsFax(){
document.form1.tester.value="";
document.form1.target="clint";
document.form1.action="include/numsFax.asp";
document.form1.submit();}
function myclients1(){
document.form1.target="clint";
document.form1.action="include/nums1.asp";
document.form1.submit();}