var curr_time;
var has_switched = 0;  // boolean 
var switchTime = "00:00";  // syntax:  "hr : min" ....  midnight:  "00 : 00"

$(function() {

	// set an interval to get the time
	setInterval("getTime()", 5000);
	

});

function getTime() {
	var d = new Date();
	
	//var curr_hour = d.getHours();
	//var curr_min = d.getMinutes();	
	//curr_time = curr_hour + " : " + curr_min;	
	
	curr_time = d.format("HH:MM");
	$("#output").append(curr_time + "<br />");
	
	//alert(curr_time);
	
	if (curr_time == switchTime && has_switched == 0) {
		alert(curr_time);
		has_switched = 1;
		
		getDS();
		
	}
}


