function navigate(menuid,destination,rootpath)
{	
	window.location = rootpath+"redirect.aspx?mid="+menuid+"&pg="+destination;
	return false;
}

function validateRegExp(regstr,evalstr)
{
	var rx = new RegExp(regstr);
	var matches = rx.exec(evalstr);
	return (matches != null && evalstr == matches[0]);
}

function trimText(strComp)
{
	ltrim = /^\s+/
	rtrim = /\s+$/
	strComp = strComp.replace(ltrim,'');
	strComp = strComp.replace(rtrim,'');
	return strComp;
}

function isEmail(newstr)
{
	var emailexp = /^[a-z][a-z_0-9\-\.]+@[a-z_0-9\-\.]+\.[a-z]{2,4}$/i
	//var emailexp = /(^[a-z]([a-z_\.]*)@([a-z_\.]*)([.][a-z]{3})$)|(^[a-z]([a-z_\.]*)@([a-z_\.]*)(\.[a-z]{3})(\.[a-z]{2})*$)/i;

	//Check that the email entry is valid
	if (!emailexp.test(newstr) || newstr.indexOf("..") >= 0)
	{
		return false;
	}
	return true;
}

function isValidInteger(newstr)
{
	var intexp = /^[0-9]*$/

	//Check that the interger entry is valid
	if (!intexp.test(newstr))
	{
		return false;
	}
	return true;
}

function isValidIP(newstr)
{
	var ipexp = /^\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b$/

	//Check that the IP entry is valid
	if (!ipexp.test(newstr))
	{
		return false;
	}
	return true;
}