// Java Document
function pontuar()
{
	
	var formteste = document.Form2;
	
	var parametros = mountParameters(formteste);
	var combouf = createXMLHTTP();
		

	combouf.open("post", "pontuar.asp", true);
	document.body.style.cursor = "wait";
    combouf.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    combouf.onreadystatechange=function(){
     if (combouf.readyState==4){// abaixo o texto do gerado no arquivo executa.asp e colocado no div
      var resp = combouf.responseText;
	  
    if (resp == 1) {
	  alert("Dados computados com sucesso!");
	  document.body.style.cursor = "auto";
	 TINY.box.hide();
	 
	  //mensagem();
	  }
	  else 
	  {
		  if (resp == 3) {
			  alert("Você já votou neste restaurante");
			  document.body.style.cursor = "auto";
			  TINY.box.hide();
		  }
		  else
		  {
	  alert("Erro no envio.")
	  document.body.style.cursor = "auto";
	  TINY.box.hide();
	  }
	  }
	  }}
      combouf.send(parametros);

}
function pontuar2()
{
	
	var formteste = document.Form2;
	
	var parametros = mountParameters(formteste);
	var combouf = createXMLHTTP();
	
	combouf.open("post", "pontuar2.asp", true);
	document.body.style.cursor = "wait";
    combouf.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    combouf.onreadystatechange=function(){
     if (combouf.readyState==4){// abaixo o texto do gerado no arquivo executa.asp e colocado no div
      var resp = combouf.responseText;
	 
	  if (resp == 1) {
	  alert("Dados computados com sucesso!");
	  document.body.style.cursor = "auto";
	 TINY.box.hide();
	 
	  //mensagem();
	  }
	  else 
	  {
		  if (resp == 3) {
			  alert("Você já votou neste prato");
			  document.body.style.cursor = "auto";
			  TINY.box.hide();
		  }
		  else
		  {
	  //alert("Erro no envio.");
	  alert(resp);
	  document.body.style.cursor = "auto";
	  TINY.box.hide();
	  }
	  }
	  }}
      combouf.send(parametros);

}
function mountParameters(objForm){

        var strReturn = "";

        if(objForm){

                var y = objForm.length-1;
                for(x = 0; x < objForm.length; x++){
                        if(objForm[x].value && !objForm[x].disabled && objForm[x].style.display != "none" && objForm[x].type != "button" && objForm[x].type != "reset" && objForm[x].type != "submit"){
                                if(strReturn){
                                        strReturn = strReturn + "&";
                                }
                                strReturn = strReturn + objForm[x].id + "=" + escape(objForm[x].value);
                        }
                }

        }

        return strReturn;
}
function checkboxv(checknome,valor) {
var checknome = checknome;
var checknome2 = checknome;
checknome2 = checknome.toString;
checknome2 = checknome.split("_");
checknome2 = checknome2[0];
checknome2 = checknome2+"c";
var valor = valor;
form = document.forms[0];
checkbox2 = document.getElementById(checknome2);
checkbox = document.getElementById(checknome);
alert(checknome2);
var checknome = checknome;
var objeto = document.Form2.Atendimento1;
document.getElementById(checknome2).value = valor;

if(checkbox.checked == true){


checkbox.value = '1';
checkbox2.value = valor;

return true;
}else {

checkbox.value = '0' ;
 return true;}
}
