var xmlHttp

function hentPlayer(str)
{ 
if (str.length > 0)
{ 
var url="/hentplayer.asp?sid=" + Math.random() + "&q=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
} 
else
{ 
document.getElementById("showBuffersContainer").innerHTML=""
} 
} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById("showBuffersContainer").innerHTML=xmlHttp.responseText 
} 
} 


function showBuffTyper(str)
{ 
xmlHttp=GetXmlHttpObject1();
if (xmlHttp==null)
  {
  alert ("Your brower does not support the use of AJAX!");
  return;
  } 
streng1=str
var url="hentbuffers.asp";
url=url+"?bufftypen="+str;
url=url+"&sid="+Math.random();
var type="1"
xmlHttp.onreadystatechange=stateChanged1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}

function stateChanged1() 
{ 
document.getElementById("showBuffersContainer").innerHTML = "<br><img src='http://fallen-empire.wzarlon.dk/skin/ajax-loader.gif' WIDTH='54' HEIGHT='55' align='absmiddle'> Please wait. Fetching Player and Buff data.......<br>";
if (xmlHttp.readyState==4)
{ 
document.getElementById("showBuffersContainer").innerHTML=xmlHttp.responseText;
showBuffInfo(streng1)
}

}

function showBuffInfo(str)
{ 
xmlHttp=GetXmlHttpObject1();
if (xmlHttp==null)
  {
  alert ("Your brower does not support the use of AJAX!");
  return;
  } 
var url="hentinfo.asp";
url=url+"?bufftypen="+str;
url=url+"&sid="+Math.random();
var type="1"
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}

function stateChanged2() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("showBuffInfoContainer").innerHTML=xmlHttp.responseText;
}

}




function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null

if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This function is not supported by Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error: Scripting for ActiveX seems to be disabled on your browser") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 

function GetXmlHttpObject1()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}
