function doContactSubmit(){//alert();}
	fName=document.formContact.fnm.value;
	if (fName=="")
	 	{ msg="נא למלא שם פרטי";
		  alert(msg);
		  document.formContact.fnm.select();
		  return;}
	lName=document.formContact.lnm.value;
	if (lName=="")
	 	{ msg="נא למלא משפחה ";
		  alert(msg);
		  document.formContact.lnm.select();
		  return;}
	address=document.formContact.address.value;
	if (address=="")
	 	{ msg="נא למלא כתובת ";
		  alert(msg);
		  document.formContact.address.select();
		  return;}
	city=document.formContact.city.value;
	if (city=="")
	 	{ msg="נא למלא עיר";
		  alert(msg);
		  document.formContact.city.select();
		  return;}
	age=document.formContact.age.value;
	if (age=="")
	 	{ msg="נא למלא את גיל הילד";
		  alert(msg);
		  document.formContact.age.select();
		  return;}
	gender=document.formContact.gender.value;
	if (gender=="")
	 	{ msg="נא לבחור את מין הילד";
		  alert(msg);
		  document.formContact.gender.select();
		  return;}
	Email=document.formContact.eml.value;
	if ((Email=='דוא"ל')||(Email==''))
	 	{ msg= "נא למלא דוא''ל";
		  alert(msg);
		  document.formContact.eml.select();
		  return;}
	
	if ((Email.indexOf("@")<2) || (Email.lastIndexOf(".")<=(Email.indexOf("@")+2) || ((Email.length<8)) || (Email.charAt(0) == "-" || Email.charAt(0) == "_" || Email.charAt(0) == "@" || Email.charAt(0) == "-" || Email.charAt(0) == "_" || Email.charAt(0) == "."))) 
	  	{ msg= "נא למלא דוא''ל תקין";
		  alert(msg);
		  document.formContact.eml.select();
		  return;}
	pn=document.formContact.pn.value;
	if (pn=="")
	 	{ msg="נא למלא טלפון ";
		  alert(msg);
		  document.formContact.pn.select();
		  return;} 
	comments=document.formContact.comments.value;
	if (comments=='')
	 	{ msg= "נא למלא הודעה";
		  alert(msg);
		  document.formContact.comments.select();
		  return;}
	document.formContact.submit();
	//ClearContactForm();
	
}
function doGender(prm)
	{if (prm==1)
		document.formContact.gender.value='זכר';
	else if (prm==2)
		document.formContact.gender.value='נקבה';
	}
function doStorySubmit(){
	fName=document.formStory.flnm.value;
	if (fName=="")
	 	{ msg="נא למלא שם ";
		  alert(msg);
		  document.formStory.flnm.focus();
		  return;}
	content=document.formStory.content.value;
	if (content=="")
	 	{ msg="נא למלא סיפור ";
		  alert(msg);
		  document.formStory.content.focus();
		  return;}
	document.formStory.submit();
	//ClearContactForm();
	
}
function isMail(e){	
	var strCheck = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.@';
	var whichCode = (window.Event) ? e.which : e.keyCode;		
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) == -1 ) return false;
		else return true;
	}
}
function isNmbr(e){	
	var strCheck = '0123456789';
	var whichCode = (window.Event) ? e.which : e.keyCode;	
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) >-1 ) return  true;
		else return false;
	}
}
function isTel(e){	
	var strCheck = '0123456789.-';
	var whichCode = (window.Event) ? e.which : e.keyCode;	
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) >-1 ) return  true;
		else return false;
	}
}
var myWindow;
function newWindow(winWidth,winHeight,imgName,sb){
 if   (myWindow)
	  myWindow.close();
  myWindow=window.open(imgName,'mama','resizable=no,scrollbars='+sb+',width='+winWidth+',height ='+winHeight+',left='+(screen.width/2-winWidth/2)+',top='+(screen.height/2-winHeight/2)+'');
  myWindow.focus();
}
function setContenLength()
 {var s = new String(document.getElementById("content").value);
  document.getElementById("span1").innerHTML="נותרו "+(500-s.length)+" תוים";
  if (s.length>500)
	{document.getElementById("content").value=s.slice(1,501); 
	alert("הסיפור עד 500 תווים");
	}}
	
function getNextStoriesPage()
{
document.form1.pageNum.value=parseInt(document.form1.pageNum.value)+1;
document.form1.submit();}
function getPrevStoriesPage()
{
document.form1.pageNum.value=parseInt(document.form1.pageNum.value)-1;
document.form1.submit();}