var theresponse = "";


function parseSettings(divName){	
	var thediv = document.getElementById(divName);
	thediv.innerHTML = theresponse;
}

//function obtainSettings(path,divName,addHistory,pageName,pageStuff){
function obtainSettings(path,divName) {
	//alert(divName);
	var therequest = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();   
		
	//loadScript(autoIncludeFunctions);
	setTimeout("",5000);
	
	therequest.onreadystatechange = function()
		{
	 	 if (therequest.readyState == 4)
			{
	 	 	 if (therequest.status == 200)
				{					
					theresponse = therequest.responseText;	
					//alert(divName);
		
							
		 	 	 	//if(addHistory == 'true')
		 	 	 	//{
		 	 	 	//	setTimeout("",1250);
		 	 	 	//alert(theresponse);	
					//initialize();
					
		 	 	 	//alert(pageName);
		 	 	 	//var rand = Math.floor(Math.random()*1500);
					//var mystuff = pageName+'startTheDiv'+divName+'endTheDivstartTheURL'+pageStuff+'endTheURLstartTheResponse'+theresponse;
					//alert(mystuff);
		 	 	 	//dhtmlHistory.add(pageName,'startTheDiv'+divName+'endTheDivstartTheURL'+pageStuff+'endTheURLstartTheResponse'+theresponse);
						
		 	 	 // 	}		 	 	
		 	 		
					parseSettings(divName,'false');			 	 	 
				}
	 	 	 else 	{
			 	 alert('Error File '+ therequest.statusText);
				}
			}
		}
	
	var forceGET = "&n="+ parseInt(Math.random()*999999999);
	therequest.open("GET", path+forceGET, true);
	therequest.send(null);
	return true;
}



function obtainSettingsPost(path,divName,params){
	//alert(path);
	//alert(params.length);
	var therequest = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();   
	
	
	therequest.onreadystatechange = function()
		{
	 	 if (therequest.readyState == 4)
			{
	 	 	 if (therequest.status == 200)
				{
		 	 	 theresponse = therequest.responseText;
		 	 	 //alert(theresponse);
		 	 	 parseSettings(divName);
				}
	 	 	 else 	{
			 	 alert('Error File '+ therequest.statusText);
				}
			}
		}
	var forceGET = "&n="+ parseInt(Math.random()*999999999);
	therequest.open("POST", path, true);
	therequest.setRequestHeader("Content-type", "application/x-ww-form-urlencoded");
	therequest.send(params); 
	
}