// Author : Simon Cunningham
// Description : Page monitoring functions

////////////////////////////////////////////////////////////////////////////////
//
// syncTitles
//
// Synchorize title of 'target' with that of 'source'
//

function syncTitles(source,target) {
  // Grab source HREF and store in sourceHREF
  var sourceTitle;
  sourceTitle = source.title;
  var targetTitle;
  targetTitle = target.title;
  if ( sourceTitle != targetTitle ) {
    // Set page title to sourceHREF
    target.title = sourceTitle;
    //alert("Title changed");
  }
}

////////////////////////////////////////////////////////////////////////////////
//
// getElement
//
// get an element by its ID.
//
// Parameters
// id : DOM id of the requested element.
//

function getElement(id) {
  // getElementByID is from xbDom.js
  return document.getElementById(id);
}


////////////////////////////////////////////////////////////////////////////////
//
// getEventSource
//
// get the object that triggered an event
//
// Parameters
// event : an object event
//

function getEventSource(e) {
  e = (e)? e: (window.event)? window.event: "";
  if ( e.srcElement ) {
	source = e.srcElement;
  }
  else {
	source = e.target;
  }
  return(source);
}

////////////////////////////////////////////////////////////////////////////////
//
// getMouseX
//
// Get X position of mouse cursor
//

function getMouseX(e) {
  return(e.clientX);
}

////////////////////////////////////////////////////////////////////////////////
//
// getMouseY
//
// Get Y position of mouse cursor
//

function getMouseY(e) {
  return(e.clientY);
}
