//Begin VideoDesign Validation Script © VideoDesign.ro (www.VideoDesign.ro)
var hintnume='<table width="100%"  cellpadding="0" cellspacing="0" ><tr><td><img src="images/formcheck/helper_arrow2.gif"></td><td><nobr>Minim 2 caractere.</nobr></td></tr></table>';
function verify_input_text(input_name,input_lengh,check_display){
//alert(input_lengh);
var input_name=document.getElementById(input_name).value;
if (input_name.length<input_lengh) {
	input_name_ok='false';
	document.getElementById(check_display).style.color='red';
	document.getElementById(check_display).innerHTML='<img src="images/error_bang.gif" width="16" height="14" border="0">';
	} else {
	input_name_ok='true';
	document.getElementById(check_display).style.color='green';
	document.getElementById(check_display).innerHTML='<img src="images/checkbullet.gif" width="16" height="16" border="0">';
	}
}

function verify_email(input_name,check_display,input_submit){
var email=document.getElementById(input_name).value;
var filter=/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/
if (!filter.test(email)) {
	email_ok='false';
	document.getElementById(check_display).style.color='red';
	document.getElementById(check_display).innerHTML='<img src="images/error_bang.gif" width="16" height="14" border="0">';
	disableSubmit(input_submit);
	} else {
	email_ok='true';
	document.getElementById(check_display).style.color='green';
	document.getElementById(check_display).innerHTML='<img src="images/checkbullet.gif" width="16" height="16" border="0">';
	enableSubmit(input_submit);
	}
}

//procesez comutator radio
function comutator_radio(input_name,check_display) {
var input_name=document.getElementById(input_name).value;
	if ((input_name=='Persoana_Fizica') && (input_name=='Persoana_Juridica')) {
		document.getElementById(check_display).innerHTML='<img src="images/error_bang.gif" width="16" height="14" border="0">';
	} else {
		document.getElementById(check_display).innerHTML='<img src="images/checkbullet.gif" width="16" height="16" border="0">';
	}
}

function enableSubmit(input_submit) {
  var newState = false;
  document.getElementById(input_submit).disabled = newState;
}

function disableSubmit(input_submit) {
  var newState = true;
  document.getElementById(input_submit).disabled = newState;
}

function arataverde(){

}
function numefocus(a,b){
	if(b.value==''){
		document.getElementById(a).innerHTML=hintnume;
		afiseazadiv(a,0,0,200,30,100,10);
	}
}
function numeblur(a,b){
	if(b.value==''){
		document.getElementById(a).innerHTML=hintnume;
		ascundediv(a,0,0,200,30,100,10);
	}
	else{

	}
}

function afiseazadiv(divid,x0,y0,x1,y1,timp,pas){
var continua=false;
var mdiv=document.getElementById(divid);
var xa=x0;
var ya=y0;
if(xa+pas<=x1){
	xa+=pas;
	continua=true;
}
else{
	xa=x1;
}
if(ya+pas<=y1){
	ya+=pas;
	continua=true;
}
else{
	ya=y1;
}
mdiv.style.width=xa+'px';
mdiv.style.height=ya+'px';
if(continua==true){
	var expresie='afiseazadiv(\''+divid+'\','+xa+','+ya+','+x1+','+y1+','+timp+','+pas+')';
	//alert(expresie);
	var t=setTimeout(expresie,timp);
}

}

function ascundediv(divid,x0,y0,x1,y1,timp,pas){
var continua=false;
var mdiv=document.getElementById(divid);
var xa=x1;
var ya=y1;
if(xa-pas>=x0){
	xa=xa-pas;
	continua=true;
}
else{
	xa=x0;
}
if(ya-pas>=y0){
	ya=ya-pas;
	continua=true;
}
else{
	ya=y0;
}
mdiv.style.width=xa+'px';
mdiv.style.height=ya+'px';
if(continua==true){
	var expresie='ascundediv(\''+divid+'\','+x0+','+y0+','+xa+','+ya+','+timp+','+pas+')';
	//alert(expresie);
	var t=setTimeout(expresie,timp);
}

}

//End VideoDesign Validation Script © VideoDesign.ro (www.VideoDesign.ro)
