


// JavaScript Document

var NS=0;        // Netscape 4.x
var IE=0;        // IE
var IE6=0;	 // Netscape 6.x
var IE7=0;	 // Netscape 6.x
var Ypos = 0;
var Xpos = 0;
var lastEvWindow = 0;

document.onmousemove = MoveHandler
if (NS) document.captureEvents(Event.MOUSEMOVE)

function MoveHandler (e) {
  self.status = 'Universidade São Judas Tadeu';

  if (NS) {
    Xpos = e.pageX;
    Ypos = e.pageY;

    clientHeight = document.innerHeight;
  }

  if (IE) {
    Xpos = (window.event.x + document.body.scrollLeft) - 90;
    Ypos = window.event.y + document.body.scrollTop;
  }
}

var persistmenu="yes" 
var persisttype="sitewide"

if (document.getElementById){ 
document.write('<style type="text/css">\n')
document.write('.defesamaisinfo{display: none;margin-top:0px;margin-bottom:15px;}\n')
document.write('<\/style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterli").getElementsByTagName("span"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="defesa") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate

function showhideHint(texto) {
meuHint = document.getElementById("hint")

	if (texto == '') {
	meuHint.style.display = "none";
	}

	else {
	meuHint.style.display = "block";
	meuHint.innerHTML = texto
	}
}
var tam = 11;
function changeFontSize(n){
	var c = document.all? document.all['linha1'] : document.getElementById('linha1');
	if (n == 0)
	{
		tam=10;
	}
	if (n == 1)
	{
		tam=14;
	}
	if (n == 2)
	{
		tam=16;
	}
	if (n == 3)
	{
		tam=18;
	}
	c.style.fontSize = tam+'px';

	
}




function Mascara (formato, keypress, objeto){
campo = eval (objeto);


// telefone
if (formato=='tel'){
separador1 = '(';
separador2 = ')';
separador3 = '-';
conjunto1 = 0;
conjunto2 = 3;
conjunto3 = 8;
if (campo.value.length == conjunto1){
campo.value = campo.value + separador1;
}
if (campo.value.length == conjunto2){
campo.value = campo.value + separador2;
}
if (campo.value.length == conjunto3){
campo.value = campo.value + separador3;
}
}
}

function SomenteNumero(e){
    var tecla=(window.event)?event.keyCode:e.which;
    if((tecla > 47 && tecla < 58)) return true;
    else{
    if (tecla != 8) return false;
    else return true;
    }
}


function desabilita_enter(event)
{
//Internet Explorer
if(window.event && window.event.keyCode == 13)
{
return false;
}

//Netscape e Mozilla
if (event && event.which == 13)
{
return false;
}
}
function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}


function mm_openbrwindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}


			var janela = null;
			function abrirJanela(pagina, nomeJanela, largura, altura, rol) {
				var posY, posX, propJanela
				posY = (screen.height - altura) / 2;
				posX = (screen.width - largura) / 2;
				propJanela = "height=" + altura + ",width=" + largura + ",top=" + posY + ",left=" + posX + ",scrollbars=" + rol + ",resizable";
				window.open(pagina, nomeJanela, propJanela);
				if (janela == null) {
					janela = window.open(pagina, nomeJanela, propJanela);
					janela.window.focus();
				} else {
					janela.close();
					janela = window.open(pagina, nomeJanela, propJanela);
					janela.window.focus();
				}
			}	