 // config da barra
var BarraNumero = 24;
var BarraCor1 = '#7F8DA8'; // cor clara
var BarraCor2 = '#667077'; // cor escura

var aMeses = new Array("","Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro");

var dC = document;
function $(id) {
	return document.getElementById(id);
}

function getParser(_url)
{
	var L=_url;
	var d=L.substring(L.indexOf("?")+1);
	var c=v=new Array(); c=d.split("&");
	for(i=0;i<c.length&&c.length>0;i++) {
	v=c[i].split("="); if(v.length>1)
	eval(v[0]+"=unescape('"+v[1].replace(/\+/g," ")+"')");} 
}

function loadScript(src,callback,doOnload) 
{
  var script = document.createElement('script');
  script.type = 'text/javascript';
	script.src = src;  	
  if (callback) 
  {
  	if ((typeof(doOnload) == "undefined") || doOnload == 1)
   		addEvent(window,"load",callback);
   	else
   		setTimeout(callback,100);
  }
  document.getElementsByTagName("head")[0].appendChild(script);
  
  return;
}

function loadStyle(src) 
{
  var css_style = document.createElement('link');
  css_style.type = 'text/css';
  css_style.rel = 'stylesheet';
	css_style.href = src;  	
  document.getElementsByTagName("head")[0].appendChild(css_style);
}

function addEvent(oElement,szType, oFunction)
{
	if (oElement.addEventListener) {
		oElement.addEventListener (szType,oFunction,false);
	} else if (oElement.attachEvent) {
		oElement.attachEvent ('on'+szType,oFunction)
	} else {
		eval ("oElement."+szType+"= oFunction");
	}
}

String.prototype.lastName = function()
{
	lastname = this.substr(this.search(" ")+1,this.length);
	return lastname;
}	
String.prototype.parseProva = function() 
{ 
	return this.replace(/(GP dos |GP do |GP das |GP da |GP de )/g, ""); 
}

String.prototype.BrazilianDate = function() 
{
	   aData = this.split ('-');
	   return aData[2]+"/"+aData[1]+"/"+aData[0];
}
String.prototype.replaceAccent = function()
{
	// Transforma a acentuação
	Accent = /[ÂÁÀÃÊÉÈÎÍÌÔÓÒÕÛÚÙÜÇÑ\+]/g;
	reA = /[ÂÁÀÃ]/g;
	reE = /[ÊÉÈ]/g;
	reI = /[ÎÍÌ]/g;
	reO = /[ÔÓÒÕ]/g;
	reU = /[ÛÚÙÜ]/g;
	reC = /[Ç]/g;
	reN = /[Ñ]/g;
	reMAIS = /\+/g;
	
	//Substitui caracteres acentuados em "Seu Nome"
	upNome = this.toUpperCase();
	if(upNome.search(Accent)!=-1) 
	{
		upNome = upNome.replace(reA,"A");
		upNome = upNome.replace(reE,"E");
		upNome = upNome.replace(reI,"I");
		upNome = upNome.replace(reO,"O");
		upNome = upNome.replace(reU,"U");
		upNome = upNome.replace(reC,"C");
		upNome = upNome.replace(reN,"N");
		upNome = upNome.replace(reMAIS," ");
	}
	
	return upNome;
}
function writeSCRIPT(szSRC)
{
	document.write('<SCR'+'IPT LANGUAGE="JavaScript1.1" src="'+szSRC+'"> </SCR'+'IPT>');
	
}

function setHeightAgain()
{
	// Trata colunas
	if($("corpo")) $("corpo").style.height = "auto";
	if($("col-esquerda")) $("col-esquerda").style.height = "auto";
	if($("col-direita")) $("col-direita").style.height = "auto";
	if($("col-centro")) $("col-centro").style.height = "auto";
	
	//$("corpo").style.height = $("col-esquerda").style.height = $("col-centro").style.height = $("col-direita").style.height= "auto";
	
	setHeight('corpo','col-esquerda','col-centro','col-direita'); 
}

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };
