var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


var curr_gal = 0;

function echeck(str) {

	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		return false
	}

	if (str.indexOf(at,(lat+1))!=-1){
		return false
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		return false
	}

	if (str.indexOf(dot,(lat+2))==-1){
		return false
	}

	if (str.indexOf(" ")!=-1){
		return false
	}
	return true;					
}

function CheckData1(){
	el = document.newdoc.fname;
	if (el.value=='' )
	{
		alert ('נא לציין שם מלא');
		document.newdoc.fname.focus();
		return false;

	} 
	el = document.newdoc.email;
	if (el.value=='' )
	{
		alert ('נא לציין כתובת דואל');
		document.newdoc.email.focus();
		return false;

	} 
	el = document.newdoc.email;
	if (echeck(el.value)==false){
		alert("כתובת הדואל לא חוקית")
		document.newdoc.email.focus();
		return false;
	}
	
	document.newdoc.action="SendMail1.asp";
	return true;
}
function CheckData(){
	el = document.newsLetterForm.Fullname;
	if (el.value=='' )
	{
		alert ('נא לציין שם מלא');
		document.newsLetterForm.Fullname.focus();
		return false;

	} 
	el = document.newsLetterForm.EmailAddress;
	if (el.value=='' )
	{
		alert ('נא לציין כתובת דואל');
		document.newsLetterForm.EmailAddress.focus();
		return false;

	} 
	el = document.newsLetterForm.EmailAddress;
	if (echeck(el.value)==false){
		alert("כתובת הדואל לא חוקית")
		document.newsLetterForm.EmailAddress.focus();
		return false;
	}
	
	document.newsLetterForm.action="SendMail.asp?nletter=ok";
	return true;
}




function hide_div_gal()
{
 document.getElementById("big_pic_div").style.display = "none";
}



function show_pic_div_gal(strpic,fun_ind)
{
 curr_gal =  fun_ind ;
document.getElementById("big_pic").innerHTML = strpic;
document.getElementById("big_pic_div").style.top = document.body.scrollTop + 50;
document.getElementById("big_pic_div").style.left = ((document.body.clientWidth - 450) / 2);
document.getElementById("big_pic_div").style.display = '';

}


function next_gal_pic()
{
if(curr_gal == gal_ind)
	curr_gal = 0;
else
	curr_gal = curr_gal + 1;
document.getElementById("big_pic").innerHTML = pic_gal_arr[curr_gal];
}

function prev_gal_pic()
{
if(curr_gal == 0)
	curr_gal = gal_ind;
else
	curr_gal = curr_gal -1;
document.getElementById("big_pic").innerHTML = pic_gal_arr[curr_gal];
}



function change_class(c_id,to_id)
{
 curr_a= document.getElementById("menu"+c_id)
	 if (to_id==1)
	 {
		curr_a.className = "smenuhome";
	 }
	 else
	{
		 curr_a.className = "smenu";
	}
}
