function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}




function del(text,action){
var confirmx=confirm('Doriti sa stergeti '+text+'? ');
	if(confirmx){
		document.location.href="actions-delete.php?"+action;
	}
}


function delReview(text,action){
var confirmx=confirm(text);
	if(confirmx){
		document.location.href="actions-delete.php?"+action;
	}
}


function delx(text,action){
var confirmx=confirm(text);
	if(confirmx){
		document.location.href="actions-delete.php?"+action;
	}
}


function retFalse(){
	return false;
	}
	
	
	
function validareProdus(f) {

	unhighlightErrors(f, sErrorFields)
	sErrorTexts = '';
	sErrorFields = '';
	if(f.patern.value.length == 0) { addError('Te rugam sa alegi patern-ul dorit.', 'patern') }
	if(f.color.value.length == 0) { addError('Te rugam sa alegi culorile cristalelor dorite.', 'color') }

	if(sErrorTexts.length > 0) {
		highlightErrors(f, sErrorFields)
		alert('S-au detectat urmatoarele probleme:\n\n' + sErrorTexts)
		return false

	}
	else {
		return true

	}

}


function validareContact(f) {
	unhighlightErrors(f, sErrorFields)
	sErrorTexts = '';
	sErrorFields = '';

	if(f.nume.value.length == 0) { addError('Va rugam specificati numele dumneavoastra ', 'nume') }
	if(f.telefon.value.length == 0) { addError('Va rugam specificati telefonul dumneavoastra ', 'telefon') }
	
	if(f.mail.value.length < 5) {
		addError('Va rugam specificati adresa dumneavoastra de email', 'mail')
	}
	else if(!emailValid(f.mail.value)) {
		addError('Adresa dumneavoastra de email nu este valida', 'mail')
	}
	if(f.mesaj.value.length == 0) { addError('Va rugam introduceti mesajul dumneavoastra', 'mesaj') }
	
	if(sErrorTexts.length > 0) {
		highlightErrors(f, sErrorFields)
		alert('S-au detectat urmatoarele probleme:\n\n' + sErrorTexts)
		return false
	}
	else {
		window.open("pop_contact.php", "popup","toolbars=no,width=300,height=100");
		document.contact.Submit.disabled="true";
		return true
	}
}

