function afisez2(element) 
{
	sir=element.value;
	pos=sir.indexOf("#");
	txt_ron=sir.substr(0,pos);	
	nr_price=sir.substr(pos+1);
	document.getElementById('ron').innerHTML = txt_ron+" Lei";
	document.form1.nr_price.value = nr_price;
}


function afisez3(element, nr) {
    hex = element.value;
    document.getElementById('camera'+nr).bgColor=hex;
    hex = hex.substr(1);
    test = hex.substr(0,1)
    if (test>"c") culoare="negru"; else culoare="alb";	
	test = '<a href="#" onclick="w_h=window.open(\'./sticker_culoare.php?c=' + hex + '\',\'culoare\',\'resizable=1,location=0,status=0,menubar=0,toolbar=0,scrollbars=1,top=150,left=150,width=420,height=420\'); if (window.focus) {w_h.focus()}; return false;" class="' + culoare + '">click pentru test culoare</a>';
    document.getElementById('linc'+nr).innerHTML = test;
}

function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)

	if (str.indexOf(at)==-1){
	   alert("Adresa e-mail invalida! (exemplu: vasile@yahoo.com)")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Adresa e-mail invalida! (exemplu: vasile@yahoo.com)")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	   alert("Adresa e-mail invalida! (exemplu: vasile@yahoo.com)")
	    return false
	}

	if (str.indexOf(at,(lat+1))!=-1){
	   alert("Adresa e-mail invalida! (exemplu: vasile@yahoo.com)")
	    return false
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	   alert("Adresa e-mail invalida! (exemplu: vasile@yahoo.com)")
	    return false
	}
	
	if (str.indexOf(dot,(lat+2))==-1){
	   alert("Adresa e-mail invalida! (exemplu: vasile@yahoo.com)")
	    return false
	}

	if (str.indexOf(" ")!=-1){
	   alert("Adresa e-mail invalida! (exemplu: vasile@yahoo.com)")
	    return false
	}

	return true					
}
