var arr_kot = new Array();
var arr_texts = new Array();
var arr_pics = new Array();
var left_time = 0;
var right_time = 0; 
var right_c = 0;
var left_c = 0;
var total_pics;
var  total_pics_counter = 1;
var block_right_flag = 1;
var block_left_flag = 0;
var curr_gallery_height=298;
var show_gallery;
var hide_gallery;
var curr_pic = 1;
var next_pic = 2;
var prev_pic;
var hide_pic = 1;

function check_valid_email(str_email)
{
	var  ret_val = true;
	func_email = str_email;
	if(func_email.indexOf("@") < 2)
	{
	 ret_val=false
	}
	if(func_email.indexOf(".") == 1 || func_email.indexOf(".") == func_email.length)
	{
	 ret_val=false
	}
	return ret_val;
}


function valid_form(str_form)
{
 fname = document.getElementById("fname").value;
 email = document.getElementById("email").value;
 phone = document.getElementById("phone").value;
 email_stat = check_valid_email(email);
 if(fname == "" || phone == ""  || email == "")
	 {
		alert("יש למלא את כל הפרטים");
	 }	
 else
	 {
		if(email_stat == false)
			alert("יש למלא כתובת מייל תקינה ושם");
		else
			document.getElementById(str_form).submit();		
	 }	
}



function show_hide(str_obj)
{
	if(document.getElementById(str_obj).style.display=="")
		document.getElementById(str_obj).style.display="none";
	else
		document.getElementById(str_obj).style.display="";
}

function open_big_pic(pid)
{
	document.getElementById("pic_div").style.display="";
	document.getElementById("pic_div").innerHTML = pid;
	
}

function set_sep_back(s_id)
{
	var n_s_id = s_id + 1;
	document.getElementById("sep"+s_id).src = "images/menu/menu_sep.gif";
	document.getElementById("sep"+n_s_id).src = "images/menu/menu_sep.gif";
}


function set_sep(s_id)
{
	var n_s_id = s_id + 1;
	document.getElementById("sep"+s_id).src = "images/menu/menu_sep2.gif";
	document.getElementById("sep"+n_s_id).src = "images/menu/menu_sep2.gif";
}


function next_pic_gallery()
{
	hide_pic = 	curr_pic;
	curr_pic = curr_pic + 1;
	if(curr_pic > total_pics_counter)
		curr_pic = 1;
	show_pic_gallery();
}

function prev_pic_gallery()
{
	hide_pic = 	curr_pic;
	curr_pic = curr_pic - 1;
	if(curr_pic == 0)
		curr_pic = total_pics_counter - 1;
	show_pic_gallery();
}


function show_pic_gallery()
{
	document.getElementById("pic"+hide_pic).style.display = "none";
	document.getElementById("pic"+curr_pic).style.display = "";
}
