function Validate(frm)
{
	if(trim(frm.txtURLName.value) == '')
	{
		alert("Please enter the URL name");
		frm.txtURLName.focus();
		return false;
	}
	if(!CheckFolderName(frm.txtURLName.value))
	{
		frm.txtURLName.focus();
		return false;
	}
	if(!validate_JAVASCRIPT(frm.txtURLName, "URL name")){return false;}
	
	if(trim(frm.txtPassword.value) == '')
	{
		alert("Please enter your password");
		frm.txtPassword.focus();
		return false;
	}
	if(trim(frm.txtPassword.value) != trim(frm.txtConfirmPassword.value))
	{
		alert("The password and the confirm password should be same");
		frm.txtConfirmPassword.focus();
		return false;
	}
	
	if(trim(frm.txtDisplayName.value) !='')
		if(!validate_JAVASCRIPT(frm.txtDisplayName, "display name")){return false;}
	
	if(trim(frm.txtEmail.value) == '')
	{
		alert("Please enter your email address");
		frm.txtEmail.focus();
		return false;
	}
	if(trim(frm.txtEmail.value) != '')
	{
		if(!validate_EMAIL(frm.txtEmail, "email address"))
		return false;
	}
	if(frm.cboCountry.options[frm.cboCountry.selectedIndex].value == '')
	{
		alert("Please select your country");
		frm.cboCountry.focus();
		return false;
	}
	if(trim(frm.cboCountry.options[frm.cboCountry.selectedIndex].text) != '')
	{
		if(trim(frm.cboCountry.options[frm.cboCountry.selectedIndex].text).toUpperCase() == 'UNITED STATES')
		{
			if(trim(frm.txtZipCode.value) != '')
				if(!validate_ZIP(frm.txtZipCode, "zip code")){return false;}
		}
	}
	if(trim(frm.txtSecurityCode.value) == '')
	{
		alert("Please enter the security code displayed in the image");
		frm.txtSecurityCode.focus();
		return false;
	}
	if(!frm.chkTerms.checked)
	{
		alert("Please accept our terms and conditions");
		return false;
	}
}


function fnCheckAvail()
{
	if(trim(document.frm.txtURLName.value) == '')
	{
		alert("Please enter the URL Name to check the availability");
		document.frm.txtURLName.focus();
		return false;
	}
	var intleft = parseInt(screen.width) - 800;
	intleft = intleft / 2;
	var objPopWin=window.open('CheckAvail.asp?Name='+ document.frm.txtURLName.value,'CheckAvail',"Height=200,Width=500,top=25,left="+intleft+",toolbar=0,resizable=yes,location=0,status=0,menubar=0,scrollbars=yes")
	objPopWin.focus();
}
