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 = url_value + '/index.php/menu_css/stylesBlack', themeCSS2 = url_value + '/index.php/menu_css/stylesBlue', themeCSS3 = url_value + '/index.php/menu_css/stylesBrick', themeCSS4 = url_value + '/index.php/menu_css/stylesBubble', themeCSS5 = url_value + '/index.php/menu_css/stylesChrome', themeCSS6 = url_value + '/index.php/menu_css/stylesGold', themeCSS7 = url_value + '/index.php/menu_css/stylesGray', themeCSS8 = url_value + '/index.php/menu_css/stylesMirror', themeCSS9 = url_value + '/index.php/menu_css/stylesNavy', themeCSS10 = url_value + '/index.php/menu_css/stylesRed', themeCSS11 = url_value + '/index.php/menu_css/stylesStone', themeCSS12 = url_value + '/index.php/menu_css/stylesTaupe', themeCSS13 = url_value + '/index.php/menu_css/stylesBluechrome';

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{var x=0,y=document.styleSheets.length-1,nv="",act=true;if(y>0){nv=document.getElementsByTagName('head')[0].lastChild.attributes['href'].nodeValue;	do{if(eval(themeArray[x])==nv){act=false;break;}x++;}while(themeArray[x])}alert(act);if(act){var cssNode=document.createElement('link');cssNode.setAttribute('rel','stylesheet');cssNode.setAttribute('type','text/css');cssNode.setAttribute('href',fileLocation);document.getElementsByTagName('head')[0].appendChild(cssNode);}else{document.getElementsByTagName('head')[0].lastChild.attributes['href'].nodeValue=fileLocation;alert(fileLocation);	}	}catch(err){}}
function setStyleSheet(fileLocation) {try {var x=0,y=document.styleSheets.length-1,nv="",act=true;if(y>0 && document.getElementsByTagName('head')[0].lastChild.attributes.getNamedItem("href")){nv=document.getElementsByTagName('head')[0].lastChild.attributes['href'].nodeValue;do{if(eval(themeArray[x])==nv){act=false;break;}x++;}while(themeArray[x])}if(act){var cssNode=document.createElement('link');cssNode.setAttribute('rel','stylesheet');cssNode.setAttribute('type','text/css');cssNode.setAttribute('href',fileLocation);document.getElementsByTagName('head')[0].appendChild(cssNode);}else{document.getElementsByTagName('head')[0].lastChild.attributes['href'].nodeValue=fileLocation;}}catch(err){}}
