function menus(objecto, conteudo)
{
document.getElementById(objecto).innerHTML=document.getElementById(conteudo).innerHTML;
}

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_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_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 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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->

var Cookie = function(name, value, path, expires, domain, secure)
{
	this.Name = name;
	this.Value = value;
	this.Path = path;
	this.Expires = expires;
	this.Domain = domain;
	this.Secure = secure;
}

Cookie.prototype.MaxSize = 4000; //size in KB

Cookie.prototype.toString = function()
{
	return this.Value;
}

Cookie.prototype.Append = function(newValue)
{
	this.Value += newValue;
}

Cookie.prototype.$GetValue = function( startIndex )
{  
	var endIndex = document.cookie.indexOf( ";", startIndex );  
	if( endIndex == -1 )    
		endIndex = document.cookie.length;
	var cookieValue = document.cookie.substring(startIndex, endIndex);
	if( cookieValue == "" )
		return null;
	else
		return unescape( cookieValue );
}

Cookie.prototype.Load = function()
{  
	var arg = this.Name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	
	var i = 0;  
	while( i < clen )
	{    
		var j = i + alen;    
		if( document.cookie.substring(i, j) == arg )
		{
			this.Value = this.$GetValue(j);
			return this.Value;
		}
		i = document.cookie.indexOf( " ", i ) + 1;    
		if( i == 0 ) break;   
	}  
	
	return null;
}

Cookie.prototype.Save = function()
{
	var newCookie = this.Name + "=" + escape(this.Value) +
	((this.Expires == null) ? "" : ("; expires=" + this.Expires)) +
	((this.Path == null) ? "" : ("; path=" + this.Path)) +
	((this.Domain == null) ? "" : ("; domain=" + this.Domain)) +
	((this.Secure == true) ? "; secure" : "");
	
	if( newCookie.length > Cookie.MaxSize )
		throw Error("Cookie length was " + newCookie.length + "kb but cookies cannot exceed " + Cookie.MaxSize + "kb");
	
	document.cookie = newCookie;
}

Cookie.prototype.Delete = function()
{  
	var exp = new Date();  
	exp.setTime(exp.getTime() - 1);
	document.cookie = this.Name + "=null;expires=" + exp.toGMTString();
}

var PageCookie = function(pageName)
{
    this.base = Cookie;
    this.base(pageName);
    
	this.PageName = pageName;
}
PageCookie.prototype = new Cookie();
PageCookie.prototype.constructor = PageCookie;

PageCookie.prototype.GetValue = function(id)
{
	if( this.Value == null ) return null;
	
	var i = this.Value.indexOf("|id|" + id);
	if( i < 0 ) return null;

	var vi = this.Value.indexOf("|value|", i);
	var vie = this.Value.indexOf("|disabled|", vi);
	
	var v = this.Value.substring(vi+7, vie);
	return v;
}

PageCookie.prototype.GetDisabled = function(id)
{
	if( this.Value == null ) return null;

	var i = this.Value.indexOf("|id|" + id);
	if( i < 0 ) return null;

	var vi = this.Value.indexOf("|disabled|", i);
	var vie = this.Value.indexOf("|id|", vi);
	if( vie == -1 ) vie = this.Value.length;
	
	var v = this.Value.substring(vi+10, vie);
	return v;
}

PageCookie.prototype.$Append = Cookie.prototype.Append;
PageCookie.prototype.Append = function(id, value, disabled)
{
	this.$Append("|id|" + id + "|value|" + value + "|disabled|" + disabled);
}

PageCookie.prototype.GetPageState = function(psAIBlock)
{
	if( psAIBlock == null ) 
		psAIBlock = "all";
	else
		psAIBlock = psAIBlock.toLowerCase();

	var oFields = document.getElementsByTagName("input");

	if( oFields != null )
	{
		for( i=0; i < oFields.length; i++ )
		{
			var sAIBlock = oFields[i].getAttribute('ai_block');
			
			if( sAIBlock != null ) 
				sAIBlock = sAIBlock.toLowerCase();
				
			if( psAIBlock == "all" || sAIBlock == psAIBlock )
			{
				if( oFields[i].type == "text" )
				{
					if( oFields[i].id != null )
						this.Append(oFields[i].id, oFields[i].value, oFields[i].disabled);
				}
				else if( oFields[i].type == "checkbox" || oFields[i].type == "radio" )
				{
					if( oFields[i].id != null )
						this.Append(oFields[i].id, oFields[i].checked, oFields[i].disabled);
				}
			}
		}
	}

	var oFields = document.getElementsByTagName("textarea");

	if( oFields != null )
	{
		for( i=0; i < oFields.length; i++ )
		{
			var sAIBlock = oFields[i].getAttribute('ai_block');
			
			if( sAIBlock != null ) 
				sAIBlock = sAIBlock.toLowerCase();
				
			if( psAIBlock == "all" || sAIBlock == psAIBlock )
			{
				if( oFields[i].type == "textarea" )
				{
					if( oFields[i].id != null )
						this.Append(oFields[i].id, oFields[i].value, oFields[i].disabled);
				}
			}
		}
	}
	
	var oFields = document.getElementsByTagName("select");

	if( oFields != null )
	{
		for( i=0; i < oFields.length; i++ )
		{
			var sAIBlock = oFields[i].getAttribute('ai_block');
			
			if( sAIBlock != null ) 
				sAIBlock = sAIBlock.toLowerCase();
				
			if( psAIBlock == "all" || sAIBlock == psAIBlock )
			{
				if( oFields[i].type == "select-one" )
				{
					if( oFields[i].id != null )
						this.Append(oFields[i].id, oFields[i].selectedIndex, oFields[i].disabled);
				}
			}
		}
	}
}

PageCookie.prototype.RestorePageState = function(psAIBlock)
{
	if( this.Value == null ) return;

	if( psAIBlock == null ) 
		psAIBlock = "all";
	else
		psAIBlock = psAIBlock.toLowerCase();
	
	var oFields = document.getElementsByTagName("input");

	if( oFields != null )
	{
		for( i=0; i < oFields.length; i++ )
		{
			var sAIBlock = oFields[i].getAttribute('ai_block');
			
			if( sAIBlock != null ) 
				sAIBlock = sAIBlock.toLowerCase();
				
			if( psAIBlock == "all" || sAIBlock == psAIBlock )
			{
				if( oFields[i].type == "text" )
				{
					var id = oFields[i].id;
					if( id )
					{
						var v = this.GetValue(id);
						var d = this.GetDisabled(id);
						if( v != null )
							oFields[i].value = v;

						//needed because in JS "false" evalutes to true (WTF?!?)
						if( d == "true" )
							oFields[i].disabled = true;
						else
							oFields[i].disabled = false;
					}
				}
				else if( oFields[i].type == "checkbox" || oFields[i].type == "radio" )
				{
					var id = oFields[i].id;
					if( id )
					{
						var v = this.GetValue(id);
						var d = this.GetDisabled(id);
						
						//needed because in JS "false" evalutes to true (WTF?!?)
						if( v == "true" )
							oFields[i].checked = true;
						else
							oFields[i].checked = false;
							
						//needed because in JS "false" evalutes to true (WTF?!?)
						if( d == "true" )
							oFields[i].disabled = true;
						else
							oFields[i].disabled = false;
					}
				}
			}
		}
	}

	var oFields = document.getElementsByTagName("textarea");

	if( oFields != null )
	{
		for( i=0; i < oFields.length; i++ )
		{
			var sAIBlock = oFields[i].getAttribute('ai_block');
			
			if( sAIBlock != null ) 
				sAIBlock = sAIBlock.toLowerCase();
				
			if( psAIBlock == "all" || sAIBlock == psAIBlock )
			{
				if( oFields[i].type == "textarea" )
				{
					var id = oFields[i].id;
					if( id )
					{
						var v = this.GetValue(id);
						var d = this.GetDisabled(id);
						if( v != null )
							oFields[i].value = v;

						//needed because in JS "false" evalutes to true (WTF?!?)
						if( d == "true" )
							oFields[i].disabled = true;
						else
							oFields[i].disabled = false;
					}
				}
			}
		}
	}
	
	var oFields = document.getElementsByTagName("select");

	if( oFields != null )
	{
		for( i=0; i < oFields.length; i++ )
		{
			var sAIBlock = oFields[i].getAttribute('ai_block');
			
			if( sAIBlock != null ) 
				sAIBlock = sAIBlock.toLowerCase();
				
			if( psAIBlock == "all" || sAIBlock == psAIBlock )
			{
				if( oFields[i].type == "select-one" )
				{
					var id = oFields[i].id;
					if( id )
					{
						var v = this.GetValue(id);
						var d = this.GetDisabled(id);
						if( v != null )
							oFields[i].selectedIndex = v;

						//needed because in JS "false" evalutes to true (WTF?!?)
						if( d == "true" )
							oFields[i].disabled = true;
						else
							oFields[i].disabled = false;
					}
				}
			}
		}
	}
}

function left($string,$count) {
$string = substr($string,0,$count);
return $string;
}

function right ($str, $howManyCharsFromRight)
{
  $strLen = strlen ($str);
  return substr ($str, $strLen - $howManyCharsFromRight, $strLen);
}
