function getXMLHTTP() { //fuction to return the xml http object

        var xmlhttp=false;    

        try{

            xmlhttp=new XMLHttpRequest();

			//alert("hi XMLHttpRequest");

        	}

        catch(e){        

				try{            

					xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");

					//alert("hi Microsoft.XMLHTTP");

					}

				catch(e){

						try{

								req = new ActiveXObject("Msxml2.XMLHTTP");

								//alert("hi Msxml2.XMLHTTP");

							}

                catch(e1){

                    xmlhttp=false;

                		}

           			 }

       			 }

             

        return xmlhttp;

    } // the above function creates the browser specific object. 

	

function checkloginname(strURL,div) // To get the Package details by using AJAX

    {     

/*alert(strURL); 

alert("Hello");*/

        var req = getXMLHTTP();    

        if (req) 

        {

            

            req.onreadystatechange = function() 

            {

               //alert(req.responseText); exit;

				if (req.readyState == 4) 

                {

                    // only if "OK"

                  //alert(req.responseText); exit;

                    if (req.status == 200)

                     {   //alert("hi")     

                         document.getElementById(div).innerHTML=req.responseText;  

						 if(req.responseText!='')

						  {

							document.getElementById("uname").value='';  

						  }

                     } 

                    else

                     {

                        alert("There was a problem while using XMLHTTP:\n" + req.statusText);

                    }

                }                

            }

            //alert(strURL);

            

            req.open("GET", strURL, true);

            req.send(null);

            //alert("hello");

        }

        //alert("hello");        

    }	

	

	function check(strURL,div) // To get the captcha result by using AJAX

    {    // alert("hi");

//alert(strURL); 

        var req = getXMLHTTP();    

        if (req) 

        {

            

            req.onreadystatechange = function() 

            {

               //alert(req.responseText); exit;

				if (req.readyState == 4) 

                {

                    // only if "OK"

                  //alert(req.responseText); exit;

                    if (req.status == 200)

                     {   //alert("hi")     

                         document.getElementById(div).innerHTML=req.responseText;    

                          if(document.getElementById("captcharesult").value=='')

						  { 

							  document.getElementById("code").value='';

							  }

						

                     } 

                    else

                     {

                        alert("There was a problem while using XMLHTTP:\n" + req.statusText);

                    }

                }                

            }

            //alert(strURL);

            

            req.open("GET", strURL, true);

            req.send(null);

            //alert("hello");

        }

        //alert("hello");        

    }	

	

