var tip;
function setTip() {  
  tip = document.getElementById('toolTip'); 
} 
document.onmousemove = function(e) {  
  //if (!e) e = event; 
  e = e?e:event;
  mouse = e;  
}
function killMMH() {  
  document.onmousemove = null;  
}
function dragObject() {  
  //with (dragObj.style) {
	tip.style.top=(mouse.clientY+20+(document.documentElement.scrollTop||document.body.scrollTop||0))+'px';
	tip.style.left=(mouse.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft||0))+'px'; 
	return false;  
}  
  
function setMMH() {  
  document.onmousemove = dragObject; // event handler for move  
} 

function toolTipOn(showThis){
	tip.innerHTML=showThis;
	tip.style.display='block';
}
function toolTipOff(){
	tip.style.display='none';
	tip.innerHTML="";
}


function launchGolf(whichPage) {
	var url = "/stats/golf?golfCourseName=" + whichPage +"&format=html";
	var strOriginal = url;
	var strReplaced = strOriginal.replace(/\_/g,"%20");
	url = strReplaced;
	var size = "width=613,height=332";
	var features = size + ",left=0,top=0,scrollbars=yes,resizable=yes";
	// strip out extra chars in whichPage	
	if(whichPage.indexOf("/") != -1) {
		var lastIndex = whichPage.lastIndexOf("/");
		whichPage = whichPage.substring(lastIndex+1, whichPage.length);
	}
	window.open(url,whichPage,features);
	
}

function mapsOpener(map){
	var h = window.screen.availHeight;
	var w = window.screen.availWidth - 10;
	window.open('/maps/index.jsp?map=' + map + '','newMaps','height=' + h + ',width=' + w + ',top=0,left=0,x=0,y=0,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes')
}	
