﻿// JScript File
    function openConteudo(id){
       var url = "produtos.aspx?";
       var pars = "_cat="+id;
       window.location = url + pars;
	 }
     
// function loadConteudo(xmlResp){
//   var DocXml = xmlResp.responseXML;
//   var nodes = DocXml.getElementsByTagName("Node");
//   var titleCAT = DocXml.getElementsByTagName("Categoria")[0].firstChild.nodeValue;
//   $("titleConteudo").innerHTML= "<a href='#' title='Trabalhamos com os seguintes fabricantes de "+titleCAT+"'>Trabalhamos com os seguintes fabricantes:</a>";
//   if(nodes != null){
//   var str ="";
//     for(var i= 0; i < nodes.length; i++){
//        var node = nodes[i];
//        var nome = node.getElementsByTagName("Nome")[0].firstChild.nodeValue;
//        var img = node.getElementsByTagName("Img")[0].firstChild.nodeValue;
//        str += "<a href='#' title='"+nome+"'><img src='../images/noticia/"+img+"' alt='"+nome+"' class='parceriaItem' title='"+nome+"'/></a>";      
//     }
//    
//      $("conteudoItem").innerHTML = str;
//   }else{
//         $("conteudoItem").innerHTML = "<a href='#'>Não existem registros cadastrados para essa categoria.</a>";
//   }
// }
 
 function hideWater(obj, name){
      if(obj.value != '' && obj.value == name){ 
         obj.value= '';
      }
    }
    function blockWater(obj, name){
      if(obj.value == '' && obj.value != name){
         obj.value= name;
      }
    }
    
    function openParcerias(){
      var post = "";
      if(document.getElementById('hf_post').value != "")
      {
          post = document.getElementById('hf_post').value;
          document.cookie = 'par=10';
          window.location = post + 'empresa.aspx';
          
      }else{
        window.location = 'http://www.hsinfor.com.br/empresa.aspx';
      }
    
    }
    
      function validate(){
      if($("txtName").value == "" ||  $("txtMail").value == ""){
        alert('É necessario preencher os 2 campos.');
        return false;
       
      }else if($("txtName").value == "Nome" ||  $("txtMail").value == "E-mail"){
           alert('É necessario preencher os 2 campos.');
        return false;
      }
      else
      {
          alert('E-mail adicionado com sucesso, aguarde que logo lhe enviaremos novidades.');
          return true;  
      }
     }