<!--
// Function to validate User Name
// Arguments   : 1. User : Value of the field containing User Name or String Constant.
// Return Value: true if valid, false otherwise.
// Note : 	Usernames will be used to create mail IDs. So, directory will also 
//		be created with the same name. So, validating for:
//		1.	No Spl character other than underscore.
//		2.	Should have more than 1 char and less than 16 char.
//		3.	No embeded space.


function Inint_AJAX() {
   try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
   try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
   try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript
   alert("XMLHttpRequest not supported");
   return null;
};

function toAjax(id_name,value,flag)
{


//function dochange(src, val) {
     var req = Inint_AJAX();
     req.onreadystatechange = function () { 
		document.getElementById(id_name).innerHTML="<img src='images/loading.gif'>"; //retuen value
          if (req.readyState==4) {
               if (req.status==200) {

                    document.getElementById(id_name).innerHTML=req.responseText; //retuen value
               } 
          }
     };
     req.open("GET", "ajax.php?value="+value+"&flag="+flag); //make connection
     req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=iso-8859-1"); // set Header
     req.send(null); //send value
}
//-->

