<!--
if (document.layers) var ns=true; else ns=false; 
if (document.all) var ie=true; else ie=false;



var continueFlag=false;
var continueFlagMenu=false;
var currentScroll=null;
var currentScrollMenu=null;
var scrollMargin=0;
var scrollEnable=false;
var scrollEnableMenu=false;
var scrollpos=0;
var scrollSpeedStep=20;
var scrollStep=4;
var thelayer;
var thelayermenu;


function scrollMenuExec(direction, type) {
	if (currentScrollMenu==direction) {	
		if ((type=="step") && (currentScrollMenu)) {
			setTimeout("scrollExec('"+direction+"', '"+type+"');", scrollSpeedStep);
		} else 
			currentScrollMenu=null;
		  
		if (ie) {
			boxheight = scrollboxmenu.offsetHeight;
			maxscroll = thelayermenu.scrollHeight - boxheight+60;
		}
		if (ns) {
			boxheight = document.layers['scrollboxmenu'].clip.height;
			maxscroll = thelayermenu.document.height - boxheight + 60;
		}
		if (type=="page") 
			delta=boxheight-scrollMargin;
		else 
			if (type=="step")
				delta=scrollStep;
			else
				if (type=="none")
					delta=scrollStep;
				else
					if (type=="topo")
						delta=0;
					else
						if (type=="base")
							delta=maxscroll;
						else
							delta=1*type;
		if (direction=="up") delta=-delta;
		if (type=="topo")
			scrollpos=0;
		else
			scrollpos+=delta;
		if (scrollpos < 0) scrollpos=0;
		if (scrollpos > maxscroll) scrollpos = maxscroll;
		if (ie) thelayermenu.style.top=-scrollpos;
		if (ns) thelayermenu.top=-scrollpos;
	}
}


function scrollFuncMenu(direction, type) {
	if (scrollEnableMenu) {
		continueFlagMenu=true;
		if ((currentScrollMenu==direction) && (type=="step")) {
			currentScrollMenu=null;
		}
		else {
			currentScrollMenu=direction;
			scrollMenuExec(direction, type);
		}
	}
}

function scrollFunc(direction, type) {
	if (scrollEnable) {
		continueFlag=true;
		if ((currentScroll==direction) && (type=="step")) {
			currentScroll=null;
		}
		else {
			currentScroll=direction;
			scrollExec(direction, type);
		}
	}
}

function mouseUp(e) {
	if (!continueFlag) currentScroll=false;
	continueFlag=false;
	setTimeout("scrollFlag=false;", 100);
	if (!continueFlagMenu) currentScrollMenu=false;
	continueFlagMenu=false;
	setTimeout("scrollFlag=false;", 100);
}

function  execDownload(arquivo){
	window.location=arquivo;
}

function init() {
	document.onmouseup = mouseUp;
	if (ns) document.captureEvents(Event.MOUSEUP);
	
	if (ie) scrolldiff = thelayer.scrollHeight-scrollbox.offsetHeight;
	if (ns) scrolldiff = thelayer.document.height - document.layers['scrollbox'].clip.height;
	if (scrolldiff > 0) {
		scrollEnable=true;
	}
	
	if (ie) scrolldiffmenu = thelayermenu.scrollHeight-scrollboxmenu.offsetHeight;
	if (ns) scrolldiffmenu = thelayermenu.document.height - document.layers['scrollboxmenu'].clip.height;
	if (scrolldiffmenu > 0) {
		scrollEnableMenu=true;
	}
}

function isScrollEnabled(){
	if (ie) scrolldiff = thelayer.scrollHeight-scrollbox.offsetHeight;
	if (ns) scrolldiff = thelayer.document.height - document.layers['scrollbox'].clip.height;
	if (scrolldiff > 0) {
		scrollEnable=true;
	}
	return scrollEnable;
}

function scrollExec(direction, type) {
	if (currentScroll==direction) {
	
		if ((type=="step") && (currentScroll)) {
			setTimeout("scrollExec('"+direction+"', '"+type+"');", scrollSpeedStep);
		} else 
			currentScroll=null;
		  
		if (ie) {
			boxheight = scrollbox.offsetHeight;
			maxscroll = thelayer.scrollHeight - boxheight+60;
		}
		if (ns) {
			boxheight = document.layers['scrollbox'].clip.height;
			maxscroll = thelayer.document.height - boxheight + 60;
		}
		if (type=="page") 
			delta=boxheight-scrollMargin;
		else 
			if (type=="step")
				delta=scrollStep;
			else
				if (type=="none")
					delta=scrollStep;
				else
					if (type=="topo")
						delta=0;
					else
						delta=1*type;
		if (direction=="up") delta=-delta;
		if (type=="topo")
			scrollpos=0;
		else
			scrollpos+=delta;
		if (scrollpos < 0) scrollpos=0;
		if (scrollpos > maxscroll) scrollpos = maxscroll;
		if (ie) thelayer.style.top=-scrollpos;
		if (ns) thelayer.top=-scrollpos;
	}
}

function mostraLayer1() {
	if (ns){
		document.layers['artepop'].style.visibility = 'shown';
	}
	if (ie){
		document.all['artepop'].style.visibility = 'visible';
	}
}
function mostraLayer(layer) {
	if (ns){
		document.layers[layer].style.visibility = 'shown';
	}
	if (ie){
		document.all[layer].style.visibility = 'visible';
	}
}

function escondeLayer(layer) {
	if (ns){
		document.layers[layer].style.visibility = 'hidden';
	}
	if (ie){
		document.all[layer].style.visibility = 'hidden';
	}	
}

function findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function leftPosOf(objFocused) {
	aleft = objFocused.offsetLeft;
	var objPai = objFocused.offsetParent;
	while(objPai) {
		aleft = aleft + objPai.offsetLeft;
		var objPai = objPai.offsetParent;
	}
	return aleft;
}

function topPosOf(objFocused) {
	atop = objFocused.offsetTop;
	var objPai = objFocused.offsetParent;
	while(objPai) {
		atop = atop + objPai.offsetTop;
		var objPai = objPai.offsetParent;
	}
	return atop;
}

function resizeLayerToElement(theLayer,theElement,larg, alt) { 
	theLayer.style.pixelLeft = leftPosOf(theElement); 
	theLayer.style.pixelTop = topPosOf(theElement);
	if (alt){
		theLayer.style.pixelHeight=1*alt;
	}
	if (larg){
		theLayer.style.pixelWidth=1*larg;
	}	
}

function resizeLayerToLayer(theLayerOrigem,theLayerDestino,esq, topo){
	theLayerDestino.style.pixelLeft=theLayerOrigem.style.pixelLeft + esq;
	theLayerDestino.style.pixelTop=theLayerOrigem.style.pixelTop + topo;
}
function highlight(color,object){
	object.bgColor = color;
}

function showState(StateName,object){
	name = 'layer';
	HTML = '<table width=100 bgcolor="#BD3121" border=1 bordercolor="#000000" style="border-style: solid"><tr><td align=center><font face=tahoma size=2 color="#FFFFFF"><b>' + StateName + '</td></tr></table>';
	document.all[name].style.left = event.clientX + document.body.scrollLeft + 5; 
	document.all[name].style.top = event.clientY + document.body.scrollTop + 5; 
	document.all[name].style.width = 150; 
	document.all[name].style.height = 110; 
	document.all[name].innerHTML = HTML;
	document.all[name].style.display='block';
	highlight('E9CDC1',object);
}
function hideState(object){
	name = 'layer';
	document.all[name].style.display='none';
	highlight('DCAF9B',object);
}
-->
