<!--
// dhtml_base.js
// updated : 2000.12.22
//
// supports Mozilla M17 / Netscape 6 / Gecko
// supports IE 4, 5 and 5.5 on windows
// supports IE 4.5 and IE 5 on macOS
// supports NN 4.5, 4.7 on windows and macOS
// partial support of Opera 4.01
//
// all code is copyright sebastien chevrel, cooked from scratch
// feel free to reuse, just let me know if you do something nice with it
// seb@sebchevrel.com
//
// startMouseCapture()
// swapImage(name,src,layer)
// popUp(URL,width,height,additional)
// getscrollX(window)
// getscrollY(window)
// Showlayer(id,visibility)
// Movelayer(id,x,y)
// Writelayer(id,htmlcode)
// Resizelayer(id,w,h)
// setZindex(id,z)
// getwindowWidth()
// getwindowHeight()
// getlayerX(id)
// getlayerY(id)
// getlayerWidth(id)
// getlayerHeight(id)
// Cliplayer(id,left,top,right,bottom)

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

mouseX=0;
mouseY=0;

// 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='';
		//window.captureEvents(Event.RESIZE);	// handle the resize bug on NN
	}
	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;

//if (isNav) document.captureEvents(Event.RESIZE);
//top.onresize=resizeH;

// Cross Browser DHTML Functions

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

function Movelayer(which,x,y) {
	if (isExp)	{
		eval ('document.'+pre+which+suf+'.pixelLeft='+x);
		eval ('document.'+pre+which+suf+'.pixelTop='+y);
		return;
	}
	else if (isNav) {
		eval ('document.'+which+'.moveTo('+x+','+y+')');
		return;
	}
	else if (isW3C) {
		obj=document.getElementById(which);
		obj.style.left=x+'px';
		obj.style.top=y+'px';	
		return;
	}
	else if (isOpera) {
		obj=document.getElementById(which);
		obj.style.left=x;
		obj.style.top=y;	
	}
}

// -->
