hNavTab();

// hide all the lists
$("#smenu ul").hide();
$("#smenu a.smenuo").attr('class','smenuc');


// get the bredcrumb trail
var bc = $("#bc a");
// colour and open any in the trail
for (var i = 0; i < bc.length; i++) {
	var bchref = $(bc[i]).attr('href');
	bchref = bchref.replace(/\/index\.html/, "/");
	
	$("#smenu a[href='" + bchref + "']:first").attr('class','smenuo');
	$("#smenu a[href='" + bchref + "']:first").addClass('sectionopen');
	$("#smenu a[href='" + bchref + "']").parents().show();
}
// and this page too!
var locpath = location.pathname;
locpath = locpath.replace(/\/index\.html/, "/");
$("#smenu a[href='" + locpath + "']").siblings().show(); // open the siblings of the current page
$("#smenu a[href='" + locpath + "']").parents().show(); // open the parents of the current page
$("#smenu a[href='" + locpath + "']:last").attr('class','smenuo');
$("#smenu a[href='" + locpath + "']:last").addClass('sectionopen');



function loadImage(a, b, c, d, e, f, g) {
	sTag = "<img src=\"" + b + "\" width=\"" + c + "\" height=\"" + d + "\" alt=\"" + e + "\" title=\"" + e + "\" >";
	if (f != "") {
		sT = (g == 1) ? " target=\"_blank\"" : "";
		sTag = "<a href=\"" + f + "\"" + sT + ">" + sTag + "<\/a>";
	}
	oTag = $("#" + a);
	if (oTag.length > 0) {
		oTag[0].innerHTML = sTag;
	}
}


function smContent(){;loadImage("smcnt1","/learning/images/sidebar_library.jpg",160,90,"Library books","/corporate/library/");;loadImage("smcnt2","/learning/images/sidebar_library.jpg",160,90,"Library books","/corporate/library/");loadImage("smcnt3","/training/images/college1_160x90.jpg",160,90,"Training environment","/training/");}

$(document).ready(function(){
	// stripey tables
	$(".zebra tr:even").addClass("even");
	$(".zebra tr:odd").addClass("odd");


    hsDisplay(false);
    $(".ghead230,.ghead470,.tab,.qtpanel").corner("tl tr cc:#FFFFFF").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
    $("#footer,.tintpanel,.qtattr").corner("bl br cc:#FFFFFF").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
	
	$("#smenu a:first").corner("tl tr cc:#FFFFFF");
	//
	
	// if the last branch is hilighted then don't add corners
	if (!$('#ccmenulast').hasClass('sectionopen')) {
		$('#ccmenulast').corner("bl br cc:#FFFFFF");
	} else {
		$("#smenu a:last").corner("bl br cc:#FFFFFF");
	}
	
    $(".ftpanel").corner("6px cc:#FFFFFF").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
    $(".fttop").corner("tl tr 5px").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
    $(".ftbase").corner("bl br 5px").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
    $(".ktop").corner("tl tr 10px").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
    $(".kbase").corner("bl br 6px").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
    $(".kcont").corner("bl br 5px").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
});