var dom = document.getElementById ? true:false;
var nn4 = document.layers ? true:false;
var ie4 = document.all ? true:false;
var mouseY;
var mouseX;


function fO(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=fO(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function switch_layer() { 
  var i,p,v,obj,args=switch_layer.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=fO(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function setText(objName,x,newText) { 
  if ((obj=fO(objName))!=null) with (obj)
    if (navigator.appName=='Netscape') {document.write(unescape(newText)); document.close();}
    else innerHTML = unescape(newText);
}
function getMouse(){
	if(ie4){
		mouseY =  event.clientY + document.body.scrollTop ;
		mouseX =  event.clientX + document.body.scrollLeft;
	}
	else if(nn4 || dom){
		mouseY = e.pageX + document.body.scrollTop ;
		mouseX = e.pageY + document.body.scrollLeft;
		
	}
}
function correct_pos() {

getMouse();

if(ie4){document.all.hint.style.pixelLeft = mouseX-100;
	document.all.hint.style.pixelTop  = mouseY+10; 	}
else if(nn4){
	document.hint.left   = mouseX+10;
	document.hint.top    = mouseY+10;			}       
else if(dom){
	document.getElementById("hint").style.left = mouseX+10;
	document.getElementById("hint").style.top  = mouseY+10;}
}

function showPopWnd (sText) {
	correct_pos();
	switch_layer('hint','','show');
	var sLine = '<table class="poptable" width="100%" cellspacing="2" cellpadding="2" align="center">';
	sLine = sLine + '<tr>';
	sLine = sLine + '<td class="pop">'+sText+'</td>';
	sLine = sLine + '</tr>';
	sLine = sLine + '</table>'
	setText('hint','',sLine);
}

function off() {
switch_layer('hint','','hide');
}


