<!--
//Bloco de c?digo para esconder e mostra form
var Ver4 = parseInt(navigator.appVersion) >= 4
var IE4 = ((navigator.userAgent.indexOf("MSIE") != -1) && Ver4)
var block = "formulario";
function esconde(obj) {	document.getElementById(obj).style.visibility = "hidden"; }
function mostra (obj) { document.getElementById(obj).style.visibility = "visible"; }
//Bloco de codigo para esconder e mostra form
function Expande(d) {
	with (document.getElementById(d)) {
		if (style.display=='none') {
			style.display='list-item';
		} else {
			style.display='none';
		}
	}
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  return window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}



var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function toolTip(msg, fg, bg)
{
  if(msg=='') // hide

  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else // show
  {
    if(!fg) fg = "#000000";
    if(!bg) bg = "#FFFFE1";
    var content =
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +
    '<table border="0" cellspacing="2" cellpadding="1" bgcolor="' + bg + 
    '"><td align="left"><font face="verdana" color="' + fg +
    '" size="-2">&nbsp\;' + msg +
    '&nbsp\;</font></td></table></td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function noSpam(nome,dominio) {
	window.location='mailto:'+nome+'@'+dominio;
}

function noSpamPrint(nome,dominio) {
	document.write(nome+'@'+dominio);
}

function gerasenha(alfa,num,tam){
	var str1 = 'ABCDEFGHIJKLMNOPQRSTUVXWYZ', str2 = '0123456789'; senha = '';
	var str = (alfa?str1:'') + (num?str2:'');
	for (var i=1;i<=tam;i++){
		senha+=str.substr(Math.floor(Math.random()*(str.length-1)),1);
	}
	return senha;
}
function scroll_zero() {
	MM_goToURL('window','#');
}
function SlideShow(slideList, image, speed, name){
         this.slideList = slideList;
         this.image = image;
         this.speed = speed;
         this.name = name;
         this.current = 0;
         this.timer = 0;
 }
function switchImage(imgName, imgSrc){
	if (imgName=='bgtopo') {
		document.getElementById(imgName).background=imgSrc;
	} else {
		document.getElementById(imgName).src=imgSrc;
	}
}

function SlideShow_play(){
	with(this){
		if(current++ == slideList.length-1) current = 0;
		switchImage(image, slideList[current]);
		clearTimeout(timer);
		timer = setTimeout(name+'.play()', speed);
	}
} 

SlideShow.prototype.play = SlideShow_play;

//funcoes para mostrar/ocultar div no form de cadastro
	function Centra2(win){
		if (ns6) {
			_left=(window.innerWidth/2)-(350/2);
			_top=(window.innerHeight/2)-(120/2);
		} else {
			w=((screen.width-window.screenTop)/2);
			h=((screen.height-window.screenLeft)/2);
			_left=(w/2);
			_top=(h/2);
		}
		win.style.left=_left;
		win.style.top=_top;
	}
	function Mostra(Id){
		win = document.getElementById(Id);
		Centra2(win);
		win.style.display='inline';
	}
	function Oculta(Id){
		document.getElementById(Id).style.display='none';
	}
	
// FUNCOES PARA CARTAO DE CREDITO
function validaFormCC() {
	if (confirm('Confirma as informações preenchidas?')) {
		return true;
	}
	return false;
}
function AddNum(n,m){
//	with (document.forms[0]) {
	with (document) {
		t = getElementById('NumeroCartao').value;
		if (t.length<m) {
			getElementById('NumeroCartao').value += n;
		} else {
			alert('Número máximo de caracteres atingido ('+m+')!');
		}
	}
}
function bloqueia_digit(e) {
	key=0;
	if(window.event){key=e.keyCode;}else if(e.which){key=e.which;}
	//if (key!=8 || key < 48 || key > 57) return (((key > 47) && (key < 58)) || (key==8));
	return false;
}
function VerificaFormaPagto()
  {
  var objForm = document.getElementById('frmPedido');
  var objDivNumeroCartao = document.getElementById('divNumeroCartao');
  var objDivSelCard = document.getElementById('divSelCard');
  var objDivMesVal = document.getElementById('divMesVal');
  var objDivAnoVal = document.getElementById('divAnoVal');
  var objDivCodSeg = document.getElementById('divCodSeg');
  var objDivNumParc = document.getElementById('divNumParc');
  with(objForm)
  {
      switch (bandeira.options[bandeira.selectedIndex].value)
      {
      case 'VISA':
         //Visa
         objDivNumeroCartao.style.display = 'block';
         //objDivSelCard.style.display = 'none';
         objDivMesVal.style.display = 'block';
         objDivAnoVal.style.display = 'block';
         objDivCodSeg.style.display = 'block';
         objDivNumParc.style.display = 'none';
         FormaPagto.value='VISA';
         break;
	  case 'MASTERCARD':
         //Master
         objDivNumeroCartao.style.display = 'none';
         //objDivSelCard.style.display = 'none';
         objDivMesVal.style.display = 'none';
         objDivAnoVal.style.display = 'none';
         objDivCodSeg.style.display = 'none';
         objDivNumParc.style.display = 'none';

         FormaPagto.value='MASTERCARD';
         break;
	  case 'DINERS':
         //Master
         objDivNumeroCartao.style.display = 'none';
         //objDivSelCard.style.display = 'none';
         objDivMesVal.style.display = 'none';
         objDivAnoVal.style.display = 'none';
         objDivCodSeg.style.display = 'none';
         objDivNumParc.style.display = 'none';

         FormaPagto.value='DINERS';
         break;
      case 'AMEX':
         //Amex
         objDivNumeroCartao.style.display = 'block';
         //objDivSelCard.style.display = 'none';
         objDivMesVal.style.display = 'block';
         objDivAnoVal.style.display = 'block';
         objDivCodSeg.style.display = 'block';
         objDivNumParc.style.display = 'none';
         FormaPagto.value='AMEX';
         break;		
      default:
         alert('Selecione uma forma de pagamento.');
         Bandeira.focus();
         return(false);
      }
    }
}
// FUNCOES PARA CARTAO DE CREDITO :: FIM
function fecha_banner() {
	document.getElementById('banner_ajax').style.display='none';
}

