isNav=false;
isW3C=false;
isExp=false;
isOpera=false;
isNOT=false;
isMac=false;

// Detect browser and define pre/suf-fixes
browser=navigator.appName;
version=navigator.appVersion;
useragent=navigator.userAgent;
Vmajor=parseInt(navigator.appVersion);
Vminor=parseFloat(navigator.appVersion);

if (useragent.indexOf('Opera') != -1) {
	isOpera=true;
	pre='all';
	suff='.style';
}
else if (browser=="Netscape") {
	if (Vmajor==4)
	{
		isNav=true; pre='layers.'; suf='';
	}
	else if (Vmajor>=5)	isW3C=true;
	else isNOT=true;
}
else if (browser=="Microsoft Internet Explorer") {
	if ( version.indexOf('MSIE 5.0; Macintosh;') != -1 )  {
		isExp=true;
		pre='all.';
		suf='.style';
	}
	// IE 4 to 5.5 return 4 as the version
	else if ( (Vmajor==4) ) {
		isExp=true;
		pre='all.';
		suf='.style';
	}
	else isNOT=true;
} else {
	isW3C=true;
}

if (version.indexOf('Mac') != -1) isMac=true;

function showlayer(which) {
	if (isNav || isExp) {
		eval ('document.'+pre+which+suf+'.visibility="visible"');
		eval ('document.'+pre+which+suf+'.display="block"');
		return;
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		obj.style.visibility="visible";
		obj.style.display="block";
        if (isOpera) {
            obj.style.position="relative";
        }
	}
}

function hidelayer(which) {
	if (isNav || isExp) {
		eval ('document.'+pre+which+suf+'.visibility="hidden"');
		eval ('document.'+pre+which+suf+'.display="none"');
		return;
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		obj.style.visibility="hidden";
		obj.style.display="none";
        if (isOpera) {
            obj.style.position="absolute";
        }
	}
}

function setCSScolor(which, color) {
	if (isNav || isExp) {
		eval ('document.'+pre+which+suf+'.backgroundColor="' + color + '"');
		eval ('document.'+pre+which+suf+'.backgroundColor="' + color + '"');
		return;
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		obj.style.backgroundColor=color;
	}
}

function setCSSparam(which, param, val) {
	if (isNav || isExp) {
		eval ('document.'+pre+which+suf+'.' + param + '="' + val + '"');
		eval ('document.'+pre+which+suf+'.' + param + '="' + val + '"');
		return;
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		if (obj) { eval ('obj.style.' + param + '="' + val + '"'); }
	}
}


