/*#########################################################
			ESPELEOLOGIA
		

    IDENTIFICA O BROWSER 

###########################################################*/

function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major >= 4));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4  = (this.ie && (this.major >= 4));
    this.op3 = (agent.indexOf("opera") != -1);
}

var is = new Is();

/*#########################################################

    SELECIONA O "DOCUMENT OBJECT" conforme o browser
	NS4 / IE4

###########################################################*/

if(is.ns4) {
    doc = "document";
    sty = "";
    htm = ".document"
    xpos = "e.contentX";
    ypos = "e.contentY";
} else if(is.ie4) {
    doc = "document.all";
    sty = ".style";
    htm = ""
    xpos = "event.x";
    ypos = "event.y";
}

/*#########################################################
	
		Msgbox

###########################################################*/

   function msg(mensagem)
	{
	alert(mensagem);

	}
	

/*#########################################################
	
	Troca Imagem com várias frames

###########################################################*/

  function chgf(imagem,ficheiro,nome_frame)
	{
	tmp = eval("parent." + [nome_frame] + ".document." + [imagem]);
	tmp.src = ficheiro;
	}

/*#########################################################
	
	Troca Imagem na mesma página

###########################################################*/

  function chg(imagem,ficheiro)
	{
	if (document.images)
		{
		document.images[imagem].src=ficheiro.src;	
		}
	}

/*#########################################################
	
		Instala Folha de Estilo NS4 / IE4
			( Conforme o Browser )
###########################################################*/

function FolhaEstilo(path)
	{
	if(is.ns4) 
		{
	 	document.write('<LINK REL=StyleSheet HREF="' + path + 'NS_eusebio.css" TYPE="text/css">')
		// msg('Netscape')
		} 
	else
		{
		document.write ('<LINK REL=StyleSheet HREF="' + path + 'IE_eusebio.css" TYPE="text/css">')
		// msg('Explorer')
		}
	}
	
/*#########################################################
	
	Abre Janela Pequena só com imagem 
	
	x - WIDTH  - largura
	y - HEIGHT - altura
###########################################################*/

function window_open(caminhoEimagem,x,y) 
{
	tam = caminhoEimagem.length
	nome = caminhoEimagem.substr(tam-6,2)

	var janela = window.open(caminhoEimagem, nome,"width=" + x + ",height=" + y + ",toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=0");
	janela.moveTo('10','10');
}

/*#########################################################
	

###########################################################*/

function imagem_grande(caminhoEimagem) 
{
	var janela = window.open("imagem_actividade.asp?imagem=" + caminhoEimagem, "","width=100,height=100,toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=1");  
}