   var http_request = false;

/////////////
   function search_by_client(client_id,page,prj_type) {
	for(var i=0;i<document.getElementById("cbo_client_id").length;i++)
	{
		if(document.getElementById("cbo_client_id")[i].value==client_id)
		{
			document.getElementById("cbo_client_id")[i].selected=true;
		}
	}
      var poststr = "cbo_sector_id=" + encodeURI( document.getElementById("cbo_sector_id").value ) +
	  				"&cbo_practices_id=" + encodeURI( document.getElementById("cbo_practices_id").value ) +
	  				"&cbo_country_id=" + encodeURI( document.getElementById("cbo_country_id").value ) +
	  				"&cbo_client_id=" + encodeURI( client_id ) +
					"&prj_type=" + encodeURI( prj_type ) +
					"&p=" + page +
					"&t=con";
      makePOSTRequest_showproject('allprojects.php', poststr);
   }

   function showproject(page,prj_type) {
//   alert("here");
      var poststr = "cbo_sector_id=" + encodeURI( document.getElementById("cbo_sector_id").value ) +
	  			    "&cbo_practices_id=" + encodeURI( document.getElementById("cbo_practices_id").value ) +
	  				"&cbo_country_id=" + encodeURI( document.getElementById("cbo_country_id").value ) +
	  				"&cbo_client_id=" + encodeURI( document.getElementById("cbo_client_id").value ) +
					"&prj_type=" + encodeURI( prj_type ) +
					"&p=" + page +
					"&t=con";
//	 alert(poststr);
      makePOSTRequest_showproject('allprojects.php', poststr);
   }
//Change Password HTTP Function
   function makePOSTRequest_showproject(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents_showproject;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

  
   
   
  function alertContents_showproject() {
      if (http_request.readyState == 1) 
	  {
	   		  document.getElementById("pgContent").innerHTML = '<div align=center></br></br></br></br><img src="images/ajax-loader.gif"/></br></br></div>';
	  }
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('pgContent').innerHTML = result;
         } else {
            alert('There was a problem with the request.');
         }
      }
   }   
///////////////////////////////////

/////////////
   function bottom_flash(flash_type) {

      var poststr = "flash_type=" + encodeURI(flash_type) ;
      makePOSTRequest_bottom_flash('bottom_flash.php', poststr);
   }

 //Change Password HTTP Function
   function makePOSTRequest_bottom_flash(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents_bottom_flash;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

  
   
   
  function alertContents_bottom_flash() {
      if (http_request.readyState == 1) 
	  {
	   		  document.getElementById("div_flash").innerHTML = '<div style="height:100px" align=center><img src="images/ajax-loader.gif"/></div>';
	  }
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('div_flash').innerHTML = result;
         } else {
            alert('There was a problem with the request.');
         }
      }
   }   
///////////////////////////////////

