function XMLHTTPObject()
{
	var xmlhttp; 

	if (window.ActiveXObject) 
	{
		// Instantiate the latest Microsoft ActiveX Objects
		if (_XML_ActiveX)
		{
			xmlhttp = new ActiveXObject(_XML_ActiveX);
		
		}
		else
		{ 
			// loops through the various versions of XMLHTTP to ensure we're using the latest
			var versions = ["MSXML2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0", "Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0"];			

			for (var i = 0; i < versions.length ; i++) 
			{ 
				try
				{
					// Try and create the ActiveXObject for Internet Explorer, if it doesn't work, try again.
					xmlhttp = new ActiveXObject(versions[i]); 
						
					if (xmlhttp) 
					{ 
						var _XML_ActiveX = versions[i];
						break;
					}
				}
				catch (e)
				{
					// TRAP
				};
			}
			;
		}			
	}// Well if there is no ActiveXObject available it must be firefox, opera, or something else

	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		try 
		{ 
			xmlhttp = new XMLHttpRequest(); 
		} 
		catch (e) 
		{
			xmlhttp = false; 
		}
	}
	
	return xmlhttp;
}

function processRequest(contentId,httpRequest,refreshContentOnFunction,parameterForRefresh)
{ 
	
	if (httpRequest.readyState == 4) 
	{ 
		if(httpRequest.status == 200)
		{ 
			results = httpRequest.responseText; // http.responseXML; which will lead to an XML based response, if we were to have some XML output from a server file
			var para = document.getElementById(contentId); //or whatever ID you gave your element. 			
			para.innerHTML = results; 		
			if (refreshContentOnFunction != "null")
			{		
				refreshContent(refreshContentOnFunction,parameterForRefresh);	
							
			}
			
		}
		else 
		{ 
			var results = "Sorry, there was an error finding the server-side file. Please contact support."; 
			var para = document.getElementById(contentId); 
			para.innerHTML = results; 
		}
		
	}	

	
}



function loadplayer()
{
	
	httpRequest=null;
	var refreshContent = "null";
	var result = true;
	
	// Javascript validation block (if any)
	{
		;	
	}
	// End
	
	// If there is no javascript error then go thru the processing/request response cycle	
	
	//objplayer=document.getElementById('playerbox');
	
		httpRequest = XMLHTTPObject();	
		
		var varContentUrl =  "getflashplayer.php";	
		//var varContentUrl =  "homeprocessajax.php?processfunction=populateCity&stateId="+stateValue;	

		//alert(varContentUrl);

		var contentId = "playerbox";				
		
		var para = document.getElementById(contentId);
		para.innerHTML = "<b style='color:red;'>Loading Player<img src='../resources/images/loading.gif'/></b>"; 
		
		httpRequest.open("GET", varContentUrl, true); 
		httpRequest.onreadystatechange = function () {processRequest(contentId,httpRequest,refreshContent,""); } ;
		httpRequest.setRequestHeader('Cache-Control', 'no-cache');
		httpRequest.setRequestHeader('Cache-Control', 'no-store');
		httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');		
		httpRequest.send(null);	
	}	

