 
// email address
function mailadd (which) {
   var one = "camping@";
   var two = "horam-manor.c";
   var three = "o.uk";
   return one+two+three;
}
function mailtag (which,subject) {
   return '<a href=\"mailto:' + mailadd(which) + '?subject=' + subject + '\">';
}
function maillink (which,text,subject) {
   if (!text) text = mailadd(which);
   if (!subject) subject = "Email from Horam Manor web site";
   return mailtag(which,subject) + text + "</a>";
}

function newopen(url) {
	newwin = parent.open(url,'new','toolbar,scrollbars,resizable')
	newwin.focus()
	}


/* 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('Jan','Feb','Mar',
    'Apr','May','Jun','Jul','Aug','Sep',
    'Oct','Nov','Dec');

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 getCorrectedYear(year) {
// reason for all this stuff unknown, works without it - EXCEPT ON NETSCAPE!
    year = year - 0;
    if (year < 70) return (2000 + year);
    if (year < 1900) return (1900 + year);
    return year;
}

function makeFomattedDate(date) {
    var corrYear = getCorrectedYear(date.getYear());
    var dateY2K = new Date(corrYear,date.getMonth(),date.getDate());
    return dateY2K.getDate() /* +  nths(dateY2K.getDate()) */ + " " + months[dateY2K.getMonth()] + " " + corrYear;
}
function thisYear() {
    date = new Date();
    return getCorrectedYear(date.getYear());
}

// form: moredetails box pop-up -- not used here

function moreDetails() {
   document.getElementById('moredetails').style.visibility='hidden';
   if (document.getElementById('searchengine').selected) { document.getElementById('moredetails').style.visibility='visible'; }
   if (document.getElementById('weddingdirectory').selected) { document.getElementById('moredetails').style.visibility='visible'; }
   if (document.getElementById('other').selected) { document.getElementById('moredetails').style.visibility='visible'; }
}


