<!--

//library of useful js functions

function Reload(oForm)
{
        oForm.submit();
}

//trim string
function TrimString(sStr) 
{
	sStr = this != window? this : sStr;
	return sStr.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function Empty(sStr)
{
	if(TrimString(sStr) == '')
		return true;
	else
		return false;
}

function RetrieveRadioVal(oRadio)
{
	for(var i = 0; i < oRadio.length; i++)
	{
		if (oRadio[i].checked)
			return oRadio[i].value;
	}
	return false;
}

function popUp(sUrl, sWidth, sHeight)
{
	var oWin;
	openPop(oWin, 'popup', sUrl, sWidth, sHeight, true);
}

/* Moves focus to sNextField within oForm when oField has reached iLength, should be used with onKeyUp event like so, onKeyUp='NextField(this, this.form.sNextField, iLength)' */
function NextField(oField, oNextField, iLength)
{
	if(oField.value.length >= iLength)
		oNextField.focus();
}

/* Clears a field if it's current value is equal to sValue, should be used if a field has a default that should be cleared when the user selects the input */
function ClearField(oField, sValue)
{
	if(oField.value == sValue)
		oField.value = '';
}

//open pop-up window
function openPop(winPop, winName, url, popWidth, popHeight, scrolling){
  
  if (scrolling === true) scrolling = 'yes';
  
  var leftPos = (screen.availWidth - popWidth) / 2;
  var rightPos = (screen.availHeight - popHeight) / 2;
  
  var details = "height=" + popHeight + ",width=" + popWidth + ",left=" + leftPos + ",top=" + rightPos + ",status=no,resizable=yes,titlebar=no,toolbar=no,location=no,scrollbars=" + scrolling + ",directories=no";
  
  if (winPop && winPop.open && !winPop.closed){
    winPop.resizeTo(popWidth, popHeight);				//only works in IE
    winPop.location = url;
    winPop.focus();
  }
  else { 
    winPop = window.open(url, winName, details);
    winPop.focus();
  }
  return winPop;
}


//close pop-up window
function closePop(winPop){
  if (winPop && winPop.open && !winPop.closed){
    winPop.close();
  }
}

// single rollover --

function rollover(imageSource, whichImage, imageWidth, imageHeight ,statusText) {
if (document.images) {
	image = new Image(imageWidth,imageHeight);
	image.src = imageSource;
	
	swapImage(whichImage);
	//window.status=statusText;
}
}

function unRollover(imageSource, whichImage, statusText) {
if (document.images) {
	replaceImage(imageSource, whichImage);
	//returnStatus(statusText);
}
}

function swapImage(whichImage) {
document.images[whichImage].src = image.src;
}

function replaceImage(imageSource, whichImage) {
document.images[whichImage].src = imageSource;
}


function returnStatus(statusText) {
	changeStatus(statusText);
	window.defaultStatus='Thameslink';
}

function changeStatus(statusText) {
	window.status=statusText;
}

function preloadImg(imgSrc) 
{
   var preLoad = new Image;
   preLoad.src = imgSrc; 
}

function formRollover(oElement, sImage)
{
	oElement.src = sImage;
}

function swapImg(oImgTag, sImage)
{
	oImgTag.src = sImage;
}

function ShowLoader()
{
	document.getElementById("Loader").style.display = "inline";
}

function HideLoader()
{
	document.getElementById("Loader").style.display = "none";
}

function openWindow()
{
	window.open("terms.html","window1","width=480,height=450,status=no,menubar=no,directories=no,resizable=no,scrollbars=yes,toolbar=no");
}

-->