function addDOMLoadEvent(func) { if (!window.__load_events) { var init = function () { if (arguments.callee.done) return; arguments.callee.done = true; if (window.__load_timer) { clearInterval(window.__load_timer); window.__load_timer = null;}
for (var i=0;i < window.__load_events.length;i++) {window.__load_events[i]();}
window.__load_events = null;}; if (document.addEventListener) { document.addEventListener("DOMContentLoaded", init, false);}
if (/WebKit/i.test(navigator.userAgent)) { window.__load_timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) {init();}}, 10);}
window.onload = init; window.__load_events = [];}
window.__load_events.push(func);}
function toggleClass(objectToChange, oldValue, newValue){ objectToChange.className = objectToChange.className.replace(new RegExp(oldValue), newValue);}
function getElementsByClass(searchClass,node,tag) { var classElements = new Array(); if ( node == null )
node = document; if ( tag == null )
tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp('(^|\\s)'+searchClass+'(\\s|$)'); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++;}
}
return classElements;}
function printPage() { var newWindow = window.print(); return false;}
function getPrintLinks() { if (document.getElementById && document.createElement && document.appendChild) { if(getElementsByClass('print')){ var links = document.getElementsByTagName('a'); var link; for (var i = 0; i < links.length; i++) { link = links[i]; if (/\bprint\b/.exec(link.className)) { link.onclick = printPage; link.title = link.firstChild.nodeValue + ' (printable format of this page)';}
}
objWarningText = null;}
}
}
addDOMLoadEvent(getPrintLinks);
function openInNewWindow() { var newWindow = window.open(this.getAttribute('href'), '_blank'); newWindow.focus(); return false;}
function getNewWindowLinks() { if (document.getElementById && document.createElement && document.appendChild) { if(getElementsByClass('non-html')){ var links = document.getElementsByTagName('a'); var objWarningText; var strWarningText; var link; for (var i = 0; i < links.length; i++) { link = links[i]; if (/\bnon\-html\b/.exec(link.className)) { link.onclick = openInNewWindow; link.title = link.firstChild.nodeValue + ' (opens in a new window)'; toggleClass(link, "non-html", "newWin");}
}
objWarningText = null;}
}
}
addDOMLoadEvent(getNewWindowLinks);

//////////////////////////////////////////////////////////////////
// qTip - CSS Tool Tips - by Craig Erskine
// http://qrayg.com | http://solardreamstudios.com
//
// Inspired by code from Travis Beckham
// http://www.squidfingers.com | http://www.podlob.com
//////////////////////////////////////////////////////////////////



var qTipTag = "a"; //Which tag do you want to qTip-ize? Keep it lowercase!//
var qTipX = -30; //This is qTip's X offset//
var qTipY = 25; //This is qTip's Y offset//



//There's No need to edit anything below this line//
tooltip = {
  name : "qTip",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function () {
	var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
	if(!tipContainerID){ var tipContainerID = "qTip";}
	var tipContainer = document.getElementById(tipContainerID);

	if(!tipContainer) {
	  tipContainer = document.createElementNS ? document.createElementNS(tipNameSpaceURI, "div") : document.createElement("div");
		tipContainer.setAttribute("id", tipContainerID);
	  document.getElementsByTagName("body").item(0).appendChild(tipContainer);
	}

	if (!document.getElementById) return;
	this.tip = document.getElementById (this.name);
	if (this.tip) document.onmousemove = function (evt) {tooltip.move (evt)};

	var a, sTitle;
	var anchors = document.getElementsByTagName (qTipTag);

	for (var i = 0; i < anchors.length; i ++) {
		a = anchors[i];
		sTitle = a.getAttribute("title");
		if(sTitle) {
			a.setAttribute("tiptitle", sTitle);
			a.removeAttribute("title");
			a.onmouseover = function() {tooltip.show(this.getAttribute('tiptitle'))};
			a.onmouseout = function() {tooltip.hide()};
		}
	}
}

tooltip.move = function (evt) {
	var x=0, y=0;
	if (document.all) {//IE
		x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		x += window.event.clientX;
		y += window.event.clientY;
		
	} else {//Good Browsers
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x + this.offsetX) + "px";
	this.tip.style.top = (y + this.offsetY) + "px";
}

tooltip.show = function (text) {
	if (!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.display = "block";
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
}

window.onload = function () {
	tooltip.init ();
}