﻿$(document).ready(function() {
	$("[id^='tm']").mouseover(function() {
		var tm = $(this);
		if (tm.attr("id") == "tmleft")
			tm = $("#tm8");
		else if (tm.attr("id") == "tmright")
			tm = $("#tm1");

		tm.css("background-image", "url(/images/topmenuhighlight.png)");
		tm.css("cursor", "pointer");
		tm.children("a").css("color", "white");

		if (tm.attr("id") == "tm8") {
			$("#tmleft").css("background-image", "url(/images/topmenu_left_highlight.png)");
			$("#tmleft").css("cursor", "pointer");
		}
		else if (tm.attr("id") == "tm1") {
			$("#tmright").css("background-image", "url(/images/topmenu_right_highlight.png)");
			$("#tmright").css("cursor", "pointer");
		}
	});
	$("[id^='tm']").mouseout(function() {
		var tm = $(this);
		if (tm.attr("id") == "tmleft")
			tm = $("#tm8");
		else if (tm.attr("id") == "tmright")
			tm = $("#tm1");

		tm.css("background-image", "");
		tm.css("cursor", "default");
		tm.children("a").css("color", "#949494");

		if (tm.attr("id") == "tm8") {
			$("#tmleft").css("background-image", "");
			$("#tmleft").css("cursor", "default");
		}
		else if (tm.attr("id") == "tm1") {
			$("#tmright").css("background-image", "");
			$("#tmright").css("cursor", "default");
		}
	});
	$("[id^='tm']").click(function() {
		var tm = $(this);
		if (tm.attr("id") == "tmleft")
			tm = $("#tm8");
		else if (tm.attr("id") == "tmright")
			tm = $("#tm1");
			
		var lPath = tm.attr("href");
		if (lPath != "" && lPath != undefined)
			document.location.href = lPath;
	});
	$(".bottomline").mouseover(function() {
		$(this).css("background-image", "url(/images/MenuHoverBk.png)");
		$(this).css("background-repeat", "repeat-y");
		$(this).css("background-position", "right top");
	});
	$(".bottomline").mouseout(function() {
		$(this).css("background-image", "");
	});
});

function SubmitButton(aButtonName) {
	var btn = $("[id*='" + aButtonName + "']");
	if (btn) {
		btn.click();
	}
}
