function LimparProSubmit(form){

	var elementos = $(form).elements;

	var length = elementos.length;

	var i = 0;

	for(i=0;i<length;i++){

		if($j(elementos[i]).attr("formatado") == "true"){

			$j(elementos[i]).attr("value",MascaraRemove($j(elementos[i]).attr("value")));

		}

	}

}

function Cadastro(form,plus,lang){

	

	

	if(!Validacao(form,lang)){

		return false;	

	}

	

	LimparProSubmit(form);

	

	// NÃO ALTERAR //
	
	var caderro=false;

	var iframe = document.createElement("iframe");

	iframe.setAttribute("id","iframe-temp");

	iframe.setAttribute("name","iframe-temp");

	iframe.setAttribute("width","0");

	iframe.setAttribute("height","0");

	iframe.setAttribute("border","0");

	iframe.setAttribute("style","width: 0; height: 0; border: none;");	

	$(form).parentNode.appendChild(iframe);

 	window.frames['iframe-temp'].name="iframe-temp";

	var carregou = function() { 

		if ( $('iframe-temp').detachEvent ) {

			$('iframe-temp').detachEvent( 'onload', carregou );

		} else {

			$('iframe-temp').removeEventListener( 'load', carregou, false ); 

		}

		//alert($j('iframe-temp').contents());
		

	}

	if ($('iframe-temp').addEventListener)

        $('iframe-temp').addEventListener("load", carregou, true);

    if ($('iframe-temp').attachEvent)

        $('iframe-temp').attachEvent("onload", carregou);

	//$(form).setAttribute("target","iframe-temp"); // ** COMENTAR ESTA LINHA CASO ESTEJA DANDO ALGUM ERRO NO CADASTRO OU EDIÇÃO PARA FACILITAR O DEBUG ** //


	$(form).setAttribute("method","post");

	$(form).setAttribute("enctype","multipart/form-data");

	$(form).setAttribute("encoding","multipart/form-data");

	//submetendo

	$(form).submit();

	// NÃO ALTERAR //

}



function Cadastro2(plus){

	if(plus == 'next'){

		Load();

	} else {

		Voltar(plus);	

	}

}