function showDisclaimer()
{
	var disclaimerel = document.getElementById("disclaimer");
	var dislaimerBtn = document.getElementById("disclaimer-btn");
	if (disclaimerel.style.display == "none")
	{
		disclaimerel.style.display = "block";
		dislaimerBtn.style.color = "#ffddd9";
	}
	else
	{
		disclaimerel.style.display = "none";
		dislaimerBtn.style.color = "#ffffff";
	}
}
function prepareDisclaimer()
{
	var dislaimerBtn = document.getElementById("disclaimer-btn");
	dislaimerBtn.style.visibility = "visible";
	dislaimerBtn.style.backgroundImage = "url(../images/btnbkg.jpg)";

	showDisclaimer();
	document.getElementById("disclaimer-btn").onclick = function()
	{
		showDisclaimer();
	}
	dislaimerBtn.style.color = "#ff0000";
	dislaimerBtn.onmouseover = function()
	{
		dislaimerBtn.style.paddingTop = "7px";
		dislaimerBtn.style.backgroundImage = "url(../images/btnbkg2.jpg)";
		dislaimerBtn.style.color = "#ffffff";
	}
	dislaimerBtn.onmouseout = function()
	{
		if (document.getElementById("disclaimer").style.display == "none")
		{
			dislaimerBtn.style.paddingTop = "7px";
			dislaimerBtn.style.backgroundImage = "url(../images/btnbkg.jpg)";
			dislaimerBtn.style.color = "#ff0000";
		}
	}
}
function validarebtnanim()
{
	document.getElementById("inputelvalidare").src = "../images/validarebkg.jpg";
	document.getElementById("inputelvalidare").onmouseover = function()
	{
		document.getElementById("inputelvalidare").src = "../images/validarebkg2.jpg";
	}
	document.getElementById("inputelvalidare").onmouseout = function()
	{
		document.getElementById("inputelvalidare").src = "../images/validarebkg.jpg";
	}
}

function chknum(o, next)
{
	if (o.value == "1")
		return;
	if(!(/[^1-9]/.test(o.value)))
	{
		if (next != null)
			o.form[next].focus();
	}
	else
	{
		o.value = "1";
	}
}

/*
 * autor: Sergiu Dogotaru
 * descriere: Afisharea codului JS pentru AJAX din localitati. Ca parametru va fi preluata valoare de pe campul de judet.
 * modificari: Am mutat functia din cls_formular. Aici pare mai la locul ei.
 */
function updatelocalitate()
{
	document.getElementById('localitate').value = document.getElementById('localitateselect').value;
}
function ajaxFunction()
{
	var xmlhttp;
	if (window.XMLHttpRequest)
		{
			// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		}
	else
		{
			// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
			document.getElementById('divjudet').className = 'fieldcontainer';
			document.getElementById('divlocalitate').style.display = 'none';
			document.getElementById('divlocalitateselect').style.display = 'block';
			var localitatecombovar = document.getElementById('localitateselect');
			localitatecombovar.length = 0;
			localitatecombovar.options[localitatecombovar.length] = new Option('-->Selecteaza', '');
			var jsonarray = eval(xmlhttp.responseText);
			for (var i = 0; i < jsonarray.length; i++)
			{
			  	localitatecombovar.options[localitatecombovar.length] = new Option(jsonarray[i], jsonarray[i]);
			}
		}
	}
	xmlhttp.open("GET","../modules/localitati.php?judet="+document.getElementById('judet').value,true);
	xmlhttp.send(null);
}
function alternpagesprep(v)
{
	var blocklinks = document.getElementById('blocklinks').getElementsByTagName('a');
	var myid;
	
	for (i = 1; i <= blocklinks.length; i++)
	{
		myid = blocklinks[i-1].id.replace('link-','');
		if (blocklinks[i-1].id == v)
		{
			document.getElementById(myid).style.display = 'block';
		}
		else
		{
			document.getElementById(myid).style.display = 'none';
		}
		document.getElementById(blocklinks[i-1].id).onclick = function()
		{
			alternpagesprep(this.id); return false;
		}
	}
}