// JavaScript Document
				var Mac = (navigator.userAgent.indexOf("Mac") != -1 )
				var IE = (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Mac") == -1 && navigator.appVersion.substring(0,1) >= 3);
				var NS = (navigator.userAgent.indexOf("Mozilla") != -1 && navigator.userAgent.indexOf("Mac") == -1 && navigator.userAgent.indexOf("MSIE") == -1 && navigator.appVersion.substring(0,1) >= 4);
				function makeArray(n)
				{
					this.length = n;
					for (i=1;i<=n;i++)
					{
						this[i]=0;
				  	}
					return this;
				}
				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 MM_findObj(n, d) //v4.01
				{ 
					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 MM_showHideLayers()  //v6.0
				{
					var i,p,v,obj,args=MM_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; }
				}
				/**
				* Sets/unsets the pointer in browse mode
				*
				* @param   object   the table row
				* @param   object   the color to use for this row
				*
				* @return  boolean  whether pointer is set or not
				*/
				function setPointer(theRow, thePointerColor)
				{
					if (thePointerColor == '' || typeof(theRow.style) == 'undefined') 
					{
						return false;
					}
					if (typeof(document.getElementsByTagName) != 'undefined')
					{
						var theCells = theRow.getElementsByTagName('td');
					}
					else if (typeof(theRow.cells) != 'undefined') 
					{
						var theCells = theRow.cells;
					}
					else
					{
						return false;
					}
					var rowCellsCnt  = theCells.length;
					for (var c = 0; c < rowCellsCnt; c++)
					{
						theCells[c].style.backgroundColor = thePointerColor;
					}
					return true;
				}
					function sitesearch(){
						sitesear = document.formSear.searWords.value;
						location.href='?conteudo=search&searWords='+sitesear;
					}
	function transferItems( fromList, toList, bAllItems ) {
	  /* Pass 0 or 1 for the parameter bAllItems. 0 transfers only the selected items */
	  for( i=0; i<fromList.options.length; i++ ) {
		if( bAllItems || fromList.options[i].selected ) {
		  toList.options[toList.options.length] = new Option( fromList.options[i].text, fromList.options[i].value );
		  fromList.options[i] = null;
		  i--;
		}
	  }
	}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}	


	function checkIt(evt){
		var charCode = (evt.which) ? evt.which : event.keyCode
		if (charCode > 31 && (charCode < 48 || charCode > 57)){
			alert("Por favor digite apenas números!");
			return false;
		}
		return true;
	}
	function cnpjFormat(imput,maxsize,keypress)
	{
		var key = keypress.keyCode;
		var vr = imput.value;
		vr = vr.replace( "-", "" );
		vr = vr.replace( "/", "" );
		vr = vr.replace( ".", "" );
		vr = vr.replace( ".", "" );
		tam = vr.length;
		if (tam < maxsize && key != 13){ tam = vr.length + 1 ; }
		if (key == 13 ){	tam = tam - 1 ; }
		if ( key == 13 || (key >= 48 && key <= 57) || (key >= 96 && key <= 105) )
		{
			if ( tam <= 2 )
			{ 
				imput.value = vr ;
			}
			tam = tam - 1;
			if ( (tam > 2) && (tam <= 5) )
			{
				imput.value = vr.substr( 0, tam - 2 ) + '-' + vr.substr( tam - 2, tam ) ; 
			}
			if ( (tam >= 6) && (tam <= 8) )
			{
				imput.value = vr.substr( 0, tam - 6 ) + '/' + vr.substr( tam - 6, 4 ) + '-' + vr.substr( tam - 2, tam ) ; 
			}
			if ( (tam >= 9) && (tam <= 11) )
			{
				imput.value = vr.substr( 0, tam - 9 ) + '.' + vr.substr( tam - 9, 3 ) + '/' + vr.substr( tam - 6, 4 ) + '-' + vr.substr( tam - 2, tam ) ; 
			}
			if ( (tam >= 12) && (tam <= 14) )
			{
				imput.value = vr.substr( 0, tam - 12 ) + '.' + vr.substr( tam - 12, 3 ) + '.' + vr.substr( tam - 9, 3 ) + '/' + vr.substr( tam - 6, 4 ) + '-' + vr.substr( tam - 2, tam ) ; }
			}
		}
		function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
  function setTall()
  {
    if (document.getElementById)
    {

      // O array Divs recebe a referencia das colunas, pode colocar ou retirar quantas quiser.
      var divs = new Array(document.getElementById ('center'),
						                     document.getElementById('left'));

      // Seta todas as colunas para auto, assim se o novo tamanho for menor então ela diminui
      for (var i = 0; i < divs.length; i++)
        divs[i].style.height = 'auto';

      // Determina qual a coluna mais alta
      var maxHeight = 0;
      for (var i = 0; i < divs.length; i++)
        if (divs[i].offsetHeight > maxHeight)
          maxHeight = divs[i].offsetHeight; 
        
      // Deixa todas as colunas com a mesma altura
      for (var i = 0; i < divs.length; i++) {
        divs[i].style.height = maxHeight + 'px';

        if (divs[i].offsetHeight > maxHeight)
        { 
          divs[i].style.height = (maxHeight - (divs[i].offsetHeight - maxHeight)) + 'px';
        }
      }
    }
  }
		
window.onload = function()//Quando a página carregar
{
  externalLinks();
		window.name = 'iVirtua Solutions';
	 try
  {
				bpc.boot('commons/backbase/3_1_1/');
  }
  catch(e)
  {
			
		}
	 try
  {
    setTall();
  }
  catch(e)
  {
			
		}
}

window.onresize = function()//Quando a página for redimencionada
{
	 try
  {
    setTall();
  }
  catch(e)
  {}
}
	//-->

