/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function newWindow(mypage, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, '', winprops)
if (parseInt(navigator.appVersion) >= 4) win.window.focus();}

function pad(number, length)
{
  var str = '' + number;

  while (str.length < length)
  {
      str = '0' + str;
  }

  return str;
}

String.prototype.trim = function(){ return this.replace(/^\s*/, "").replace(/\s*$/, ""); }

function clearText(field) {
if (field.defaultValue == field.value) field.value = '';
else if (field.value == '') field.value = field.defaultValue;
}

function zoomText(acao,el){
obj=document.getElementById(el);	
if (obj.style.fontSize=="")	obj.style.fontSize="13px";
atual=parseInt(obj.style.fontSize);
inc=2; maxVal = 19; minVal = 9;
if(acao=="reestablecer"){ obj.style.fontSize="1em" }	
if(acao=="aumentar"){ val=atual+inc; if(val <= maxVal) obj.style.fontSize=val+"px" }	
if(acao=="diminuir"){ val=atual-inc; if(val >= minVal) obj.style.fontSize=val+"px"; }
} 

function GeraSWF(arquivo,largura,altura,id,transp){
var incTransp = '';
document.writeln('<object align="middle" id="globalnav-object" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" name="'+id+'">');
if(transp == "yes"){ document.writeln('<param name="wmode" value="transparent" />'); incTransp = 'wmode="transparent"'; }
document.writeln('<param name="allowScriptAccess" value="always" />');
document.writeln('<param name="quality" value="high" />');
document.writeln('<param name="scaleMode" value="noScale" />');
document.writeln('<param name="menu" value="false" />');
document.writeln('<param name="movie" value="'+arquivo+'" />');
document.writeln('<embed id="globalnav-embed" src="'+arquivo+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" menu="false" align="middle" quality="high" allowscriptacess="always" scale="noscale" id="'+id+'" width="'+largura+'" height="'+altura+'" '+incTransp+'></embed>');
document.writeln('</object>');
}

function MM_findObj(n, d) {
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 setCookie(n, v, p, t){
  now = new Date();
  now.setTime(Date.parse(now) + t);
  document.cookie =  n+'='+escape(v)+';PATH='+p+';EXPIRES='+now.toUTCString();
}

function showHideLayers() {
today = new Date();
setCookie('flutuante', 1, '/', today.getTime() + (3600 * 1000) );
var i,p,v,obj,args=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;}
}
