/* 
 * 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>');
}
