var today = new Date();
var bool = "a";

function Display()
{



//Gets the difference in minutes between local time where the page

//is open and the GMT. Then the time difference to Uzbekistan.	  
	intHours = today.getTimezoneOffset();
	intHours = (intHours / 60) + 5;

// Gets the local time where the page is open. Also sets the time
// to Uzbekistan local time. 	
	if (bool == "a")
	{ 
	intHour = (today.getHours()) + (intHours);
	bool = "x";
	} 
	else
	{
	intHour = today.getHours();
	};
	
	intMinute = today.getMinutes();
	intSecond = today.getSeconds();

    intSecond++;
	
	 if (intSecond > 59)
	  {
		intMinute++;
		intSecond =0;
	  }

		
	if (intMinute > 59)
	  {
		intHour++
		intMinute = 0;
	  }
//works out the the first hours after 24:00 hours
	
	if(intHour>23)
	{
		intHoldMin = intHour - 24;		

		intHour=0 + intHoldMin;
	}    

//Formatting Hrs, Min, Sec AM-PM for display


	
	if (intHour == 00)
	{
		hours = "12" + ":";
		ts = " MidNight";
	}

	else if (intHour < 12)
	{
		hours = intHour + ":";
		ts = " AM";
	}

	else if (intHour == 12)
	{
		hours = intHour + ":";
		ts = " Noon";
	}

	else
	{
		hours = intHour - 12;
		hours = hours + ":";
		ts = " PM";
	}


	if (intMinute < 10)
	{
		 minutes = "0"+intMinute+":";
	}

	else
	{
		minutes = intMinute+":";
	}

	if (intSecond < 10) 

	{
		seconds = "0"+intSecond+" ";
	} else {
		seconds = intSecond + " ";
	}

	 
	  today.setHours(intHour);
	  today.setMinutes(intMinute);
	  today.setSeconds(intSecond);	

	  timeStrFn = hours + minutes + seconds + ts


//display the hour and retards the function calling by one second 
//every time	

	  netClock.innerText ="Local time in Uzbekistan  " + timeStrFn + "  ";
	  window.setTimeout("Display();",1000)
	
}
