/* GLOBAL VARIABLES */
var xmlobject;
/* AJAX Object Initialization*/
function getxmlobject() {
    if (window.XMLHttpRequest){
        // If IE7, Mozilla, Safari, etc: Use native object
        var xmlobject = new XMLHttpRequest()
    } else {
        if (window.ActiveXObject){
            // ...otherwise, use the ActiveX control for IE5.x and IE6
            var xmlobject = new ActiveXObject("Microsoft.XMLHTTP"); 
        }
    }
	return xmlobject;
}
/* generic function to make ajax post */
function ajaxpost(url, parameters, callbackfn)
{
	xmlobject = getxmlobject();
	if(!xmlobject) {
		alert ("Browser does not support HTTP Request");
		return;
	}

	xmlobject.onreadystatechange = callbackfn;
	xmlobject.open('POST', url, true);
	xmlobject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlobject.setRequestHeader("Content-length", parameters.length);
	xmlobject.setRequestHeader("Connection", "close");
	xmlobject.send(parameters);
}
/* generic function to make ajax get */
function ajaxget(url,callbackfn) 
{
	xmlobject = getxmlobject();
	if(!xmlobject) {
		alert ("Browser does not support HTTP Request");
	}
	xmlobject.onreadystatechange=callbackfn;
	xmlobject.open("GET",url,true);
	xmlobject.send(null);
}
/* get value by the ID*/
function getvalue(fldname) {
	return document.getElementById(fldname).value;
}
/* set value by the id */
function setvalue(fldname,fldvalue) {
	document.getElementById(fldname).value = fldvalue;
}
/* Function to validate Mobile Number entered in Recharge Box */
function checkMobileNo(mobNo)
{
	var mobNoLen = mobNo.length;
	if(mobNoLen <= 0)
	{
		return false;
	}
	if(mobNoLen <= 9 || mobNo.charAt(0) == '0' || mobNo.charAt(0) == '1'  || mobNo.charAt(0) == '2' || mobNo.charAt(0) <= '3' || mobNo.charAt(0) == '4' || mobNo.charAt(0) == '5' || mobNo.charAt(0) == '6')
	{
		return false;
	}
	return true;
}