/************************************************************/
var ie=document.all;
var nn6=document.getElementById&&!document.all;
/************************************************************/
function show_flash(val){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="homepage" align="middle"> \n')
	document.write('<param name="allowScriptAccess" value="sameDomain" /> \n')
	document.write('<param name="movie" value="images/Lool.swf?hasRecipe='+val+'" /> \n')
	document.write('<param name="quality" value="best" /> \n')
	document.write('<param name="bgcolor" value="#ffffff" /> \n')
	document.write('<param name="flashvars" value="hasRecipe='+val+'" /> \n')
	document.write('<param name="wmode" value="transparent" /> \n')
	document.write('<embed src="images/Lool.swf?hasRecipe='+val+'" quality="high" bgcolor="#ffffff" flashvars="hasRecipe='+val+'" wmode="transparent" width="800" height="600" name="homepage" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n')
	document.write('</object> \n')
}
function show_flash_NIZAN(val){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="homepage" align="middle"> \n')
	document.write('<param name="allowScriptAccess" value="sameDomain" /> \n')
	document.write('<param name="movie" value="images/Lool2.swf?hasRecipe='+val+'" /> \n')
	document.write('<param name="quality" value="best" /> \n')
	document.write('<param name="bgcolor" value="#ffffff" /> \n')
	document.write('<param name="flashvars" value="hasRecipe='+val+'" /> \n')
	document.write('<param name="wmode" value="transparent" /> \n')
	document.write('<embed src="images/Lool2.swf?hasRecipe='+val+'" quality="high" bgcolor="#ffffff" flashvars="hasRecipe='+val+'" wmode="transparent" width="800" height="600" name="homepage" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n')
	document.write('</object> \n')
}
function show_flash_test(val){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="homepage" align="middle"> \n')
	document.write('<param name="allowScriptAccess" value="sameDomain" /> \n')
	document.write('<param name="movie" value="images/Lool1.swf?hasRecipe='+val+'" /> \n')
	document.write('<param name="quality" value="best" /> \n')
	document.write('<param name="bgcolor" value="#ffffff" /> \n')
	document.write('<param name="flashvars" value="hasRecipe='+val+'" /> \n')
	document.write('<param name="wmode" value="transparent" /> \n')
	document.write('<embed src="images/Lool1.swf?hasRecipe='+val+'" quality="high" bgcolor="#ffffff" flashvars="hasRecipe='+val+'" wmode="transparent" width="800" height="600" name="homepage" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n')
	document.write('</object> \n')
}
function show_recipe_book(){
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="600" id="recipe_book" align="middle"> \n')
	document.write('<param name="allowScriptAccess" value="sameDomain" /> \n')
	document.write('<param name="movie" value="images/recipe_book.swf" /> \n')
	document.write('<param name="quality" value="best" /> \n')
	document.write('<param name="bgcolor" value="#ffffff" /> \n')
	document.write('<param name="wmode" value="transparent" /> \n')
	document.write('<embed src="images/recipe_book.swf" quality="high" bgcolor="#ffffff" wmode="transparent" width="800" height="600" name="recipe_book" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n')
	document.write('</object> \n')
}
function call_from_flash(call_to){
	switch(call_to){
		case "tasty":		document.getElementById("innerFrame").src = 'tasty.asp';
							break;
		case "nutrition":	document.getElementById("innerFrame").src = 'dietitian.asp';
							break;
		case "recipe":		document.getElementById("innerFrame").src = 'recipe.asp';
							break;
		case "home":		document.getElementById("innerFrame").src = 'home.html';
							break;
	}
}
/* ------------------------------------------------------- */
function check_email_field(email){
      var strValue = email;
      var objRegExp = /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{2})(\.[a-z]{2})*$)/i
      //check for valid email
      if(objRegExp.test(strValue)){
            return true;
      }else{
            return false;
      }
}
function echeck(str) {
	var hebStr="אבגדהוזחטיכלמנסעפצקרשת";
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   return false
	}
	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
	 }
	 for (i=0;i<hebStr.length;i++){
		 if (str.indexOf(hebStr.substring(i,i+1))!=-1){
		    return false
		 }
	 }
	 return true					
}

function CheckValue(){
	if(document.getElementById("txtFname").value=="")
		{
			alert("חובה להקליד שם פרטי");
			document.getElementById("txtFname").focus();
			return;	
		}
	if(document.getElementById("txtLname").value=="")
		{
			alert("חובה להקליד שם משפחה");
			document.getElementById("txtLname").focus();
			return;	
		}	
	if(document.getElementById("txtEmail").value==""){
				alert("חובה להקליד כתובת דואר אלקטרוני");
				document.getElementById("txtEmail").focus();
				return false;
			}	
	if(!echeck(document.getElementById("txtEmail").value)){
				alert("כתובת הדואר האךקטרוני אינה נכונה");
				document.getElementById("txtEmail").focus();
				return false;
			}	
	document.FrmUserDetails.submit();	
				
}
function Vote(NumVote){
	alert(NumVote)
}

function getQueryVariable(variable) {
  	var query = window.location.search.substring(1);
  	var vars = query.split("&");
  	for (var i=0;i<vars.length;i++) {
    	var pair = vars[i].split("=");
    	if (pair[0] == variable) {
      		return pair[1];
    	}
  	} 
}

