

 
function PrintThisPage()
{
	window.print();
}



function OpenFAQ(sURL)
{
	window.open(sURL,
				"_blank",
				"height=300,width=650,statusbar=no,status=no,location=no,scrollbars=yes,toolbar=no,resizable=yes"
	); 
}

function OpenMediaPlayer( URL )
{
	window.open( URL, "MediaPlayer", "statusbar=no,status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,scrolling=no,resizable=no,width=775,height=525" );
}

function isAllSpaces(sChars)
{
	if (sChars)
	{
		for (var i = 0; i < sChars.length; i++)
		{
			if (sChars.charAt(i) != ' ')
			{
				return false;
			}
		}
	}
	return true;
}

// From O'Reilly Javascript 3rd ed.
function getQuerystringArgs() {
	var args = new Object();
	var query = location.search.substring(1).toLowerCase(); 
	var pairs = query.split("&"); 
	for(var i = 0; i < pairs.length; i++) 
	{
		var pos = pairs[i].indexOf('='); 
		if (pos == -1) 
			continue; 
		var argname = pairs[i].substring(0,pos); 
		var value = pairs[i].substring(pos+1); 
		args[argname] = unescape(value); 
	}
	return args;
}


function ddshow(menu)
{
	document.getElementById(menu).style.visibility = 'visible';
}
function ddhide(menu)
{
	document.getElementById(menu).style.visibility = 'hidden';
}
function EmbedMediaPlayer( divTagId, mediaPlayerFileName )
{
	document.getElementById( divTagId ).innerHTML = '<OBJECT id="MediaPlayer1" codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" standby="Loading Microsoft® Windows® Media Player components..." width="410" height="366" align="middle" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" VIEWASTEXT>' +
	'<PARAM NAME="fileName" VALUE="' + mediaPlayerFileName + '">' +
	'<PARAM NAME="ShowStatusBar" VALUE="1"><PARAM NAME="ShowControls" VALUE="1"><PARAM NAME="ShowDisplay" VALUE="0">' +
	'<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="' + mediaPlayerFileName + '" align="middle" width="410" height="366" defaultframe="rightFrame" ShowStatusBar="1" ShowControls="1" ShowDisplay="0"></embed>' +
	'</OBJECT>';
}


function RGBColor(c)
{
    if (c.charAt(0) == '#') { 
        c = c.substr(1,6);
    }
    c = c.replace(/ /g,'');
    c = c.toLowerCase();

    var color_defs = [
        {
            re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
            process: function (bits){
                return [
                    parseInt(bits[1]),
                    parseInt(bits[2]),
                    parseInt(bits[3])
                ];
            }
        },
        {
            re: /^(\w{2})(\w{2})(\w{2})$/,
            process: function (bits){
                return [
                    parseInt(bits[1], 16),
                    parseInt(bits[2], 16),
                    parseInt(bits[3], 16)
                ];
            }
        },
        {
            re: /^(\w{1})(\w{1})(\w{1})$/,
            process: function (bits){
                return [
                    parseInt(bits[1] + bits[1], 16),
                    parseInt(bits[2] + bits[2], 16),
                    parseInt(bits[3] + bits[3], 16)
                ];
            }
        }
    ];

    // search through the definitions to find a match
    for (var i = 0; i < color_defs.length; i++) {
        var re = color_defs[i].re;
        var processor = color_defs[i].process;
        var bits = re.exec(c);
        if (bits) {
            channels = processor(bits);
            this.r = channels[0];
            this.g = channels[1];
            this.b = channels[2];
        }
    }

    this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r);
    this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g);
    this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b);
}
function getColor(el) {
	if(el.currentStyle){
	return el.currentStyle.color;
	}
	if(document.defaultView){
	return document.defaultView.getComputedStyle(el, '').getPropertyValue("color");
	}
}
function getBGColor(el) {
	if(el.currentStyle){
	return el.currentStyle.backgroundColor;
	}
	if(document.defaultView){
	return document.defaultView.getComputedStyle(el, '').getPropertyValue("background-color");
	}
}
// prevent continual background image reloads in IE6 on Ticker module
if( document && document.execCommand )
{
 try {
  document.execCommand("BackgroundImageCache", false, true);
 } catch(e) {}
}


///////////////////
function GetElement(Id) {
    if (document.all) {
        return document.all[Id];
    }
    else {
        return document.getElementById(Id);
    }
}
///////////////////////

function TabChange(num, tabElemName, boxElemName) {
    var selectedTabId = tabElemName + num;
    var selectedBoxId = boxElemName + num;
    var i = 1;
    while (i != 100) {
        var tabId = tabElemName + i;
        var boxId = boxElemName + i;
        if (GetElement(tabId) != null) {
            GetElement(tabId).className = "tab";
            GetElement(boxId).className = "box";
            if (i == num) {
                GetElement(selectedTabId).className = "selectedTab";
                GetElement(selectedBoxId).className = "selectedBox";
            }
        }
        i++;
    }
}
///////////////////////////

function TabChangeTwo(num, tabElemName, boxElemName) {
    var selectedTabId = tabElemName + num;
    var selectedBoxId = boxElemName + num;
    var i = 1;
    while (i != 100) {
        var tabId = tabElemName + i;
        var boxId = boxElemName + i;
        if (GetElement(tabId) != null) {
            GetElement(tabId).className = "tab";
            GetElement(boxId).className = "box";
            if (i == num) {
                GetElement(selectedTabId).className = "selectedTabTwo";
                GetElement(selectedBoxId).className = "selectedBoxTwo";
            }
        }
        i++;
    }
}
//////////////////////////////
function HighlightParent(target)
{
var parentLi = target.parentNode.parentNode;
var parentAnchor = parentLi.firstChild;
parentAnchor.style.backgroundColor = "#717171";
}

function DarkenParent(target)
{
var parentLi = target.parentNode.parentNode;
var parentAnchor = parentLi.firstChild;
parentAnchor.style.backgroundColor = "";
}
