function checkaccsub()
{
ValidateForm1();
var c=0;
if(ValidateForm1()==false)
{
c=1
}
if(c==0)
{
var email=document.getElementById('email').value
url='/useralertpage?email='+ email;
//alert(url);
window.open(url,'_blank','resizable=no,scrollbars=no','width=60,height=60');
}
}



function echeck1(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function ValidateForm1(){
	var emailID=document.getElementById('email')
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email")
		emailID.focus()
		return false
	}
	if (echeck1(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }
function checkform()
{
ValidateForm1();
var fullname=document.getElementById('fullname');
var organization=document.getElementById('organization');
var empcode=document.getElementById('empcode1');
var orgname=document.getElementById('orgname1');
var address=document.getElementById('address');
var ranconfirm=document.getElementById('ranconfirm');
var ranconfirm1=document.getElementById('ranconfirm1');
var c=0;
if(fullname.value=='')
{
alert('Name Cannot be Blank');
fullname.focus();
c=1;
}
if(organization.value=='')
{
alert('Organization Cannot be Blank');
organization.focus();
c=1;
}
if((organization.value=='NIC')||(organization.value=='DIT'))
{
//alert(organization.value);
if(empcode.value=='')
{
alert('Emp Code Cannot be Blank');
empcode.focus();
c=1;
}
}
if(organization.value=='Others')
{
if(orgname.value=='')
{
alert('Organization Name Cannot be Blank');
orgname.focus();
c=1;
}
}
if(address.value=='')
{
alert('Address Cannot be Blank');
address.focus();
c=1;
}
if(ranconfirm1.value=='')
{
alert('Please Enter the Security Code');
ranconfirm1.focus();
c=1;
}
if(ranconfirm.value!=ranconfirm1.value)
{
alert('Security Code is Invalid');
ranconfirm1.focus();
c=1;
}
if(c==0)
{
document.form1.action='requestuseraccountscript';
var mess=document.getElementById('message');
var button1=document.getElementById('button1');
mess.className='show';
button1.disabled=true;
document.form1.submit();
}
}
