var formUseri=Class.create();
	formUseri.prototype = {
							initialize: function(params){
								try{
									this.verify=false;
									this.params=params;
									if(this.params.captcha){
										this.captcha();
									}

									this.fields=this.params.check_fields;

									for(var i=0;i<this.fields.length;i++){
										Event.observe($(this.fields[i].id),this.fields[i].event,this[this.fields[i].validation].bindAsEventListener(this,this.fields[i].required));
									}
								}catch(err){
									//console.log(err);
								}
							},
							
							captcha: function(){
								try{
									this.refresh = function(){
										var date=new Date();
										var src=$(this.params.captcha.captcha_id).getAttribute("src").replace(/\?for_chrome_cache=\d+/i,'?for_chrome_cache='+date.getTime()); // stupid workaround pentru chrome cache
										$(this.params.captcha.captcha_id).setAttribute("src",src+(!/\?for_chrome_cache/i.test(src)?"?for_chrome_cache="+date.getTime():""),0);
										$(this.params.captcha.captcha_input_id).value="";
										$(this.params.captcha.confirm_captcha_id).update();
										$(this.params.captcha.confirm_captcha_id).hide();
									};
				
									this.validate_captcha = function(event,force_check){
										if(event === true && /^\s*$/.test($(this.params.captcha.captcha_input_id).value)){
											return this.invalidate(this.params.captcha.captcha_id,"Camp obligatoriu");
										}

										if(!/^\s*$/.test($(this.params.captcha.captcha_input_id).value) || arguments.length==2){
											if(/^.{5}$/.test($(this.params.captcha.captcha_input_id).value)){
												new Ajax.Request($(this.params.captcha.captcha_id).getAttribute("src"),
												  {
													method:'POST',
													asynchronous:false,
													parameters:{"val":$(this.params.captcha.captcha_input_id).value},
													onSuccess: function(transport){
															var serverDataJSON=transport.responseText.evalJSON();
															if(serverDataJSON.validate=='ok'){
																this.validate(this.params.captcha.captcha_id,"valid");
															}
															else{
																this.invalidate(this.params.captcha.captcha_id,"invalid");
															}
														}.bind(this),
													onFailure: function(transport){
															this.hide_validation_message(this.params.captcha.captcha_id,true);
														}.bind(this)
												  });
											}
											else{
												this.invalidate(this.params.captcha.captcha_id,"invalid");
											}
										}
										else{
											this.hide_validation_message(this.params.captcha.captcha_id,true);
										}
									};
									$(this.params.captcha.captcha_id).setStyle({"cursor":"pointer"});
									Event.observe($(this.params.captcha.captcha_id),"click",this.refresh.bindAsEventListener(this));
									
									if($(this.params.captcha.captcha_input_id)){
										Event.observe($(this.params.captcha.captcha_input_id),"keyup",this.validate_captcha.bindAsEventListener(this));
									}
								}catch(err){
									//console.log(err);
								}

							},

							check_user: function(event){
								try{	
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									if(!/^\s*$/.test(el.value)){
										if(!/^(?=[a-z])[\w.-]{4,32}$/i.test(el.value)){
											this.invalidate(el.getAttribute("id"),"invalid");
										}
										else{
											new Ajax.Request("/include/check_user.php?tip=username",
											  {
												method:'POST',
												asynchronous:false,
												parameters:{"val":el.value},
												onSuccess: function(transport){
														var serverDataJSON=transport.responseText.evalJSON();
														if(serverDataJSON.validate=='ok'){
															this.validate(el.getAttribute("id"),"disponibil");
														}
														else{
															this.invalidate(el.getAttribute("id"),"indisponibil");
														}
													}.bind(this),
												onFailure: function(transport){
														this.hide_validation_message(el.getAttribute("id"),arguments[1]);
													}.bind(this)
											  });
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}						
							},

							check_pass: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}

									var strengthPass = {"bad":"slaba","good":"buna","strong":"puternica"};
									
									var check_strength = function(val){
										var score=0;

										//lungimea parolei fara caractere repetitve
										valTrimRepet=trimRepetition(val);
										score+=valTrimRepet.length;
										
										//parola are cel putin 3 cifre diferite
										if(/(?=(?:.*\d){3,})/.test(valTrimRepet)){
											score+=5;
										}

										//parola contine simboluri
										if(/^(?=.*[\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\xFF])/.test(valTrimRepet)){
											score+=5;
										}

										//contine litere mari si mici
										if(/^(?=.*[a-z])(?=.*[A-Z])/.test(valTrimRepet)){
											score+=15;
										}

										//parola contine numere si litere
										if(/^(?=.*\d)(?=.*[a-z])/i.test(valTrimRepet)){
											score+=20;
										}

										//parola contine numere si simboluri
										if(/^(?=.*[\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\xFF])(?=.*\d)/i.test(valTrimRepet)){
											score+=15;
										}

										//parola contine litere si simboluri
										if(/^(?=.*[\x21-\x2F\x3A-\x40\x5B-\x60\x7B-\xFF])(?=.*[a-z])/i.test(valTrimRepet)){
											score+=15;
										}

										//parola contine doar numere si litere
										if(/^(?=^[\da-z]+$)/i.test(valTrimRepet)){
											score-=10;
										}

										if (score < 30 )  return strengthPass.bad;
										if (score < 60 )  return strengthPass.good;
										return strengthPass.strong;
									};

									var trimRepetition = function(val){
										return val.replace(/(.)\1+/g,"$1");
									};

									this.check_pass_bis($('parola_biss'));

									check_strength(el.value);
									if(!/^\s*$/.test(el.value)){
										
										if(el.value.length<4){
											return this.invalidate(el.getAttribute("id"),"prea scurta");
										}

										if(el.value.length>32){
											return this.invalidate(el.getAttribute("id"),"prea lunga");
										}
										
										return this.validate(el.getAttribute("id"),check_strength(el.value));
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_pass_bis: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}

									if(el.value==$('parola').value && el.value!=''){
										return this.validate(el.getAttribute("id"),"confirmata");
									}
									else{
										return this.invalidate(el.getAttribute("id"),"neconfirmata");
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_nume: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									if(!/^\s*$/.test(el.value)){
										if(/^(?=.{3,})(?=[a-z])[a-z-\s]+$/i.test(el.value)){
											this.validate(el.getAttribute("id"));
										}
										else{
											this.invalidate(el.getAttribute("id"));
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_prenume: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}

									if(!/^\s*$/.test(el.value)){

										if(/^(?=.{3,})(?=[a-z])[a-z-\s]+$/i.test(el.value)){
											this.validate(el.getAttribute("id"));
										}
										else{
											if(/^\s*$/.test(el.value)){
												this.hide_validation_message(el.getAttribute("id"),arguments[1]);
											}
											else{
												this.invalidate(el.getAttribute("id"));
											}
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_email_syntax: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									if(!/^\s*$/.test(el.value)){
										if(/^(?:[\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])\]))$/i.test(el.value)){
											this.validate(el.getAttribute("id"));
										}
										else{
											if(/^\s*$/.test(el.value) && !arguments[1]){ //arguments[1] expects required flag
												this.hide_validation_message(el.getAttribute("id"),arguments[1]);
											}
											else{
												this.invalidate(el.getAttribute("id"));
											}
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_email: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									if(!/^\s*$/.test(el.value)){
										if(/^(?:[\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])\]))$/i.test(el.value)){
											new Ajax.Request("/include/check_user.php?tip=email",
											  {
												method:'POST',
												asynchronous:false,
												parameters:{"val":el.value},
												onSuccess: function(transport){
														var serverDataJSON=transport.responseText.evalJSON();
														if(serverDataJSON.validate=='ok'){
															this.validate(el.getAttribute("id"),"valid");
														}
														else{
															this.invalidate(el.getAttribute("id"),"mail deja folosit");
														}
													}.bind(this),
												onFailure: function(transport){
														this.hide_validation_message(el.getAttribute("id"),arguments[1]);
													}.bind(this)
											  });
											//this.validate(el.getAttribute("id"));
										}
										else{
											this.invalidate(el.getAttribute("id"));
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_email_recup: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									if(!/^\s*$/.test(el.value)){
										if(/^(?:[\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])\]))$/i.test(el.value)){
											new Ajax.Request("/include/check_user.php?tip=email_recup",
											  {
												method:'POST',
												asynchronous:false,
												parameters:{"val":el.value},
												onSuccess: function(transport){
														var serverDataJSON=transport.responseText.evalJSON();
														if(serverDataJSON.validate=='ok'){
															this.validate(el.getAttribute("id"),"valid");
														}
														else{
															this.invalidate(el.getAttribute("id"),"mail inexistent");
														}
													}.bind(this),
												onFailure: function(transport){
														this.hide_validation_message(el.getAttribute("id"),arguments[1]);
													}.bind(this)
											  });
											//this.validate(el.getAttribute("id"));
										}
										else{
											this.invalidate(el.getAttribute("id"));
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_edit_email: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									if(!/^\s*$/.test(el.value)){
										if(/^(?:[\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])\]))$/i.test(el.value)){
											new Ajax.Request("/include/check_user.php?tip=edit_email",
											  {
												method:'POST',
												asynchronous:false,
												parameters:{"val":el.value},
												onSuccess: function(transport){
														var serverDataJSON=transport.responseText.evalJSON();
														if(serverDataJSON.validate=='ok'){
															this.validate(el.getAttribute("id"),"valid");
														}
														else{
															this.invalidate(el.getAttribute("id"),"mail deja folosit");
														}
													}.bind(this),
												onFailure: function(transport){
														this.hide_validation_message(el.getAttribute("id"),arguments[1]);
													}.bind(this)
											  });
											//this.validate(el.getAttribute("id"));
										}
										else{
											this.invalidate(el.getAttribute("id"));
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_data_nasterii: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									if(/^\d{4}-\d{2}-\d{2}$/i.test(el.value)){
										this.validate(el.getAttribute("id"));
									}
									else{
										this.invalidate(el.getAttribute("id"));
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_sex: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(el.nodeName=='DIV' && event.nodeType==1){
										var radios=el.select("input[type=radio]");
										for(var i=0;i<radios.length;i++){
											if(radios[i].checked){
												return this.validate("sex","ok");
											}
										}
										return this.invalidate("sex");
									}
									if(/^[mf]$/i.test(el.value) && el.checked){
										this.validate("sex","ok");
									}
									else{
										this.invalidate("sex");
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_agreement: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);
									if(el.checked){
										this.validate(el.getAttribute("id"));
									}
									else{
										this.invalidate(el.getAttribute("id"));
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_sugestii: function(event){
								try{
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									
									if(!/^\s*$/.test(el.value)){
										if(!/^\s*$/.test(el.value)){
											return this.validate(el.getAttribute("id"),"ok");
										}
										else{
											return this.invalidate(el.getAttribute("id"),"necompletat");
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}
								}catch(err){
									console.log(err);
								}
							},

							check_text: function(event){
								try{	
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}

									if(!/^\s*$/.test(el.value)){
										this.validate(el.getAttribute("id"));
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										if($('max_title')){
											$('max_title').update(100);
										}
									}
									
								}catch(err){
									//console.log(err);
								}						
							},

							//pentru partea de director adauga site
							check_url: function(event){
								try{	
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}

									if(!/^\s*$/.test(el.value)){
										if(!/^https?:\/\//i.test(el.value)){
											this.invalidate(el.getAttribute("id"),"Nu incepe cu http(s)://");
										}
										else{//conform cu BNF vezi http://www.ietf.org/rfc/rfc1738.txt
											if(/^(?:https?:\/\/)(?:(?:(?:(?!-)[a-z\d-]+\.)+(?:(?!-)(?!\d+\b)[a-z\d-]+\/?))|(?:(?:\d{1,3}\.){3}\d{1,3}))(?::(\d+))?(?:\/(?:(?:[a-z\d_.!~*\'():@&=+$,-]|%[\da-f]{2})+\/?)+)?(?:\?(?:(?:[a-z\d;/?:@&=+$,_.!~*\'()-]|%[\da-f]{2})+))?(?:\x23(?:(?:[a-z\d;/?:@&=+$,_.!~*\'()-]|%[\da-f]{2})*))?$/i.test(el.value)){
												this.validate(el.getAttribute("id"));
											}
											else{
												this.invalidate(el.getAttribute("id"));
											}
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
									}	
								}catch(err){
									//console.log(err);
								}						
							},
							
							check_title: function(event){
								try{	
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}

									if(!/^\s*$/.test(el.value)){
										if(el.value.length > 100){
											this.invalidate(el.getAttribute("id"),"Maxim depasit");
											if($('max_title')){
												$('max_title').update(0);
											}
										}
										else{
											this.validate(el.getAttribute("id"));
											if($('max_title')){
												$('max_title').update(100-el.value.length);
											}
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										if($('max_title')){
											$('max_title').update(100);
										}
									}
									
								}catch(err){
									//console.log(err);
								}						
							},
							
							check_descriere: function(event){
								try{	
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									
									if(!/^\s*$/.test(el.value)){
										if(el.value.length > 400){
											this.invalidate(el.getAttribute("id"),"Maxim depasit");
											if($('max_descriere')){
												$('max_descriere').update(0);
											}
										}
										else{
											this.validate(el.getAttribute("id"));
											if($('max_descriere')){
												$('max_descriere').update(400-el.value.length);
											}
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										if($('max_descriere')){
											$('max_descriere').update(400);
										}
									}
								}catch(err){
									//console.log(err);
								}						
							},
							
							check_cuvinte: function(event){
								try{	
									var el=event.nodeType==1?event:Event.element(event);

									if(event.nodeType==1 && /^\s*$/.test(el.value)){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}
									
									if(!/^\s*$/.test(el.value)){
										if(el.value.length > 200){
											this.invalidate(el.getAttribute("id"),"Maxim depasit");
											if($('max_cuvinte')){
												$('max_cuvinte').update(0);
											}
										}
										else{
											this.validate(el.getAttribute("id"));
											if($('max_cuvinte')){
												$('max_cuvinte').update(200-el.value.length);
											}
										}
									}
									else{
										this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										if($('max_cuvinte')){
											$('max_cuvinte').update(200);
										}
									}
								}catch(err){
									//console.log(err);
								}						
							},
							
							check_categ: function(event){
								try{	
									var el=event.nodeType==1?event:Event.element(event);
									if(event.nodeType==1 && el.value=="0"){
										if(!arguments[1]){//verfica daca e required
											return this.hide_validation_message(el.getAttribute("id"),arguments[1]);
										}
										else{
											return this.invalidate(el.getAttribute("id"),"Camp obligatoriu");
										}
									}

									if(el.value=="0"){
										this.hide_validation_message(el.getAttribute("id"));
									}
									else{
										this.validate(el.getAttribute("id"));
									}

								}catch(err){
									//console.log(err);
								}						
							},
							//END director adauga site

							validate:function(id,mesaj){
								try{
									$("confirm_"+id).className="valid";
									$("confirm_"+id).update(mesaj || "valid");
									$("confirm_"+id).show();
									this.verify=true;
								}catch(err){
									//console.log(err);
								}
							},
							
							invalidate:function(id,mesaj){
								try{
									$("confirm_"+id).className="invalid";
									$("confirm_"+id).update(mesaj || "invalid");
									$("confirm_"+id).show();
									this.verify=false;
								}catch(err){
									//console.log(err);
								}
							},
							
							hide_validation_message:function(id){
								try{
									$("confirm_"+id).hide();
									$("confirm_"+id).update();
									if(arguments[1]){
										this.verify=false;
									}
								}catch(err){
									//console.log(err);
								}
							},

							check_all: function(e){
								var verify_all=true;
								for(var i=0;i<this.fields.length;i++){
									//if(this.fields[i].required){
										this[this.fields[i].validation]($(this.fields[i].id),this.fields[i].required);
										if(!this.verify){
											verify_all=false;
										}
									//}
								}

								if(this.params.captcha){
									this.validate_captcha(true,true);
									if(!this.verify){
										verify_all=false;
									}
								}

								if(!verify_all){
									try{if(e !== undefined) Event.stop(e);}catch(err){}
									return false;
								}
								return true;
							}
							
							
	}