function activateDiv(imageName, divName) {
	if (!document.images) return;
	if (document.all || document.getElementById || !divName)
		document.images[imageName].src = eval("btn_" + imageName + "_over.src");
	else
		document.layers[divName].document.images[imageName].src = eval("btn_" + imageName + "_over.src");
}
function inactivateDiv(imageName, divName) {
	if (!document.images) return;
	if (document.all || document.getElementById || !divName)
		document.images[imageName].src = eval("btn_" + imageName + "_off.src");
	else
		document.layers[divName].document.images[imageName].src = eval("btn_" + imageName + "_off.src");
}
function openRCGateway(url,transferURL) {
	if (getCookie('RCGatewayTerms')) {
		window.location = transferURL;
	} else {
		window.location = url + '?transfer=' + transferURL;
	}
}
function openPopup(url) {
    var popupWin = window.open(url,null,"toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=566,height=400");
    if (popupWin.opener == null)
    	popupWin.opener=window;
        popupWin.opener.name="opener";
}
function openHospitalBillingPopup(url) {
    var popupWin = window.open(url,null,"toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=780,height=400");
    if (popupWin.opener == null)
    	popupWin.opener=window;
        popupWin.opener.name="opener";
}

/**********************************************************************************
 *  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';
}

/**********************************************************************************
 *  Cookie functions
 *********************************************************************************/

	// get value of named cookie
	function getCookie(c_name)
	{
		if (document.cookie.length>0)
		{
			c_start=document.cookie.indexOf(c_name + "=");
			if (c_start!=-1)
			{
				c_start=c_start + c_name.length+1;
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
			}
		}
		return "";
	}
	
	// set value and expiration date of new or existing cookie
	function setCookie(c_name,value,expiredays)
	{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	}

