var MenuBaseURL = "http://www.skillsoft.com";
var loc_string = document.location.pathname;
var s = new String(loc_string);
var last_index = s.lastIndexOf('/');
var url = new String(parent.document.URL); 
var query_string = "";
if (url.indexOf('?') != -1) {
	query_string = url.substring(url.indexOf('?')+1, url.length);
}

/* Function to return 4-digit year */
function getYr() {
	var today = new Date();
	var yr = new String(today.getFullYear()); 
	document.write(yr);
}

/* Function to return default stylesheet */
function getStyle() {
	var stylesheet = "";
	if (query_string.indexOf('print=1') != -1) {
		stylesheet = "print.css";
	} else {
		stylesheet = "main.css";
	}
	document.write('<link href="'+MenuBaseURL+'/styles/'+stylesheet+'" rel="stylesheet" type="text/css" />');
}

/* Function to return printer friendly link */
function getPrintUrl() {
	var print_url;
	if (query_string != "") {
		print_url = s + "?print=1&amp;" + query_string;
	} else {
		print_url = s + "?print=1";
	}
	document.write('<a href="'+print_url+'" title="Printer Friendly Link" target="_blank" class="file print">Printer Friendly Version</a>');
}

/* Function for top navigation menu */
sfHover = function() {
	var sfEls = document.getElementById("bannerMenu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

/* Function for left navigation menu */
if (((last_index > 0) && (url.indexOf('newheader') == -1)) || (url.indexOf('skillsoft.com') == -1)) { // above root directory
	sfHover = function() {
		var sfEls = document.getElementById("sideMenu").getElementsByTagName("LI");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);
	//if (document.all&&document.getElementById) window.onload=sfHover; 
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function toggleDiv(divid){
	var div = document.getElementById(divid);
	div.style.display = div.style.display == 'block' ? 'none' : 'block';
	if(div.style.display == 'block'){
		if (document.getElementById){
			document.getElementById("label").innerHTML = "Less &lt;";
		}else{
			document.all.label.innerHTML = "Less &lt;";
		}
	}else{
		if (document.getElementById){
			document.getElementById("label").innerHTML = "More &gt;";
		}else{
			document.all.label.innerHTML = "More &gt;";
		}
	}
}
