function abrir() 
{
	var windowFeatures = "", nomeArquivo = "", nomeJanela = "", erro = null;

	Argumentos = abrir.arguments; 
	noArgumentos = Argumentos.length; 
	nomeArquivo = Argumentos[0];
	
	for (i = 1; i < noArgumentos; i++) 
	{
		valor = Argumentos[i].substring(2, Argumentos[i].length);
	
		switch (Argumentos[i].substring(0, 2)) 
		{
			case "nj" : nomeJanela = valor; break;
			case "to" : windowFeatures += "top=" + valor + ", "; break;
			case "le" : windowFeatures += "left=" + valor + ", "; break;
			case "he" : windowFeatures += "height=" + valor + ", "; break;
			case "wi" : windowFeatures += "width=" + valor + ", "; break;
			case "lb" : windowFeatures += "location=" + valor + ", "; break;
			case "mb" : windowFeatures += "menubar=" + valor + ", "; break;
			case "sc" : windowFeatures += "scrollbars=" + valor + ", "; break;
			case "st" : windowFeatures += "status=" + valor + ", "; break;
			case "tb" : windowFeatures += "toolbar=" + valor + ", "; break;
			case "tt" : windowFeatures += "titlebar=" + valor + ", "; break;
			case "re" : windowFeatures += "resizable=" + valor + ", "; break;
			
			default : erro = '"Código de atributo não informado no '+(i+1)+' º argumento (' +Argumentos[i]+ ')"';
		}
	}
	
	
	windowFeatures = windowFeatures.substring(0,windowFeatures.lastIndexOf(","));
	
	if (erro)
	{
		alert(erro);
	}
	else 
	{ 
		novaJanela = window.open(nomeArquivo, nomeJanela, windowFeatures) 
	}
}


function mostrarPorId(strId)
{
	var obj = document.getElementById(strId);
	obj.style.display = 'block';
}

function ocultarPorId(strId)
{
	var obj = document.getElementById(strId);
	obj.style.display = 'none';
}


function mostraTextoPadrao(objCampo, strTexto)
{
	if ((objCampo.value == null) || (objCampo.value != null && objCampo.value.length == 0))
	{
		objCampo.value = strTexto;
	}
}

function ocultaTextoPadrao(objCampo, strTexto)
{
	if (objCampo.value == strTexto)
	{
		objCampo.value = '';
	}
}

function ExibeFlash(src, larg, alt, vars, vars2)
{
	var strHtml = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ larg +'" height="'+ alt +'">';
	strHtml += '<param name="movie" value="'+ src +'" />';	
	strHtml += '<param name="flashvars" '+ vars +' />';
	strHtml += '<param name="wmode" value="transparent" />';
	strHtml += '<embed src="'+ src +'" flashvars="'+ vars2 +'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ larg +'" height="'+ alt +'"></embed>';
	strHtml += '</object>';

	document.write(strHtml);
}

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}
