// JavaScript Document

/** FUN��O JAVASCRIPT PARA TABS(ABAS) TAMANHO DE FONTE E CONTRASTE
** @Author F�bio Nunes Nakatani
** @Date 11/09/2008
** @Version 1.5
* Para adicioar novas tabs basta copiar o codigo de cima e aplicar o nome da div
*/

// Adiciona novas Abas para as divs
function mudar_aba_educacao(id){
	switch (id){
		case "presencial" :
			document.getElementById("presencial").style.display = "block";
			document.getElementById("distancia").style.display = "none";
		break;
		case "distancia" :
			document.getElementById("presencial").style.display = "none";
			document.getElementById("distancia").style.display = "block";
		break;
	}
};
function mudar_aba_posgraduacao(id){
	switch (id){
		case "bolsas" :
			document.getElementById("bolsas").style.display = "block";
			document.getElementById("avaliacao").style.display = "none";
		break;
		case "avaliacao" :
			document.getElementById("bolsas").style.display = "none";
			document.getElementById("avaliacao").style.display = "block";
		break;
	}
}

/* script para tamanho das fontes */
var tamanhofonte = 100;

function aumentaFonte(i){
	if(i>tamanhofonte){
		tamanhofonte = tamanhofonte+10;
		document.getElementById('corpo').style.fontSize = tamanhofonte+"%";
		}
	};
function diminuiFonte(i){
	if(i<tamanhofonte){
		tamanhofonte = tamanhofonte-10;
		document.getElementById('corpo').style.fontSize = tamanhofonte+"%";
		}
	};
function resetFonte(){
	tamanhofonte = 100;
	document.getElementById('corpo').style.fontSize = tamanhofonte+"%";
	}

/* Alto contraste */

//variaveis
acao = 1;
valorCookie = 1;
nomeCookie = "contrasteCapes";

//bota o CSS escondido
/*cssAltoContraste.disabled = true;*/

//Fun��o para retornar o cookie
function readCookie() {
		var nameEQ = nomeCookie + "=";
		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;
	}
	
//V� cookie e seta para o valor correto da variavel
lerCookieVar = readCookie();
if (lerCookieVar == 1){
	acao = 0;
	valorCookie = 0;
}


//Fun��o do bot�o de contraste
function altoContraste(){
	
	if (acao == 1){
		document.getElementById('contraste').href = "templates/capes/css/ac_main.css";
		document.cookie = nomeCookie+"="+valorCookie;
		valorCookie = 0;
		acao = 0;
		}
	else  {
        document.getElementById('contraste').href = "";
		document.cookie = nomeCookie+"="+valorCookie;
		valorCookie = 1;
		acao = 1;
		}
}

function addFlash(swf)
{
document.write("<object id='ob' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='555' height='300'><param name='movie' value='images/stories/conteudoestatico/sobre/"+swf+"' data='images/stories/conteudoestatico/sobre/"+swf+"'/><param name='quality' value='high'/><param name='wmode' value='opaque'/><param name='allowscriptaccess' value='always'/><embed width='555' height='300' wmode='opaque' src='images/stories/conteudoestatico/sobre/"+swf+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' allowscriptaccess='always'/></object>");
}