var expDays = 7;
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

function autoCalc(atual, nova) {
if (nova != atual) {
	document.carrinho.submit();
}
}

function Layers(Id,action) {
document.getElementById(Id).style.visibility = action;
}

function imprime() {
window.print();
}

function janela(url,nome,scroll,w,h,c) {
propriedades = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,width="+w+",height="+h;
win = window.open(url,nome,propriedades);
if(c!="n"){
var x = (win.screen.width-w)/2;
var y = (win.screen.height-h)/2;
win.moveTo(x,y);
}
}

function Fotos(img,w,h) {
janela("../descricao.php?cod="+img,img,"no",w,h,"");
}

function abreBoleto(cod){
janela('boleto.php?cod='+cod,'Boleto','yes',700,600,'');
}

function pagamento(tipo,cod){
if(tipo=='BF'){
tipo = 'applet';
}else if(tipo=='TB'){
tipo = 'Transfer';
}else{
tipo = 'Boleto';
}
janela('https://mup.comercioeletronico.com.br/seps'+tipo+'/004516168/prepara_pagto.asp?MerchantId=004516168&OrderId='+cod,'pagamentoLoja','yes',700,500,'');
return false;
}

function findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function confirma(msg){
conf = confirm('Confirma:\n'+msg);
return conf;
}

function right(e) {
msg = "Cópia não permitida!";
  if (navigator.appName == 'Netscape' && e.which == 3) {
   alert(msg);
   return false;
  }
  if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
   alert(msg);
   return false;
  }
  else return true;
}

function cop() {
//document.onmousedown = right;
  if(document.images) {
    for(i=0;i<document.images.length;i++) {
      document.images[i].onmousedown = right;
      document.images[i].onmouseup = right;
    }
  }
}

