// JavaScript Document
// JavaScript Document
//Função para criar e ler cookie das paginas

  //date=new Date();
 function JGCookie(name, content, days) {
 date=new Date();
    var expires = "";
    if(days) {
	  this.date.setTime(this.date.getTime()+(days*24*60*60*1000));
      expires = this.date.toGMTString() + "; ";
	}
	document.cookie = name + "=" + content + "; " + expires + "path=/";
	return true;
  }
  
  

   function Ler( name ) {
  	var nameE = name + "=";
	var cookies = document.cookie.split(";");
	for(var i = 0, Cookie; Cookie = cookies[i]; i++) {
	  while(Cookie.charAt(0) == " ") {
	  	Cookie = Cookie.substring(1,Cookie.length);
	  }
	  if(Cookie.indexOf(nameE) == 0) {
	  	return Cookie.substring(nameE.length,Cookie.length);
	  }
	}
	return false;
  }
  
  /*function traz(){
var vNumero=parseInt(Ler("valor"));
if (vNumero>1){
vNumero--;
abas(vNumero);
//ajaxpage("portf_pdv"+vNumero+".html", "ConteudoLeft");
}}

function frente(){
var vNumero=parseInt(Ler("valor"));
if (vNumero<9){
vNumero++;
abas(vNumero);
//ajaxpage("portf_pdv"+vNumero+".html", "ConteudoLeft");
}}*/


function abas (id){

    for (i = 1; i < 8; i++){
         document.getElementById(i).className = "linkDesativo";
    }
                
    document.getElementById(id).className = "linkAtivo"; 
	JGCookie("valor", id, 1);
}

