// Extended Tooltip Javascript
// copyright 9th August 2002, 3rd July 2005
// 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 (ai) return wS ? document.getElementById(oi).style:document.getElementById(oi); 
	if (al) return wS ? document.all[oi].style: document.all[oi]; 
	if (an) return document.layers[oi];
}

function pw() {
	return window.innerWidth != null? window.innerWidth: document.body.clientWidth != null? document.body.clientWidth:null;
}

function mouseX(evt) {
	if (evt.pageX) return evt.pageX; 
	else if (evt.clientX)return evt.clientX + (document.documentElement.scrollLeft ?  document.documentElement.scrollLeft : document.body.scrollLeft); 
	else return null;
}

function mouseY(evt) {
	if (evt.pageY) return evt.pageY; 
	else if (evt.clientY)return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); 
	else 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 {
			tv = mouseY(evt) + 20; lv = mouseX(evt) - (ew/4); 
			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 mouse_X;
var mouse_Y;

var tip_active = 0;

var ie = document.all?true:false;
if (!ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

function update_tip_pos(oi){
		document.getElementById(oi).style.left = mouse_X + 20;
		document.getElementById(oi).style.top  = mouse_Y;
}



function getMouseXY(e) {
	if (ie) { // grab the x-y pos.s if browser is IE
		mouse_X = event.clientX + document.body.scrollLeft;
		mouse_Y = event.clientY + document.body.scrollTop;
	} else { // grab the x-y pos.s if browser is NS
		mouse_X = e.pageX;
		mouse_Y = e.pageY;
	}
	if (mouse_X < 0){mouse_X = 0;}
	if (mouse_Y < 0){mouse_Y = 0;}
	if(tip_active){
		update_tip_pos();
	}
}


function tip_it(which, oi){
	if(which){
		update_tip_pos(oi);
		tip_active = 1;
		document.getElementById(oi).style.visibility = "visible";		
	}else{
		tip_active = 0;
		document.getElementById(oi).style.visibility = "hidden";
	}
}

*/





var topColor, subColor, ContentInfo;


ContentInfo = "";



topColor = "#6633FF"
subColor = "#FFFFCC"








var mouse_X;
var mouse_Y;

var tip_active = 0;



function update_tip_pos(){

		document.getElementById('ToolTip').style.left = mouse_X + 20;
		document.getElementById('ToolTip').style.top  = mouse_Y;
}






var ie = document.all?true:false;
if (!ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

function getMouseXY(e) {
if (ie) { // grab the x-y pos.s if browser is IE
mouse_X = event.clientX + document.body.scrollLeft;
mouse_Y = event.clientY + document.body.scrollTop;
}
else { // grab the x-y pos.s if browser is NS
mouse_X = e.pageX;
mouse_Y = e.pageY;
}
if (mouse_X < 0){mouse_X = 0;}
if (mouse_Y < 0){mouse_Y = 0;}

if(tip_active){update_tip_pos();}
}
















function EnterContent(TTitle, TContent){

ContentInfo = '<table border="0" width="100" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+

'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+

'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%">'+

'<font class="tooltiptitle">&nbsp;'+TTitle+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+

'<tr><td width="100%" bgcolor='+subColor+'>'+

'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+

'<tr><td width="100%">'+

'<font class="tooltipcontent">'+TContent+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>';

}








function tip_it(which, TTitle, TContent){

	
	if(which){
	
		update_tip_pos();
	
		tip_active = 1;
		
		document.getElementById('ToolTip').style.visibility = "visible";
		
		EnterContent(TTitle, TContent);
		
		document.getElementById('ToolTip').innerHTML = ContentInfo;
	
	}else{
	
		tip_active = 0;
	
		document.getElementById('ToolTip').style.visibility = "hidden";
	}

}



















