function fnXHRHandler(sCourseNumber,sTab, OutputToContainer, UsingXSLFileName)			
	{
	var oReq = null; //to hold reference to XMLHttp Object
	var sURL = null; //to hold the address/URL of the data handler
	var sDataToSend = null; //to hold the data inforamtion 
	sURL = 'http://' + location.hostname + '/Forms/XHRHandler.aspx'; //URL to use to get the data
	//alert(sURL);
	sDataToSend = 'CourseNumber=' + sCourseNumber + '&' + 'sTab=' + sTab; //Data to send to the page calling the BE process
	var xslDoc= null; //object to hold the xsl document
	try //to load the stylesheet
		{
		xslDoc = fnLoadXMLFile(UsingXSLFileName,'StyleSheets');
		}
	catch(e) //exception.  Show error message.
		{
		return 'Cannot load style sheet ' + UsingXSLFileName;
		}
	
	//*******************************************************************************
	//Check if the browser is IE or other and declare the appropriate XMLHttp object
	//*******************************************************************************
	if (window.XMLHttpRequest) 
		{
		try 
			{
			oReq = new XMLHttpRequest();
			}
		catch(e) 
			{
			oReq = null;
			}
		} 
	else if (window.ActiveXObject)
		try	
			{
			oReq = new ActiveXObject("Msxml2.XMLHTTP");
			} 
		catch(e) 
			{
			try 
				{
				oReq = new ActiveXObject("Microsoft.XMLHTTP");
				} 
			catch(e) 
				{
				oReq = null;
				}
			}
	if (oReq) //start of XMLHttpRequest
		{
		//Open the port for query in asynchronous mode
		oReq.open("POST", sURL, true);
		//Check the state & status of this oReq object
		oReq.onreadystatechange = function() {							
			if (oReq.readyState == 4) 
				{
				try
					{
					gs_TempXMLDoc=null;
					gs_TempXMLDoc = oReq.responseXML;
					var oHTMLFrag = new fnHTMLFrag(gs_TempXMLDoc,xslDoc,null,null);
					if (oHTMLFrag.hFrag=='<?xml version=\"1.0\"?><table style=\"width:950px;\" border=\"0\"></table>')
						{
						oHTMLFrag.hFrag = 'Quarterly guides are not available at this time';
						}
					if (window.ActiveXObject)
						{
						document.getElementById(OutputToContainer).innerHTML=oHTMLFrag.hFrag;
						oHTMLFrag=null;
						}
					else if (document.implementation && document.implementation.createDocument)
						{
						document.getElementById(OutputToContainer).innerHTML='';
						document.getElementById(OutputToContainer).appendChild(oHTMLFrag.hFrag);
						oHTMLFrag=null;
						}					
					}
				catch(e)
					{
					alert(e.message);
					}		
				} //end of if, that checks the state & status
				} //end of event statechange
			oReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			oReq.send(sDataToSend);									//Send data to the server
			} //end of the XMLHttpRequest
		} //end of function
		
function fnLoadXMLFile(FileName,FolderName)
	{
		var oDoc=null;
		//See if it is Microsoft browser
		if (window.ActiveXObject)
			{
			if (FolderName!='StyleSheets')
				{
				//If loading an XML doc and is not an XSL
				oDoc=new ActiveXObject("Msxml2.DOMDocument.5.0"); 
				}
			else
				{
				//If loading an XML doc that is adn XSL
				oDoc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.5.0"); 
				}
			}
		// For other browsers -- Firefox and Opera tested 
		else if (document.implementation && document.implementation.createDocument)
			{
			oDoc=document.implementation.createDocument("","",null);
			}
		else
			{
			alert('Error RC:10 fnLoadXMLFile. Cannot load file ' + FileName);
			return false;
			}
		oDoc.async=false;
		oDoc.load('../' + FolderName + '/'+ FileName);
		return(oDoc);	
	}




function fnHTMLFrag(xmlDoc,xslDoc,ParameterName,ParameterValue)
	{
	if (xmlDoc==null)
		{
		this.hFrag='';
		}
	else
		{
		try
		{
		//alert('Stylesheet should show next');
		//alert(xslDoc.xml);
		//alert('XML Document should show next');
		//alert(xmlDoc.xml);
		//See if it is Microsoft browser
		if (window.ActiveXObject)
			{
			var oCache = new ActiveXObject("Msxml2.XSLTemplate.5.0");
			oCache.stylesheet=xslDoc;
			var xsltProcessor = oCache.createProcessor();
			xsltProcessor.input=xmlDoc;
			//Set the parameter if provided
			if ((ParameterName!=null) && (ParameterValue!=null))
				{
				xsltProcessor.addParameter(ParameterName,ParameterValue);
				}
			xsltProcessor.transform();
			this.hFrag = xsltProcessor.output;
			xsltProcessor=null;
			}
		// For other browser 
		else if (document.implementation && document.implementation.createDocument)
			{
				xsltProcessor=new XSLTProcessor();
				xsltProcessor.importStylesheet(xslDoc);
				//Set the parameter if provided
				if ((ParameterName!=null) && (ParameterValue!=null))
					{
					xsltProcessor.setParameter(null,ParameterName,ParameterValue)
					}
				this.hFrag = xsltProcessor.transformToFragment(xmlDoc,document);
				xsltProcessor=null;
			}
		}
		catch(e)
		{
		//alert(e.message);
		this.hFrag = 'Data cannot be loaded...';
		alert(e.message + ' Error RC:10 fnHTMLFrag. Cannot do the transformations.');
		}
		}
	}
	
function fnCreateXMLDocFromString(sXMLString)
	{
	var xTransformedString=null;
	//For MS browser 
	if (window.ActiveXObject) 
		{
        xTransformedString = new ActiveXObject("Msxml2.DOMDocument.5.0")
        xTransformedString.async="false"
        xTransformedString.loadXML(sXMLString)
		}
	//Other browsers
   else if (document.implementation.createDocument) 
		{
        var xmlParser = new DOMParser()
        xTransformedString = xmlParser.parseFromString(sXMLString, "text/xml")
		}
	return xTransformedString;
	}