<!--
function getElementById(id) {
	if (document.all) {
		return document.all[id];
	} else  {
		return document.getElementById(id);
	}
}

function getElementByName(name) {
	if (document.all) {
		return document.all[name];
	} else  {
		return document.getElementByName(name);
	}
}

function readCookie(name) {
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0) { 
    offset = document.cookie.indexOf(search);
    if (offset != -1) { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function deleteCookie(name) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() - 1);
	document.cookie = name + "=delete; expires=" + todayDate.toGMTString() + ";path=/;";
}

function SetCookie(name, value, expdate) {
	document.cookie = name + "=" + escape(value) + "; expires=" + expdate.toGMTString() + ";path=/;";
}

var current_pic = -1;
var imgArr = new Array();
function loadImages() {
	for (count=0; count < imgFileArr.length; ++count) {
		imgArr[count]  = new Image();
		imgArr[count].src = 'images/' + imgFileArr[count];
	}
}
function nextPic() {
	// for previous/next links for photo album
	// current_pic and image array must be defined in page
	++current_pic;
	getElementById('album').src = 'images/' + imgFileArr[current_pic];
	getElementById('caption').innerHTML = '<p class="centred smallText halfMargin">'+imgCaptions[current_pic]+'</p>';
	showHideLinks();
}
function previousPic() {
	// for previous/next links for photo album
	// current_pic and image array must be defined in page
	--current_pic;
	getElementById('album').src = 'images/' + imgFileArr[current_pic];
	getElementById('caption').innerHTML = '<p class="centred smallText halfMargin">'+imgCaptions[current_pic]+'</p>';
	showHideLinks();
}
function showHideLinks() {
	// for previous/next links for photo album
	// current_pic and image array must be defined in page
	// as well as divs for next and previous links
	if(current_pic < (imgFileArr.length-1)) {
		getElementById('nextDiv').style.visibility = 'visible';
	} else {
		getElementById('nextDiv').style.visibility = 'hidden';
	}
	if(current_pic == 0) {
		getElementById('previousDiv').style.visibility = 'hidden';
	} else {
		getElementById('previousDiv').style.visibility = 'visible';
	}
}


function checkLength(elem, len) {
	/* 
	 To use this function the input (type=text) or textarea must have its id attribute set
	 There must be an empty div element with an id of the same name with '-msg' at the end to display the error message
	 Call using... onkeyup="checkLength(this, 50)" ...where 50 is the maximum length you want to allow
	 e.g. 
	 <textarea id="Comments" name="Comments" onkeyup="checkLength(this, 50)"></textarea>
	 <div id="Comments-msg"></div>
	*/
	if(elem.value.length >= len) {
		if(getElementById(elem.id + '-msg')) {
			getElementById(elem.id + '-msg').innerHTML = 'You have reached the maximum length';
		}
		elem.value = elem.value.substr(0, len);
	} else {
		if(getElementById(elem.id + '-msg')) {
			getElementById(elem.id + '-msg').innerHTML = '';
		}
	}
}

var mywin = null;
function myWin(url, w, h) {
	mywin = window.open(url, 'mywin', "location=no,menubar=no,scrollbars=yes,resizable=yes,width="+w+",height="+h+",left=50,top=50");
	mywin.focus();
}


var blink_colours = new Array('#fff', '#f00');
var count = 0;
function b_link() {
	getElementById('glow').style.color = blink_colours[count++];
	if(count == blink_colours.length) count = 0;
}
function startblink() {
}
function initialisepage() {
}
function tidyup() {
}
//-->

