/*  These scripts are Copyright, Rich Harding
		http://www.csscomputing.co.uk, 2002-9
		You may re-use them free of charge
		as long as you retain this notice   */

if (document.images) {       //if image object is available

	imageOn = new Image();
	imageOn.src= "/images/but_d.gif";

	imgOn = new Image();					// Mouse In Image
	imgOn.src= "/images/but_o.gif";

	imgoff = new Image();                  // MouseOut Image
	imgoff.src = "/images/but_n.gif";

	var imageonname="img<%= lngMenu %>";

}

function imgOver(imgName) {
	if (document.images) {
		imageHolder=new Image();
		imageHolder.src=imgOn.src;
		document[imgName].src = imgOn.src;
	}
}

function imgOut(imgName) {
  if (document.images) {
		imageHolder=new Image();
		imageHolder.src=imgoff.src;
		if (document[imgName].src != imageOn.src) {
  		document[imgName].src = imgoff.src;
  	}
  }
}

// For Sites Guide:

function imgSOver(imgName,lngType) {
 switch (lngType) {
  case 0 : document[imgName].src = '/images/but_o.gif'; break;
  case 1 : document[imgName].src = '/images/butp_o.gif'; break;
  case 2 : document[imgName].src = '/images/butg_o.gif'; break;
 }
}

function imgSOut(imgName,lngType) {
 switch (lngType) {
  case 0 : document[imgName].src = '/images/but_n.gif'; break;
  case 1 : document[imgName].src = '/images/butp_n.gif'; break;
  case 2 : document[imgName].src = '/images/butg_n.gif'; break;
 }
}

function goback() {
	history.go(-1);
}

var bSize = document.images? true : false;

function newWin(imgName) {

	if (bSize) {

// Get the image info:
		var getName = document.images[imgName].src;
		var getWidth = document.images[imgName].width;
		var getHeight = document.images[imgName].height;

// Centre the new window on the screen:
		var xPos = (screen.width - getWidth) / 2
		var yPos = (screen.height - getHeight) / 2

		var lastSlash = getName.lastIndexOf('\/')
		var strFile = getName.substr(lastSlash + 1)

		var lCoach = getName.indexOf('coaches')
		if (lCoach != -1) {
			var sBar = 'no'
			var newName = 'images/coaches/large/' + strFile
		}

		var fullName = 'imgauto.htm?img=' + newName

// The image written into a full, amendable web page:
		imgWin = window.open(fullName, 'iWin', 'toolbar=no,location=no,status=' + sBar + ',scrollbars=no,width=' + getWidth + ',height=' + getHeight + ',left=' + xPos + ',top=' + yPos)

// Make sure your new window gets focus (if called more than once):
		setTimeout('reFocus(imgWin)', '500')
	}

}

