<!-- HIDE FROM NON-JAVASCRIPT ENABLED BROWSERS
/*
 * Copyright (c) HBOS Plc ECD, Belfast
 * All Rights Reserved
 */

/** ----------------------------------------------------------------------
  * Initialising image objects to be used for roll over button effect.
  * Certainly not the most generic way of creating this effect, but one
  * of the least brittle - gives good cross browser results.
  *
  * When setting up the onMouse events that will call the rollover
  * functions, remember to place them in the <A HREF> tag - in NS (<6.0)
  * onMouse events are not supported on the <IMG> tag.
  * 
  * If any buttons are to be added to the menu, they need to be initalised
  * here - remembering to give each a unique name by following the
  * sequence - link1, link2 and so on.
  * ----------------------------------------------------------------------
  */
if (document.images)
{
	// Active images
	link1on = new Image();
	link1on.src = "buttons/17_11_on.gif";
	link2on = new Image();
	link2on.src = "buttons/17_21_on.gif";
	link3on = new Image();
	link3on.src = "buttons/17_31_on.gif";
	link4on = new Image();
	link4on.src = "buttons/17_41_on.gif";
	link5on = new Image();
	link5on.src = "buttons/17_51_on.gif";

	// Inactive images
	link1off = new Image();
	link1off.src = "buttons/17_11.gif";
	link2off = new Image();
	link2off.src = "buttons/17_21.gif";
	link3off = new Image();
	link3off.src = "buttons/17_31.gif";
	link4off = new Image();
	link4off.src = "buttons/17_41.gif";
	link5off = new Image();
	link5off.src = "buttons/17_51.gif";
}

/** ----------------------------------------------------------------------
  * imgOn
  *
  * Remarks:
  * Changes the src file of the image element 'imgName' from the 'off'
  * image to the 'on' image
  *
  * parameters: imgName - name attribute value of image elem to manipulate
  * returns: None
  *
  * Created:    23 Jan 2003
  * Author:     Kevin Corr
  * ----------------------------------------------------------------------
  */
function imgOn(imgName)
{

	if (document.images)
	{
		document[imgName].src = eval(imgName + "on.src");
	}
}



/** ----------------------------------------------------------------------
  * imgOff
  *
  * Remarks:
  * Changes the src file of the image element 'imgName' from the 'on'
  * image to the 'off' image
  *
  * parameters: imgName - name attribute value of image elem to manipulate
  * returns: None
  *
  * Created:    23 Jan 2003
  * Author:     Kevin Corr
  * ----------------------------------------------------------------------
  */
function imgOff(imgName)
{
	if (document.images)
	{
		document[imgName].src = eval(imgName + "off.src");
	}
}


/** ----------------------------------------------------------------------
  * openWindow
  *
  * Remarks:
  * Spawns a new browser window, and opens the file found identified by
  * URL in the new window.
  *
  * parameters: url - the URL of the file to open in the new window
  * returns: None
  *
  * Created:    23 Jan 2003
  * Author:     Kevin Corr
  * ----------------------------------------------------------------------
  */
function openWindow(url)
{
	window.open(url,"","height=595,width=485,left=140,top=40,screenX=140,screenY=40,scrollbars=1'");
}


/** ----------------------------------------------------------------------
  * changePic
  *
  * Remarks:
  * Changes the image ref known as tourImage to point to img_src
  * and changes its alt text to img_alt
  *
  * parameters: img_src - the path to the new image ref
  *		img_alt - the text to display as the image alt
  *		scl_pnt - the position to move the scroll area to
  * returns: None
  *
  * Created:    24 mar 2004
  * Author:     Kevin Corr
  * ----------------------------------------------------------------------
  */
function changePic(img_src,img_alt, scl_pnt)
{
	document['tourImage'].src	= img_src;
	document['tourImage'].alt	= img_alt;
	document.getElementById("description").innerText	= img_alt;
	document.getElementById("nav").scrollLeft= scl_pnt;
}

/** ----------------------------------------------------------------------
  * changeLctnPic
  *
  * Remarks:
  * Changes the image ref known as locationImage to point to img_src
  *
  * parameters: img_src - the path to the new image ref
  * returns: None
  *
  * Created:    25 Mar 2004
  * Author:     Kevin Corr
  * ----------------------------------------------------------------------
  */
function changeLctnPic(img_src)
{
	document['locationImage'].src	= img_src;
}



/** ----------------------------------------------------------------------
  * fixElement
  *
  * Remarks:
  * Function to efficiently fix elements that are not filled.
  *
  * parameters: element, message
  * returns: None
  *
  * Created:    25 Mar 2004
  * Author:     Kevin Corr
  * ----------------------------------------------------------------------
  */
  function fixElement(element, message)
  {
     alert(message);
     element.focus();
  }
  
  
/** ----------------------------------------------------------------------
  * isContactFormReady
  *
  * Remarks:
  * Function to efficiently fix elements that are not filled.
  *
  * parameters: form
  * returns: None
  *
  * Created:    25 Mar 2004
  * Author:     Kevin Corr
  * ----------------------------------------------------------------------
  */
  function isContactFormReady(form)
  {
     var passed = false;
     if (form.name.value == "")
     {
        fixElement(form.name, "Please include your name.");
     }
     else if ((form.email.value == "") && (form.phone.value == ""))
     {
        fixElement(form.email, "Please include your email address or phone number.");
     }
     else if (form.query.value == "")
     {
        fixElement(form.query, "Please inlcude your query.");
     }
     else
     {
        passed = true;
     }
     return passed;
  }

    function RefreshImage(valImageId) {
	    var objImage = document.images[valImageId];
	    if (objImage == undefined) {
		    return;
	    }
	    var now = new Date();
	    objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
    }

// END HIDE -->