
var xmlHttp;
  
function make_xmlHTTP()
{
	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("Your browser does not support AJAX!");
						return false;
					}
		 	 }
		}
}

function ajaxFunction(str)
  {
  
  /*
  * this code determines which/if  object 
  * can be used based on browser and testing
  * uses that object from then on
  * else prints error
  */
  

  
  if(xmlHttp == null)
		make_xmlHTTP();
	
	/*
	*  called when the object detects 
	* a change
	*/
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById("projectList").innerHTML=xmlHttp.responseText;
        }
      }
	 var url="projectPrint.php";
	url=url+"?username="+str;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
 }//eo ajaxFunction
 
 function descGrow(desc_id)
 {//if more - then add embed, if less then remove
 
	 if(document.getElementById("a_"+desc_id).innerHTML=="more")
	 {
		  if(xmlHttp == null)
			make_xmlHTTP();
			
			//need to make page to return additional code
			
		 xmlHttp.onreadystatechange=function()
		  {
		  if(xmlHttp.readyState==4)
			{
			document.getElementById("embed_"+desc_id).innerHTML+=xmlHttp.responseText;
			document.getElementById("a_"+desc_id).innerHTML="less";
			}
		  }
		  
		
		/*
		var x=document.getElementById("a_"+desc_id);
		x.parentNode.removeChild(x);
		*/
		
		var url="embedPrint.php";
		url=url+"?id="+desc_id;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	 }
 
 	else
	{
		document.getElementById("embed_"+desc_id).innerHTML="";
		document.getElementById("a_"+desc_id).innerHTML="more";
	}
 }
 
  function blogFullText(blogID)
 {
	  if(xmlHttp == null)
		make_xmlHTTP();
		
		document.getElementById("abs_"+blogID).innerHTML="...loading";
		
		//need to make page to return additional code
		
	 xmlHttp.onreadystatechange=function()
      {
		  
      if(xmlHttp.readyState==4)
        {
			document.getElementById("abs_"+blogID).innerHTML=xmlHttp.responseText;
  
        }
      }
	
	var url="blogFullPrint.php";
	url=url+"?id="+blogID;
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
 }
  
 