// JavaScript Document
var year = new Date();

var theyear = year.getYear();

if(theyear < 1900){
	
	theyear += 1900;
	
}

var copyright = '&copy; Copyright '+theyear+', Fly Biggles.com';

String.prototype.trim = function() { 

	var _ret = this.replace(/^\s+|\s+$/g, ''); 
	
	return _ret.replace(/^(\&nbsp\;)+|(\&nbsp\;)+$/g, ''); 

}

function newWindow(url,width,height,scrollbars){
	
		window.open(url, 'Window', 'toolbar=0,scrollbars='+scrollbars+',location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height+',left=20,top=20');
		
}
var weekday=new Array(7);
weekday[0]="Sun";
weekday[1]="Mon";
weekday[2]="Tue";
weekday[3]="Wed";
weekday[4]="Thu";
weekday[5]="Fri";
weekday[6]="Sat";

var month=new Array(7);
month[0]="Jan";
month[1]="Feb";
month[2]="Mar";
month[3]="Apr";
month[4]="May";
month[5]="Jun";
month[6]="Jul";
month[7]="Aug";
month[8]="Sep";
month[9]="Oct";
month[10]="Nov";
month[11]="Dec";

function getDateExt(date){
	var ext = 'th';
	if(date != "11" & date != "12" & date != "13"){
		switch(date.charAt(date.length-1)){
		case '1':
			ext = 'st';
			break;
		case '2':
			ext = 'nd';
			break;
		case '3':
			ext = 'rd';
			break;
		}
	}
	return date+ext;
}

function dateTime(){
	var dt = new Date();
	var hours = dt.getHours();
	var mins = dt.getMinutes();
	var secs = dt.getSeconds();
	if (hours<=9) hours="0"+hours;
	if (mins<=9) mins="0"+mins;
	if (secs<=9) secs="0"+secs;
	document.getElementById('clock').innerHTML = weekday[dt.getDay()] +", "+ getDateExt(""+(dt.getDate())+"") +" "+ month[dt.getMonth()] +" "+theyear +"&nbsp;&nbsp;"+hours+":"+mins+":"+secs;
}

setInterval('dateTime()',100);



