var start = false;
var tembusca = false;
var temnavegacao = false;
function init() {
	DynLayerInit(); //inicia layers e cria-os como objeto pelo dynlayer
	if (window.tem_painel) initPainelCeA();
}

//abre janela padrão
function clickPop(url,nome,opcoes) {
  window.open(url,nome,opcoes);
}

// proxima url [ menu da home ]
function clickVai(praonde) {
	top.location.href = praonde;
}

function clickOK(tembusca,temnavegacao) {
  if (tembusca) {
    document.busca.palavra_aux.value="Digite aqui o produto";
  }
  if (temnavegacao) {
	fSetOptions(precos,document.localizador.faixadeprecos,1);
  //document.busca.palavra.focus();
  }
  start = true; // Define start como true para que as funcoes de swap de imagem possam ser executadas
}

// Manipulação de SELECTs
function mOption(strId, strText) {
	this.id = strId;
	this.text = strText;
}
function fSetOptions(vOptions, fSelect, strSelected) {
	fSelect.length = vOptions.length;
	for (i=0; i<vOptions.length; i++) {
		fSelect.options[i].value = vOptions[i].id; 
		fSelect.options[i].text = vOptions[i].text;
		if (vOptions[i].id==strSelected)
			fSelect.options[i].selected=true;
	}
}

// Abre pop-up chromeless
function openIT(theurl,wname,W,H,TIT) {
	windowCERRARa 		= "images/close_a.gif"
	windowCERRARd 		= "images/close_d.gif"
	windowCERRARo 		= "images/close_o.gif"
	windowTIT 	    	= "<font face=verdana size=1>&nbsp; "+TIT+"</font>"
	windowBORDERCOLOR   	= "#333333"
	windowBORDERCOLORsel	= "#336699"
	windowTITBGCOLOR    	= "#ACACC8"
	windowTITBGCOLORsel 	= "#8C8CB3"
	openchromeless(theurl, wname, W, H, windowCERRARa, windowCERRARd, windowCERRARo, windowTIT, windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel)
}

// Reloads the window if Nav4 resized
function reloadPage(init) {
  c = navigator.appName
  if (init==true) with (navigator) {
    if (c=="Netscape") {
      document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage;
    }
  } else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

