//Error handling function
window.onerror=errorhandler;

function errorhandler(msg, url, ln)
{
	alert("Error: " + msg + "\nIn File:" + url + "\nAt Line" + ln);
	return true; //tell the browser the error has been handled
}


//Display the welcome message in the status bar
function welcome()
{
	window.defaultStatus="Biomedical Technology Innovations";
}

//Finding the date:
//Create an array of day and month names
function write_date()
{
	var days = new Array("Sunday","Monday","Tuesday",
	                     "Wednesday","Thursday","Friday","Saturday");
	var months = new Array("January","February","March","April","May",
	                      "June","July","August","September","October",
												"November","December");
	var now = new Date(); //Create a date object
	var yy = now.getYear(); //Get the year
	var mn = now.getMonth(); //Get the month
	var dd = now.getDate(); //Get the day no. in month
	var dy = now.getDay(); //Get the day no. in the week
	if (yy<2000) yy += 1900; //Adjust for mozilla add 1900 to the current date
	mn = months[mn]; //Convert month to a name
	dy = days[dy]; //Convert day to a name
	return(dy +" "+ mn +" "+ dd + ", " + yy);
}

function write_time()
{
	var now = new Date(); //Create a date object
	var hours = now.getHours(); //Get the time in hours
	var minutes = now.getMinutes(); //Get the minutes
	if (minutes < 10) minutes = "0" + minutes;
	if (hours >= 12)
	{
		if(hours!=12){
		hours-=12;}
		return(hours + ":" + minutes + "pm");
	}
	else
	{
		if (hours==0) hours=12;
		return(hours + ":" + minutes + "am");
	}
}