// JavaScript Document
function carregaCidades(origem,param){
    document.getElementById("cidades").innerHTML = "Carregando cidades...";;
 $.get(origem , {"estado": param} ,function(data){
             document.getElementById("cidades").innerHTML = data;
          }
  );
};


function checaForm(which,objAdd) {

 var pass=true;
 
  for (i=0;i<which.length;i++) {
      
	  var tempobj=which.elements[i];
      //alert(tempobj.name.substring(0,8));
 
    if (tempobj.name.substring(0,1)=="_") {
      if (((tempobj.type=="text"||tempobj.type=="textarea"||tempobj.type=="password"||tempobj.type=="file")&&
          tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
          tempobj.selectedIndex==0)) {
		  tempobj.focus()
          pass=false;
        break;
      }
    }
  }
  if (!pass) {
    shortFieldName=tempobj.name.substring(1,30).toUpperCase();
  if(shortFieldName == "EMAIL"){
     alert("Se não tiver e-mail crie um nome de usuário no campo para e-mail");
  }else{
     alert("O campo "+shortFieldName+" é obrigatório.");
  }
    return false;
  } else {
    if(objAdd == 'progress'){
   dispProgress();
  }
   return true;
  }
  };

function carrega(url,tit_cont){
    document.getElementById('contents').innerHTML = '<img src="http://listaon.com/jquery/plugins/interface/images/imagebox/loading.gif" />';
if(tit_cont != undefined){
    document.getElementById('tit_contents').innerHTML = "<div align=\"center\" style=\"background:#FFFF99\"><span class=\"titulo\"><b>"+tit_cont+"</b></span></div>";
}else{
    document.getElementById('tit_contents').innerHTML = "";
}
$.ajax({
type: "POST",
url: url,
data: "id=6",
success: function(cont){
    //alert( msg );
    document.getElementById('contents').innerHTML = cont;
}
});
}
function popcentral(mypage, myname, w, h, scroll) {
//alert("Aqui");
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
};