var timerID = null;
var timerOn = false;
var timecount = 300;
var check = false;
function init() {
	if (document.layers) {
		layerRef="document.layers";
		styleSwitch="";
		visibleVar="show";
		screenSize = window.innerWidth;
		what ="ns4";
	}
	else if(document.all) {
		layerRef="document.all";
		styleSwitch=".style";
		visibleVar="visible";
		screenSize = document.body.clientWidth + 18;
		screenSize = window.innerWidth; 
		what ="ie4";
	}
	else if(document.getElementById) {
		layerRef="document.getElementByID";
		styleSwitch=".style";  visibleVar="visible";
		what="dom1";
	}
	else {
		what="none";  newbrowser = false;
	}
	check = true;
} 
function showLayer(layerName) {
	if(check) {
		if (what =="none") {
			return;
		}
		else if (what == "dom1") {
			document.getElementById(layerName).style.visibility="visible";
		}
		else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
		}
	}
	else {
	return;
	}
}
function hideLayer(layerName) {
	if(check) {
		if (what =="none") {
			return;
		}
		else if (what == "dom1") {
			document.getElementById(layerName).style.visibility="hidden";
		}
		else {
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
		}
	}
	else {
		return;
	}
} 
function hideAll() {
	hideLayer('menu1');
	hideLayer('menu2');
	hideLayer('menu3');
} 
function startTime() {
	if (timerOn == false) {
		timerID=setTimeout( "hideAll();" , timecount);
		timerOn = true;
	}
} 
function stopTime() {
	if (timerOn) {
		clearTimeout(timerID);  timerID = null;  timerOn = false;
	}
}
function galeria(id) {
	window.open('gal_popup.htm?id='+id,'GaleriaFotos','width=648,height=469');
}
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin) {
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 6;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	document.write('<\/SCR' + 'IPT\> \n');
}
// flash //
function fls(lnk,nome,tipo,larg,alt) {
if(tipo=="flash" && plugin){
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,16,0" ID=flashad WIDTH="'+ larg +'" HEIGHT="'+ alt +'"><PARAM NAME=movie VALUE="' + nome + '?clickTAG='+ escape(lnk) +'"> <param name="menu" value="false"><param name="wmode" value="transparent"><PARAM NAME=quality VALUE=high><EMBED swliveconnect="true" wmode="transparent" menu="false" quality="High" src="' + nome + '?clickTAG='+ escape(lnk) +'" quality=high NAME=flashad swLiveConnect=TRUE WIDTH="'+ larg +'" HEIGHT="'+ alt +'" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
} else {
	document.write('<a href="'+lnk+'" target="_blank"><img src='+nome+'.'+tipo+' width=120 height=36 border=0></a>');
  }
}