var horizonContent = new Array(),showHorizonBg = false;
var themeArray = new Array('themeCSS1','themeCSS2','themeCSS3','themeCSS4','themeCSS5','themeCSS6','themeCSS7','themeCSS8','themeCSS9','themeCSS10','themeCSS11','themeCSS12','themeCSS13');
var themeCSS1 = 'http://media.mgnetwork.com/CQHorizonNavBar2/black/stylesBlack.css', themeCSS2 = 'http://media.mgnetwork.com/CQHorizonNavBar2/blue/stylesBlue.css', themeCSS3 = 'http://media.mgnetwork.com/CQHorizonNavBar2/brick/stylesBrick.css', themeCSS4 = 'http://media.mgnetwork.com/CQHorizonNavBar2/bubble/stylesBubble.css', themeCSS5 = 'http://media.mgnetwork.com/CQHorizonNavBar2/chrome/stylesChrome.css', themeCSS6 = 'http://media.mgnetwork.com/CQHorizonNavBar2/gold/stylesGold.css', themeCSS7 = 'http://media.mgnetwork.com/CQHorizonNavBar2/gray/stylesGray.css', themeCSS8 = 'http://media.mgnetwork.com/CQHorizonNavBar2/mirror/stylesMirror.css', themeCSS9 = 'http://media.mgnetwork.com/CQHorizonNavBar2/navy/stylesNavy.css', themeCSS10 = 'http://media.mgnetwork.com/CQHorizonNavBar2/red/stylesRed.css', themeCSS11 = 'http://media.mgnetwork.com/CQHorizonNavBar2/stone/stylesStone.css', themeCSS12 = 'http://media.mgnetwork.com/CQHorizonNavBar2/taupe/stylesTaupe.css', themeCSS13 = 'http://media.mgnetwork.com/CQHorizonNavBar2/bluechrome/stylesBluechrome.css';
function overNav(item){
	try {
		x = 0; do { if(document.getElementById(horizonPage[x]) != item.parentNode) js2css('remove',document.getElementById(horizonPage[x]),'horizonNavOnOver','');x++; } while(horizonPage[x])
		js2css('add',item.parentNode,'horizonNavOnOver','');
		if(horizonContent[item.parentNode.id].length > 0) { document.getElementById('horizonLowNav').innerHTML = horizonContent[item.parentNode.id]; } else {	document.getElementById('horizonLowNav').innerHTML = (showHorizonBg) ? '<div id="horizonSubWrapper"></div>' : '<div id="horizonEmptyNav"></div>'; }
	} catch(err) {
		document.getElementById('horizonLowNav').innerHTML = (showHorizonBg) ? '<div id="horizonSubWrapper"></div>' : '<div id="horizonEmptyNav"></div>'; ;	
	}
	return;
}
function activateNav(item) {
	var results = "";
	try {
		js2css('add',document.getElementById(item),'horizonNavOnOver','');
		if (showHorizonBg) { results = (horizonContent[item].length > 0) ? horizonContent[item] : '<div id="horizonSubWrapper"></div>';	} else { results =  (horizonContent[item].length > 0) ? horizonContent[item] : '<div id="horizonEmptyNav"></div>'; }
	} catch(err) {
		results = (showHorizonBg) ? '<div id="horizonSubWrapper"></div>' : '<div id="horizonEmptyNav"></div>';
	}
	document.getElementById('horizonLowNav').innerHTML = results; 
	return;
}
function js2css(act,item,arg1,arg2) {
	try { 
		switch (act){
	    case 'add': if(!js2css('check',item,arg1)){item.className+=item.className?' '+arg1:arg1;} break;
	    case 'remove': var rep=item.className.match(' '+arg1)?' '+arg1:arg1; item.className=item.className.replace(rep,''); break;
	    case 'swap': item.className=!js2css('check',item,arg1)?item.className.replace(arg2,arg1): item.className.replace(arg1,arg2); break;
	    case 'check': return new RegExp('\\b'+arg1+'\\b').test(item.className); break;
	  } 
  } catch(err) {}
}

function setStyleSheet(fileLocation) {
	try {
		if(document.getElementById('NavBarStyle'))
		{
			document.getElementById('NavBarStyle').attributes['href'].nodeValue=fileLocation;
		}
		else
		{
			var cssNode=document.createElement('link');
			cssNode.setAttribute('id','NavBarStyle');
			cssNode.setAttribute('rel','stylesheet');
			cssNode.setAttribute('type','text/css');
			cssNode.setAttribute('href',fileLocation);
			document.getElementsByTagName('head')[0].appendChild(cssNode);
		}
	}catch(err){}
}