
//the following function sends the request to the font resize php page
function GetFontSession(xaction)
  {
    var oXMLHttp = null;
	
	//check if it's mozilla browser and create an XMLHttp request if true.
	if (window.XMLHttpRequest)
	  {
	    oXMLHttp = new XMLHttpRequest();
	  }
	//check if it's ie browser and create an XMLHttp request if true.
	else
	  if (window.ActiveXObject)
	    {
		  oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	
	//send the request
	if (oXMLHttp != null)
	{
	  oXMLHttp.onreadystatechange =  function ApplyFontResize() {
		    //if the request was successfully loaded (4)
		  	if (oXMLHttp.readyState == 4)
			  {
			    //if the request was successfully executed (200)
				if (oXMLHttp.status == 200)
				  {
				    var sessionFontSize;
					var textContent;
					var textContentP;
					var sidebarContent;
					
					//get the font size back from the php page
					sessionFontSize = oXMLHttp.responseText;
					textContent = document.getElementById('content');
					textContentP = textContent.getElementsByTagName("p");
					textContent.style.fontSize = sessionFontSize;
					
					for (var i=0; i < textContentP.length; i++)
					  {
						textContentP[i].style.fontSize = sessionFontSize + "px";
					  }
					//change the img for the minus button if the font size is less than 12
					if (sessionFontSize < 12)
					  {
						document.getElementById('minus-img').src = "/images/btn-minus-brown.gif";
					  }
					else
					  {
					    document.getElementById('minus-img').src = "/images/btn-minus-brown-on.gif";
					  }
					  
					//change the img for the plus button if the font size is greater than 16
					if (sessionFontSize >= 16)
					  {
						document.getElementById('plus-img').src = "/images/btn-plus-brown.gif";
					  }
					else
					  {
					    document.getElementById('plus-img').src = "/images/btn-plus-brown-on.gif";
					  }
				  }
			  }
		
		 };//end of readystatechange function -- ApplyFontResize()

	}//end of send request
	
	oXMLHttp.open("GET", "/common/font-resize.php?xaction=" + xaction, true);
	oXMLHttp.send(null);
	
	
  }