// JavaScript Document

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

}

function MM_reloadPageN4(init) {  MM_reloadPage(init); }


MM_reloadPage(true);


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];}}
}

var myArray = new Array('frontpage','liveboard', 'tivoli',  'scribble', 'handwaving',  'casablanca',  'aroma',  'tactguide','palette', 'paperbutton', 'tacit', 'callscalm');


debug = false;

function my_layer(n, obj) { // rewrite / customization of MM_findObj v3.0
	if (debug) alert("in my_layer");
  var p,i,x;  
  	if(!obj) obj=document; 
	x=obj.getElementById(n); 
	for(i=0; !x && obj.layers && i<obj.layers.length; i++) {
		alert("going for seconds");
		x=my_layer(n,obj.layers[i].document); 
	}
	if (debug) alert("gracefully leaving  my_layer");
	return x;
}

function my_swapLayers(n) { // rewrite / customization of MM v3.0
	if (debug) alert("entering my_swapLayers");
  var i,v,obj;
  for (i=0; i<(myArray.length); i++) {
	obj=my_layer(myArray[i]);
  	if (obj!=null) {
   		v='hidden'; 
    	if (obj.style) { 
			obj=obj.style; 
			if (i==n) { 
				//alert("my_swapLayers made layer #"+n+" visible";
				v='visible'; 
			}
		}
   		obj.visibility=v; 
	  }
	}
	if (debug) alert("gracefully leaving  my_swapLayers");
}

function hideLayer(n) { // rewrite / customization of MM v3.0
 	if (debug) alert("entering  hideLayer");
 var obj, v;
	obj=my_layer(myArray[n]);
	v = 'visible';				// lookup to get the ref for each layer
  	if (obj!=null) {			// if this layer exists....
   		if (obj.style) { 		//	check to see if the layer has a style attached...
			obj=obj.style; 		//		if so, make the style element the new object
			v='hidden'; 	//				if so, set the v to visible
		}
		obj.visibility=v; 			// 	default is that the layer is hidden
	}
	obj=my_layer(myArray[0]);	// lookup to get the ref for the instruction layer
  	if (obj!=null) {			// if this layer exists....
    	if (obj.style) { 		//	check to see if the layer has a style attached...
			obj=obj.style; 		//		if so, make the style element the new object
			v='visible'; 	//				if so, set the v to visible
		}
		obj.visibility=v; 			// 	default is that the layer is hidden
	}
	if (debug) alert("gracefully leaving  hideLayer");
}

