function change_select_option(val){
	if(val=='da'){
		document.getElementById('search_cat').disabled=true;
		}
	else{
		document.getElementById('search_cat').disabled=false;
		}
	}
function show_details(nume_id){
	if (document.getElementById(nume_id).style.display=='block'){
	
		document.getElementById(nume_id).style.display='none';
	
	}
	else{
	
		document.getElementById(nume_id).style.display='block';
	
	}

}

//topuri
function arata_topuri(id_unu,id_doi){
						
	var titlu_top='title_'+id_unu;
	document.getElementById(id_unu).style.display='block';
	document.getElementById(titlu_top).style.backgroundImage='url(./pictures/bg_top.gif)';
	document.getElementById(titlu_top).style.backgroundColor='#ffffff';
	document.getElementById(titlu_top).style.top='-36px';
	
	
	var titlu_top='title_'+id_doi;
	document.getElementById(id_doi).style.display='none';
	document.getElementById(titlu_top).style.backgroundImage='url()';
	document.getElementById(titlu_top).style.backgroundColor='#ececec';
	document.getElementById(titlu_top).style.top='-37px';

}
//---



///ajax verifica camp
var xmlHttp
var id_camp_err;
function verificaCamp(valoare_camp,nume_camp,id_camp_eroare){
	id_camp_err=id_camp_eroare;
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
		{
		alert ("Browser does not support HTTP Request")
		return
		} 
	
	url='verifica_campuri.php?camp_n='+nume_camp+'&camp_v='+valoare_camp;
	xmlHttp.onreadystatechange=insertError;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null);
}
function insertError() 
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		document.getElementById(id_camp_err).innerHTML=xmlHttp.responseText 
	
	} 
} 
//---

// ajax include 

function show_form(url)
	{
	if (url.length==0)
		{ 
		document.getElementById("txtHint").innerHTML="";
		return
		}
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
		{
		alert ("Browser does not support HTTP Request")
		return
		} 
	
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	} 
	

function stateChanged(nume_form) 
	{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
		document.getElementById("form_input").innerHTML=xmlHttp.responseText 
		
		} 
	} 

function GetXmlHttpObject()
	{ 
	var objXMLHttp=null
	if (window.XMLHttpRequest) //penru mozilla
		{
		objXMLHttp=new XMLHttpRequest()
		}
	else if (window.ActiveXObject) //pentru internet explorer
		{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
	return objXMLHttp
	} 
// ---
function add_to_favorite(url,title){

	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		window.external.AddFavorite(url,title);
	} 
	else if (navigator.appName == "Netscape") {
		window.sidebar.addPanel(title,url,"");
	} 
	else {
		alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
	}
}



function change_menu(meniu){
	
	document.getElementById('sign_meniu').style.display='block';
	if(meniu=='index'){
		document.getElementById('sign_meniu').style.left='17px';
		
	}
	
	if(meniu=='carte_de_bucate'){
  		  document.getElementById("sign_meniu").style.left = '110px';
	}
	
	if(meniu=='retete_din_ingrediente'){
  		  document.getElementById("sign_meniu").style.left = '260px';
	}
	
	if(meniu=='articole'){
		document.getElementById('sign_meniu').style.left='370px';
	}
	if(meniu=='info_culinar'){
		document.getElementById('sign_meniu').style.left='455px';
	}
	
	if(meniu=='restaurante'){
		document.getElementById('sign_meniu').style.left='550px';
	}
	
	if(meniu=='forum'){
		document.getElementById('sign_meniu').style.left='629px';
	}
	
	if(meniu=='contact'){
		document.getElementById('sign_meniu').style.left='690px';
	}

}
function out_menu(meniu){
	
	document.getElementById('sign_meniu').style.display='none';

}
