/*
	HTMLJester Javascript routines v 1.01
	=====================================
	
	Anti-Copyrite 1999. If you plan to use these scripts, then please
	acknowledge their origin. If you plan to use them to make money
	then send me flowers.
	
	Author: 			Mark Focas
	Last modified:		25 February 2002
	email to: 			asockfarm@yahoo.com

*/	

SCRIPT_NAME='show_hide.js'
SCRIPT_VERSION='2.0.0'
var SCRIPT_SHOW_HIDE_IS_INCLUDED=true // this is used for determining dependencies in other scripts

function Is() {
    var agent = navigator.userAgent.toLowerCase();    
    this.major = (navigator.appVersion.indexOf("MSIE 5")>0)? 5: parseInt(navigator.appVersion);
    this.minor = (navigator.appVersion.indexOf("MSIE 5")>0)? getIE5Minor() : parseFloat(navigator.appVersion);
    this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
    this.ns2 = (this.ns && (this.major == 2));
    this.ns3 = (this.ns && (this.major == 3));
    this.ns4b = (this.ns && (this.minor < 4.04));
    this.ns4 = (this.ns && (this.major >= 4));
    this.ie   = (agent.indexOf("msie") != -1);
    this.ie3  = (this.ie && (this.major == 2));
    this.ie4only  = (this.ie && (this.major == 4));
    this.ie4  = (this.ie && (this.major >= 4));
    this.op3 = (agent.indexOf("opera") != -1);
    this.op5 = (agent.indexOf("opera 5") != -1);
	this.isDomCompliant=document.getElementById

    if(this.ns4) {
      doc = "document";
      sty = "";
    } else if(this.ie4) {
      doc = "document.all";
      sty = ".style";
    }
	//if ((this.ns4) && (navigator.userAgent.toLowerCase().indexOf('netscape6')==-1)) {
	//	document.getElementById=_getElementById
	//}
}
function _getElementById(strElement) {	
   return eval(doc+WrapThis(strElement))
}

function getIE5Minor() {
    var strStart=navigator.appVersion.indexOf("MSIE 5") + 5;
    var strEnd=navigator.appVersion.lastIndexOf(";");
    return navigator.appVersion.substring(strStart, strEnd);
}

var is = new Is();

function showLayer(layerName){
//Show the specified layer
   changeLayerVisibility (layerName, 'visible')
 }

function hideLayer(layerName){	
   changeLayerVisibility (layerName, 'hidden')
}

function changeLayerVisibility(layerName, state) {

   if (is.isDomCompliant) {
   		document.getElementById(layerName).style.visibility=state
	}else{
	   var blnHidden=(state=='visible')? false : true
	   eval(doc+WrapThis(layerName)+ '.hidden=' + blnHidden);
   }
}
function WrapThis(WhatToWrap) {
	return '["'+WhatToWrap+'"]'
}

function listProperties(elem) {
	for (var prop in elem) {
		alert (prop + ' ' + elem[prop])
	}
}