<!--
// 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
//
// preLoad
// startMouseCapture()
// swapImg(name,src,layer)
// swapClass(which,name)
// popUp(URL,width,height,additional)
// getScrollX(window)
// getScrollY(window)
// returnLayer(id)
// showLayer(id,visibility)
// moveLayer(id,x,y)
// writeLayer(id,htmlcode)
// clipLayer
// resizeLayer(id,w,h)
// setZindex(id,z)
// getscreenWidth()
// getscreenHeight()
// getwindowWidth()
// getwindowHeight()
// getscreenX()
// getscreenY()
// getlayerX(id)
// getlayerY(id)
// getlayerWidth(id)
// getlayerHeight(id)


mouseX=0;
mouseY=0;


//===================================================================================================================
// Cross Browser DHTML Functions
//===================================================================================================================


//preload images
function preLoad() {
  if (!document.images) return;
  var ar = new Array();
  var arguments = preload.arguments;
  for (var i = 0; i < arguments.length; i++) {
    ar[i] = new Image();
    ar[i].src = arguments[i];
  }
}



// Swap Image Src

function swapImg(imgObj, imgSrc) {
document.images[imgObj].src = eval(imgSrc + '.src');
}



// This function writes HTML code in a layer
function writeLayer(layer,code) {
	if (isNav) {
		eval('document.'+layer+'.document.open()');
		eval('document.'+layer+'.document.write(code)');
		eval('document.'+layer+'.document.close()');
		}
	else if (isExp) {
		eval('document.all.'+layer+'.innerHTML=code');
	}
	else if (isW3C) {
		obj=document.getElementById(layer);
		// this is a non-compliant netscape hack supported by Gecko/Mozilla,
		// necessary to allow writing markup in a layer
		obj.innerHTML=code;
	}
	else if (isOpera) {
		obj=document.getElementById(layer);
		obj.style.innerHTML=code;
	}
}

function getscrollX() {
	if (isNav || isW3C) {
		return eval('window.pageXOffset');
	}
	else if (isExp) {
	    if (document.documentElement && !document.documentElement.scrollLeft)
	    {
	        // IE6 +4.01 but no scrolling going on
            return 0;
        }
        else if (document.documentElement && document.documentElement.scrollLeft)
        {
            // IE6 +4.01 and user has scrolled
            return eval(document.documentElement.scrollLeft);
        }
        else if (document.body && document.body.scrollLeft)
        {
            // IE5 or DTD 3.2
            return eval('document.body.scrollLeft');
        }
	}
}

function getscrollY() {
	if (isNav || isW3C) {
		return eval('window.pageYOffset');
	}
	else if (isExp) {
	    if (document.documentElement && !document.documentElement.scrollTop)
	    {
	        // IE6 +4.01 but no scrolling going on
            return 0;
        }
        else if (document.documentElement && document.documentElement.scrollTop)
        {
            // IE6 +4.01 and user has scrolled
            return eval(document.documentElement.scrollTop);
        }
        else if (document.body && document.body.scrollTop)
        {
            // IE5 or DTD 3.2
            return eval('document.body.scrollTop');
        }
	}
}



function setscrollY(y) {

	if (isNav || isW3C) {
		window.pageYOffset = y;
	}
	else if (isExp) {
		window.document.body.scrollTop = y;
	}

} 


function mousemoveH(evt) {
	if (isNav) {
		mouseX=evt.pageX;
		mouseY=evt.pageY;
	} 
	else if (isExp) {
		mouseX=window.event.clientX;
		mouseY=window.event.clientY;
	}
	else if (isW3C) {
		mouseX=evt.clientX;	
		mouseY=evt.clientY;
	}
	else if (isOpera) {
		mouseX=window.event.clientX;
		mouseY=window.event.clientY;
	}
	return true;
}

function startMouseCapture(handler) {
	if (isNav) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
	if (handler) document.onmousemove=handler;
	else document.onmousemove=mousemoveH;
//	if (isW3C) document.addEventListener(Event.MOUSEMOVE,mousemoveH,true);
}


function setZindex(which,how) {
	if (isNav || isExp) {
		eval ('document.'+pre+which+suf+'.zIndex="'+how+'"');
		return;
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		obj.style.zIndex=how;
	}
}


function returnLayer(which){
	if (isNav || isExp) {
		obj = eval('document.'+pre+which);
		if (!obj) {return false;}
		else {return true;}
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		if (!obj) {return false;}
		else {return true;}
	}
}


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 showLayerBlock(which,how) {
	if (isExp) {
		eval ('document.'+pre+which+suf+'.display="'+how+'"');
		return;
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		obj.style.display=how;
	}
}



function swapClass(which,name) {
	if (isNav || isExp) {
		eval ('document.'+pre+which+'.className="'+name+'"');
		return;
	}
	else if (isW3C || isOpera) {
		obj=document.getElementById(which);
		obj.className=name;
	}
}




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;
		return;	
	}
}

function getwindowWidth() {
	if (isExp) {
		return document.body.clientWidth;
	}
	else if (isNav || isW3C || isOpera) {
		return window.innerWidth;
	}
}
function getwindowHeight() {
	if (isExp) {
		return document.body.clientHeight;
	}
	else if (isNav || isW3C || isOpera) {
		return window.innerHeight;
	}
}


function getscreenWidth() {
		return screen.width;
}
function getscreenHeight() {
		return screen.height;
}





function getscreenX() {
	if (isExp) {
		return window.screenTop;
	}
	else if (isNav || isW3C || isOpera) {
		return window.screenX;
	}
}
function getscreenY() {
	if (isExp) {
		return window.screenLeft;
	}
	else if (isNav || isW3C || isOpera) {
		return window.screenY;
	}
}





function getlayerX(which) {
	if (isExp) {
		return eval ('document.'+pre+which+suf+'.pixelLeft');
	}
	else if (isNav) {
		return eval ('document.'+pre+which+suf+'.left');
	}
	else if (isW3C) {
		obj=document.getElementById(which);
		style=getComputedStyle(obj,null); // computed style vs. style definition
		return parseInt(style.getPropertyValue('left')); // we need to parse 'px' out
	}

}

function getlayerY(which) {
	if (isExp) {
		return eval ('document.'+pre+which+suf+'.pixelTop');
	}
	else if (isNav) {
		return eval ('document.'+pre+which+suf+'.top');
	}
	else if (isW3C) {
		obj=document.getElementById(which);
		style=getComputedStyle(obj,null); // computed style vs. style definition
		return parseInt(style.getPropertyValue('top')); // we need to parse 'px' out
	}
	else if (isOpera) { // broken
		obj=document.getElementById(which);
		return (obj.style.top);
	}


}

function resizeLayer(which,w,h) {
	if (isExp) {
		eval ('document.'+pre+which+'.style.width='+w);
		eval ('document.'+pre+which+'.style.height='+h);
	}
	
	else if (isW3C) {
		obj=document.getElementById(which);
		obj.style.width = w + 'px';
		obj.style.height = h + 'px';
		return;
	
	}
}



function resizeH(which,h) {
	if (isExp) {
		eval ('document.'+pre+which+'.style.height='+h);
	}
	
	else if (isW3C) {
		obj=document.getElementById(which);
		obj.style.height = h + 'px';
		return;
	
	}
}


function getlayerWidth(which) {
	if (isExp) {
		return eval ('document.'+pre+which+'.pixelWidth');
	}
	else if (isNav) {
		return eval ('document.'+pre+which+'.clip.width');
	}
	else if (isW3C) {
		obj=document.getElementById(which);
		style=getComputedStyle(obj,null);
		return parseInt(style.getPropertyValue('width'));
	}
	else if (isOpera) { // broken
		obj=document.getElementById(which);
		return (obj.style.width);
	}

}

function getlayerHeight(which) {
	if (isExp) {
		//return eval ('document.'+pre+which+'.pixelHeight');
		return eval ('document.'+pre+which+'.clientHeight');
	}
	else if (isNav) {
		return eval ('document.'+pre+which+'.clip.height');
	}
	else if (isW3C) {
		obj=document.getElementById(which);
		style=getComputedStyle(obj,null);
		return parseInt(style.getPropertyValue('height'));
	}
	else if (isOpera) {	// broken
		obj=document.getElementById(which);
		return (obj.style.height);
	}

}

function clipLayer(which,left,top,right,bottom) {
	if (isNav) {
		eval('document.'+pre+which+'.clip.top='+top);
		eval('document.'+pre+which+'.clip.bottom='+bottom);
		eval('document.'+pre+which+'.clip.left='+left);
		eval('document.'+pre+which+'.clip.right='+right);
	} else if (isExp) {
		eval('document.'+pre+which+'.style.clip = "rect('+top+'px '+right+'px '+bottom+'px '+left+'px)"');
	} else if (isW3C) {
		obj=document.getElementById(which);
		obj.style.clip='rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';
	}
}

//-->
