function showElementById(id) {
    document.getElementById(id).style.display = "block";
}
function hideElementById(id) {
    document.getElementById(id).style.display = "none";
}

function toggleShow(id){	
   	if (document.getElementById(id).style.display == "block")		    	
   		document.getElementById(id).style.display = "none"	
  	else		
		document.getElementById(id).style.display = "block"
}
function toggleShowObj(obj){	
   	if (obj.style.display == "none")		    	
   		obj.style.display = "block"	
  	else		
		obj.style.display = "none"
}

function confirmChecked(form,checkboxList,message )
{ 
	var flag=false;
	var comfList = document.forms[ form ].elements[ checkboxList ];
	
	for (i = 0; i < comfList.length; i++) 
		if (comfList[i].checked)
			flag = true;
	if (flag)	
		eval('document.' + form + '.submit();'); 
	else
		alert(message);
	return false;
}
function ValidEmail(EmailAddress)
{
	var emailRegex=new RegExp("^([0-9a-zA-Z]+[-._+&amp;])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$");
	return emailRegex.test(EmailAddress);
}
function validDomainName(obj)
{
	text = obj.value;
	obj.className = "valid";
	if (text == "")
		return false;
	if ( text.length < 1 || text.length > 62) 
	{
		domainObj.className = 'invalid';
		return false;
	}
	var expre=new RegExp("^[a-zA-Z]+[-0-9a-zA-Z]+[0-9a-zA-Z]{1}$");
	
	if (!expre.test(text)){
		obj.className = "invalid";
		return false;
	}
	else	
		return true;
}
function FSfncValidateDomain(domainObj) {
			DomainName=domainObj.value; // .value.toLowerCase();
			
			var specialChars="/\\(\\)><@,.;:*$%\\\\\\\"\\.\\[\\]";
			var alphanum=new RegExp("^([0-9a-zA-Z])");
			var validChars="\[^\\s" + specialChars + "\]";
			var atom=validChars + '+';
			var atomPat=new RegExp("^" + atom + "$");
			var domArr=DomainName.split(".");
			var len=domArr.length;
			if ( DomainName.length == 0 ) 
			{
				domainObj.className = 'valid';
				return false;
			}
			if (!alphanum.test(DomainName[0]) || !alphanum.test(DomainName[DomainName.length-1]) ) {
				domainObj.className = 'invalid';
				return false;
			}
			if ( DomainName.length-1>2 ) if ( !alphanum.test(DomainName[2]) || !alphanum.test(DomainName[3])){
				domainObj.className = 'invalid';
				return false;
			}
			for (i=0;i<len;i++) {
				if (domArr[i].search(atomPat)==-1) {
					//alert(" invalid"); 
					domainObj.className = 'invalid';
					return false;
				}
			}
			if ( DomainName.length < 2 || DomainName.length > 62) 
			{
				domainObj.className = 'invalid';
				return false;
			}
			domainObj.className = 'valid';
			return true;
		}
function validDomain(obj)
{
	text = obj.value;
	obj.className = "valid";
	if (text == "")
		return false;
	if ( text.length < 2 || text.length > 62) 
	{
		domainObj.className = 'invalid';
		return false;
	}
	
	var expre=new RegExp("^([a-zA-Z]+[-0-9a-zA-Z]+[0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$");

	if (!expre.test(text)){
		obj.className = "invalid";
		return false;
	}		
	else	
		return true;
}
