﻿
function InitRuntime()
{
	$(".frm input").each(function()
	{
		$(this).Watermark(this.title);
	});
	
	$(".itext").each(function()
	{
		var th = $(this);
		this.initialText = th.val();
		th.css("color", "#888888");
		th.css("font-style", "italic");
	});
	$(".itext").focus(function()
	{
		var th = $(this);
		th.css("font-style", "normal");
		th.css("color", "black");
		if (th.val() == this.initialText) th.val("");
	});
	$(".itext").blur(function()
	{
		var th = $(this);
		if ($.trim(th.val()) == "")
		{
			th.val(this.initialText);
			th.css("color", "#888888");
			th.css("font-style", "italic");
		}
	});

	$(".btnUn, .abtnUn").hover(
		function()
		{
			SetSelected($(this));
		},
		function()
		{
			SetUnselected($(this));
		});
		$(".btnUn .btn").click()
		{
			if (this.blur) this.blur();
		}
	
	$(".rhList TBODY TR").hover(
		function()
		{
			$(this).stop().animate(
			{
				backgroundColor: '#FFFFFF'
			});
			//$(this).css("background-color", "white");
		},
		function()
		{
			$(this).stop().animate(
			{
				backgroundColor: '#fff0cc'
			});
			//$(this).css("background-color", "#fff0cc");
		}
	);
		$(".rhList TBODY TR").click(function()
		{
			//debugger;
			window.location.href=$('.rDetails A', this)[0].href;
		});
}

var curObj = null;
var tmOn = true;
function sM(tdo, spanId)
{
	//null.d;
	tmOn = false;
	if ((curObj != null) && (spanId != curObj.id))
	{
		curObj.style.display = "none";
		curObj = null;
	}
	curObj = window.document.getElementById(spanId);
	if (curObj == null) return;
	var offset = $(tdo).offset();
	var tb = tdo.getElementsByTagName("table")[0];
	tb.style.left = (offset.left) + "px";
	tb.style.top = (offset.top + 20) + "px";
	curObj.style.display = "block";
}
function hM()
{
	if (curObj == null) return;
	if (!tmOn) return;
	curObj.style.display = "none";
	curObj = null;
	tmOn = false;
}

function SetSelected(jqObj)
{
	jqObj.css("background-color", "#5a2d01").css("color", "white");
}
function SetUnselected(jqObj)
{
	jqObj.css("background-color", "#fff0cc").css("color", "black");
}

