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 (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";
	}
}

function hidelayer(which) {
	if (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";
	}
}

function displayCaption(num) {
	if (isExp || isW3C && !isOpera ) {
		hideAllCaptions();
		showlayer("scrCaption" + num);
	}
}

function hideAllCaptions() {
	for (var i = 0; i <= 6; i++) {
		hidelayer("scrCaption" + i);
	}
}

function swapImage(strElement, objImage) {	
// this function swaps the image identified by strElement for a new one preloaded as objImage
	if (document.images && objImage && objImage.src && objImage.src != "") {
		if (document.images[strElement]) {
			document.images[strElement].src = objImage.src
		}
	}
}

function pop(filename, width, height, type) {
	playerWindow = window.open(filename,type,'width=' + width + ',height=' + height + ',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
}




