//### Guarda em variável a página atual
var sPagAtual=document.location.href.toUpperCase();

var oBaseTop=document.getElementsByTagName('base')[0];
if(oBaseTop)var IsBaseTop=(oBaseTop.target=='_top');
else var IsBaseTop=false;

//### função para link no topo
function LinkTop(sTitle,sPage,sParam,sStyle){
  sPageM=sPage.toUpperCase();
  if(sPageM=='CADASTRO' || sPageM=='TRACK'){sURL='https://www.rumo.com.br/sistema/';}else{sURL='';}
  if(sPageM=='CADASTRO' || sPageM=='TRACK' || IsBaseTop){sTarget='top';}else {sTarget='window';}
  if(sPagAtual.indexOf(sPageM+'.ASP')>=0 && sPagAtual.indexOf(sParam.toUpperCase())>=0){
    document.write('<table width=100% class='+sStyle+'_On align=center OnClick='+sTarget+'.location.href="'+sURL+sPage+'.asp?IDLoja='+IDLoja+sParam+'" cellspacing=0 cellpadding=0><tr><td align=center>'+sTitle+'</td></tr></table>');}
   else{
    document.write('<table width=100% class='+sStyle+'_Off align=center OnMouseOut=this.className="'+sStyle+'_Off" OnMouseOver=this.className="'+sStyle+'_Hover" OnClick='+sTarget+'.location.href="'+sURL+sPage+'.asp?IDLoja='+IDLoja+sParam+'" cellspacing=0 cellpadding=0><tr><td align=center>'+sTitle+'</td></tr></table>');}
}

//### função para link no rodapé
function LinkPag(sTitle,sPage,sParam,sStyle){ 
  sPageM=sPage.toUpperCase();
  if(sPageM=='CADASTRO' || sPageM=='TRACK'){sURL='https://www.rumo.com.br/sistema/';}else {sURL='';}
  if(sPageM=='CADASTRO' || sPageM=='TRACK' || IsBaseTop){sTarget=' target=_top';}else {sTarget='';}
  var str='<a href=';
  str+=sURL+sPage+'.asp?IDLoja='+IDLoja+sParam+' class='+sStyle;
  if(sPagAtual.indexOf(sPageM+'.ASP')>=0 && sPagAtual.indexOf(sParam.toUpperCase())>=0)str +='_On';
  else str +='_Off';
  str+=sTarget+'>'+sTitle+'</a>';
  document.write(str);
}


//### Guarda em variável a página atual
var sPag=document.location.href.toUpperCase();
var Juros=new Array(0,0,0,0,0,0,0,0,0,0);
var JurosVISA=new Array(0,0,0,0,0,0,0,0,0,0);


//### Define os estilos dos menus
FundoMenu1_On='FundoMenu1_On';
FundoMenu1_Off='FundoMenu1_Off';
FundoMenu1_Hover='FundoMenu1_Hover';

//### Define os links para as páginas
LinkHome='home.asp?'+IDLoja;
LinkCat='categorias.asp?'+IDLoja;
LinkProm='listaprodutos.asp?promocao=true&'+IDLoja;
LinkLanc='listaprodutos.asp?lancamento=true&'+IDLoja;
LinkPedido='addproduto.asp?'+IDLoja;
LinkContato='faleconosco.asp?'+IDLoja;
LinkAjuda='ajuda.asp?'+IDLoja;
LinkIndique='Indique.asp?'+IDLoja;
LinkCadastro='https://www.rumo.com.br/sistema/Cadastro.asp?'+IDLoja;
LinkSeção='listaprodutos.asp?'+IDLoja+'&IDCategoria=' ;

function MostraPrecoaVistaDet(PrecoProd)
{
 if(PrecoProd==0)return;
 document.write("<br>Pague com depósito bancário ou boleto bancário e ganhe <font color=#990000><b>13%</font> de desconto</b>.<hr size=1 align=center width=90% style='color:#B4B4B4;'> Valor com desconto <span class=EstPrecoProd>"+FormatPrecoReais(PrecoProd*0.87)+"</span><br><br>");
}


function MostraPreco6x(PrecoProd)
{ 
  if(PrecoProd==0)return;
  document.write("<b>10x de "+ FormatPrecoReais(PrecoProd/10)+ " no Cartão</b>");
 }
function Condicao6x()
{  document.write("no cartão Visa ou Mastercard");
} 
 
function MostraPrecoaVista(PrecoProd)
{  document.write("<b>ou 1x de"+FormatPrecoReais(PrecoProd*0.87)+" por depósito ou boleto 13% desconto<br></b>");
}
function Condicao1x()
{  document.write("Valor já com 13% de desconto em pagamento antecipado a vista");
} 



//### Função que abre janela de chat
function MostraChatP(){
 popup=window.open('ChatLogin.asp?'+IDLoja,'Chat','top=20,left=20,height=280,width=390,scrollbars=no,resizable=yes');
 popup.focus();return void(0);}

//### Função que valida a busca  
function VerTexto(oNome)
{  	if (oNome.Texto.value=='' || oNome.Texto.value.length<2)
   	{	alert('Busca inválida.');
   	 	oNome.Texto.focus();
   	 	return false;
	}
 	else{return true;}
}



//##  Retornar para a página anteriro
  function retornar(i)
   {   
            history.go(i);   
   }   




function MostraSeções(isec)
{
	alert('listaprodutos.asp?'+IDLoja+'&IDCategoria=57538');
	window.location.ref='https://www.rumo.com.br/sistema/ListaProdutos.asp?'+IDLoja+'&IDCategoria=57538';
	alert('https://www.rumo.com.br/sistema/ListaProdutos.asp?'+IDLoja+'&IDCategoria=57538');
}



/**
 * w3cookies (0.1) - 23/12/2006
 * Leandro Vieira Pinho
 * Localize-me. Blog: [ http://leandro.w3invent.com.br ], E-mail leandro[at]w3invent[dot]com[dot]br
 */
var w3cookies =
{	date: new Date(),
	// Cria o(s) cookie(s)
	// Forma de uso: w3cookies.create('nome_do_cookie','valor',dias_para_expirar);
	create: function(strName, strValue, intDays) {
		if ( intDays ) {
			this.date.setTime(this.date.getTime()+(intDays*24*60*60*1000));
			var expires = "; expires=" + this.date.toGMTString();
		} else {
			var expires = "";
		}
		document.cookie = strName + "=" + strValue + expires + "; path=/";
	},
	
	// Ler as informações de um cookie em específico
	// Forma de uso: w3cookies.read('nome_do_cookie');
	read: function(strName) {
		var strNameIgual = strName + "=";
		var arrCookies = document.cookie.split(";");
		for ( var i = 0, strCookie; strCookie = arrCookies[i]; i++ ) {
			while ( strCookie.charAt(0) == " ") {
				strCookie = strCookie.substring(1,strCookie.length);
			}
			if ( strCookie.indexOf(strNameIgual) == 0 ) {
				return strCookie.substring(strNameIgual.length,strCookie.length);
			}
		}
		return null;
	},
	// Delete um cookie desejado
	// Forma de uso: w3cookies.erase('nome_do_cookie');
	erase: function(strName) {
		this.create(strName,"",-1);
	}
}
/*    BANNERS RANDOMICOS  */

/*    LER   /  GRAVAR COOKIES   */

if (w3cookies.read('lastMenuP')==null)	{ w3cookies.create('lastMenuP',0,180);}
if (w3cookies.read('lastDepto')==null)	{ w3cookies.create('lastDepto','smenu0',180);}
lastDepto=w3cookies.read('lastDepto');
lastMenuP=w3cookies.read('lastMenuP');





