﻿function SendFriend(){
	if(document.getElementById("sf").style.display=="none"){
		document.getElementById("sf").style.display = "block";
		document.getElementById("sf").className = "hidden";
	} else {
		document.getElementById("sf").style.display = "none";
		document.getElementById("sf").className = "";
	}
}


function CheckRecipe(){
	var title=document.addrecipe.title.value;
	var info=document.addrecipe.info.value;
	var content=document.addrecipe.content.value;
	var materials=document.addrecipe.materials.value;
	var cat=document.addrecipe.cat.value;

	if(title!='' && info!='' && content!='' && materials!='' && cat!='')
		return (ture)
	else {
		alert("יש למלא את כל פרטי הטופס");
		return (false);
	}
}

function checkreg(form){
	var check=true;
	check=checkemail();
	check=checkusername();
	check=checkpass();
	return check;
}

function checkemail(){
	var email=document.registerform.email.value;
	call_ajax('emailStatus','../include/register.php','?func=email&v='+email);
}

function checkusername(){
	var username=document.registerform.username.value;
	call_ajax('usernameStatus','../include/register.php','?func=username&v='+username);
}

function checkpass(){
	var pass=document.registerform.password.value;
	call_ajax('passwordStatus','../include/register.php','?func=password&v='+pass);
}

function BookMark() {
	title = document.title;
	url = location.href;
	if (window.sidebar) {
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) {
		// IE Favorite
		window.external.AddFavorite( url, title);
	}
	else if(window.opera && window.print) {
		// Opera Hotlist
		return true;
	}
}

function BookMarkMain() {
	title = "מתכונים | Echef.co.il - העוזר האישי שלך במטבח";
	url = "http://www.echef.co.il/";
	if (window.sidebar) {
		// Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) {
		// IE Favorite
		window.external.AddFavorite( url, title);
	}
	else if(window.opera && window.print) {
		// Opera Hotlist
		return true;
	}
}

function CopyUrl() {
	holdurl.innerText = location.href;
	Copied = holdurl.createTextRange();
	Copied.execCommand("Copy");
	alert("הקישור הועתק בהצלחה.");
}

function changeimg(img){
	document.getElementById("rankshow").innerHTML="<img id=\"rankimg\" src=\""+img+"\" alt=\"\" usemap=\"#rank\" style=\"float:right;\" />";
}
