function openWindow(URL, windowName, windowFeatures, w, h) {
  var t = (screen.height - h) / 2;
  var l = (screen.width  - w) / 2;
  window.open(URL, windowName, windowFeatures+',width='+w+',height='+h+',top='+t+',left='+l);
  return false;
}
function openWindow2(URL, windowName, windowFeatures, w, h) {
  var t = (screen.height - h) / 4;
  var l = (screen.width  - w) / 2;
  window.open(URL, windowName, windowFeatures+',width='+w+',height='+h+',top='+t+',left='+l);
  return false;
}
function alterar(URL) {
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'width=470,height=500,scrollbars');");
}
function popUp(URL) {
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'width=789,height=550,status,scrollbars');");
}
function email(URL) {
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'width=350,height=250,status=no,scrollbars=no');");
}
 
function orcamento ()  
 {
  document.forms[0].submit();
 }

function impre_pes(parm1)
 {
    window.open("apgresu.php?id="+parm1+"&modo=1&qual="+document.all['qual'].value,"_new","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=180,height=210");
  }

function passarValor(parm1)
  { 
    document.all['qual'].value = parm1; 
  }
function limpa() {
    controle.nick.value="";
}
 function orcamento ()  
 {
  document.forms[0].submit();
 }
 function impre_pes(parm1)
 {
    window.open("apgresu.php?id="+parm1+"&modo=1&qual="+document.all['qual'].value,"_new","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=210");
 }
 function impre_pet(parm1)
 {
    window.open("apgresu.php?id="+parm1+"&modo=0&qual="+document.all['qual'].value,"_new","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=210");
 }
function passarValor(parm1)
 { 
    document.all['qual'].value = parm1; 
 } 
function popUp(URL) {
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'width=789,height=550,status,scrollbars');");
}
function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=500,width=790,scrollbars=nos,status=no,resizable=yes');
myform.target=windowname;
return true;
}
function alterar(URL) {
       day = new Date();
       id = day.getTime();
       eval("page" + id + " = window.open(URL, '" + id + "', 'width=470,height=500,scrollbars');");
}
function foto(URL) {
 day = new Date();
 id = day.getTime();
 eval("page" + id + " = window.open(URL, '" + id + "', 'width=470,height=500,scrollbars');");

}
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 Browser(){
	this.name = navigator.appName;
	if (this.name == 'Microsoft Internet Explorer') this.browser = 'ie';
	else if (this.name.match(/Netscape/)) this.browser = 'ns';
	else this.browser = this.name;
	this.version = parseInt(navigator.appVersion);
	this.ns = (this.browser=='ns' && this.version>=4);
	this.ns4 = (this.browser=='ns' && this.version==4);
	this.ns6 = (this.browser=='ns' && this.version>=5);
	this.ie = (this.browser=='ie' && this.version>=4);
	this.ie4 = (this.browser=='ie' && navigator.userAgent.indexOf('MSIE 4')>-1);
	this.ie5 = (this.browser=='ie' && navigator.userAgent.indexOf('MSIE 5')>-1);
	this.ie6 = (this.browser=='ie' && navigator.userAgent.indexOf('MSIE 6')>-1);
	if (this.ie5) this.version = 5;
	this.op5 = (navigator.userAgent.indexOf('Opera 5')>-1);
	if (this.op5){this.browser = 'op'}
	this.dom1 = (document.implementation && document.implementation.hasFeature)?true:false;
	this.os = (navigator.platform)?navigator.platform:'unknown';
	if (this.ie){ this.language = navigator.userLanguage.substring(0,2).toLowerCase() } else if (this.ns || this.op5) { this.language = navigator.language.substring(0,2).toLowerCase() }
	this.toString = function(){ return '[object Browser]'}
	return this;
}

function setOpacity(objId, i){
	b = new Browser()
	if (b.ie){
		obj = document.all[objId]
		obj.style.filter = "alpha(opacity=" + i + ")";
	}
	else if (b.ns6){
		obj = document.getElementById(objId)
		obj.style.MozOpacity = i+'%'
	}
}

function fadeOpacity(objId, sOpacity, fOpacity,speed){
	b = new Browser()
	var finished = false
	if (sOpacity == fOpacity){finished=true}
	else if (sOpacity > fOpacity){ sOpacity-- }
	else if (sOpacity < fOpacity){ sOpacity++ }
	setOpacity(objId,sOpacity)
	if (finished!=true) document.TC_opacity = setTimeout('fadeOpacity(\''+objId+'\','+sOpacity+','+fOpacity+','+speed+')',speed)
}
function nada(e){
var r = 0;

}
function AbreJanela(pagina,janela,w,h,scrolling) {
if (!scrolling) { scrolling='auto' }
Abrir = window.open(pagina,janela,'width='+w+',height='+h+',scrollbars='+scrolling+',toolbar=no,location=no,status=no,menubar=no,resizable=no,left=200,top=150')
}
function SelectScript_oncellchange(pagina,janela,w,h,scrolling){
if (!scrolling) { scrolling='auto' }
Abrir = window.open(SelectScript.value,janela,'width=300,height=200,scrollbars=yes,toolbar=no,location=no,status=no,menubar=no,resizable=no,left=200,top=200')
}
function mostra_esconde_menu( menu ) {
if ( menu.style.visibility == "visible" ){
menu.style.visibility="hidden";
}
else{
menu.style.visibility="visible"
document.form33.email.focus();
}
}
function esconde_destaque( menu ) {
menu.style.visibility="hidden"
}
function mostra_destaque( menu ) {
menu.style.visibility="visible"
}

