var req = null;
if (typeof XMLHttpRequest != "undefined")
	req = new XMLHttpRequest();
if (!req && typeof ActiveXObject != "undefined")
{
	try
	{
		req=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		try
		{
			req=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (e2)
		{
			try {
				req=new ActiveXObject("Msxml2.XMLHTTP.4.0");
			}
			catch (e3)
			{
				req=null;
			}
		}
	}
}

function callback(param)
{
	req.open("GET",param ,false);
	req.send(null);
	var result = req.responseText;
	return result;
}

function openDlg(Url,WindowName,Width,Height)
{
	var s = window.showModalDialog(Url, WindowName, "dialogHeight:" + Height +"px; dialogWidth:" + Width + "px;status:yes;scrollbars:no;");
	return s;
}

function openForm(Url,WindowName,Width,Height)
{
	var t;
	var l;
	if (screen.height <= Height){t=0;} else {t=(screen.height-Height)/2;}
	if (screen.width <= Width){l=0;} else {l=(screen.width-Width)/2;}
	window.open(Url, WindowName, "toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, top=" + t + ", left=" + l + ", width=" + Width + ", height=" + Height);
}

function emailCheck (emailStr) 
{
    var emailPat=/^(.+)@(.+)$/;
    var matchArray=emailStr.match(emailPat);
    if (matchArray==null) 
    {
	    return false;
    }
    return true;
}

function pleaseWait()
{
	return "<table width='100%' height='100%'><tr><td align='center'><img src='images/wait.gif'></td></tr></table>";
}