var thumbnailviewer2={
enableTitle: false, //Should "title" attribute of link be used as description?
enableTransition: true, //Enable fading transition in IE?
hideimgmouseout: false, //Hide enlarged image when mouse moves out of anchor link? (if enlarged image is hyperlinked, always set to false!)

iefilterstring: 'progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)', //IE specific multimedia filter string
iefiltercapable: document.compatMode && window.createPopup? true : false, //Detect browser support for IE filters
preloadedimages:[], //array to preload enlarged images (ones set to display "onmouseover"
targetlinks:[], //array to hold participating links (those with rel="enlargeimage:initType")
alreadyrunflag: false, //flag to indicate whether init() function has been run already come window.onload

loadimage:function(linkobj){
var imagepath=linkobj.getAttribute("href") //Get URL to enlarged image
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in
var dest=linkobj.getAttribute("rev").split("::")[1] //Get URL enlarged image should be linked to, if any
var description=(thumbnailviewer2.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : "" //Get title attr
var imageHTML='<img src="'+imagepath+'" style="border-width: 0" />' //Construct HTML for enlarged image
if (typeof dest!="undefined") //Hyperlink the enlarged image?
imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'
if (description!="") //Use title attr of the link as description?
imageHTML+='<br />'+description
if (this.iefiltercapable){ //Is this an IE browser that supports filters?
showcontainer.style.filter=this.iefilterstring
showcontainer.filters[0].Apply()
}
showcontainer.innerHTML=imageHTML
this.featureImage=showcontainer.getElementsByTagName("img")[0] //Reference enlarged image itself
this.featureImage.onload=function(){ //When enlarged image has completely loaded
if (thumbnailviewer2.iefiltercapable) //Is this an IE browser that supports filters?
showcontainer.filters[0].Play()
}
this.featureImage.onerror=function(){ //If an error has occurred while loading the image to show
if (thumbnailviewer2.iefiltercapable) //Is this an IE browser that supports filters?
showcontainer.filters[0].Stop()
}
},

hideimage:function(linkobj){
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in
showcontainer.innerHTML=""
},


cleanup:function(){ //Clean up routine on page unload
if (this.featureImage){this.featureImage.onload=null; this.featureImage.onerror=null; this.featureImage=null}
this.showcontainer=null
for (var i=0; i<this.targetlinks.length; i++){
this.targetlinks[i].onclick=null
this.targetlinks[i].onmouseover=null
this.targetlinks[i].onmouseout=null
}
},

addEvent:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},

init:function(){ //Initialize thumbnail viewer script
this.iefiltercapable=(this.iefiltercapable && this.enableTransition) //True or false: IE filters supported and is enabled by user
var pagelinks=document.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){ //BEGIN FOR LOOP
if (pagelinks[i].getAttribute("rel") && /enlargeimage:/i.test(pagelinks[i].getAttribute("rel"))){ //Begin if statement: Test for rel="enlargeimage"
var initType=pagelinks[i].getAttribute("rel").split("::")[1] //Get display type of enlarged image ("click" or "mouseover")
if (initType=="mouseover"){ //If type is "mouseover", preload the enlarged image for quicker display
this.preloadedimages[this.preloadedimages.length]=new Image()
this.preloadedimages[this.preloadedimages.length-1].src=pagelinks[i].href
pagelinks[i]["onclick"]=function(){ //Cancel default click action
return false
}
}
pagelinks[i]["on"+initType]=function(){ //Load enlarged image based on the specified display type (event)
thumbnailviewer2.loadimage(this) //Load image
return false
}
if (this.hideimgmouseout)
pagelinks[i]["onmouseout"]=function(){
thumbnailviewer2.hideimage(this)
}
this.targetlinks[this.targetlinks.length]=pagelinks[i] //store reference to target link
} //end if statement
} //END FOR LOOP


} //END init() function

}


if (document.addEventListener) //Take advantage of "DOMContentLoaded" event in select Mozilla/ Opera browsers for faster init
thumbnailviewer2.addEvent(document, function(){thumbnailviewer2.alreadyrunflag=1; thumbnailviewer2.init()}, "DOMContentLoaded") //Initialize script on page load
else if (document.all && document.getElementsByTagName("a").length>0){ //Take advantage of "defer" attr inside SCRIPT tag in IE for instant init
thumbnailviewer2.alreadyrunflag=1
thumbnailviewer2.init()
}
thumbnailviewer2.addEvent(window, function(){if (!thumbnailviewer2.alreadyrunflag) thumbnailviewer2.init()}, "load") //Default init method: window.onload
thumbnailviewer2.addEvent(window, function(){thumbnailviewer2.cleanup()}, "unload")



//sabalist - add list
function doSubmit1()
{
	document.getElementById('error').style.display='none';

	var submitForm=true;
	var itemname=document.formi.iname.value;
    var seller_phone=document.formi.seller_phone.value;
    var seller_location=document.formi.seller_location.value;

	if (itemname=="" || seller_phone=="" || seller_location=="")
	{
		document.getElementById('error').style.display='';
		document.formi.iname.focus()
		submitForm= false;
	}

	if (submitForm==true)
	{
		document.formi.submit();
	}

}

function doSubmit2()
{
	document.getElementById('error').style.display='none';

	var submitForm=true;
	var itemname=document.formi.iname.value;
    var seller_phone=document.formi.seller_phone.value;
    var seller_location=document.formi.seller_location.value;

	if (itemname=="" || seller_phone=="" || seller_location=="")
	{
		document.getElementById('error').style.display='';
		document.formi.iname.focus()
		submitForm= false;
	}

	if (submitForm==true)
	{
		document.formi.submit();
	}

}

//step 1 mail list form

              function doSubmit3()
              {
              	document.getElementById('error123').style.display='none';

              	var submitForm22=true;
                var email=document.formadd.email.value;
              	if (email=="" || email=="הקש כתובת דוא''ל" || email.length<6)
              	{
              		document.getElementById('error123').style.display='';
              		document.formadd.email.focus()
              		submitForm22= false;
              	}

              	if (submitForm22==true)
              	{
              		document.formadd.submit();
              	}

              }

//step 2 mail list form

              function doSubmit4()
              {
              	document.getElementById('error123').style.display='none';

              	var submitForm=true;
                var fname=document.formadd.fname.value;
                var lname=document.formadd.lname.value;
                var address=document.formadd.address_city.value;
              	if (fname=="" || lname=="" || address=="")
              	{
              		document.getElementById('error123').style.display='';
              		document.formadd.fname.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.formadd.submit();
              	}

              }


//contact us form

              function doSubmit5()
              {
              	document.getElementById('error122').style.display='none';

              	var submitForm=true;
                var fname=document.formadd2.fname.value;
                var lname=document.formadd2.lname.value;
			    var email=document.formadd2.email.value;
              	if (fname=="" || lname=="" || email=="")
              	{
              		document.getElementById('error122').style.display='';
              		document.formadd2.fname.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.formadd2.submit();
              	}

              }

//kanyon form

              function doSubmit05()
              {
              	document.getElementById('error122').style.display='none';

              	var submitForm=true;
                var fname=document.formadd2.fname.value;
                var lname=document.formadd2.lname.value;
			    var email=document.formadd2.email.value;
				var phone=document.formadd2.cellphone.value;
              	if (fname=="" || lname=="" || email=="" || phone=="")
              	{
              		document.getElementById('error122').style.display='';
              		document.formadd2.fname.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.formadd2.submit();
              	}

              }

//upload article form

              function doSubmit6()
              {
              	document.getElementById('error122').style.display='none';

              	var submitForm=true;
                var fname=document.formadd2.fname.value;
                var fullname=document.formadd2.fullname.value;
              	if (fname=="" || fullname=="")
              	{
              		document.getElementById('error122').style.display='';
              		document.formadd2.fname.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.formadd2.submit();
              	}

              }


//join new user form

              function doSubmit7()
              {
              	document.getElementById('error111').style.display='none';
              	document.getElementById('error222').style.display='none';
              	document.getElementById('error333').style.display='none';
              	document.getElementById('error444').style.display='none';
              	document.getElementById('error555').style.display='none';
              	document.getElementById('error666').style.display='none';

              	var submitForm=true;
                var fname=document.MyForm.fname.value;
                var phone=document.MyForm.phone.value;
                var email=document.MyForm.email.value;
                var user=document.MyForm.user.value;
                var user_ok=document.MyForm.user_ok.value;
                var pass1=document.MyForm.pass1.value;
                var pass2=document.MyForm.pass2.value;


              	if (fname=="" || phone=="" || email=="" || user=="" || pass1=="" || pass2=="")
              	{
              		document.getElementById('error111').style.display='';
              		document.MyForm.fname.focus()
              		submitForm= false;
              	}
				else
				{
					if (user.indexOf(" ")>0) 
					{
	              		document.getElementById('error555').style.display='';
	              		document.MyForm.user.focus()
	              		submitForm= false;
					}
					else
					{
						if (user.length<5)
						{
				              	document.getElementById('error555').style.display='';
			              		document.MyForm.user.focus()
			              		submitForm= false;
						}
						else
						{
			              	if (pass1.length<5 || pass2.length<5)
			              	{
			              		document.getElementById('error444').style.display='';
			              		document.MyForm.pass1.focus()
			              		submitForm= false;
			              	}
							else
							{
								if (pass1!=pass2)
								{
				              		document.getElementById('error333').style.display='';
				              		document.MyForm.pass1.focus()
				              		submitForm= false;					
								}
							}
						}
					}


					if (email.length>0 && (email.indexOf('@', 0) == -1 || email.indexOf('.', 0) == -1))
					{
						document.getElementById('error222').style.display='';		
						document.MyForm.email.focus();
						submitForm= false;
					}

	              	if (user_ok=="")
	              	{
	              		document.getElementById('error666').style.display='';
	              		document.MyForm.user.focus()
	              		submitForm= false;
	              	}


				}



              	if (submitForm==true)
              	{
              		document.MyForm.submit();
              	}

              }


function checkusername()
{
				submitForm=true;
              	document.getElementById('error555').style.display='none';
                var user=document.MyForm.user.value;

		if (user.indexOf(" ")>0) 
		{
              		document.getElementById('error555').style.display='';
              		document.MyForm.user.focus()
              		submitForm= false;
		}
		else
		{
			if (user.length<5)
			{
	              	document.getElementById('error555').style.display='';
              		document.MyForm.user.focus()
              		submitForm= false;
			}
		}


              	if (submitForm==true)
              	{
              		xmlhttpPost('join.asp?Action=checkusername', 'MyForm', 'MyResult', '<img src=\'pleasewait.gif\'>'); 
				
					y=setTimeout('confirmuser()',1000);
					return false;


              	}

}


function confirmuser(){
	if (document.getElementById('MyResult').innerHTML=="שם המשתמש פנוי לרישום") { 
		document.MyForm.user_ok.value=document.MyForm.user.value;

	 } else  { document.MyForm.user_ok.value=''; } 
	clearTimeout(y);
}

function markV(txt,vimg)
{
	if (txt.length>=5) { document.getElementById(vimg).style.display=''; } else { document.getElementById(vimg).style.display='none'; }
}

function delV(txt,vimg)
{
	if (txt.length<5) {document.getElementById(vimg).style.display='none';}
}

function checkIfNumeric()
{
	if((window.event.keyCode<48 || window.event.keyCode>57) && window.event.keyCode!=45)
		window.event.returnValue=null;
}


//login form

              function doSubmit10()
              {
              	document.getElementById('error111').style.display='none';

              	var submitForm=true;
                var user=document.Login.user.value;
                var pass=document.Login.pass.value;

              	if (user=="" || pass=="")
              	{
              		document.getElementById('error111').style.display='';
              		document.Login.user.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.Login.submit();
              	}

              }


//add reminder form

              function doSubmit11()
              {
              	document.getElementById('error111').style.display='none';

              	var submitForm=true;
                var datein=document.MyForm.datein.value;
                var title=document.MyForm.title.value;

              	if (title=="" || datein=="")
              	{
              		document.getElementById('error111').style.display='';
              		document.MyForm.title.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.MyForm.submit();
              	}

              }

//add gallery form

              function doSubmit12()
              {
              	document.getElementById('error111').style.display='none';

              	var submitForm=true;
                var title=document.MyForm.title.value;

              	if (title=="")
              	{
              		document.getElementById('error111').style.display='';
              		document.MyForm.title.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.MyForm.submit();
              	}

              }

//add reminder form

              function doSubmit13()
              {
              	document.getElementById('error111').style.display='none';

              	var submitForm=true;
                var desc=document.MyForm.main_text.value;
                var title=document.MyForm.title.value;

              	if (title=="" || desc=="")
              	{
              		document.getElementById('error111').style.display='';
              		document.MyForm.title.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.MyForm.submit();
              	}

              }


function submitwithenter(e){
	if(e){
	e = e 
	} else {
	e = window.event
	} 
	
	if(e.which){ 
	var keycode = e.which
	} else {
	var keycode = e.keyCode 
	}

	if(keycode == 13) {
		document.Login.submit();
	}

}

// change details from my.asp

              function doSubmit8()
              {
              	document.getElementById('error111').style.display='none';


              	var submitForm=true;
                var fname=document.MyForm.fname.value;
                var phone=document.MyForm.phone.value;

              	if (fname=="" || phone=="")
              	{
              		document.getElementById('error111').style.display='';
              		document.MyForm.fname.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.MyForm.submit();
              	}

		 	 }


              function doSubmit9()
              {
              	document.getElementById('error222').style.display='none';
              	document.getElementById('error333').style.display='none';

              	var submitForm=true;
                var pass1=document.MyForm2.pass1.value;
                var pass2=document.MyForm2.pass2.value;

              	if (pass1=="" || pass2=="")
              	{
              		document.getElementById('error333').style.display='';
              		document.MyForm2.pass1.focus()
              		submitForm= false;
              	}
				else
				{
	              	if (pass1.length<5 || pass2.length<5)
	              	{
	              		document.getElementById('error333').style.display='';
	              		document.MyForm2.pass1.focus()
	              		submitForm= false;
	              	}
					else
					{
						if (pass1!=pass2)
						{
		              		document.getElementById('error222').style.display='';
		              		document.MyForm2.pass1.focus()
		              		submitForm= false;					
						}
					}
				}

              	if (submitForm==true)
              	{
              		document.MyForm2.submit();
              	}

		 	 }


//Lifebooks order form

              function doSubmit14()
              {
              	document.getElementById('error111o').style.display='none';

              	var submitForm=true;
                var phone=document.form1order.textfield2.value;
                var fullname=document.form1order.textfield.value;
              	if (phone=="" || fullname=="")
              	{
              		document.getElementById('error111o').style.display='';
              		document.form1order.textfield.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.form1order.submit();
              	}

              }



//Katava Pirsumit Form1

              function doSubmit15()
              {
              	document.getElementById('error123').style.display='none';

              	var submitForm=true;
                var fname=document.formadd1.fname.value;
                var phone=document.formadd1.phone.value;
                var email=document.formadd1.email.value;
              	if (fname=="" || phone=="" || email=="")
              	{
              		document.getElementById('error123').style.display='';
              		document.formadd1.fname.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.formadd1.submit();
              	}

              }


//Katava Pirsumit Form2

              function doSubmit16()
              {
              	document.getElementById('error122').style.display='none';

              	var submitForm=true;
                var fname=document.formadd2.fname.value;
                var phone=document.formadd2.phone.value;
                var email=document.formadd2.email.value;
              	if (fname=="" || phone=="" || email=="")
              	{
              		document.getElementById('error122').style.display='';
              		document.formadd2.fname.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.formadd2.submit();
              	}

              }


//Life books add form

              function doSubmit17()
              {
              	document.getElementById('error_add_1').style.display='none';
              	document.getElementById('error_add_2').style.display='none';

              	var submitForm=true;
                var fname=document.form1.fname.value;
                var phone=document.form1.phone1.value;
                var email=document.form1.email.value;
              	if (fname=="" || phone=="" || email=="")
              	{
              		document.getElementById('error_add_1').style.display='';
              		document.form1.fname.focus()
              		submitForm= false;
              	}
                var book_name=document.form1.book_name.value;
                var book_pub=document.form1.book_pub.value;
                var pic=document.form1.pic.value;
                var book_price=document.form1.book_price.value;
                var book_author=document.form1.book_author.value;
                var book_desc=document.form1.book_desc.value;
              	if (book_name=="" || book_pub=="" || pic=="" || book_price=="" || book_author=="" || book_desc=="")
              	{
              		document.getElementById('error_add_2').style.display='';
              		document.form1.book_name.focus()
              		submitForm= false;
              	}

              	if (submitForm==true)
              	{
              		document.form1.submit();
              	}

              }



<!--
//function clickIE4(){if (event.button==2){return false;}}
//function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){return false;}}}
//if(document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}
//else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}
//document.oncontextmenu=new Function("return false");
//document.onselectstart=new Function("return false");
//document.onkeydown = function(){if(event.ctrlKey)return false;}
//-->



//for image banner at index page
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_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_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];}
}




//for teleprompter
function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//for fast contact form in search results
              function doSubmit18(eid)
              {
              	document.getElementById('error123_'+eid).style.display='none';
              	var submitForm=true;
                var email=eval('document.formsend'+eid+'.email'+eid+'.value;');
                var phone=document.getElementById('phone'+eid).value;
				alert(email);
              	if (email=="" || phone=="")
              	{
              		document.getElementById('error123_'+eid).style.display='';
              		submitForm= false;				
              	}

              	if (submitForm==true)
              	{
                	document.getElementById('formsend'+eid).submit();
              	}

              }
