function calcularAltura()
{
  //Calcular a altura da página actual.
  var the_height=
    document.getElementById('conteudo').contentWindow.
      document.body.scrollHeight;

  //Alterar a altura do iframe
  document.getElementById('conteudo').height=
      the_height;
}


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_timelinePlay(tmLnName, myID) { //v1.2
  //Copyright 1997, 2000 Macromedia, Inc. All rights reserved.
  var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
  if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
  tmLn = document.MM_Time[tmLnName];
  if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
  if (myID == tmLn.ID) { //if Im newest
    setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
    fNew = ++tmLn.curFrame;
    for (i=0; i<tmLn.length; i++) {
      sprite = tmLn[i];
      if (sprite.charAt(0) == 's') {
        if (sprite.obj) {
          numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
          if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
            keyFrm=1;
            for (j=0; j<sprite.values.length; j++) {
              props = sprite.values[j]; 
              if (numKeyFr != props.length) {
                if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
                else        sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
              } else {
                while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
                if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
                  if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
                  else        sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
        } } } } }
      } else if (sprite.charAt(0)=='b' && fNew == sprite.frame) eval(sprite.value);
      if (fNew > tmLn.lastFrame) tmLn.ID = 0;
  } }
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


//data

var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var timeValue = "" + ((hours >12) ? hours -12 :hours)
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += (hours >= 12) ? " PM" : " AM"
timerRunning = true;

mydate = new Date();
myday = mydate.getDay();
mymonth = mydate.getMonth();
myweekday= mydate.getDate();
weekday= myweekday;
myyear= mydate.getYear();
year = myyear

if(myday == 0)
day = " Domingo, "

else if(myday == 1)
day = " Segunda, "

else if(myday == 2)
day = " Terça, "

else if(myday == 3)
day = " Quarta, "

else if(myday == 4)
day = " Quinta, "

else if(myday == 5)
day = " Sexta, "

else if(myday == 6)
day = " Sábado, "

if(mymonth == 0)
month = " de Janeiro de "

else if(mymonth ==1)
month = " de Fevereiro de "

else if(mymonth ==2)
month = " de Março de "

else if(mymonth ==3)
month = " de April de "

else if(mymonth ==4)
month = " de Maio de "

else if(mymonth ==5)
month = " de Junho de "

else if(mymonth ==6)
month = " de Julho de "

else if(mymonth ==7)
month = " de Agosto de "

else if(mymonth ==8)
month = " de Setembro de "

else if(mymonth ==9)
month = " de Outubro de "

else if(mymonth ==10)
month = " de Novembro de "

else if(mymonth ==11)
month = " de Dezembro de "




function doBlink() {
  // Blink, Blink, Blink...
  var blink = document.all.tags("BLINK")
  for (var i=0; i < blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
  // Make sure it is IE4
  if (document.all)
    setInterval("doBlink()",400)
}

function janela(url)
{
	newwindow=window.open(url,'janela','width=640, height=480, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function janela2(url)
{       //alert('A livraria virtual encerrou as atividades de 2007...\nNovos pedidos poderão ser efetuados após 02/01/2008.\nUm Feliz Natal e próspero  2008. ');return false;exit;
	newwindow=window.open(url,'janela','left=0,top=0,width=640, height=480, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=no');
	if (window.focus) {newwindow.focus()}
	return false;
}

function janela3(url)
{
	newwindow=window.open(url,'janela','left=0,top=0,width=740, height=480, menubar=no, status=no, location=no, toolbar=yes, scrollbars=yes, resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function janela4(url)
{
	newwindow=window.open(url,'janela','width=790, height=580, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}

function validar(form1) 
{ 

teste=new String()
  
    if (( form1.objetivo[0].checked == false )
    && ( form1.objetivo[1].checked == false ) 
    && ( form1.objetivo[2].checked == false ) 
    && ( form1.objetivo[3].checked == false ))
    
    {
        alert("Marque o objetivo da mensagem...")
//        form1.objetivo.focus()
        return false 
    }
    
    objetivo=this.form1.objetivo.value

    if (form1.nome.value.length < 2) 
    { 
        alert("Preencher o campo NOME.") 
        form1.nome.focus() 
        return false 
    } 

    if (form1.email.value.length <6 ) 
    { 
        alert("Preencher o campo E-mail.") 
        form1.email.focus() 
        return false 
    } 

    teste=this.form1.email.value

    if (!teste.match("@"))
    {alert("Verifique o preenchimento do campo  e-mail !!!")
    return false
    }
    if (teste.match(","))
    {alert("ERRO !!! Email incorreto! Não use separadores...Apenas um email pode ser digitado !!!")
    return false
    }
if (teste.match(";"))
    {alert("ERRO !!! Email incorreto! Não use separadores...apenas um email pode ser digitado !!!")
    return false
    }
if (teste.match(" "))
    {alert("ERRO !!! Email incorreto! Espaços não permitidos em enderêço de email !!!")
    return false
    }	

if (( form1.atividade[0].checked == false )
    && ( form1.atividade[1].checked == false ) 
    && ( form1.atividade[2].checked == false ) 
    && ( form1.atividade[3].checked == false )
    && ( form1.atividade[4].checked == false )
	&& ( form1.atividade[5].checked == false )
    && ( form1.atividade[6].checked == false ))
    
    {
        alert("Selecione uma Atividade...")
//        form1.objetivo.focus()
        return false 
    }



    if (form1.cidade.value.length <2) 
    { 
        alert("Informar nome da CIDADE.") 
        form1.cidade.focus() 
        return false 
    }


    if (form1.estado.value.length <2) 

    { 
        alert("Informar nome do ESTADO.") 
        form1.estado.focus() 
        return false 
    } 

    if (form1.assunto.value.length <5) 
    { 
        alert("Informar ASSUNTO da mensagem.") 
        form1.assunto.focus() 
        return false 
    } 

    if (form1.mensagem.value.length <10) 
    { 
        alert("Falta digitar sua MENSAGEM.") 
        form1.mensagem.focus() 
        return false 
    
	} 
alert("A confirmação de recebimento de sua mensagem deverá ser automaticamente enviada para seu email (informado neste formulário)... Verifique em alguns minutos !");
}

