function check_availability(a)
{
if (document.forms("aspnetForm").elements("ctl00$ContentPlaceHolder1$InfoWizard$username").value !='')
{
    try
    {
	var objdoc;
	var ab1=new Array();
	var ab2=new Array();
	var httpob=new ActiveXObject("Microsoft.XMLHTTP");
	httpob.open("POST","check.aspx?username=" + a ,false);
	httpob.send();
	ab1=httpob.responseText;
	ab2=ab1.split("^");
	
	if(ab2[0]=='Congratulations You got it!')
	{
	   // alert(ab2[0]);
	}
	if(ab2[0]=='Sorry This Username already exists. Try another.')
	{
	    alert(ab2[0]);
	    document.forms("aspnetForm").elements("ctl00$ContentPlaceHolder1$InfoWizard$username").value ='';
	}
	if(ab2[1]=='found')
    {
        //  Do something if 'Found'
	}  
    }
    catch (e)
    {
        alert (e);
    }
		
}
else
{
	alert("Please enter username first");
}
}

