function mover(id){
	img = document.getElementById(id);
	img.setAttribute("src", "img/int/over.gif", 0);
}

function mout(id){
	img = document.getElementById(id);
	img.setAttribute("src", "img/int/out.gif", 0);
}


function redirect(loc,id, show){
	location.href='index.php?loc='+loc+'&id='+id+'&show='+show;
}

function arata_recomanda(){
	dex = document.getElementById('recomanda');
	if(dex.style.display == 'none')
		dex.style.display = '';
	else
		dex.style.display = 'none';
}

function switch_contact(){
	dex = document.getElementById('contact');
	if(dex.style.display == 'none')
		dex.style.display = '';
	else
		dex.style.display = 'none';
}

function verifica_campuri(obj){
	
	nume = document.frecomanda['nume1'].value;
	email1 = document.frecomanda['email1'].value;
	email2 = document.frecomanda['email2'].value;
	mesaj = document.frecomanda['mesaj'].value;
	error_string="";
	emp = /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/
	emp1 = /^'$/
	if(nume.length>3){
		t1 = 1;
	}
	else{
		t1 = 0;
		error_string+="Numele introdus de dumneavoastra nu este corect.\n";
	}


	if(emp.test(email1)){
		t2 = 1;
	}
	else{
		t2 = 0;
		error_string+="Adresa dumneavaoastra de mail nu este corecta.\n";
	}
	if(emp.test(email2)){
		t3 = 1;
	}
	else{
		t3 = 0;
		error_string+="Adresa demail a prietenului dumneavaoastra nu este corecta.\n";
	}
	
	/*
	if(text.length>0){
		t4 = 1;
	}
	else{
		t4 = 0;
		error_string+="Nu ai scris nici un mesaj prietenului.\n";
	}
	*/

	if(t1 && t2 && t3){
		return true;
	}
	else{
		alert(error_string);
	}
	return false;
}

function verifica_campuri_contact(obj){
	
	nume = document.fcontact['nume'].value;
	email = document.fcontact['email'].value;
	mesaj = document.fcontact['mesaj'].value;
	error_string="";
	emp = /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/
	emp1 = /^'$/
	if(nume.length>3){
		t1 = 1;
	}
	else{
		t1 = 0;
		error_string+="Numele introdus de dumneavoastra nu este corect.\n";
	}


	if(emp.test(email)){
		t2 = 1;
	}
	else{
		t2 = 0;
		error_string+="Adresa dumneavaoastra de mail nu este corecta.\n";
	}
	
	
	if(mesaj.length>0){
		t3 = 1;
	}
	else{
		t3 = 0;
		error_string+="Trebuie sa completati campul de mesaj.\n";
	}
	

	if(t1 && t2 && t3){
		return true;
	}
	else{
		alert(error_string);
	}
	return false;
}