if(document.images){
	hp_but1a 		= new Image;
	hp_but1a.src 	= "images/tix_order/but_info.gif";
	hp_but1b 		= new Image;
	hp_but1b.src 	= "images/tix_order/but_info2.gif";
	hp_but2a 		= new Image;
	hp_but2a.src 	= "images/tix_order/but_for_the_all_family.gif";
	hp_but2b 		= new Image;
	hp_but2b.src 	= "images/tix_order/but_for_the_all_family2.gif";	

	tix_but1a 		= new Image;
	tix_but1a.src 	= "images/tix_order/but_inner_info.gif";
	tix_but1b 		= new Image;
	tix_but1b.src 	= "images/tix_order/but_inner_info2.gif";
	tix_but2a 		= new Image;
	tix_but2a.src 	= "images/tix_order/inner_but_for_the_whole_fam.gif";
	tix_but2b 		= new Image;
	tix_but2b.src 	= "images/tix_order/inner_but_for_the_whole_fa2.gif";		
	
	menu_but1a 		= new Image;
	menu_but1a.src 	= "images/pix.gif";	
	menu_but1b 		= new Image;
	menu_but1b.src 	= "images/menu/over1.gif";	

	menu_but2a 		= new Image;
	menu_but2a.src 	= "images/pix.gif";	
	menu_but2b 		= new Image;
	menu_but2b.src 	= "images/menu/over2.gif";
	
	menu_but3a 		= new Image;
	menu_but3a.src 	= "images/pix.gif";	
	menu_but3b 		= new Image;
	menu_but3b.src 	= "images/menu/over3.gif";	
	
	menu_but4a 		= new Image;
	menu_but4a.src 	= "images/pix.gif";	
	menu_but4b 		= new Image;
	menu_but4b.src 	= "images/menu/over4.gif";	
	
	menu_but5a 		= new Image;
	menu_but5a.src 	= "images/pix.gif";	
	menu_but5b 		= new Image;
	menu_but5b.src 	= "images/menu/over5.gif";		
	
	menu_but6a 		= new Image;
	menu_but6a.src 	= "images/pix.gif";	
	menu_but6b 		= new Image;
	menu_but6b.src 	= "images/menu/over6.gif";	
		
	menu_but7a 		= new Image;
	menu_but7a.src 	= "images/pix.gif";	
	menu_but7b 		= new Image;
	menu_but7b.src 	= "images/menu/over7.gif";	
	
	menub_but1a 		= new Image;
	menub_but1a.src 	= "images/pix.gif";	
	menub_but1b 		= new Image;
	menub_but1b.src 	= "images/menu2/over1.gif";	
		
	menub_but2a 		= new Image;
	menub_but2a.src 	= "images/pix.gif";	
	menub_but2b 		= new Image;
	menub_but2b.src 	= "images/menu2/over2.gif";	
	
	menub_but3a 		= new Image;
	menub_but3a.src 	= "images/pix.gif";	
	menub_but3b 		= new Image;
	menub_but3b.src 	= "images/menu2/over3.gif";	
		
	menub_but4a 		= new Image;
	menub_but4a.src 	= "images/pix.gif";	
	menub_but4b 		= new Image;
	menub_but4b.src 	= "images/menu2/over4.gif";	
	
	menuc_but1a 		= new Image;
	menuc_but1a.src 	= "images/pix.gif";	
	menuc_but1b 		= new Image;
	menuc_but1b.src 	= "images/menu3/over1.jpg";	
		
	menuc_but2a 		= new Image;
	menuc_but2a.src 	= "images/pix.gif";	
	menuc_but2b 		= new Image;
	menuc_but2b.src 	= "images/menu3/over2.jpg";	
	
	hp_gal1 		= new Image;
	hp_gal1.src 	= "images/hp_gal/clock2.jpg";		
	hp_gal2 		= new Image;
	hp_gal2.src 	= "images/hp_gal/clock1.jpg";		
	hp_gal3 		= new Image;
	hp_gal3.src 	= "images/hp_gal/clock3.jpg";	
	hp_gal4 		= new Image;
	hp_gal4.src 	= "images/hp_gal/1.jpg";		
	hp_gal5 		= new Image;
	hp_gal5.src 	= "images/hp_gal/2.jpg";		
	hp_gal6 		= new Image;
	hp_gal6.src 	= "images/hp_gal/3.jpg";		
	hp_gal7 		= new Image;
	hp_gal7.src 	= "images/hp_gal/4.jpg";		
	hp_gal8 		= new Image;
	hp_gal8.src 	= "images/hp_gal/5.jpg";		
	hp_gal9 		= new Image;
	hp_gal9.src 	= "images/hp_gal/6.jpg";		
	hp_gal10 		= new Image;
	hp_gal10.src 	= "images/hp_gal/7.jpg";		
}

	function changeImages(img_name, new_src)
	{
		if(document.images)
			document.images[img_name].src=eval(new_src+".src");
	}

	function validate(form_id,email) {
	   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
	   var address = document.forms[form_id].elements[email].value;
	   if(reg.test(address) == false) {
		  alert('כתובת אימייל אינה תקינה');
		  return false;
	   }
	   return true;
	}	
	function checkTixForm(){
		if(document.order_tix.fname.value==""){
			alert("חובה למלא את שמך");
			document.order_tix.fname.focus();
			return false;
		}
		if(document.order_tix.phone.value==""){
			alert("חובה למלא מספר טלפון");
			document.order_tix.phone.focus();
			return false;
		}
		if(!validate('order_tix','email')){
			document.order_tix.email.focus();
			return false;
		}		
		return true;
	}
	//viko: 
	function checkBookForm(){
		if(document.book_order.fname.value==""){
			alert("חובה למלא את שמך");
			document.order_tix.fname.focus();
			return false;
		}
		if(document.book_order.phone.value==""){
			alert("חובה למלא מספר טלפון");
			document.order_tix.phone.focus();
			return false;
		}
		if(!validate('book_order','email')){
			document.book_order.email.focus();
			return false;
		}		
		return true;
	}

	function checkContact(){
		if(document.formi.fname.value==""){
			alert("חובה למלא את שמך");
			document.formi.fname.focus();
			return false;
		}
		if(document.formi.phone.value=="" && document.formi.email.value==""){
			alert("חובה למלא מספר טלפון או אימייל לחזרה");
			document.formi.phone.focus();
			return false;
		}
		if(document.formi.email.value!="" && !validate('formi','email')){
			document.formi.email.focus();
			return false;
		}		
		return true;
	}	
	
	var hp_gal = 1;
	
	function hp_gallery(plus){
		
		if(hp_gal==10 && plus==1){
			hp_gal = 1;
		}
		else{
			if(hp_gal==1 && plus==-1){
				hp_gal = 10;
			}		
			else{
				hp_gal = hp_gal + plus;
			}
		}
		
		changeImages('hp_gal','hp_gal'+hp_gal);
	}
	
	
	function hp_func(num){
	switch(num){
		case 0:
			location="clocks.asp";
			break;
		case 1:
			location="the-robbery.asp";
			break;			
		case 2:
			location="press.asp";
			break;		
		case 3:
			location="info.asp";
			break;		
		case 4:
			location="en/";
			//alert("coming soon");
			break;					
	}
}