function showTooltip(x, y, contents) {
	$('<div id="tooltip">' + contents + '</div>').css( {
		position: 'absolute',
		display: 'none',
		top: y + 5,
		left: x + 5,
		border: '1px solid #fdd',
		padding: '2px',
		'background-color': '#fee',
		opacity: 0.80
	}).appendTo("body").fadeIn(200);
}

function getRangeDates(){
	var range = document.getElementById("range").value;
	var endM=endD=endY=startM=startD=startY="";
	var startdateformat = enddateformat = "";
	
	if(range != ""){
		//endDate will be today (the end date)
		var endDate = new Date();
		endM = endDate.getMonth();
		//month is 0-11
		endM++;
		endD = endDate.getDate();
		endY = endDate.getFullYear();
		enddateformat = endM + "/" + endD + "/" + endY;
		
		var startDate = new Date();
		startDate.setDate(startDate.getDate()-range);
		startM = startDate.getMonth();
		//month is 0-11
		startM++;
		startD = startDate.getDate();
		startY = startDate.getFullYear();
		startdateformat = startM + "/" + startD + "/" + startY;
	}
	
	document.getElementById("startdate").value = startdateformat;
	
	document.getElementById("enddate").value = enddateformat;
}

function confirmDelete()
{
    return confirm("Are you sure?");
}