function activate_form() {

document.reg.amcititregulile.checked=true;
document.reg.amcititregulile.disabled=true;
document.reg.trimite.disabled=false;

}


function reg_verify(){

	if((isWhitespace(document.reg.user.value)) || (!isEmail(document.reg.email.value)) || (isWhitespace(document.reg.paswword.value)) || (isWhitespace(document.reg.repassword.value)) || (isWhitespace(document.reg.detalii.value)) || (isWhitespace(document.reg.prenume.value)) || (isWhitespace(document.reg.security_code.value))){

		if(isWhitespace(document.reg.user.value)){ 
			document.forms['reg'].user.value = 'Introduceti numele de utilizator';
			document.forms['reg'].user.style.color = "#881835";
		}
		
		if(isWhitespace(document.reg.password.value)){ 
			document.forms['reg'].password.value = 'Introduceti parola';
			document.forms['reg'].password.style.color = "#881835";
		}
		
		if(isWhitespace(document.reg.repassword.value)){ 
			document.forms['reg'].repassword.value = 'Reintroduceti parola';
			document.forms['reg'].repassword.style.color = "#881835";
		}
		
		if(!isEmail(document.reg.email.value)){ 
			document.forms['reg'].email.value = 'Introduceti adresa de email';
			document.forms['reg'].email.style.color = "#881835";
		}
		
		
		if(isWhitespace(document.reg.detalii.value)){
			document.forms['reg'].detalii.value = 'Completati detaliile';
			document.forms['reg'].detalii.style.color = "#881835";
		}
		
		if(isWhitespace(document.reg.prenume.value)){
			document.forms['reg'].prenume.value = 'Introduceti prenumele';
			document.forms['reg'].prenume.style.color = "#881835";
		}
		
		if(isWhitespace(document.reg.security_code.value)){
			document.forms['reg'].security_code.value = 'Introduceti codul';
			document.forms['reg'].security_code.style.color = "#881835";
		}

		return false;

	}

	else return true;

}


function cont_verify(){

	if((isWhitespace(document.cont.nume.value)) || (!isEmail(document.cont.email.value)) || (isWhitespace(document.cont.mesaj.value))){

		if(isWhitespace(document.cont.nume.value)){ 
			document.forms['cont'].nume.value = 'Introduceti numele';
			document.forms['cont'].nume.style.color = "#881835";
		}
		
		if(!isEmail(document.cont.email.value)){ 
			document.forms['cont'].email.value = 'Introduceti adresa de email';
			document.forms['cont'].email.style.color = "#881835";
		}
		
		if(isWhitespace(document.cont.mesaj.value)){ 
			document.forms['cont'].mesaj.value = 'Introduceti mesajul';
			document.forms['cont'].mesaj.style.color = "#881835";
		}

		return false;

	}

	else return true;

}




function clearTxt(txtId){

	if ((document.getElementById(txtId).value == "Introduceti numele de utilizator") || (document.getElementById(txtId).value == "Introduceti parola") || (document.getElementById(txtId).value == "Reintroduceti parola") || (document.getElementById(txtId).value == "Introduceti adresa de email") || (document.getElementById(txtId).value == "Completati detaliile") || (document.getElementById(txtId).value == "Introduceti prenumele") || (document.getElementById(txtId).value == "Introduceti codul") || (document.getElementById(txtId).value == "Introduceti mesajul") || (document.getElementById(txtId).value == "Introduceti numele")){

		document.getElementById(txtId).value = "";
		document.getElementById(txtId).style.color = "#ffffff";
	}

}


function AdaugaLocatie ()
{

var nr=0;
if (document.getElementById('c1').style.display == "none"){
	document.getElementById('c1').style.display = "block";
	}else{
		if (document.getElementById('c2').style.display == "none"){
			document.getElementById('c2').style.display = "block";
			}else{
				document.getElementById('c3').style.display = "block";
		}
	}

if (document.getElementById('c1').style.display == "block"){nr++;}
if (document.getElementById('c2').style.display == "block"){nr++;}
if (document.getElementById('c3').style.display == "block"){nr++;}

if (nr==3){document.getElementById('plus').style.display = "none";}

}



function EliminaLocatie1()
{

document.getElementById('c1').style.display = "none";
document.reg.l1.selectedIndex = 0;
document.getElementById('plus').style.display = "block";

}


function EliminaLocatie2()
{

document.getElementById('c2').style.display = "none";
document.reg.l2.selectedIndex = 0;
document.getElementById('plus').style.display = "block";

}

function EliminaLocatie3()
{

document.getElementById('c3').style.display = "none";
document.reg.l3.selectedIndex = 0;
document.getElementById('plus').style.display = "block";

}



function ShowContent (id, tot)
{
var i=1;
for (i=1;i<=tot;i++)
	{
	document.getElementById('cont'+i).style.display = "none";
	}
	document.getElementById('cont'+id).style.display = "block";
}


function ShowDiv (id)
{
	document.getElementById(id).style.display = "block"; 
}


function HideDiv (id)
{
	document.getElementById(id).style.display = "none";
}

function clearY(txtId){
	if ((document.getElementById(txtId).value == "Nu spun acum")){

		document.getElementById(txtId).value = "";

	}
}


function ArataOrAscundeOptiuni(selid){
	var stsel=document.getElementById(selid);
	if (stsel.selectedIndex==0){
		ShowDiv('dns'); HideDiv('dnc'); ShowDiv('hs'); HideDiv('hc'); ShowDiv('gs'); HideDiv('gc'); ShowDiv('cps'); HideDiv('cpc'); ShowDiv('cos'); HideDiv('coc'); ShowDiv('zs'); HideDiv('zc'); ShowDiv('fs'); HideDiv('fc'); ShowDiv('bs'); HideDiv('bc'); ShowDiv('das'); HideDiv('dac');
	}
	if (stsel.selectedIndex==1){
		ShowDiv('dns'); HideDiv('dnc'); ShowDiv('hs'); HideDiv('hc'); ShowDiv('gs'); HideDiv('gc'); ShowDiv('cps'); HideDiv('cpc'); ShowDiv('cos'); HideDiv('coc'); ShowDiv('zs'); HideDiv('zc'); ShowDiv('fs'); HideDiv('fc'); ShowDiv('bs'); HideDiv('bc'); ShowDiv('das'); HideDiv('dac');
	}
	if (stsel.selectedIndex==2){
		ShowDiv('dnc'); HideDiv('dns'); ShowDiv('hc'); HideDiv('hs'); ShowDiv('gc'); HideDiv('gs'); ShowDiv('cpc'); HideDiv('cps'); ShowDiv('coc'); HideDiv('cos'); ShowDiv('zc'); HideDiv('zs'); ShowDiv('fc'); HideDiv('fs'); ShowDiv('bc'); HideDiv('bs'); ShowDiv('dac'); HideDiv('das');
	}
}


function ArataPlusDestSel(selectid){
	var cdinsel=document.getElementById(selectid);
	if (cdinsel.selectedIndex==0){
		EliminaLocatie1(); EliminaLocatie2(); EliminaLocatie3(); HideDiv('plus');
	}
	if (cdinsel.selectedIndex==1){
		EliminaLocatie1(); EliminaLocatie2(); EliminaLocatie3(); HideDiv('plus');
	}
	if (cdinsel.selectedIndex==2){
		ShowDiv('c1');ShowDiv('plus');
	}
	if (cdinsel.selectedIndex==3){
		EliminaLocatie1();EliminaLocatie2(); EliminaLocatie3(); HideDiv('plus');
	}
}


function ArataCeTrebuie(seltid){
	var tarasel=document.getElementById(seltid);
	if (tarasel.selectedIndex!=1){
		ShowDiv('exloc'); HideDiv('judiv'); HideDiv('locco');
	}else{	
		ShowDiv('judiv'); HideDiv('exloc'); HideDiv('locco');
	}
}




function ReclearY(txtId){
	if ((document.getElementById(txtId).value == "")){

		document.getElementById(txtId).value = "Nu spun acum";

	}
}

function clearYY(txtId){
	if ((document.getElementById(txtId).value == "Nu conteaza")){

		document.getElementById(txtId).value = "";

	}
}

function ReclearYY(txtId){
	if ((document.getElementById(txtId).value == "")){

		document.getElementById(txtId).value = "Nu conteaza";

	}
}
