// 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;
}

// Desativa um layer pelo nome
function desativa(nome){
 GetObject(nome);
 if (IE||NS6) {objeto.style.visibility = "hidden";}
 if (NS) {objeto.style.visibility = "hide";}
 return true;
}

// Ativa um layer pelo nome
function ativa(nome){
 GetObject(nome);
 if (IE||NS6) {objeto.style.visibility = "visible";}
 if (NS) {objeto.style.visibility = "show";}
 return true;
}

// ----- GALERIA ----- //

function galeria_troca(id)
{
	obGaleria = GetObject('grande').innerHTML = '<img src="/_br/imagem/gde/'+galeria_fotos[id]['imagem_med']+'">';
	/*obGaleria = GetObject('legenda').innerHTML = galeria_fotos[id]['legenda'];*/
	return true;
}

// - FIM GALERIA ----- //


// ----- SCROLL --- //

function left(obj,mask){
	y = parseInt(obj.style.left);
	altura_obj = parseInt(obj.clientWidth);
	largura_mask = parseInt(mask.clientWidth);
	if(y >= (largura_mask - altura_obj))
	{
		obj.style.left = y-5+'px';
	}
		
}

function right(obj,mask){
	y = parseInt(obj.style.left);
	if(y+2 <= 0)
	{
		obj.style.left = y+5+'px';
	}
}


function down(obj,mask){
	y = parseInt(obj.style.top);
	altura_obj = parseInt(obj.clientHeight);
	altura_mask = parseInt(mask.clientHeight);
	altura_obj = altura_obj+114;
	if(y >= (altura_mask - altura_obj))
	{
		obj.style.top = y-2+'px';
	}
	else if(y < (altura_mask - altura_obj))
	{
		obj.style.top = 114+'px';
	}
	
	
}

// - FIM SCROLL --- //



