function localWatersArea(leftcoord, topcoord, rightcoord, bottomcoord, callhref, title) {	
	if (document.getElementById && document.createElement) {
		if (! document.getElementById('highlight')) {
			return;
		}	

		document.getElementById('highlight').style.left=leftcoord +'px';
		document.getElementById('highlight').style.top=topcoord +'px';  
		document.getElementById('highlight').style.width=(rightcoord-leftcoord) +'px'; 
		document.getElementById('highlight').style.height=(bottomcoord-topcoord) +'px';	
		document.getElementById('highlight').getElementsByTagName('a')[0].setAttribute('href',callhref);
		document.getElementById('highlight').getElementsByTagName('a')[0].setAttribute('title', 'Click to see ' + title + ' local waters area');
	
		//line below to show the div 
		document.getElementById('highlight').style.display='block';
	}
}

function makeDiv(){
	if (document.getElementById && document.createElement) {
		if (! document.getElementById('dohighlight')) {
			return;
		}
		var ref = document.getElementById('dohighlight');
		h=document.createElement('div');
		h.setAttribute('id','highlight');
		//line below to hide the div
		h.style.display ='none';
		a = document.createElement('a');
		a.setAttribute('href',"#");
		h.appendChild(a);
		ref.appendChild(h);
	}
}

window.onLoad=addEvent(window, 'load', makeDiv); 

function addEvent(obj,evt,fn){
		if(obj.addEventListener)
			obj.addEventListener(evt, fn, false);
			else if(obj.attachEvent)
				obj.attachEvent('on' + evt,fn);
}


