function fun_detect_bw(){
	var obj_canvas_browser = ie_box ? document.body : document.documentElement;
	var int_browser_width = window.innerWidth || obj_canvas_browser.clientWidth;
	if(int_browser_width > 800) return true; else return false;
}

function class_AF(){
	this.closeAll = function(str_id_base){
		var bln_continue = true, int_count = 0;

		while(bln_continue){
			int_count++;

			try{
				document.getElementById(str_id_base + '_item_' + int_count + '_a').style.backgroundColor	= ((int_count % 2 == 0) ? '#E8EAEC' : '#E2E3E5');
				document.getElementById(str_id_base + '_item_' + int_count + '_img').style.display			= 'block';
				document.getElementById(str_id_base + '_item_' + int_count + '_b').style.display				= 'none';
			}catch(obj_err){
				bln_continue = false;
			}
		}
	}

	this.Open = function(str_id_base, int_id){
		this.closeAll(str_id_base);
		document.getElementById(str_id_base + '_item_' + int_id + '_a').style.backgroundColor	= '#FFF3C1';
		document.getElementById(str_id_base + '_item_' + int_id + '_img').style.display			= 'none';
		document.getElementById(str_id_base + '_item_' + int_id + '_b').style.display				= 'block';								
	}
}

var AF = new class_AF();

function fcn_no_accents(str_expression, bln_lcase){
	if(str_expression != ''){
		str_expression = str_expression.replace(/-/gi,'_');
		str_expression = str_expression.replace(/\./gi,'_');
		str_expression = str_expression.replace(/(á|à|ã|â|ä)/gi,'a');
		str_expression = str_expression.replace(/(é|è|ê|ë)/gi,'e');
		str_expression = str_expression.replace(/(í|ì|î|ï)/gi,'i');
		str_expression = str_expression.replace(/(ó|ò|õ|ô|ö)/gi,'o');
		str_expression = str_expression.replace(/(ú|ù|û|ü)/gi,'u');
		str_expression = str_expression.replace(/(ç)/gi,'c');
		str_expression = str_expression.replace(/ /gi,'_');
		str_expression = str_expression.replace(/([^A-Za-z0-9_]{0,})/gi,'');
		str_expression = ((bln_lcase) ? str_expression.toLowerCase() : str_expression);
	}
	
	return str_expression;
}

function class_HTMLSpecialChar(){
	this.Table = [[' ','&nbsp;'],['&','&amp;'],['"','&quot;'],['Á','&Aacute;'],['É','&Eacute;'],['Í','&Iacute;'],['Ó','&Oacute;'],['Ú','&Uacute;'],['á','&aacute;'],['é','&eacute;'],['í','&iacute;'],['ó','&oacute;'],['ú','&uacute;'],['Ä','&Auml;'],['Ë','&Euml;'],['Ï','&Iuml;'],['Ö','&Ouml;'],['Ü','&Uuml;'],['ä','&auml;'],['ë','&euml;'],['ï','&iuml;'],['ö','&ouml;'],['ü','&uuml;'],['Ã','&Atilde;'],['Ñ','&Ntilde;'],['Õ','&Otilde;'],['ã','&atilde;'],['ñ','&ntilde;'],['õ','&otilde;'],['Ø','&Oslash;'],['ø','&oslash;'],['Ð','&ETH;'],['ð','&eth;'],['ß','&szlig;'],['À','&Agrave;'],['È','&Egrave;'],['Ì','&Igrave;'],['Ò','&Ograve;'],['Ù','&Ugrave;'],['à','&agrave;'],['è','&egrave;'],['ì','&igrave;'],['ò','&ograve;'],['ù','&ugrave;'],['Â','&Acirc;'],['Ê','&Ecirc;'],['Î','&Icirc;'],['Ô','&Ocirc;'],['Û','&Ucirc;'],['â','&acirc;'],['ê','&ecirc;'],['î','&icirc;'],['ô','&ocirc;'],['û','&ucirc;'],['å','&aring;'],['Å','&Aring;'],['Ç','&Ccedil;'],['ç','&ccedil;'],['Ý','&Yacute;'],['ý','&yacute;'],['ÿ','&yuml;'],['Þ','&THORN;'],['þ','&thorn;'],['Æ','&AElig;'],['æ','&aelig;'],['×','&times;'],['÷','&divide;'],['“','&#147;'],['”','&#148;'],['Œ','&#140;'],['‡','&#135;'],['¢','&cent;'],['€','&euro;'],['™','&#153;'],['‰','&#137;'],['ƒ','&#131;'],['†','&#134;']];
	this.textConvert = function(str_string){
		for(var int_count = 0; int_count < this.Table.length; int_count++){
			str_string = str_string.replace(new RegExp(this.Table[int_count][1].replace('&', '\\&'), 'g'), this.Table[int_count][0])
		}
		return str_string;
	}
}

var HTMLSpecialChar = new class_HTMLSpecialChar();

if(typeof(bSiteEnglish) != 'undefined' && bSiteEnglish == 1){
	if(!top.frames.length && typeof(bCampanha) == 'undefined'){location='/index_internas.htm?sUrl=' + document.location.href;}
	}
else{
	if(!top.frames.length && typeof(bCampanha) == 'undefined'){location='/index_internas.htm?sUrl=' + document.location.href;}
}


var obj_sky = window.setInterval(
	function(){
		if(fun_detect_bw()){
			try{
				document.getElementById('cartoes_banner_sky').style.display = 'block';
				window.clearInterval(obj_sky);
			}catch(obj_err){}
		}
	}, 100
)

try{
	top.frames['portal']['top_level_nav'].document.body.style.background = '#DFE8E7 url(\'/cartoes/img/cartoes_estrutura/bg_corpo_branco.gif\') repeat-y 0 0';
}catch(obj_err){}