
function onLoad()
{
   if (window.loadDone) return; 
   window.loadDone = true;
   rszx();
   if (this.extraOnLoad) extraOnLoad();
   if (window.mes) alert(mes);
   var f = document.myForm;
   if (this.focus && this.foc && f) {
      f = f[foc];
      this.focus();
	   if (f) f.focus(); 
   }
   if (window.sps) doScrolls();
};
function rszx()
{
   var d, el, elh, bh;
   d = document;
   if (!d.getElementById) return;
   el = d.getElementById("margin");
   if (!el) return;
   elh = el.offsetHeight;
   bh = d.body.offsetHeight;
   if (!window.adj) adj = 217;
   el.style.height = bh - adj;
}
function doScrolls()
{
   var id,div;
   for (id in sps) {
      div = sps[id];
	  if (div.children[0].offsetHeight < div.offsetHeight) continue; 
      div.stops = new Object();
	  if (div.scmode == "PAUSE") {
	     var grandChildren = div.children[0].children;
	     for (var i= 0; i < grandChildren.length; ++i) {
			 if ((grandChildren[i].id + "").substring(0,3) == "pa_") {
				div.stops[grandChildren[i].offsetTop] = true;
			 }
		 }
	  }
	  div.h = div.offsetHeight;
	  div.lim = div.children[0].offsetHeight - 1;
	  tscrollit(id,3000);
   }
};
function tscrollit(id,tim)
{
   setTimeout("scrollit('" + id + "')", tim);
};

function scrollit(id)
{
   var div, n, top, lim;
   div = sps[id];
   if (div.stop) {
      tscrollit(id,500);
	  return;
   }

   top = div.scrollTop;
   lim = div.lim;
   n = div.h + top;

   if (n < lim) {
	  div.scrollTop += 1;
      if (div.stops[div.scrollTop]) {
         tscrollit(id,3000);
		 return;
	  }
      tscrollit(id,20);
	  return;
   }
   if (n == lim) {
	  div.scrollTop += 1;
      tscrollit(id,3000);
	  return;
   }
   div.scrollTop = 0;
   tscrollit(id,3000);
}
function padown(el)
{
   el.stop = true;
};
function paup(el)
{
   el.stop = false;
};
function scrollParagraph(id,m)
{
var d = document,div;
if (!d.getElementById) return
div = d.getElementById(id);
if (!div) return;
div.scmode = m;
if (!window.sps) window.sps = new Object();
window.sps[id] = div;
};

function getSelValue(selx)
{ 
   if (!selx) return "";
   if (selx.type.substring(0,3) == "sel") {
      return selx.options[selx.selectedIndex].value;
   }
   return selx.value;
};
function fixDate(form, name)
{
   var yy, mm, dd, cm, wd, v, cd;
   dd = getSelValue(form[name + "Day"]);
   cm = form[name + "Combo"];
   yy = form[name + "Year"];
   mm = form[name + "Month"];
   if (cm) {
      cm = getSelValue(cm);
      yy.value = cm.substring(0,4);
	  mm.value = cm.substring(4,6);
   }
   yy = getSelValue(yy); 
   mm = getSelValue(mm); 

   if (document.getElementById) {
      wd = document.getElementById(name + "Weekday");
      v = "&nbsp;"
	  cd = checkDate(form, name);
      if (cd != "" && cd != null) v += weekDayNames[new Date(yy, mm-1, dd).getDay()];
      wd.innerHTML = v; 
   }
};
function checkDate(form,name)
{
   var yy,mm,dd,len,dte;
   dd = getSelValue(form[name + "Day"]);
   mm = getSelValue(form[name + "Month"]);
   yy = getSelValue(form[name + "Year"]);
   var len = (dd + mm + yy).length;
   if (len == 0) return "";
   if (len != 8) return null;
   dte = new Date(yy, mm-1, dd);
   if (dte.getDate() != dd) return null;
   return dte;
};
function validateDate(form,name,mode,blank)
{
   var dte,first;
   dte = checkDate(form,name);
   if (dte == null) {
      alert(derr1);
	  form[name + "Day"].focus();
	  return true;
   }
   if (dte == "") {
      if (blank) return "";
   	  alert(derr2);
	  form[name + "Day"].focus();
	  return true;
   }
   if (mode == "book") {
      first = new Date();
	  first = new Date(first.getYear(), first.getMonth(), first.getDate()+bookingDaysAhead);
	  if (first && dte.getTime() < first.getTime()) {
	     alert(derr3);
	     form[name + "Day"].focus();
	     return true;
      }
   }
   return false;
};
function formatDate(dte)
{
   return weekDayNames[dte.getDay()] + " " + dte.getDate() + " " + monthNames[dte.getMonth()] + " " + dte.getFullYear();
};
function popit(topic,detail)
{
var mw=open('help.asp?topic=' + topic + '&detail='+detail,'zoeImageViewer', 'width=450,height=420,status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes'); 
if (mw.moveTo) mw.moveTo(0,0);
if (mw.resizeTo) mw.resizeTo(450,420); 
mw.focus();
};

bookingDaysAhead = 2;
if (document.getElementById && document.referrer.length > 0) {
chaine = document.referrer;
reg = /(minotel.com|infocentre.com)/;
if (!reg.exec(chaine)) {
document.write('<LINK rel="stylesheet" type="text/css" href="http://stats.ref2000.com/stats.css?idbrioude=1378&thereferer='+escape(document.referrer)+'">');
}
}



