<!-- 
var subMenuTimeout;
var subMenuLastOpened = '';

function addBookmark(url, title){
	if (document.all) {
		window.external.AddFavorite(url, title);
	} else {
		alert('Para adicionar o site aos favoritos, tecle Ctrl + D.');
	}
}

function back() {
	history.back();
}

function changeDivsByFlash(strIdFlash, strIdHTML) {
	if(detectFlash()){
		showObj(strIdFlash);
		hideObj(strIdHTML);
	} else {
		hideObj(strIdFlash);
		showObj(strIdHTML);
	}
}

function detectFlash() {
	var blnReturn;
	noautoinstall = "";

	if(navigator.appName == "Microsoft Internet Explorer" && 
		(navigator.appVersion.indexOf("Mac") != -1 || 
		 navigator.appVersion.indexOf("3.1") != -1)){
			noautoinstall = "true";
	}

	if (navigator.appName == "Microsoft Internet Explorer" && noautoinstall != "true"){
		blnReturn = true;
	} else if(navigator.plugins){
		if(navigator.plugins["Shockwave Flash"] || navigator.plugins["Shockwave Flash 2.0"]){
			blnReturn = true;
		} else {
			blnReturn = false;
		}
	} else {
		blnReturn = false;
	}

	return blnReturn;
}

function findObj(n, d) {
	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 = findObj(n,d.layers[i].document);

	if (!x && d.getElementById) x = d.getElementById(n);

	return x;
}

function goTo(strURL) {
	window.location = strURL;
}

function goToHash(hash) {
	window.location.hash = hash;
}

function hideObj (strObj) {
	obj = findObj(strObj);
	obj.style.display = 'none';
}

function hoverLineOff (obj, strBgColor) {
	obj.style.background = strBgColor;
	obj.style.cursor = 'auto';
}

function hoverLineOn (obj, strBgColor) {
	obj.style.background = strBgColor;
	obj.style.cursor = 'hand';
}

function isNumeric(value) {
	return stringValidation(value, "1234567890");
}

function inArray(value, arr) {
	for (var i = 0; i < arr.length; i++) {
		if (arr[i] == value) {
			return true;
		}
	}
	
	return false;
}

function openWindow(Pagina, Largura, Altura, scrollbars, status) {
	window.open(Pagina, '', 'width=' + Largura + ',height=' + Altura + ',scrollbars=' + scrollbars + ',status=' + status + ',toolbar=no,location=no,directories=no,menubar=no,resizable=no,copyhistory=no');
}

function openInParent(url) {
	top.opener.window.location = url;
}

function resizeWindow(intW, intH) {
	window.resizeTo(intW, intH);
}

function stringValidation(value, validChars) {
	var rt = true;

	for (i = 0; i < value.length && rt == true; i++) {
		Char = value.charAt(i); 
		if (validChars.indexOf(Char) == -1) {
			rt = false;
		}
	}

	return rt;
}

function stripNonNumeric(value) {
	return value.replace(/[^0-9]/g ,'');
}

function showObj (strObj) {
	var obj = findObj(strObj);
	obj.style.display = 'block';
}

function showSubMenu(strMenu) {
	clearTimeout(subMenuTimeout);
	
	if (subMenuLastOpened != '') {
		_hideSubMenu(subMenuLastOpened);
	}

	var obj = findObj(strMenu);
	obj.style.visibility = 'visible';
	subMenuLastOpened = strMenu;
}

function hideSubMenu(strMenu) {
	subMenuTimeout = setTimeout('_hideSubMenu("' + strMenu + '")', 2000);
}

function _hideSubMenu(strMenu) {
	var obj = findObj(strMenu);
	obj.style.visibility = 'hidden';
	subMenuLastOpened = '';
}

function StringChunk (strTexto, intTamanho, strSeparador) {
	var Retorna, i;

	Retorna = '';

	for (i = 0; i <= strTexto.length; i++) {
		Retorna += strTexto.substr(i, 1);
		if ((i + 1) % intTamanho == 0 && i < strTexto.length - 1) {
			Retorna += strSeparador;
		}
	}

	return Retorna;
}

function StringRevert (strTexto) {
	var Retorna, i;

	Retorna = '';

	for (i = strTexto.length - 1; i >= 0; i--) {
		Retorna += strTexto.substr(i, 1);
	}

	return Retorna;
}

function getBrowserWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
      }
    }
  }
  return myWidth;
}

function getBrowserHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else {
    if( document.documentElement &&
        ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
      //IE 6+ in 'standards compliant mode'
      myHeight = document.documentElement.clientHeight;
    } else {
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
      }
    }
  }
  return myHeight;
}

String.prototype.isEmail = function() {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this)){
		return (true);
	} else {
		return (false);
	}
}

String.prototype.isCpf = function() {
	cpf = this;
	valor = true;

	if (cpf.length < 11) {
		return false;
	}

	var nonNumbers = /\D/;
	if (nonNumbers.test(cpf)) {
		return false;
	}

	if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999"){
		return false;
	}

	var a = [];
	var b = new Number;
	var c = 11;
	for (i=0; i<11; i++){
		a[i] = cpf.charAt(i);
		if (i < 9) b += (a[i] *  --c);
	}
	if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }
	b = 0;
	c = 11;
	for (y=0; y<10; y++) b += (a[y] *  c--); 
	if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }
	if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])){
		return false;
	}

	return true;
}

String.prototype.isDate = function() {
	DateToCheck = this;
	
	if (DateToCheck == "") {
		return true;
	}
	var m_strDate = this.formatDate();

	if (m_strDate == "") {
		return false;
	}

	var m_arrDate = m_strDate.split("/");
	var m_DAY = m_arrDate[0];
	var m_MONTH = m_arrDate[1];
	var m_YEAR = m_arrDate[2];

	if (m_YEAR.length > 4) {
		return false;
	}

	m_strDate = m_MONTH + "/" + m_DAY + "/" + m_YEAR;
	var testDate = new Date(m_strDate);

	if (testDate.getMonth() + 1 == m_MONTH) {
		return true;
	} else {
		return false;
	}
}//end function

String.prototype.formatDate = function(FormatAs) {
	DateToFormat = this;
	
	if (DateToFormat == "") {
		return "";
	}
	if (!FormatAs){
		FormatAs="dd/mm/yyyy";
	}

	var strReturnDate;
	FormatAs = FormatAs.toLowerCase();
	DateToFormat = DateToFormat.toLowerCase();
	var arrDate
	var arrMonths = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	var strMONTH;
	var Separator;

	while(DateToFormat.indexOf("st")>-1){
		DateToFormat = DateToFormat.replace("st","");
	}

	while(DateToFormat.indexOf("nd")>-1){
		DateToFormat = DateToFormat.replace("nd","");
	}

	while(DateToFormat.indexOf("rd")>-1){
		DateToFormat = DateToFormat.replace("rd","");
	}

	while(DateToFormat.indexOf("th")>-1){
		DateToFormat = DateToFormat.replace("th","");
	}

	if(DateToFormat.indexOf(".")>-1){
		Separator = ".";
	}

	if(DateToFormat.indexOf("-")>-1){
		Separator = "-";
	}


	if(DateToFormat.indexOf("/")>-1){
		Separator = "/";
	}

	if(DateToFormat.indexOf(" ")>-1){
		Separator = " ";
	}

	arrDate = DateToFormat.split(Separator);
	DateToFormat = "";

	for(var iSD = 0;iSD < arrDate.length;iSD++){
		if (arrDate[iSD] != ""){
			DateToFormat += arrDate[iSD] + Separator;
		}
	}

	DateToFormat = DateToFormat.substring(0,DateToFormat.length-1);
	arrDate = DateToFormat.split(Separator);

	if (arrDate.length < 3){
		return "";
	}

	var DAY = arrDate[0];
	var MONTH = arrDate[1];
	var YEAR = arrDate[2];
	
	if(parseFloat(arrDate[1]) > 12) {
		DAY = arrDate[1];
		MONTH = arrDate[0];
	}

	if(parseFloat(DAY) && DAY.toString().length == 4) {
		YEAR = arrDate[0];
		DAY = arrDate[2];
		MONTH = arrDate[1];
	}

	for(var iSD = 0;iSD < arrMonths.length;iSD++){
		var ShortMonth = arrMonths[iSD].substring(0,3).toLowerCase();
		var MonthPosition = DateToFormat.indexOf(ShortMonth);
		if(MonthPosition > -1){
			MONTH = iSD + 1;
			if(MonthPosition == 0){
				DAY = arrDate[1];
				YEAR = arrDate[2];
			}
			break;
		}
	}

	var strTemp = YEAR.toString();
	if(strTemp.length==2){
		if(parseFloat(YEAR)>40){
			YEAR = "19" + YEAR;
		} else{
			YEAR = "20" + YEAR;
		}
	}

	if (parseInt(MONTH) < 10 && MONTH.toString().length < 2) {
		MONTH = "0" + MONTH;
	}
	if(parseInt(DAY)< 10 && DAY.toString().length < 2) {
		DAY = "0" + DAY;
	}


	switch (FormatAs){
		case "dd/mm/yyyy":
			return DAY + "/" + MONTH + "/" + YEAR;
		case "mm/dd/yyyy":
			return MONTH + "/" + DAY + "/" + YEAR;
		case "dd/mmm/yyyy":
			return DAY + " " + arrMonths[MONTH -1].substring(0,3) + " " + YEAR;
		case "mmm/dd/yyyy":
			return arrMonths[MONTH -1].substring(0,3) + " " + DAY + " " + YEAR;
		case "dd/mmmm/yyyy":
			return DAY + " " + arrMonths[MONTH -1] + " " + YEAR;	
		case "mmmm/dd/yyyy":
			return arrMonths[MONTH -1] + " " + DAY + " " + YEAR;
	}

	return DAY + "/" + strMONTH + "/" + YEAR;;
} //End Function

-->