
// Temporary variables to hold mouse x-y pos.s
var tempX = 0 ;
var tempY = 0 ;

var subnavheadid ;
function showSubNav(id) {
	hideSubNav() ;
	var objDiv = document.getElementById('navid_'+id) ;
	if(objDiv!=null) {
		objDiv.style.display = 'block';
		subnavheadid = 'navid_' + id ;
	}
}

function hideSubNav() {
	if(subnavheadid != null) {
		var objDivStyle = document.getElementById(subnavheadid).style ;
		objDivStyle.display = 'none';
	}
}

function showIconInfo(headline,info,direction) {
	var objDivStyle = document.getElementById('iconinfo').style ;
	objDivStyle.display = 'block' ;
	var varwidth = 200 ;
	if(info.length>100) varwidth = 300 ;
	
	if(direction=='right')
		objDivStyle.left = (tempX+10)+'px' ;
	else
		objDivStyle.left = (tempX-varwidth-20)+'px' ;
		
	objDivStyle.top =(tempY)+'px' ;
	
	objDivStyle.width = varwidth+'px' ;
	//
	document.getElementById('iconinfo_headline').innerHTML = headline ;
	document.getElementById('iconinfo_info').innerHTML = info ;
}

try {
	// If NS -- that is, !IE -- then set up for mouse capture
	document.captureEvents(Event.MOUSEMOVE)
} catch(e) {}

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;


// Main function to retrieve mouse x-y pos.s
function getMouseXY(e) {
  try { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } catch(ex) {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  

  return true
}

function hideIconInfo() {
	try {
		document.getElementById('iconinfo').style.display = 'none' ;	
	}catch(e){}
}