/* Curso iMasters - Dreamweaver MX 2004 Vol. 2 [ Advanced and Interactive ] */
/* Autor: Leandro Vieira Pinho [ leandro@dwmx.com.br ] */
// Frame Scroll
function FrameScroll() {
	if(document.getElementById("sidebar").style.display=="") {
		document.getElementById("sidebar").style.display="none";
		document.getElementById("topo_curso").style.width="764px";
		document.getElementById("conteudo").style.width="764px";
		document.getElementById("global").style.backgroundImage="url(../img/bg/bg_global_frame_scroll.gif)";
		createCookie('frame_scroll','hide',365);
	} else {
		document.getElementById("sidebar").style.display=""
		document.getElementById("topo_curso").style.width="564px";
		document.getElementById("conteudo").style.width="564px";
		document.getElementById("global").style.backgroundImage="url(../img/bg/bg_global.gif)";
		eraseCookie('frame_scroll');
	}
}
function VerificaFrameScroll() {
	var hide = readCookie('frame_scroll');
	if (hide) {
		document.getElementById("sidebar").style.display="none";
		document.getElementById("topo_curso").style.width="764px";
		document.getElementById("conteudo").style.width="764px";
		document.getElementById("global").style.backgroundImage="url(../img/bg/bg_global_frame_scroll.gif)";
	}
}

function ShowHideMenu(what) {
	if(document.getElementById(what).style.display=="") {
		document.getElementById(what).style.display="block";
	} else {
		document.getElementById(what).style.display="";
	}
}
function AumentaDiminuiTamanhoTexto() {
	if(document.getElementById("curso").style.fontSize=="") {
		document.getElementById("curso").style.fontSize="140%";
		document.getElementById("acessibilidade_link").innerHTML="Voltar o texto ao seu tamanho normal";
	} else if (document.getElementById("curso").style.fontSize=="140%") {
		document.getElementById("curso").style.fontSize="100%";
		document.getElementById("acessibilidade_link").innerHTML="Diminuir o tamanho do texto";
	} else if (document.getElementById("curso").style.fontSize=="100%") {
		document.getElementById("curso").style.fontSize="80%";
		document.getElementById("acessibilidade_link").innerHTML="Aumentar o tamanho do texto";
	} else {
		document.getElementById("curso").style.fontSize="";
	}
}
function OpenVideo(url,tamanhos) {
	window.open(url, 'OpenVideo',tamanhos);
}
/*
Funções de cookie retirado do site http://www.quirksmode.org/

Estes (cookies) são utilizados para sua conveniência. Por exemplo:
Se você fecha o menu lateral é criado um cookie chamado frame_scroll,
se o cookie (frame_scroll) existir o menu permanecerá fechado, se você abrir,
o cookie é deletado e consequentemente o menu ficará aberto.
===========================================*/
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 = "";
	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;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}