var activeDiv ;

var LAST_PAGE_COOKIE ="LastPageName"+window.location.pathname;

 function init() 
{
 if(ns4){ld.visibility="hidden";} else if (ns6||ie4) ld.display="none"; 
} 

function activateFirstLayer(){
    init();
    var lastPage = GetCookie(LAST_PAGE_COOKIE);
	if ( lastPage == null)
		activateLayer(1);
	else
		activateLayer(lastPage);
}
function openWindow(url) {
 window.open(url,'VerdantDreams','height=300,width=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0');
}


function activateLayer(LayerIndex){

var currentDiv ;
SetCookie(LAST_PAGE_COOKIE,LayerIndex);
switch(navigator.family)
    {
    case 'nn4':
		  // Nav 4.x code fork...
			currentDiv = eval('document.layers["layer' + LayerIndex + '"]');
			if ( activeDiv == null ){
			activeDiv = currentDiv ;
			}
			activeDiv.visibility = "hidden";
			currentDiv.visibility = "visible" ;
      break;
    case 'ie4':
      // IE 4/5 code fork...
		currentDiv = eval('document.all["layer' + LayerIndex + '"]');
			if ( activeDiv == null ){
			activeDiv = currentDiv ;
			}
		activeDiv.style.visibility = "hidden";
		currentDiv.style.visibility = "visible" ;
      break;
	case 'opera':
    case 'gecko':
		  // Standards Compliant code fork...
		  currentDiv = eval('document.getElementById("layer' + LayerIndex + '")');
			if ( activeDiv == null ){
			activeDiv = currentDiv ;
			}
		  activeDiv.style.visibility = "hidden";
		  currentDiv.style.visibility = "visible" ;

      break;
    }

activeDiv = currentDiv ;
return false;


}
