
// declare a global  XMLHTTP Request object
//var XmlHttpObj;
// create an instance of XMLHTTPRequest Object, varies with browser type, try for IE first then Mozilla
// called from onChange or onClick event of the continent dropdown list
function donate() 
{
   // alert("Rajasekar");
var appealid=document.getElementById("appealid").value;
var amount=document.getElementById("pledgedamount").value;
var message=document.getElementById("message").value;

var status="OK";
if(amount=="" || amount==0)
{
	status="NOTOK";
	msg="Enter Amount<br/>";
}
if(message=="")
{
	status="NOTOK";
	msg="Enter Message<br/>";
}
if(!IsNumeric(amount))
{
	status="NOTOK";
	msg="Enter Numeric Value<br/>";
}
//status="NOTOK";
 //alert(status);
if(status=="NOTOK")
{
document.getElementById("errmsg").innerHTML="<font color='red'>"+msg+"</font>";
}
if(status=="OK")
{
 requestUrl = "xml_donate.php?"+"appealid="+appealid+"&amount="+amount+"&message="+message;
	
    // use the following line if using php
    // requestUrl = "xml_data_provider.php" + "?filter=" + encodeURIComponent(selectedContinent);
//alert(requestUrl);
	CreateXmlHttpObj();
	
	// verify XmlHttpObj variable was successfully initialized
	if(XmlHttpObj)
	{
//		alert("XmlHttpObj");
        // assign the StateChangeHandler function ( defined below in this file)
        // to be called when the state of the XmlHttpObj changes
        // receiving data back from the server is one such change
		XmlHttpObj.onreadystatechange = StateChangeHandlerdonate;
		
		// define the iteraction with the server -- true for as asynchronous.
		XmlHttpObj.open("GET", requestUrl,  true);
		
		// send request to server, null arg  when using "GET"
		XmlHttpObj.send(null);		
	}	

	 // use the following line if using asp
   }
}


// this function called when state of  XmlHttpObj changes
// we're interested in the state that indicates data has been
// received from the server
function StateChangeHandlerdonate()
{
//	alert("readystate " + XmlHttpObj.readyState);
	// state ==4 indicates receiving response data from server is completed
	if(XmlHttpObj.readyState == 4)
	{
//		alert("readystate " + XmlHttpObj.status);
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpObj.status == 200)
		{	
		  //alert(XmlHttpObj.responseText);
//			alert("in 200:"+XmlHttpObj.responseXML.documentElement);
            alert("Thanks For Your Contribution");
			Populatedistrictsdonate();
		}
		else
		{
			alert("problem retrieving data from the server, status code: "  + XmlHttpObj.status);
		}
	}
}

// populate the contents of the country dropdown list
function Populatedistrictsdonate()
{


hideDonate();
history.go(0);

}
// returns the node text value 

