function clock()
{
	var fontsize = screenSize(); //get font size with our new, oversized ratio
//	alert(fontsize);
	var letterspacing = smashFontTogether(fontsize);
	var clock_div = document.getElementById('clock');
	var h = 0;
	curTime = new Date();
	hours = curTime.getHours();
	minutes = curTime.getMinutes();
	seconds = curTime.getSeconds();
	
	if (hours > 12)
	{
		h = hours - 12;
	}
	else 
	{
		h = hours;
	}
	if (hours == 0)
	{
		h = 12;
	}

	var timeStr = "" + ((h < 10) ? ("0" + h) : h);
	timeStr += ((minutes < 10) ? ":0" : ":") + minutes;
	timeStr += ((seconds < 10) ? ":0" : ":") + seconds;
	// timeStr += ((hours > 12) ? "PM" : "AM");
	clock_div.innerHTML='<div style="font-size:' + fontsize + 'px; 	letter-spacing:' + letterspacing + 'px;">' + timeStr + '</div>';

	setTimeout("clock()", 1);
}

function screenSize()
{
	if (window.innerWidth)
	{
		var width = window.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		var width = document.documentElement.clientWidth;
	}
	else if (document.body.clientWidth)
	{
		var width = document.body.clientWidth;
	}
	else
	{
		var width = screen.width;
	}

	// var fontsize = width * 300 / 1600;
	//var fontsize = width * 436 / 1600;
	
	
	var fontsize = width * 550/ 1600;
	//alert(fontsize);
	return(fontsize);
}

//setSize function written by BM Peiffer August 2008

function setSize()
{

	screenSize(); //get font size with our new, oversized ratio
	smashFontTogether();	

}

//smashFontTogether function written by BM Peiffer August 2008

function smashFontTogether(fontSize)
{
	var smashAmount = -27 * fontSize / 630.375;
	
	return(smashAmount);
	

}