// Common javascript functions for Chris Slee's Home Page
// by Chris Slee, December 2003
//
// Interface functions:
//  STRING formattedDate ( DATE )
//  STRING getURL ( )
//

// ------------------------------------------------------------------------
// Check is the page has been loaded in a frameset. If so, break out of the
// frameset and reload as a new page. This defeats the Yahoo/GeoCities
// redirection problem. 
// 
// This code runs immediately on loading. 
// ------------------------------------------------------------------------
if (self != top) {
	top.location.href = self.location.href;
} else {
  	y_gc_div_adcntr.innerHTML = '';
	y_gc_div_mast.innerHTML = '';
	y_gc_div_au1.innerHTML = '';
}

//if (self != top) {
//if (document.getElementById('FR') {
//	if (document.images) top.location.replace(window.location.href);
//	else                 top.location.href = window.location.href;
//}

// ------------------------------------------------------------------------
// Common functions
// ------------------------------------------------------------------------

var dayNames = new Array("Sunday","Monday","Tuesday",
            "Wednesday","Thursday","Friday","Saturday");
var monthNames = new Array("January","February","March",
            "April","May","June","July","August","September",
            "October","November","December");

function getFullYear(year) {
	if (year <   80) year += 2000;     // Correct lastModified bug
    if (year < 1000) year += 1900;     // Correct getYear bug
    return year; 
    }

function formattedDate(theDate) {
    var objDate = new Date(theDate);
    return (dayNames[objDate.getDay()] + ", " + objDate.getDate() +
   			" " + monthNames[objDate.getMonth()] + " " +
    		getFullYear(objDate.getYear()));
    }
    
// for backwards compatibility
function showDate(theDate) {
    document.write(formattedDate(theDate));
}

function getURL() {
    return ("<a href='"+document.location+"'>This Page</a>");
    }

// <!-- Start of StatCounter Code -->
var sc_project=4089123; 
var sc_invisible=1; 
var sc_security="b637c5a4"; 
// <!-- End of StatCounter Code -->
