// Extended Tooltip Javascript
// copyright 9th August 2002, by Stephen Chapman, Felgall Pty Ltd

// permission is granted to use this javascript provided that the below code is not altered
/*
var DH = 0;var an = 0;var al = 0;var ai = 0;if (document.getElementById) {ai = 1; DH = 1;}else {if (document.all) {al = 1; DH = 1;} else { browserVersion = parseInt(navigator.appVersion); if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {an = 1; DH = 1;}}} function fd(oi,ws) {if (ws == 1) {if (ai) {return (document.getElementById(oi).style);}
else {if (al) {return (document.all[oi].style);} else {if (an) {return (document.layers[oi]);}};}} else {if (ai) {return (document.getElementById(oi));} else {if (al) {return (document.all[oi]);} else {if (an) {return (document.layers[oi]);}};}}} function pw() {if (window.innerWidth != null) return window.innerWidth; if (document.body.clientWidth != null)
return document.body.clientWidth; return (null);} function popUp(evt,oi) {if (DH) {var wp = pw(); ds = fd(oi,1); dm = fd(oi,0); st = ds.visibility; if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; if (st == "visible" || st == "show") { ds.visibility = "hidden"; } else  { if (evt.y || evt.pageY) {if (evt.pageY) {tv = evt.pageY + 20;
lv = evt.pageX - (ew/4);} else {tv = evt.y + 20 + document.body.scrollTop; lv = evt.x  - (ew/4) + document.body.scrollLeft;} if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2;if (!an) {lv += 'px';tv += 'px'};ds.left = lv; ds.top = tv;} ds.visibility = "visible";}}}
*/


var DH = 0;var an = 0;var al = 0;var ai = 0;
if (document.getElementById) {ai = 1; DH = 1;}else {if (document.all) {al = 1; DH = 1;} else { browserVersion = parseInt(navigator.appVersion); 
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {an = 1; DH = 1;}}} function fd(oi,ws) {if (ws == 1) {if (ai) {return (document.getElementById(oi).style);}
else {if (al) {return (document.all[oi].style);} else {if (an) {return (document.layers[oi]);}};}} else {if (ai) {return (document.getElementById(oi));} else {if (al) {return (document.all[oi]);} else {if (an) {return (document.layers[oi]);}};}}} 
function pw() {
	if (window.innerWidth != null) return window.innerWidth; 
	if (document.body.clientWidth != null) return document.body.clientWidth; return (null);} 
function popUp(evt,oi,boventip) {
	if (DH) {
		var wp = pw(); 
		var ds = fd(oi,1); 
		var dm = fd(oi,0); 
		var st = ds.visibility; 
		var ew, cliphei; //var 
		if (dm.offsetWidth) ew = dm.offsetWidth; else if (dm.clip.width) ew = dm.clip.width; 
		if (st == "visible" || st == "show") { 
			ds.visibility = "hidden"; 
		} else  { 
			if (evt.y || evt.pageY) {
				var muisnaast=14;
				var tv; //var 
				var lv; //var 
				if (evt.pageY) {
					tv = evt.pageY + muisnaast;
					lv = evt.pageX - (ew/4);
				} else { 
					tv = evt.y + muisnaast + document.body.scrollTop; 
					lv = evt.x  - (ew/4) + document.body.scrollLeft;
				} 
				//
				//
				// CLIPS boven de cursor?
				//
				//boventip=0; //ALLE CLIPS NAAR BENEDEN GEFORCED (default)
				//boventip=1; // NAAR BOVEN GEFORCED
				//
				if(boventip && boventip==1){ //extra: derde input parameter
 				   if (dm.offsetHeight){ 
				   	   cliphei = dm.offsetHeight; 
				   } else if (dm.clip.height){
					   cliphei = dm.clip.height;
				   }	//alert(cliphei);
				   tv -= cliphei;	 				
				   tv -= 33; // erboven...		 				
				} 
				//
				//
				// CLIPS naast de cursor?
				//
				//boventip=2; //ALLE CLIPS NAAR links GEFORCED
				//
				if(boventip && boventip==2){ //extra: derde input parameter
 				   if (dm.offsetWidth){ 
				   	   clipwidth = dm.offsetWidth; 
				   } else if (dm.clip.width){
					   clipwidth = dm.clip.width;
				   }	//alert(cliphei);
				   lv -= clipwidth;	 				
				   //	het is nu al links, nu ook nog half omhoog:	 				
 				   if (dm.offsetHeight){ 
				   	   cliphei = dm.offsetHeight; 
				   } else if (dm.clip.height){
					   cliphei = dm.clip.height;
				   }	//alert(cliphei);
				   tv -= cliphei*0.6;	 				
				} 
				//
				//
				//
				if (lv < 2) lv = 2; else if (lv + ew > wp) lv -= ew/2;
				if (!an) {
					lv += 'px';
					tv += 'px';
				}
				ds.left = lv; 
				ds.top = tv;
			} 
			ds.visibility = "visible";
		}
	}
}
