// JavaScript Document

/*this is to get the date and time*/			
var month = new Array('Jan.','Feb.','March','April','May','June','July','August','Sept.','Oct.','Nov.','Dec.');
var the_date = new Date();
var the_day = the_date.getDate();
var the_month = the_date.getMonth();
var the_year = the_date.getFullYear();
var the_minutes = fixTime(the_date.getMinutes());
var the_hour = fixhour(the_date.getHours());
/*alert(the_date.getMinutes()+" this is the hour"+the_date.getHours());*/
var the_current_dateAndTime = month[the_month]+" " +the_day +", " + the_year+" " + the_hour + ":" + the_minutes;
var the_currentTime = the_hour + ":" + the_minutes;
function fixhour(the_hour) {

	if (the_hour >12) 
	{
		the_hour = eval(the_hour - 12);
	}
	else if(the_hour == 0)
	{
		the_hour = eval(the_hour+12)
	}
	//alert(the_hour);
	return the_hour;
}

function fixTime(the_time) {
	
	if ((the_time <10) && (the_date.getHours()<=11)) 
	{
		the_time = "0" + the_time + "am";
	}
	else if ((the_time >=10) && (the_date.getHours()<=11)) 
	{
		the_time = the_time + "am";
	}
	else if ((the_time >=10) && (the_date.getHours() >= 12)) 
	{
		the_time = the_time + "pm";
	}
	else if ((the_time <10) && (the_date.getHours() >= 12)) 
	{
		the_time = "0" + the_time + "pm";
	}
	//alert(the_time);
	return the_time;
}
function Time(){
document.write(the_currentTime);
}
function DateandTime(){
document.write(the_current_dateAndTime);
}



