// JavaScript Document

function MM_showHideLayers() { //v6.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 toggleIt( theContent ) {
	alert( "TOGGLE" );
	var theBox = document.getElementById("viewall");
	if( document.getElementById( theContent ).style.display == 'block' ) {
		document.getElementById( theContent ).style.display = 'none';
		theBox.checked = false;
		theStatus = "closed";
		// return true;
	} else {
		document.getElementById( theContent ).style.display = 'block';
		// return false;
	};
	
};

var openVal = false;
var theInterval; 

function checkClose() {
	// alert( "openVal: " + openVal );
	window.clearInterval( theInterval );
	if( openVal == true ) {
		openVal = false;
		theInterval = window.setInterval( checkClose, 3500 );
	} else {		
		closeAll();
	};
        
}

function openIt( theContent ) {
	// alert( "OPEN" );
	openVal = true;
	checkClose();
	// var theBox = document.getElementById("viewall");
	if( document.getElementById( theContent ).style.display == 'block' ) {
		// document.getElementById( theContent ).style.display = 'none';
		// theBox.checked = false;
		// theStatus = "closed";
		// return true;
	} else {
		document.getElementById( theContent ).style.display = 'block';
		// return false;
	};
	curBut = theContent;
	closeAll( curBut );
	
};

function closeAll( noClose ) {
		for( i = 0; i < 10; i ++ ) {	
			theVar = "m" + ( i + 1 );
			if( theVar != noClose ) {
				//alert( "noClose:" + noClose + "  curBut: " + curBut );
				document.getElementById( "m" + ( i + 1 ) ).style.display = 'none';
			} else {
				openVal = false;
			};
		};
};


// checkClose();

//-->
