// define the highlighted links array if its undefined.
if (hl == null){
	var hl = [];
}


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;
	}
}

// empty function for old pages
function smContent() {}


$(document).ready(function(){
						   
	//extract and add the links from the breadcrumb trail
	
	var bc = $("#bc a");
	for (var i = 0; i < bc.length; i++) {
		hl.push($(bc[i]).attr('href'));
	}
	
	//Add the current urls as well
	hl.push(location.pathname.toString());
	
	
	// colour and open any menu items with a link which is in the hl array
	for (var i = 0; i < hl.length; i++) {
		//ignore index.html
		var link = hl[i].replace(/\/index\.html/, "/");
		$("#smenu a[href='" + link + "']:first").attr('class','smenuo');
	}
						   
						   
	// stripey tables
	$(".zebra tr:even").addClass("even");
	$(".zebra tr:odd").addClass("odd");
	
	// blue close boxes

    hsDisplay(false);

    $(".ghead230,.ghead470,.tab,.qtpanel").corner("tl tr cc:#FFFFFF").children(":first-child").addClass("jqCorner").parent().children(":last-child").addClass("jqCorner");
    $(".tintpanel,.tintpanel470,.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");
	$("#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");
		
});
