

Pic1a = new Image;
Pic1b = new Image;
Pic2a = new Image;
Pic2b = new Image;
Pic3a = new Image;
Pic3b = new Image;
Pic4a = new Image;
Pic4b = new Image;
Pic5a = new Image;
Pic5b = new Image;
Pic6a = new Image;
Pic6b = new Image;

Pic1a.src = "images/images_07.gif";
Pic1b.src = "images/images_07-A.gif";
Pic2a.src = "images/images_08.gif";
Pic2b.src = "images/images_08-A.gif";
Pic3a.src = "images/images_09.gif";
Pic3b.src = "images/images_09-A.gif";
Pic4a.src = "images/images_10.gif";
Pic4b.src = "images/images_10-A.gif";
Pic5a.src = "images/images_11.gif";
Pic5b.src = "images/images_11-A.gif";
Pic6a.src = "images/images_12.gif";
Pic6b.src = "images/images_12-A.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 getSecs() 
{ 
        var mySecs = initStopwatch(); 
        var mySecs1 = ""+mySecs; 
        mySecs1= mySecs1.substring(0,mySecs1.indexOf("."));
        myMinutes=0.1

        mySecs1=myMinutes - mySecs1
        window.setTimeout('getSecs()',2000);
				
        if (mySecs1<=0) 
        {window.close();}
}
function findt1(id,outer,inner,lft,where)
{
	document.form1.id.value=id;
	document.form1.newval.value=outer;
	document.form1.valCat.value=inner;
	document.form1.leftS.value=lft;
	document.form1.action=where+".php";
	document.form1.submit();
}
function changeMe(id,outer,inner,lft)
{
	document.form1.id.value=id;
	document.form1.newval.value=outer;
	document.form1.page.value=inner;
	document.form1.leftS.value=lft;
	document.form1.submit();
}
function Change(pg,the,where)
{
	document.form1.id.value=pg;
	document.form1.newval.value=the;
	document.form1.method="POST";
	document.form1.action=where+".php";
	document.form1.submit();
}
function Refresh()
{
document.form1.newval.value="mysal";
document.form1.action="index.php";document.form1.submit();
}
function sending(thecost,totals) {
document.form1.total2.value=eval(totals)+eval(thecost)+" ₪" ;}
function delsal()
{
document.form1.act.value="cancel";
document.form1.newval.value="mysal";document.form1.leftS.value="Gen";
document.form1.action="index.php";
document.form1.submit();
}
function addtosal(id,kamut,price,what)
{
document.form1.myid.value=id;
document.form1.kamut.value=kamut;
document.form1.prices.value=price;document.form1.newval.value="mysal";
document.form1.leftS.value=what;document.form1.method="POST";
document.form1.action="index.php";document.form1.submit();
}
function chng(num,num1){
document.form1.price.value=num;
if(num1!=""){document.form1.price1.value=num1;}
}
function searches(the,where)
{
	if (document.form1.searchtxt.value==""){alert("אנא הקלד מילת חיפוש או חלק ממנה");document.form1.searchtxt.focus();}
	else
	if (document.form1.searchtxt.value.length<=1){alert("מילת החיפוש צריכה להיות יותר מאות אחת");document.form1.searchtxt.focus();}
	else{
	document.form1.newval.value=the;
	document.form1.action=where+".php";
	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+".php";
	document.form1.submit();
}
function lot(where,the,ct,num)
{
	window.open(where+".php?id="+the+"&link="+ct+"&num="+num,'','resizable=1,scrollbars=1,menubar=1');
}
function sendto(){
//var arr = showModalDialog("alert?3", "", "font-size:24; dialogWidth:16em; dialogHeight:9em");
//  if (arr == null)  return false;
document.form1.method="Post";
document.form1.action='https://www.medialand.co.il/florist/index.php';
document.form1.submit();
}
function openwin(strs,ids,w,h){
var mynewwind=window.open(strs+"?pic="+ids,'mynewwind','width='+w+',height='+h+',top=100,left=300,resizable=no scrollbars=no toolbar=no channelmode=no fullscreen=no');}function changeL(what){
window.top.location=what+".php";}
var confirmMsg  = 'Do you want ';
function gets(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 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 sendAct(what,OK){
if (document.form1.txtbox1.value=="")
	{document.form1.txtbox1.focus();
	alert("הקלד את ההודעה");}
else	
if (document.form1.thedate.value=="" || !stringFilter(document.form1.thedate,"1234567890/"))
	{document.form1.thedate.focus();
	alert("הקלד תאריך בפורמט 00/00/0000");}
else	
if (document.form1.thetime.value=="")
	{document.form1.thetime.focus();
	alert("הקלד שעה");}	
else	
if (document.form1.Category.value=="none")
	{document.form1.Category.focus();
	alert("בחר קטגוריה");}	
else
{document.form1.newval.value=what;
	document.form1.method="POST";
	document.form1.leftS.value=OK;
	document.form1.action="index.php";
	document.form1.submit();}
}
	

function newmem(getto,what){
//var at=document.form1.email.value.indexOf("@");
//var dot=document.form1.email.value.indexOf(".");
if (document.form1.lname.value=="")
	{document.form1.lname.focus();
	alert("הקלד שם משפחה");}
else	
if (document.form1.fname.value=="")
	{document.form1.fname.focus();
	alert("הקלד שם פרטי");}
else	
if (document.form1.birth.value!="" && !stringFilter(document.form1.birth,"1234567890/") && (document.form1.birth.value.length<10 || document.form1.birth.value.length>10))
	{document.form1.birth.focus();
	alert("תאריך הלידה אינו נכון 00/00/0000");}
else	
if (document.form1.address.value=="")
	{document.form1.address.focus();
	alert("הקלד כתובת");}	
else	
if (document.form1.city.value=="")
	{document.form1.city.focus();
	alert("הקלד עיר");}		
else	
if (document.form1.phone.value=="" || !stringFilter(document.form1.phone,"1234567890-"))
	{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.username.value==""){
	alert("נא לבחור שם משתמש");
	document.form1.username.focus();}
else	
if(document.form1.password.value==""){
	alert("נא בחר סיסמא");
	document.form1.password.focus();}	
else
{document.form1.newval.value=getto;
	document.form1.leftS.value=what;
	document.form1.method="POST";
	document.form1.action="index.php";
	document.form1.submit();}
}
function CheckMem(what){
if (document.form1.userM.value=="")
	{document.form1.userM.focus();
	alert("נא הקלד שם משתמש");}	
else
if (document.form1.passM.value=="")
	{document.form1.passM.focus();
	alert("נא הקלד סיסמא");}	
else
{document.form1.newval.value=what;
	document.form1.action="index.php";
	document.form1.method="POST";
	document.form1.submit();}	
}
function send(where,to,ok){
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.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.newval.value=where;
document.form1.valCat.value=to;
document.form1.leftS.value=ok;
document.form1.method="POST";
document.form1.action="index.php";
document.form1.submit();}
}
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 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 hourtime(whereto)
{
document.form1.txt.value = document.all.dynamsg1.html;
if (document.form1.compN.value=="0")
{alert("Select Company Name");	
document.form1.compN.focus();
}else
if (document.form1.proj_name.value=="0")
{alert("Select Project Name");	
document.form1.proj_name.focus();
}else
if (document.form1.dates.value=="" || !stringFilter(document.form1.dates,"1234567890/-"))
{alert("Fill Legal Date ex. 00/00/0000");	
document.form1.dates.focus();
}else
if (document.form1.dates.value.length<8 || document.form1.dates.value.length>10)
{alert("Fill Legal Date ex. 00/00/0000");	
document.form1.dates.focus();
}else
if (document.form1.stimes.value=="" || !stringFilter(document.form1.stimes,"1234567890:"))
{alert("Fill Legal Start Time - ex. 00:00");	
document.form1.stimes.focus();
}else
if (document.form1.stimes.value.length>5)
{alert("Fill Legal Start Time - ex. 00:00");	
document.form1.stimes.focus();
}else
if (document.form1.etimes.value=="" || !stringFilter(document.form1.etimes,"1234567890:")) 
{alert("Fill Legal End Time - ex. 00:00");	
document.form1.etimes.focus();
}else
if (document.form1.etimes.value.length>5)
{alert("Fill Legal End Time - ex. 00:00");	
document.form1.etimes.focus();
}else
if (document.form1.stimes.value==document.form1.etimes.value)
{alert("Attention! the Start Time and the End Time are Equal");	
document.form1.etimes.focus();
}else
if (document.form1.txt.value=="<DIV dir=rtl></DIV>")
{alert("Fill Work Description");}			
else
{document.form1.act.value=whereto;
document.form1.submit();}	
}
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 clean(){
document.form1.reset();
}
function SubmitMe(pagenum,id,num){
document.FORM2.txtPage.value=pagenum;
document.FORM2.id.value=id;
document.FORM2.leftS.value=num
document.FORM2.submit();
}
