/*#####################################
Sem cópias.
Obrigado =)
(drei, orby.com.br)
#####################################*/
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_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 abre__(pagina,x,y) {
	var left_=(screen.width-x)/2;
	var top_=(screen.height-y)/2;
	remote = window.open(pagina,'_blank','left='+ left_ +',top='+top_+',toolbar=no,location=no,directories=no,statusbar=no,menubar=no,scrollbars=1,resizable=no,menubar=no,width='+x+',height='+y)
}
function abre_(pagina,x,y) {
	var left_=(screen.width-x)/2;
	var top_=(screen.height-y)/2;
	remote = window.open(pagina,'_blank','left='+ left_ +',top='+top_+',toolbar=no,location=no,directories=no,statusbar=no,menubar=no,scrollbars=0,resizable=no,menubar=no,width='+x+',height='+y)
}

function zoom(pagina,x,y) {
	var left_=(screen.width-x)-20;
	var top_=10;
	remote = window.open(pagina,'_blank','left='+ left_ +',top='+top_+',toolbar=no,location=no,directories=no,statusbar=no,menubar=no,scrollbars=0,resizable=no,menubar=no,width='+x+',height='+y)
}

function representantes(pagina,x,y) {
	var left_=(screen.width-x)/2;
	var top_=(screen.height-y)/2;
	remote = window.open(pagina,'representantes','left='+ left_ +',top='+top_+',toolbar=no,location=no,directories=no,statusbar=no,menubar=no,scrollbars=1,resizable=no,menubar=no,width='+x+',height='+y)
}
/*#####################################*/
function enviarForm() {
	if (document.form.texto.value=="") {
		alert("Digite alguma palavra para iniciar a busca");
		document.form.texto.focus();
		return false;
	} else {
		document.form.action = "busca.php";
		abreFormEnviado('325', '425');
		document.form.target = "busca";
		document.form.submit();
	}
}
function abreFormEnviado(x, y) {
	var left_=(screen.width-x)/2;
	var top_=(screen.height-y)/2;
	var janela = window.open("",'busca','left='+ left_ +',top='+top_+',toolbar=no,location=no,directories=no,statusbar=no,menubar=no,scrollbars=1,resizable=no,menubar=no,width='+x+',height='+y)
	janela.focus();
}
/*#####################################*/

var iframeids=["interno", "destaques", "lancamentos"]

var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller






function valida_contato () {
	if (document.form_contato.nome.value=="") {
		alert("Digite o seu nome");
		document.form_contato.nome.focus();
		return false;
	}
	if (document.form_contato.empresa_.value=="") {
		alert("Digite a sua empresa");
		document.form_contato.empresa_.focus();
		return false;
	}
	if (document.form_contato.email.value=="") {
		alert("Digite o seu e-mail");
		document.form_contato.email.focus();
		return false;
	}
	if (document.form_contato.telefone.value=="") {
		alert("Digite o seu telefone");
		document.form_contato.telefone.focus();
		return false;
	}
	if (document.form_contato.cidade.value=="") {
		alert("Digite a sua cidade");
		document.form_contato.cidade.focus();
		return false;
	}
	if (document.form_contato.estado.value=="") {
		alert("Digite o seu estado");
		document.form_contato.estado.focus();
		return false;
	}
	if (document.form_contato.mensagem.value=="") {
		alert("Digite a sua mensagem");
		document.form_contato.mensagem.focus();
		return false;
	}
	
}