﻿var yDom = YAHOO.util.Dom;
var yEvent = YAHOO.util.Event;
var mDE = Sys.UI.DomElement;
var mp = "ctl00_";
var p = mp + "cnt_";
var pnlSts;

yEvent.onAvailable(mp + "pnlStatus", function() { $get(mp + "pnlStatus").className = ""; var bShow = false; if($get(mp + "hdShow").value == "1") { bShow = true; } pnlSts = new YAHOO.widget.Panel(mp + "pnlStatus", { width: "400px", constraintoviewport: true, close: true, visible: bShow, draggable: true }); pnlSts.beforeShowEvent.subscribe(function() { this.center(); }); pnlSts.render(document.body); });

function OnTimeout(arg)
{
	ShowStatus("There was an error executing the requested action! We apologise for any inconvenience. Please try again.", "e");
}

function OnError(arg)
{
	ShowStatus("There was an error executing the requested action! We apologise for any inconvenience. Please try again.", "e");
}

function ShowStatus(msg, mode)
{
	switch(mode)
	{
		case "e":
			{
				$get(mp + "lblStatus").className = "red";
				break;
			}
		case "p":
			{
				$get(mp + "lblStatus").className = "amber";
				break;
			}
	}
	$get(mp + "lblStatus").innerHTML = msg;
	pnlSts.show();
}

function HideStatus()
{
	pnlSts.hide();
}