	///////////// SCRIPTS DA HOMEPAGE 

function LeValorCookie (offset)
{
	var endstr = document.cookie.indexOf (";", offset);
  	if (endstr == -1)
    	endstr = document.cookie.length;
  	return unescape(document.cookie.substring(offset, endstr));
}

	/////////////
	/////////////  Função que retorna o valor do cookie especificado por "name".
	/////////////    name    - Objeto do tipo string contendo o display do cookie.
	/////////////    retorna - Objeto do tipo string contendo o valor do cookie, 
	/////////////              ou null se o cookie não existe.
	/////////////


function GravaCookie (name,value,expires,path,domain,secure) {
   document.cookie = name + "=" + escape (value) +
	"; path=/" +
   ((secure) ? "; secure" : "");
}


function LeCookie (name)
{
	var arg = name + "=";
  	var alen = arg.length;
  	var clen = document.cookie.length;
  	var i = 0;
  	while (i < clen)
  	{
    	var j = i + alen;
    	if (document.cookie.substring(i, j) == arg)
      		return LeValorCookie (j);
    	i = document.cookie.indexOf(" ", i) + 1;
    	if (i == 0)
    		break; 
	}
  	return "- ??? -";
}

function matriculaaberta()
{
	dia=parseInt(data.substring(0,2),10);
	mes=parseInt(data.substring(3,5),10) - 1 ;   // janeiro = 0
	ano=parseInt(data.substring(6,8),10) + 2000 ; 
	dataatual = new Date ();
	datafinal = new Date (ano,mes,dia,23,59,59);
	if ( dataatual > datafinal )
	{
		alert("As disciplinas disponíveis serão divulgadas nos dias 10 e 11 de janeiro de 2002.");
	}
	else
	{
		return "0";
	}
}

	///////////// SCRIPTS DO KIOSKI

function timeout ()
{
	if ((LeCookie("kioski") == "s") || (LeCookie("kioski") == "S"))
		setTimeout("top.location.href='http://www.cce.puc-rio.br'",3*60*1000);
}

timeout();

document.write(" <STYLE type=\"text/css\"> BODY {scrollbar-face-color:#98ACD8; scrollbar-shadow-color: gainsboro; scrollbar-highlight-color: gainsboro; scrollbar-3dlight-color: #98ACD8; scrollbar-darkshadow-color:#394A73; scrollbar-track-color: #394A73; scrollbar-arrow-color: #000000} </STYLE> ")

function sitepuc()
{
	if (LeCookie("kioski") == "s")
		alert("O Site da PUC-Rio não está disponivel no Quiosque.")
	else
		top.location.href="http://www.puc-rio.br/";
}
