// pagina de produsfunction selectMarime(contor,marimi,id,marime){	document.getElementById('inmarime').value = marime;	document.getElementById('culori0').style.display = 'none';	document.getElementById('aiales').style.color = '#000000';	document.getElementById('aiales').value = "marimea "+marime;	for(i=1;i<=marimi;i++)	{		var divname='culori'+i;		var marimename = 'amarime'+i;				if(i==contor)		{			document.getElementById(divname).style.display = 'block';			document.getElementById(marimename).style.backgroundColor = '#d56ba9';		}		else		{			document.getElementById(divname).style.display = 'none';			document.getElementById(marimename).style.backgroundColor = '#c8c8c8';		}	}}function selectCuloare(marnr,culnr,nrculori,cul,selmar){	document.getElementById('inculoare').value = cul;	document.getElementById('aiales').value = "marimea "+selmar+", "+cul;	for(i=1;i<=nrculori;i++)	{		if(i==culnr)		{			document.getElementById('cul'+i+'mar'+marnr).style.className = 'aleasa';			document.getElementById('cul'+i+'mar'+marnr).style.borderBottom='3px solid #d56ba9';		}		else		{			document.getElementById('cul'+i+'mar'+marnr).style.className = '';			document.getElementById('cul'+i+'mar'+marnr).style.borderBottom='0 none';		}	}}function checkAiales(){	obi = document.getElementById('aiales');	if(obi.value == 'alegeti marimea si culoarea')	{ 		alert("Va rugam alegeti marimea si culoarea pentru produs");		return false;	}	if (obi.value.indexOf(",")==-1)	{		alert("Va rugam alegeti culoarea produsului");		return false;	}}						// search			function blurSearch(obi){	if(obi.value == '')	obi.value = "cauta produs denumire/cod";}function focusSearch(obi){	if(obi.value == 'cauta produs denumire/cod')	obi.value = "";}// comandafunction checkComanda(){	plata1 = document.getElementById('mod_plata1');	plata2 = document.getElementById('mod_plata2');	if ((plata1.checked == false) && (plata2.checked == false))	{		alert("Va rugam selectati modalitatea de plata");		plata1.focus();		return false;	}		nume = document.getElementById('nume');	if (nume.value == '')	{		alert("Va rugam completati numele");		nume.focus();		return false;	}		cnp = document.getElementById('cnp');	if (cnp.value == '')	{		alert("Va rugam completati CNP-ul");		cnp.focus();		return false;	}			telefon = document.getElementById('telefon');	if (!check_number(telefon.value,10))	{		alert("Va rugam completati numarul de telefon, 10 cifre");		telefon.focus();		return false;	}		email = document.getElementById('email');	if (email.value == '')	{  		alert("Va rugam completati adresa de e-mail");		email.focus();				return false;		}		if (email.value != '')	{		if(!check_email(email.value))		{			alert("Adresa de e-mail este incorecta");		 	email.focus();			return false;		}		}			judet = document.getElementById('judet');	if (judet.options[judet.selectedIndex].text == '...')	{		alert("Va rugam alegeti judetul");		judet.focus();		return false;	}			loc = document.getElementById('loc');	if (loc.value == '')	{		alert("Va rugam completati localitatea");		loc.focus();		return false;	}			adresa = document.getElementById('adresa');	if (adresa.value == '' || adresa.value.length < 5)	{		alert("Va rugam completati adresa");		adresa.focus();		return false;	}			codpost = document.getElementById('codpost');	if (!check_number(codpost.value,6) || codpost.value.length > 6)	{		alert("Va rugam completati codul postal, 6 cifre");		codpost.focus();		return false;	}			termeni = document.getElementById('termeni');	if(termeni.checked == false)	{		alert("Pentru a putea comanda trebuie sa fiti de acord cu termenii si conditiile chicberry.ro");		termeni.focus();		return false;			}}function checkmail2(){	nume = document.getElementById('nume');	if (nume.value == '')	{		alert("Va rugam completati numele");		nume.focus();		return false;	}		email = document.getElementById('email');	if (email.value == '')	{  		alert("Va rugam completati adresa de e-mail");		email.focus();				return false;		}	if (email.value != '')	{		if(!check_email(email.value))		{			alert("Adresa de e-mail este incorecta");		 	email.focus();			return false;		}		}		email2 = document.getElementById('email2');	if (email2.value == '')	{  		alert("Va rugam completati adresa de e-mail");		email2.focus();				return false;		}	if (email2.value != '')	{		if(!check_email(email2.value))		{			alert("Adresa de e-mail este incorecta");		 	email2.focus();			return false;		}		}			mesaj = document.getElementById('message');	if (mesaj.value == '')	{		alert("Va rugam completati mesajul");		mesaj.focus();		return false;	}	security_code_ok = document.getElementById('sec_code');	security_code_ins = document.getElementById('security_code');	if (security_code_ins.value != security_code_ok.value || security_code_ins.value == '')	{		alert("Codul de securitate este gresit!");		security_code_ins.focus();		return false;	}}function checkmail(){	email2 = document.getElementById('email2');	if (email2.value != 'abonare newsletter')	{		if(!check_email(email2.value))		{			alert("Adresa de e-mail este incorecta");		 	email2.focus();			return false;		}		}		nume = document.getElementById('nume');	if (nume.value == '')	{		alert("Va rugam completati numele");		nume.focus();		return false;	}		email = document.getElementById('email');	telefon = document.getElementById('telefon');	if (email.value == '' && telefon.value == '')	{  		alert("Va rugam completati telefonul sau adresa de e-mail");		email.focus();				return false;		}		if (email.value != '')	{		if(!check_email(email.value))		{			alert("Adresa de e-mail este incorecta");		 	email.focus();			return false;		}		}		mesaj = document.getElementById('mesaj');	if (mesaj.value == '')	{		alert("Va rugam completati mesajul");		mesaj.focus();		return false;	}	}function check_email(e) {	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";	for(i=0; i < e.length ;i++)	{		if(ok.indexOf(e.charAt(i))<0)		{ 			return (false);		}	} 		if (document.images) 	{		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;		if (!e.match(re) && e.match(re_two)) 		{			return (-1);				} 	}}function check_number(e,lung) {	ok = "1234567890";	if(e.length < lung)	{		return false;	}	for(i=0; i < e.length ;i++)	{		if(ok.indexOf(e.charAt(i))<0)		{ 			return (false);		}	}	return (true);}// cosfunction modifCart(url,cheie,buc){	document.location.href = url+'cosul-tau/modif-'+cheie+'-'+buc;}
