function MM_findObj(n, d) { //v4.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);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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;repos }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}


function openWindow(url,y,x)
{
        mypopupWin = window.open(url, 'exemplo', 'width='+x+',height='+y+',left=0,top=0,resizable=no');
        mypopupWin.resizeTo(x+10,y+28);
        mypopupWin.focus();
}

//names of dropdowns stored here
f7_droplayer=new Array()
f7_droplayer[0]="drop1"
f7_droplayer[1]="drop2"
f7_droplayer[2]="drop3"
f7_droplayer[3]="drop4"
f7_droplayer[4]="drop5"
f7_droplayer[5]="drop6"
var aesconder=false;
var espaco=null;

f7_dom =(document.getElementById)?1:0;
f7_ie =(document.all)?1:0;
f7_ns = (f7_ie==0 && f7_dom==0)?1:0


//code for drops

function show0(){
 f7_showdrop(0)
 }
function show1(){
 f7_showdrop(1)
 }
function show2(){
 f7_showdrop(2)
 }
function show3(){
 f7_showdrop(3)
 }
function show4(){
 f7_showdrop(4)
 }
function show5(){
 f7_showdrop(5)
 }

function f7_showdrop(thelayer){
	f7_keep=thelayer; f7_hideall(); f7_showitnow=1
	f7_showit(thelayer)
	}

function f7_showit(thelayer){
		MM_showHideLayers(f7_droplayer[thelayer],"","show")
	}


function f7_hidedrop(){
	f7_keep=-1; if (aesconder==false) { aesconder=true; espaco=setTimeout('f7_hideall()',500)}
	}

f7_keep=-1

function f7_hideall(){
	for(i=0;i<f7_droplayer.length;i++){  
		f7_hideit=0; f7_checkmousepos(i);
			if (f7_keep!=i && f7_hideit) MM_showHideLayers(f7_droplayer[i],"","hide")
		}
		aesconder=false;
	}

//deal with cursor over layer
document.onmousemove = f7_getmousepos
if (f7_ns==1) document.captureEvents(Event.MOUSEMOVE)
if (f7_dom && !f7_ie) document.addEventListener("mousemove",f7_getmousepos,false);

function f7_getmousepos(e){
	if (f7_ie==0) {f7_mousex=e.pageX; f7_mousey=e.pageY}
	else {f7_mousex=event.clientX; f7_mousey=event.clientY;}
	}

function f7_checkmousepos(i){          
		var laier=MM_findObj(f7_droplayer[i])
		if (f7_ns) {
		  f7_x_min=laier.left
		  f7_x_max=f7_x_min+laier.clip.width
		  f7_y_min=120//laier.top
		  f7_y_max=120/*f7_y_min*/+laier.clip.height
		} else {
		  if (f7_ie==1) {
		    f7_x_min=parseInt(laier.style.left)
		    f7_x_max=f7_x_min+parseInt(laier.scrollWidth)
			f7_y_min=120//parseInt(laier.style.pixelTop)
			f7_y_max=120+/*f7_y_min+*/parseInt(laier.scrollHeight)
			} else { 
			f7_x_min=parseInt(laier.style.left)
			f7_x_max=f7_x_min+120//parseInt(laier.style.width)
			f7_y_min=120
			f7_y_max=120+parseInt(laier.style.height)
			}
		}
	if (f7_mousex>=f7_x_min && f7_mousex<=f7_x_max && f7_mousey>=f7_y_min && f7_mousey<=f7_y_max){
		f7_hideit=0; clearTimeout(espaco); aesconder=false; espaco=setTimeout('f7_hideall()',500)
		}
	else { f7_hideit=1}
	return f7_hideit
	}

//browser stylesheets

if(f7_ie){
document.write('<style type="text/css"><!--')

document.write('.dropdown {height:1px; top:104px; width:1px; padding-left:10px; padding-top:10px; padding-right:10px; padding-bottom:10px;text-decoration: underline}')
document.write('p { margin-top:0px; margin-bottom:6px text-decoration: underline }')
document.write('a { text-decoration: none }')
document.write('a:hover { color: white; text-decoration: none }')
document.write('--></style>')
}
