// display the loading message
function loading() {
	document.getElementById("load_frame").innerHTML = 'Loading...<br><br><br><div id="gif" style="text-align:center"><img src = "pngfiles/loadinfo.gif"></div>';
  document.getElementById("side_bar").innerHTML = "";
}

function slowload() {
	document.getElementById("load_frame").innerHTML = 'Loading...<br><br><div style="text-align:center"><img src = "pngfiles/loadinfo.gif"></div><br><br><div style="text-align:justify">Large time range may be slow in loading.</div>';
  document.getElementById("side_bar").innerHTML = "";
}


// remove the loading message when the page has finished loading
function clearmessage() {
	document.getElementById("load_frame").innerHTML = load_html;
}


function myclick(i) {
	coldmarkers[i].openInfoWindowHtml(htmls[i]);
}


// Change specified marker from cold to hot (for mouse over)
// It deletes the cold Icon marker and replaces it with the hot Icon marker      
function mymouseover(i) {
	hotmarker.setPoint(coldmarkers[i].getPoint());
	hotmarker.importance=1000000;
	map.addOverlay(hotmarker);
}

function importanceOrder (marker,b) {
	return GOverlay.getZIndex(marker.getPoint().lat()) + marker.importance*10000;
}


// Change specified marker from hot to cold (for mouse out)
// It deletes the hot Icon marker and replaces it with the cold Icon marker      
function mymouseout(i) {
	map.removeOverlay(hotmarker);
}

function animateRange(t1,t2) {
	if (document.getElementById("oneday").checked==true) {
		document.getElementById("range").checked=true;
		getRange();
	}
	D1=new Date(t1);D1.setDate(D1.getDate());
	m1=D1.getMonth()+1;d1=D1.getDate();y1=D1.getFullYear();
	D2=new Date(t2);D2.setDate(D2.getDate()-1);
	m2=D2.getMonth()+1;d2=D2.getDate();y2=D2.getFullYear();
	document.getElementById("dayone").value=m1+'/'+d1+'/'+y1;
	document.getElementById("daytwo").value=m2+'/'+d2+'/'+y2;
};