/**********************************************************************************
 *  New popup window
 *********************************************************************************/
function openWindow(URL, title, winoptions) {
	winInfo = winoptions + "location=0,statusbar=0,menubar=0,resizable=1,scrollbars=1";
	var theWindow = window.open(URL, title, winInfo);
	theWindow.focus();
}

/**********************************************************************************
 *  Fix IE background image flicker
 *  http://www.mister-pixel.com/
 *********************************************************************************/
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

/**********************************************************************************
 *  Get an array of all elements with a specified class name
 *********************************************************************************/
document.getElementsByClassName = function(cl) {
	var retnode = [];
	var myclass = new RegExp('\\b'+cl+'\\b');
	var elem = this.getElementsByTagName('*');
	for (var i = 0; i < elem.length; i++) {
		var classes = elem[i].className;
		if (myclass.test(classes)) retnode.push(elem[i]);
	}
	return retnode;
}

/**********************************************************************************
 *  Toggle frame contents and tabs
 *********************************************************************************/
function toggleFrames(tabID, frameClass)
{
	eClassHide = document.getElementsByClassName(frameClass);
	for (i = 0; i < eClassHide.length; i++) {
		eClassHide[i].style.display = 'none';
	}
	eIDShow = document.getElementById(tabID);
	eIDShow.style.display = 'block';
}

