var VALIDATE_EMAIL= "^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
var VALIDATE_NAME= "abcdefghijklmnopqrstuvwxyz' "
var VALIDATE_ALPHA= "abcdefghijklmnopqrstuvwxyz"
var VALIDATE_CNAME= "abcdefghijklmnopqrstuvwxyz1234567890#&()./,'- "
var VALIDATE_ADDR= "abcdefghijklmnopqrstuvwxyz1234567890&[],./-'()?#!-\n\r "
var VALIDATE_ANUM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234568790"
var VALIDATE_NUM="1234568790"

function chkinput(val,chklst)
{
	var checkOK =chklst ;
	var checkStr = val;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j))
				break;
			if (j == checkOK.length)
			{
				allValid = false;
				break;
			}
	}
	if (!allValid)
	{	
		return false;
	}
}

function trimSpace(x)
{
	if(x!='')
	{
		var emptySpace = / /g;
		var trimAfter = x.replace(emptySpace,"");
	}
	return(trimAfter);
}	

function trim(strText) 
{ 
    // get rid of leading spaces 
	if(strText!='')
	{
		while (strText.substring(0,1) == ' ') 
			strText = strText.substring(1, strText.length);
		
		// get rid of trailing spaces 
		while (strText.substring(strText.length-1,strText.length) == ' ')
			strText = strText.substring(0, strText.length-1);
	}
   return strText;
}

function charonly(e)
{
	var unicode=e.charCode? e.charCode : e.keyCode
	if (unicode!=8)
	{
		if ((unicode!=32 && (unicode<65 || (unicode>90 && (unicode<97 || unicode>122)))) && unicode!=39 && unicode!=45 && unicode!=13 && unicode!=15 && unicode!=39 && unicode!=14 && unicode!=9)
		return false
	}
}

function alphanumeric(e)
{
	var unicode=e.charCode? e.charCode : e.keyCode
	if (unicode!=8 && unicode!=13)
	{		
		if ((unicode>64 && unicode<91) || (unicode>96 && unicode<123) || (unicode>47 && unicode<58) || (unicode==9) || (unicode==32) || (unicode>43 && unicode<48)|| (unicode>38 && unicode<42) || (unicode==35) || (unicode==38) && unicode!=13 && unicode!=15 && unicode!=14 ) 
			return true;
		else
			return false;
	}
}

function numbersonly(e)
{
	var unicode=e.charCode? e.charCode : e.keyCode
	if (unicode!=8)
		{
			if ((unicode<48||unicode>57)&& unicode!=9 && unicode!=13 && unicode!=15 && unicode!=14 )
			return false
		}
}

function chkaddr(e)
{
	var unicode=e.charCode? e.charCode : e.keyCode
	if (unicode!=8)
	{
		if ((unicode!=32 && (unicode<65 || (unicode>90 && (unicode<97 || unicode>122)))) && unicode!=39 && unicode!=44 && unicode!=9 && unicode!=45 && unicode!=46 && unicode!=13 && unicode!=15 && unicode!=14 && unicode!=47 && unicode!=38 && unicode!=40 && unicode!=41 && ((unicode<48||unicode>57)&& unicode!=9))
			return false
	}
}

function ismaxlength(obj)
{
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength)
		obj.value=obj.value.substring(0,mlength)
}

function txtlim(obj,limit)
{
	var mlength=parseInt(limit);
	if (obj.value.length>mlength)
		obj.value=obj.value.substring(0,mlength)
}

function emailValidate(incomingString, defaultValue)
{
	if(trimSpace(incomingString).length == 0 || incomingString.search(/^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/g) == -1 || incomingString==defaultValue)
	{
		return false;
	}
	else
		return true;	
}

/*$(function()
{
	$("#groupCompanies").click(function()
	{
		$("#groupCompaniesContent").slideToggle();
	});
});*/
function hideoverlay()
{
	parent.location.href='gajgamini.html';
}

function hideoverlay1()
{
	parent.location.href='engineering.html';
}

function hideoverlay2()
{
	parent.document.getElementById("cee_overlay").style.display="none";
	parent.document.getElementById("cee_box").style.display="none";
	
}

