// open window for offsite links
function goto(url) {      
  newwin = parent.open(url,'offsite')     
  newwin.focus()
}
function mailadd () {
   var one = "mail@";
   var two = "cambridgehousehunt.c";
   var three = "o.uk";
   return one+two+three;
}
function mailtag () {
   return '<a href=\"mailto:' + mailadd() + '?subject=Email from web site' + '\">';
}
function maillink (which,text,subject) {
   if (!text) text = mailadd(which);
   if (!subject) subject = "Email from web site";
   return mailtag(which,subject) + text + "</a>";
}
/* Date format routines */

/* Thanks to:  http://www.javascript-page.com & http://www.irt.org */

function makeArray0() {
     for (i = 0; i<makeArray0.arguments.length; i++)
          this[i] = makeArray0.arguments[i];
}

var months = new makeArray0('January','February','March',
    'April','May','June','July','August','September',
    'October','November','December');

function nths(day) {
     if (day == 1 || day == 21 || day == 31) return 'st';
     if (day == 2 || day == 22) return 'nd';
     if (day == 3 || day == 23) return 'rd';
     return 'th';
}

function correctedYear(year) {
// required for Netscape
    year = year - 0;
    if (year < 70) return (2000 + year);
    if (year < 1900) return (1900 + year);
    return year;
}

function formatDate(date) {
    var newYear = correctedYear(date.getYear());
    var newDate = new Date(newYear,date.getMonth(),date.getDate());
    return newDate.getDate() /* +  nths(newDate.getDate()) */ + " " + months[newDate.getMonth()] + " " + newYear;
}

function thisYear() {
    date = new Date();
    return correctedYear(date.getYear());
}

