

function alerterr(msg)
{

		centerlayer('errorLyr',264,0);
		html  = '<table background="../images/error_back.gif" width="264" height="126" cellpadding="0" cellspacing="0" border="0">\n';
		html += '<tr>\n';
		html += '<td width="16"></td>\n';
		html += '<td width="234" height="31"></td>\n';
		html += '<td width="14"></td>\n';
		html += '</tr>\n';
		html += '<tr>\n';
		html += '<td width="16"></td>\n';
		html += '<td width="234" height="78" valign="top" style="color:#000000;font-size:9px;">'+msg+'</td>\n';
		html += '<td width="14"></td>\n';
		html += '</tr>\n';
		html += '<tr>\n';
		html += '<td width="16"></td>\n';
		html += '<td width="234" height="17" align="right" valign="top"><a href="#" onclick="hide(\'errorLyr\');"><img src="../images/error_close.jpg" width="30" height="9" alt="close" border="0"></a></td>\n';
		html += '<td width="14"></td>\n';
		html += '</tr>\n';
		html += '</table>\n\n';
		
		if(ns4 && !ns6) {
	        var status = eval(doc + '["errorLyr"]' + htm);
			status.write(html);
            status.close();
			show('errorLyr');
		} else if (ie || ns6)  {
	        var status = document.getElementById('errorLyr');
            status.innerHTML = html;
			show('errorLyr');
		}
		else
		{
			alert(msg);
		}
}

function centerlayer(layerName,w,h)
{

	obj = getObject(layerName);

	if (parseInt(navigator.appVersion)>3)
	{

		if (navigator.appName=="Netscape")
		{
			winW = window.innerWidth;
			winH = window.innerHeight;
		}

		if (navigator.appName.indexOf("Microsoft")!=-1)
		{
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}

	if (w>0)
	{
		LeftPosition=(winW)?(winW-w)/2:100;
		LeftPosition = parseInt(LeftPosition);
	//	alert(LeftPosition);
		obj.left = LeftPosition+"px";
	}

	if (h>0)
	{
		TopPosition=(winH)?(winH-h)/2:100;
		TopPosition = parseInt(TopPosition);
	//	alert(TopPosition);
		obj.top = TopPosition+"px";
	}
}

// Show layers
function show(layerName)
{
	obj = getObject(layerName);
	obj.visibility=fShow;
}
// Hide layers
function hide(layerName)
{
	obj = getObject(layerName);
	obj.visibility=fHide;
}

//Browser Sniffing
var ns4=document.layers?1:0
var ie=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
var mac=navigator.userAgent.indexOf('Mac')>0?1:0;
var obj = null;

//Hide and show layers
	if (ie||ns6)
	{
		var fShow = "visible";
		var fHide = "hidden";
	}
	else
	{
		var fShow = "show";
		var fHide = "hide";
	}


function getObject(layerName) {
	//obj = eval("document.getElementById('"+layerName+"').style");
	obj = document.getElementById(layerName).style;
/*
	if (ie)
	{
		obj = eval("document.all['"+layerName+"'].style");
	}
	else if (ns6)
	{
		obj = eval("document.getElementById('"+layerName+"').style");
	}

	else
	{
		obj = eval("document.layers['"+layerName+"']");
	}

//	alert(layerName+' '+obj);
	*/
	return obj;

}

var zNow = 10;

// Show layers
function show(layerName)
{
		zNow = zNow+10;

//		alert(zNow);

		obj = getObject(layerName);
		obj.zIndex = zNow;
		obj.visibility=fShow;
}

// Hide layers
function hide(layerName)
{
		zNow = zNow+10;

		obj = getObject(layerName);
		obj.zIndex = zNow;
		obj.visibility=fHide;
}

// x -- Standard Layer Function - as per general.inc.js ------------------------------------------------

function url_open(url,w,h,s) {
	var Width = (w)? w : 1024;
	var Height = (h)? h : 768;
	var Scroll = (s)? s : "0";
	if (Height >= screen.height) {
		Scroll = "1";
		Height = screen.height-150;
	}
	if ((Scroll == "0")&&(Width == 585)){
		Width = 560;
	}
	LeftPosition=(screen.width)?(screen.width-Width)/2:100;
	TopPosition=(screen.height)?(screen.height-Height)/2:100;
	return window.open(url,'viewer','scrollbars='+Scroll+',menu=0,height='+Height+',width='+Width+',left='+LeftPosition+',top='+TopPosition);
}

// Changed to include dotted localpart and dash in localpart.
function Validemail(val) 
{
	var RE1 = /^[\.A-Za-z0-9_-]+[\.A-Za-z0-9_-]*@{1,1}[A-Za-z0-9_-]+[.]{1,1}\w{2,4}/;
	return RE1.test(val);
}	


function TestNumerics(val) 
{
	var RE1 = /[\d]+/;
	return RE1.test(val);
}
