function countdown_Suhoor(hour, minute){
	Time_Left = getTimeLeft(hour, minute)
	
	if(Time_Left>0){
		Time_Left %= (60 * 60 * 24);
	  hours = Math.floor(Time_Left / (60 * 60));
	  Time_Left %= (60 * 60);
	  minutes = Math.floor(Time_Left / 60);
	  Time_Left %= 60;
	  seconds = Time_Left;
	  
	  hps = 's'; mps = 's'; sps = 's';
	  if(hours == 1) hps ='';
	  if(minutes == 1) mps ='';
	  if(seconds == 1) sps ='';
	  
	  document.getElementById("dvSuhoor").innerHTML = hours + ' Hr' + hps + ' ';
	  document.getElementById("dvSuhoor").innerHTML += minutes + ' Min' + mps + ' ';
	  document.getElementById("dvSuhoor").innerHTML += seconds + ' Sec' + sps;
	  
	  setTimeout('countdown_Suhoor(' + hour + ',' + minute +  ');', 1000);     
  }          
}

function countdown_Iftar(hour, minute){
	Time_Left = getTimeLeft(hour, minute)
	
	if(Time_Left>0){
		Time_Left %= (60 * 60 * 24);
	  hours = Math.floor(Time_Left / (60 * 60));
	  Time_Left %= (60 * 60);
	  minutes = Math.floor(Time_Left / 60);
	  Time_Left %= 60;
	  seconds = Time_Left;
	  
	  hps = 's'; mps = 's'; sps = 's';
	  if(hours == 1) hps ='';
	  if(minutes == 1) mps ='';
	  if(seconds == 1) sps ='';
	  
	  document.getElementById("dvIftar").innerHTML = hours + ' Hr' + hps + ' ';
	  document.getElementById("dvIftar").innerHTML += minutes + ' Min' + mps + ' ';
	  document.getElementById("dvIftar").innerHTML += seconds + ' Sec' + sps;
	  
	  setTimeout('countdown_Iftar(' + hour + ',' + minute +  ');', 1000);   
    }
    else{
	  document.getElementById("dvIftar").innerHTML = "O my Allah, for Thee, I fast, and with the food Thou gives me I break the fast, and I rely on Thee.";
	  $("#dvIftarLabel").hide("slow");
		$("#dvIftar").css("padding-top","30px");
    }
         
}
         
function getTimeLeft(hour, minute, format){
 Today = new Date();
 Todays_Year = Today.getFullYear() - 2000;
 Todays_Month = Today.getMonth();
                          
 Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), 
                         Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime();                                 
 Target_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), hour, minute, 00)).getTime();                  
 
 Time_Left = Math.round((Target_Date - Todays_Date) / 1000);
 
 if(Time_Left < 0)
    Time_Left = 0;
    
 return Time_Left;
}
