$(document).ready(function()
{
	getTime();
	$('#header-photos').cycle({timeout: 9000,slideResize: 1, height: '310px'});		
});

Date.prototype.stdTimezoneOffset = function()
{
	var jan = new Date(this.getFullYear(), 0, 1);
	var jul = new Date(this.getFullYear(), 6, 1);
	return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}

Date.prototype.dst = function()
{
	return this.getTimezoneOffset() < this.stdTimezoneOffset();
}

function getTime()
{
	var d = new Date();
	var hour = d.getUTCHours();
	
	if (d.dst())
	{
		hour++;
	}
	
	hour = hour % 12;
	
	if (hour == 0)
	{
		hour = 12;
	}
	
	var strClock = hour + ":" + padDigit(d.getUTCMinutes());
	
	if (d.getUTCHours() >= 12)
	{
		strClock += "pm";
	}
	else
	{
		strClock += "am";
	}
	
	$('span#clock').text(strClock).show();
}

function padDigit(digit)
{
	var strDigit = digit.toString();
	if (strDigit.length == 1)
	{
		strDigit = 0 + strDigit;
	}
	return strDigit;
}
