function atualizaDiv(divName) {
    // Atualiza o select
    var req;
    if (window.XMLHttpRequest){
        req = new XMLHttpRequest();
    } else if (window.ActiveXObject){
       req =  new ActiveXObject('Microsoft.XMLHTTP');
    }else{
       req =  new ActiveXObject('Microsoft.XMLHTTP2');
    }


    req.onreadystatechange= function(){
        if (req.readyState == 4){ // 4: requisição terminada, resposta pronta.
            if (req.status == 200){ // OK
                //Resposta disponivel
                result = req.responseText;
                $(divName).innerHTML = result;
            }
        }
    }

    //req.send(params);
}

function serializeForm(formName) {
	var hasForm = null;
	hashForm = $(formName).getElements();
	var hashFormT = "";
	
	for(i=0; i<hashForm.length; i++) {
		if(i==0) {
			hashFormT = hashFormT + "?";
		}
		if(hashForm[i].type != "button" && hashForm[i].type != "submit") {
			hashFormT = hashFormT + hashForm[i].id + "=" + hashForm[i].value;
				if(i<(hashForm.length-1)) {
					hashFormT = hashFormT + "&";
				}
		}
	}
	
	return hashFormT;
}
