// Texto Status
window.status=document.title;

// Determina o browser
NS6 = (document.getElementById&&!document.all);
IE = (document.all);
NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4");

var objeto = null;
// Caça Objeto pelo nome (div, img etc)
function GetObject(nome){
 if (NS6){objeto=document.getElementById(nome);}
 else if (IE) {objeto=document.all(nome);}
 else if (NS) {objeto=document.layers[nome];}
 return objeto;
}


// ----- FOTO ----- //

function amplia(img){
	if(arguments[2]!="" && arguments[3]!=""){
		width=arguments[2];
		height=arguments[3];
	}
	else{
		width=600;
		height=600;
	}
	
	if(arguments[1] != "")
		titulo = arguments[1];
	else
		titulo = "Guia do estudante";

	janela = window.open('','foto','width='+width+',height='+height+',top=0,left=0,scrollbars=no,status=no,menubars=no,location=no');
	janela.document.open();
	janela.document.write('<html><head><'+'scri'+'pt>function resize() {i=20; if (navigator.appName == \'Netscape\') i=5;if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);self.focus();}</s'+'cript'+'>');
	janela.document.write('<title>'+titulo+'</title>');
	janela.document.write('</head><body topmargin=0 leftmargin=0 marginwidth=0 rightmargin=0 bgcolor="#000000" onload="resize();">');
	janela.document.write('<div align=center><img src="'+img+'" alt="'+titulo+'" title="'+titulo+'" /></div>');
	janela.document.write('</body></html>');
	janela.document.title=titulo;
	janela.document.close();
	janela.focus();
	
	return void(0);
}

// - FIM FOTO ----- //


// ----- GALERIA ----- //

function galeria_troca(id)
{
	obGaleria = GetObject('fotos');
	if(typeof(obGaleria) == "object")
	{
		if(typeof(galeria_fotos[id]) == "object")
		{
			html = '';
			html += '<h1><img src="/premio/'+galeria_fotos[id]['imagem_grande']+'" alt="" /></h1>';
			html += '<p><b>'+galeria_fotos[id]['titulo']+'</b></p>';
			html += '<p>'+galeria_fotos[id]['texto']+'</p>';
			obGaleria.innerHTML = html;
		}
	}
	return true;
}

// - FIM GALERIA ----- //

// ----- POPUP ----- //

function abre_popup(endereco,largura,altura)
{
	if(arguments[3] != "")
		nome = arguments[3];
	else
		nome = '';
	
	janela = window.open(endereco,nome,'width='+largura+',height='+altura+',top=0,left=0,scrollbars=no,status=no,menubars=no,location=no');
	janela.focus();
	
	return void(0);
}

// - FIM POPUP ----- //
