var clockID = 0;
function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
var digits = new Array('০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯');

  var TimezoneOffset = +6  
  var localTime = new Date()
  var ms = localTime.getTime() 
             + (localTime.getTimezoneOffset() * 60000)
             + TimezoneOffset * 3600000
	
   var tDate = new Date(ms);
	var ghonta= tDate.getHours();
	var minit= tDate.getMinutes();
	var second= tDate.getSeconds();
	var bela="রাত";
	if (ghonta>=5 & ghonta<6)
		bela="ভোর";
	else if (ghonta>=6 & ghonta <11)
		bela="সকাল";
	else if (ghonta>=11 & ghonta<13)
		bela="বেলা";
	else if (ghonta>=13 & ghonta<16)
		bela="দুপুর";
	else if (ghonta>=16 & ghonta<18)
		bela="বিকাল";
	else if (ghonta>=18 & ghonta<20)
		bela="সন্ধ্যা";
	ghonta=ghonta%12;
	if (ghonta == 0)
		ghonta=12;
var bghonta= digits[parseInt(ghonta/10)]+digits[ghonta%10];
var bminit=digits[parseInt(minit/10)]+digits[minit%10];
var bsecond =digits[parseInt(second/10)]+digits[second%10];

   document.theClock.theTime.value = "" + bela + " " 
                                   + bghonta + ":" 
                                   + bminit + ":" 
                                   + bsecond;


   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

