// Basic Utilities JavaScript Document
// (c) ProProfs.com

/**------------------------- 
	@Function:		ajaxChangeStatus()
	@Param:			# url	: PHP Script url
					# resultTextDiv	: DIV id where result of php script will be shwon
	@Description:	AJAX Based Suggestions Status Change Method:
					Chnage current status of suggestion, depend upon the user selection
					Dependency: Require a PHP Server Script to pass all data and do the  database update.
	return
*/
function ajaxChangeStatus(url, resultTextDiv){	

	var xmlHttp;
	var sugUrlTitle;
	var sugTitleText;
	
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
		  // Internet Explorer
		  try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
		  catch (e)
			{
			try
			  {
			  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			catch (e)
			  {
				  alert("Please enable your browser Java Script !!!");
				  return false;
			  }
			}
		}
	
	//clears any previous message, when again requested...
	document.getElementById(resultTextDiv).innerHTML = "<img src='/images/loader.gif' /><span style='font-size:80%;'>please wait&hellip;</span>";

	xmlHttp.onreadystatechange=function()
	{
		//if everything is wrong and server sends a ready state, 4 = request processed
		if(xmlHttp.readyState==4 ){
			document.getElementById(resultTextDiv).innerHTML = xmlHttp.responseText;				
	    }
	}
	  //call server script with the GET method, query string can be passed in the url itself, which will be used by PHP script itself	
	  xmlHttp.open("GET",url,true);
	  xmlHttp.send(null);
}
//closing changeStatus


/**------------------------- 
	@Function:		ajaxLoadContent()
	@Param:			# url	: PHP Script url
					# resultTextDiv	: DIV id where result of php script will be shwon
	@Description:	AJAX Based Suggestions Status Change Method:
					Chnage current status of suggestion, depend upon the user selection
					Dependency: Require a PHP Server Script to pass all data and do the  database update.
	return
*/
function ajaxLoadContent(url, resultTextDiv){	

	var xmlHttp;
	var sugUrlTitle;
	var sugTitleText;
	
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
		  // Internet Explorer
		  try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
		  catch (e)
			{
			try
			  {
			  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			  }
			catch (e)
			  {
				  alert("Please enable your browser Java Script !!!");
				  return false;
			  }
			}
		}
	
	//clears any previous message, when again requested...
	document.getElementById(resultTextDiv).innerHTML = "<img src='/images/loader.gif' /><span style='font-size:80%;'>please wait&hellip;</span>";

	xmlHttp.onreadystatechange=function()
	{
		//if everything is wrong and server sends a ready state, 4 = request processed
		if(xmlHttp.readyState==4 ){
			document.getElementById(resultTextDiv).innerHTML = xmlHttp.responseText;				
	    }
	}
	  //call server script with the GET method, query string can be passed in the url itself, which will be used by PHP script itself	
	  xmlHttp.open("GET",url,true);
	  xmlHttp.send(null);
}
//closing ajaxLoadContent




