//<![CDATA[
function bg(element,tipo){
	div = element.id;
	if(tipo){
		document.getElementById(div).style.backgroundColor='#666';
		document.getElementById(div).style.border='';
	}else{
		document.getElementById(div).style.backgroundColor='';
		document.getElementById(div).style.border='';
	}
}
//-Abre->
function abre(url,janela,larg,alt){
	jan=window.open(url,janela,'toolbar=no,location=no,directories=no,maximize=no,status=no,menubar=no,scrollbars=no,resizable=no,adress=no,copyhistory=no,title=yes,width='+larg+',height='+alt+',top=0,left=0');
}

// Favoritos
function fav() {
	if(navigator.userAgent.indexOf("Chrome") != -1){ // Chorme
		alert("Para adicionar ao favoritos pressione <CTRL> + D");
	}else{
		var url = window.location;
		var title = document.title;
		if (window.sidebar){ // Firefox
			window.sidebar.addPanel(title, url,"");
		}else if(window.opera && window.print){ // Opera
			var mbm = document.createElement('a');
			mbm.setAttribute('rel','sidebar');
			mbm.setAttribute('href',url);
			mbm.setAttribute('title',title);
			mbm.click();
		}else if(document.all){ //IE
		window.external.AddFavorite(url, title);
		}
	}
}

function crash(url){
	abre('http://www.rsinfotech.com.br/crash_reporter.php?url='+url,'crash','400','400','0','0');
}
// Acessibilidade -->
//contraste
function contrast(a){
	cont = document.getElementById('conteudo').style;
	if(a=='+'){
		cont.background = '#000';
		cont.color = 'yellow';
	}else{
		cont.background = '';
		cont.color = '';
	}
}
//Fonte
var tam = 12;
function font(tipo){
	if (tipo=="+") {
		if(tam<24) tam+=1;
		createCookie('fonte',tam,365);
	} else if (tipo=="-") {
		if(tam>9) tam-=1;
		createCookie('fonte',tam,365);
	} else {
	tam=12;
		createCookie('fonte',tam,365);
	}	
	document.getElementById('conteudo').style.fontSize = tam+'px';
}
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
	var expires = 365;
	}
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
//-End->
// ]]>
