function Validar(parent_id_form){
	$(parent_id_form).getElements("form[target!=PagSeguro]").addEvent("submit",function(){
		var theform=this;
		var thename=this.name.split("form_")[1]
		if (thename == undefined) {
			return;
		}
		new Request({
			url:"/"+thename+".ajax.php",
			onComplete: function(responseraw){
				var nome_class="warning"
				response=JSON.decode(responseraw.trim());
				if(response!=null){
					$$("label."+"problema").removeClass("problema")
					$$("br.brprob").destroy()
					$$("."+"problema_campo").removeClass("problema_campo")
					$$("div."+nome_class).destroy();
					$each(response, function(value,key){
						
						
						if ($defined(theform.getElement("*[name="+key+"]"))){
							campao=theform.getElement("*[name="+key+"]");
							if (!$defined(campao.getParent("div").getPrevious("div")) || campao.getParent("div").getPrevious("div").className!=nome_class){
								var dv=new Element("div", {id:"warning_"+thename, "class":nome_class}).adopt(new Element("strong").set("html","Problemas nestes campos : "))
								var unl=new Element("ul").adopt(new Element("li").set("html", value))
								dv.adopt(unl)
								dv.inject(campao.getParent("div"),"before")
							} else {
								campao.getParent("div").getPrevious("div").getFirst("ul").adopt(new Element("li").set("html",value))
							}
							if(campao.getParent("p").getElements("input").length>=2){
								var pp=campao.getParent("p")
								new Element("br",{"class":"brprob"}).inject(pp.getElement("label"),"after")
								/*
								var label=pp.getElement("label").clone()
								pp.getElement("label").destroy()
								var span=new Element("span")
								pp.getChildren().each(function(e){
									e.clone().cloneEvents(e).inject(span)
								})
								pp.set("html","")
								label.inject(pp,"top")
								span.inject(pp)*/
							}
							if (campao.getPrevious("label")!=null)
								campao.getPrevious("label").addClass("problema").getNext().addClass("problema_campo")
							else
								theform.getElements("label").each(function(el){el.addClass("problema").getNext().addClass("problema_campo")})
						} else {
							var dv=new Element("div", {id:"warning_"+thename, "class":nome_class}).adopt(new Element("strong").set("html","Problemas nestes campos : "))
							unl=new Element("ul").adopt(new Element("li").set("html", value))
							dv.adopt(unl)
							dv.inject(theform.getParent("div"),"before")
							theform.getElements("label").each(function(el){el.addClass("problema").getNext().addClass("problema_campo")})
						}
					})

				} else { theform.submit()}

				return false;

			}

		}).post(this);

		return false

	})

}