// JavaScript Document
//<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  	if ((obj=MM_findObj(args[i]))!=null) { 
		v=args[i+2];
		if (obj.style) { 
			obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
		}
		obj.visibility=v;
	}
}

//browser capabilities variables -Added by Jess 15/10/07
var CanDo = document.getElementById ? true : false;
var DocAllMode = document.all ? true : false;
//position variables -Added by Jess 15/10/07
var scrollX = 0;
var scrollY = 0;
var cX = 0;
var cY = 0;

//Updates the cursor position (W3C Standard browsers) -Added by Jess 15/10/07
function UpdateCursorPosition(e) {
cX = e.pageX; cY = e.pageY;
}

//Updates the cursor position (IE) -Added by Jess 15/10/07
function UpdateCursorPositionDocAll(e) {
cX = event.clientX; cY = event.clientY;
}

if(DocAllMode) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }

//Determines the offset based on how far the page is scrolled -Added by Jess 15/10/07
function ScrollAmount() {
	if(self.pageYOffset) {
	   scrollX = self.pageXOffset;
	   scrollY = self.pageYOffset;
	} else if(document.documentElement && document.documentElement.scrollTop) {
	   scrollX = document.documentElement.scrollLeft;
	   scrollY = document.documentElement.scrollTop;
	} else if(document.body) {
	   scrollX = document.body.scrollLeft;
	   scrollY = document.body.scrollTop;
	}
}

//Assigns the position to the selected description div -Added by Jess 15/10/07
function AssignPosition(event,d) {
	ScrollAmount(); 
	if (!document.all) {
	    cX = event.clientX;
	    cY = event.clientY;
	} else {
	    cX = window.event.clientX;
	    cY = window.event.clientY;
	}
	
	d.style.left = (cX+scrollX+10) + "px";
	d.style.top = (cY+scrollY+10) + "px";
}

//Hides the open div (onmouseout) -Added by Jess 15/10/07
function HideContent(d) {
	if(! CanDo) { return; }
	document.getElementById(d).style.display = "none";
}

//Shows the selected description div (onmouseover) -Added by Jess 15/10/07
function ShowContent(event,d) {
	if(! CanDo) { return; }
	var dd = document.getElementById(d);
	AssignPosition(event,dd);
	dd.style.display = "block";
}