// com escape() para 'encodar' corretamente os caracteres na URL
function abrepop(pagina, nome, top, left, sbar, resize, x, y){
window.open(escape(pagina), nome,'top='+ top +', left='+ left +', toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+ sbar +',resizable='+ resize +',width='+ x +',height='+ y +'');
}

//abrepop sem escape, para area administrativa
function abrepop_adm(pagina, nome, top, left, sbar, resize, x, y){
window.open(pagina, nome,'top='+ top +', left='+ left +', toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+ sbar +',resizable='+ resize +',width='+ x +',height='+ y +'');
}

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

function openWin(wName, wWidth, wHeight, wResize)
			{
			  features = 'scrollbars=1,status=1,resizable=' + ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? ',height=' + wHeight : '');
			  popWin = window.open('', wName, features);
        if(popWin.focus) { popWin.focus(); }
        return true;
			}

function openWin2(wName, wWidth, wHeight, wResize)
			{
			  features = 'scrollbars=1,status=1,resizable=' + ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? ',height=' + wHeight : '');
			  popWin = window.open('', wName, features);
        if(popWin.focus) { popWin.focus(); }
        return true;
			}

// Written by Colin Moock
function loadinparent(url, closeSelf){
	self.opener.location = url;
	if(closeSelf) self.close();
	}
	
function go2()  {
  window.location=document.catalogo.catalogo.options[document.catalogo.catalogo.selectedIndex].value
}

function menugo2()  {
  window.location=document.menu.menu.options[document.menu.menu.selectedIndex].value
}

function categoriago2()  {
  window.location=document.categoria.categoria.options[document.categoria.categoria.selectedIndex].value
}

function Count(obj,nu,id){
 var res=document.getElementById(id)
 if (obj.value.length>nu){
  obj.value=obj.value.substring(0,nu);
 }
 res.value=nu-obj.value.length;
}

function confirm_entry()
{
input_box=confirm("Click OK or Cancel to Continue");
if (input_box==true)

{ 
// Output when OK is clicked
// alert ("You clicked OK"); 
}

else
{
// Output when Cancel is clicked
//alert ("You clicked cancel");
//window.location ="../boletim/";
}

}