function showtime(){
	var a_p = "";
	var d = new Date();
	var curr_hour = d.getHours();
	if (curr_hour < 12)
	   {a_p = "AM";}
	else
	   {a_p = "PM";}
	if (curr_hour == 0)
	   {curr_hour = 12;}
	if (curr_hour > 12)
	   {curr_hour = curr_hour - 12;}
	var curr_min = d.getMinutes();
	if (curr_min < 10)
		{curr_min = "0" + curr_min;}
	document.write(curr_hour + ":" + curr_min + " " + a_p);
}

function showCurDate(){
	var curDate = new Date();
	var sDate = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
	var sTodayDate = sDate[curDate.getDay()]
	var sMonth = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
	var sCurMonth = sMonth[curDate.getMonth()]
	document.write(sTodayDate + ", " + sCurMonth + " " + curDate.getDate() + ", " + curDate.getFullYear())
}

$(document).ready(function(){

//	$('#submenu_home').slideDown();
	
	$('#header_menu li a[href="#"]').click(function(){
		$('#header_submenu ul').hide();
		$('#sub'+this.id).slideDown();
		return false;
	});
	iphone();

}); // !jquery



function iphone(){
	if((navigator.userAgent.match(/iPad/i))) {
		addCSS();
		var headText = document.getElementById('v2head').innerHTML;
		var iphoneDiv='<div id="iphone_wrapper"><div id="iphone_inner"><div id="iphone_left"><p>The-Herald-To-Go on your iPad</p></div><div id="iphone_right"><a href="http://itunes.apple.com/us/app/the-ottawa-herald/id431292782?mt=8"><img src="http://www.pixelpowerhaus.net/hdniphone/app-store-logo.png" alt="App Store Button" /></a></div><div class="clear"></div></div></div>';
		document.getElementById('v2head').innerHTML = iphoneDiv+headText;
	}
}
function addCSS(){
	var fileref=document.createElement("link");
	fileref.setAttribute("rel", "stylesheet");
	fileref.setAttribute("type", "text/css");
	fileref.setAttribute("href", 'http://www.ottawaherald.com/style/iphone.css');
	document.getElementsByTagName("head")[0].appendChild(fileref);
}

