/* Web Design and Programming by Cube Connection Ltd, Copyright 2006 - www.CubeConnection.co.uk */
function ShowEmail(username, hostname, friendlyname, displaystyle) {
	var linktext;
	if (friendlyname == "") {
		if (displaystyle == "") {
			linktext = username + "@" + hostname;
			document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + linktext + "</a>");
		}
		else {
			linktext = username + "@" + hostname;
			document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + " class='" + displaystyle + "'>" + linktext + "</a>");
		}
	}
	else {
		if (displaystyle == "") {
			linktext = username + "@" + hostname;
			document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + ">" + friendlyname + "</a>");
		}
		else {
			linktext = username + "@" + hostname;
			document.write("<a href=" + "mail" + "to:" + username + "@" + hostname + " class='" + displaystyle + "'>" + friendlyname + "</a>");
		}
	}
	return true;
}

function SetupHS() {
	hs.Expander.prototype.printHtml = function () {
		var pw = window.open("about:blank", "_new");
		pw.document.open();
		pw.document.write(this.getHtmlPrintPage());
		pw.document.close();
		return false;
	};
	hs.Expander.prototype.getHtmlPrintPage = function() {
    // We break the closing script tag in half to prevent
    // the HTML parser from seeing it as a part of
    // the *main* page.
    var body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body') || this.innerContent;

    return "<html>\n" +
        "<head>\n" +
        "<title>Temporary Printing Window</title>\n" +
        "<link rel='stylesheet' type='text/css' href='/includes/site_screen.css' media='screen, tv' />\n" +
        "<link rel='stylesheet' type='text/css' href='/includes/site_print.css' media='print' />\n" +
        "<script>\n" +"function step1() {\n" +
        "  setTimeout('step2()', 10);\n" +
        "}\n" +
        "function step2() {\n" +
        "  window.print();\n" +
        "  window.close();\n" +
        "}\n" +
        "</scr" + "ipt>\n" +
        "</head>\n" +
        "<body style='background:#fff;' onLoad='step1()'>\n" +
        body.innerHTML +
        "</body>\n" +
        "</html>\n";
	};
}

function DisplayFormInfo(intFormID) {
	if (intFormID == 1) { /*login form*/
		document.getElementById('loginresults').style.display = 'block';
	}
	if (intFormID == 2) { /*myaccount form*/
		document.getElementById('myaccountresults').style.display = 'block';
	}
}

display_Accordian = function () {
	//Set default open/close settings
	$('.acc_container').hide(); //Hide/close all containers
	$('.acc_trigger').eq(selectedMenu).addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container

	//On Click
	$('.acc_trigger').click(function () {
		if ($(this).next().is(':hidden')) { //If immediate next container is closed...
			$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
			$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
			//alert($(this).attr('id').replace('m', ''));
			$.post('/setmenu.asp?menu='+$(this).attr('id').replace('m', '') );
		}
		return false; //Return the browser jump to the link anchor (flase Prevents it)
	});
}
