// Button Rollover Code
function rollOver(imgID, imgName) {
	document.getElementById(imgID).setAttribute('src', imgName);
}

// toggleTab for Production Detail pages
var prevTabID = 'Tickets';

function toggleTab(TabID) {
  document.getElementById('tab' + prevTabID).className = 'prodDetailOption';
  document.getElementById('prodDetail' + prevTabID).className = 'displayNone';


  //APPLY THE ACTIVE STYLE TO THE SELECTED TAB
  document.getElementById('tab' + TabID).className = 'prodDetailOptionOn';
  document.getElementById('prodDetail' + TabID).className = 'displayBlock';

  prevTabID = TabID;
}

// Get Mouse Coordinates
function getwindow() {
  var d = document, v = window, w, h, l, t;
  if(typeof v.innerWidth === 'number') {
    w = v.innerWidth;
    h = v.innerHeight;
    l = v.pageXOffset;
    t = v.pageYOffset;
  } else if((v = d.documentElement) &&
      typeof v.clientWidth === 'number' &&
      v.clientWidth !== 0 || (v = d.body)) {
    w = v.clientWidth;
    h = v.clientHeight;
    l = v.scrollLeft;
    t = v.scrollTop;
  }
  return {w: w, h: h, l: l, t: t};
}


var moux, mouy;
function getmouse(e) {
  e = e || window.event || {};
  var w = getwindow(),
    minx = w.l,
    miny = w.t,
    maxx = w.w + w.l,
    maxy = w.h + w.t;
  if(typeof e.pageX === 'number') {
    moux = e.pageX;
    mouy = e.pageY;
  } else {
    moux = e.x + w.l;
    mouy = e.y + w.t;
  }
//  document.forms.f.elements.t.value =
   'mouse x =\t' + moux + '\nmouse y =\t' + mouy;
}

if( window.captureEvents ) { window.captureEvents( Event.MOUSEMOVE ); }
window.onscroll = getmouse;
window.onresize = getmouse;
window.document.onmousemove = getmouse;

function containsDOM (container, containee) {
  do {
    if ((isParent = container == containee))
      break;
    containee = containee.parentNode;
  }
  while (containee != null);
  return isParent;
}

function checkMouseEnter (evt, element) {
  if (element.contains && evt.fromElement) {
    return !element.contains(evt.fromElement);
  }
  else if (evt.relatedTarget) {
    return !containsDOM(element, evt.relatedTarget);
  }
}

function checkMouseLeave (evt, element) {
  if (element.contains && evt.toElement) {
    return !element.contains(evt.toElement);
  }
  else if (evt.relatedTarget) {
    return !containsDOM(element, evt.relatedTarget);
  }
}