var xmlhttp;
var xmlhttp2;
var xmlhttp3;
var xmlhttp4;
var xmlhttp5;
var xmlhttp6;
var xmlhttp7;




function showfachbereich(str)
{
str = escape(str);

document.getElementById("phrasetemp").value = str;
//alert ("temporary phrase: " + document.getElementById("phrasetemp").value);
//alert ("phrase: " + str);
document.getElementById("loading-indicatormain").style.display='inline';
document.getElementById("searchresultmain").style.display='inline';
document.getElementById("loadcontent").style.display='none';

document.getElementById("txtHintmain").style.display='none';

document.getElementById("shopping_list_countermain").style.display='none';

xmlhttp6=GetXmlHttpObject();
if (xmlhttp6==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
 
 
  
var url="arztsuche-auswerten_ajax_fb.php";

url=url+"?fachbereich="+str;
url=url+"&sid="+Math.random();
// xhttp ist das XMLHttpRequest Objekt
xmlhttp6.onreadystatechange=stateChanged6;
xmlhttp6.open("GET",url,true);

xmlhttp6.send(null);

}

function stateChanged6()
{
if (xmlhttp6.readyState==4)
{
//alert(xmlhttp.responseText);
document.getElementById("loading-indicatormain").style.display='none';
document.getElementById("shopping_list_countermain").style.display='inline';

document.getElementById("searchresultmain").style.display='inline';
document.getElementById("txtHintmain").style.display='inline';
document.getElementById("txtHintmain").innerHTML=xmlhttp6.responseText;

//("#xtable").trigger("update");
dopage();
showAllgemeinmedizin();
showRated();
}

}



function showSearchResult(str,ort)
{
document.getElementById("phrasetemp").value = str;
//alert ("temporary phrase: " + document.getElementById("phrasetemp").value);
//alert ("phrase: " + str);
document.getElementById("loading-indicatormain").style.display='inline';
document.getElementById("searchresultmain").style.display='inline';
document.getElementById("loadcontent").style.display='none';

document.getElementById("txtHintmain").style.display='none';

document.getElementById("shopping_list_countermain").style.display='none';

xmlhttp5=GetXmlHttpObject();
if (xmlhttp5==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
 
 
  
var url="arztsuche-auswerten_ajax.php";

if((ort!='Ort, Postleizahl...')&&(str!='Suche einen Arzt, Name...')){
ort = escape(ort);
str = escape(str);
url=url+"?phrase="+str+"&varort="+ort;
 }
 
else if((ort!='Ort, Postleizahl...')&&(str=='Suche einen Arzt, Name...')) {
ort = escape(ort);

url=url+"?varort="+ort;
}
 
 else if((ort=='Ort, Postleizahl...')&&(str=='Suche einen Arzt, Name...')) {
alert("Geben Sie bitte einen Suchbegriff oder Ort ein");
history.go(-1);

}
 

else{
str = escape(str);
url=url+"?phrase="+str;
} 


url=url+"&sid="+Math.random();
// xhttp ist das XMLHttpRequest Objekt
xmlhttp5.onreadystatechange=stateChanged5;
xmlhttp5.open("GET",url,true);

xmlhttp5.send(null);

}

function stateChanged5()
{
if (xmlhttp5.readyState==4)
{
//alert(xmlhttp.responseText);
document.getElementById("loading-indicatormain").style.display='none';
document.getElementById("shopping_list_countermain").style.display='inline';

document.getElementById("searchresultmain").style.display='inline';
document.getElementById("txtHintmain").style.display='inline';

document.getElementById("txtHintmain").innerHTML=xmlhttp5.responseText;

//("#xtable").trigger("update");
dopage();
showAllgemeinmedizin();
showRated();
}

}


function showRated()
{

document.getElementById("loading-indicator4").style.display='inline';
document.getElementById("searchresult4").style.display='inline';
document.getElementById("txtHint4").style.display='none';

document.getElementById("shopping_list_counter4").style.display='none';

xmlhttp4=GetXmlHttpObject();
if (xmlhttp4==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="modules/mod_right_rated.php";
url=url+"?sid="+Math.random();
// xhttp ist das XMLHttpRequest Objekt
xmlhttp4.onreadystatechange=stateChanged4;
xmlhttp4.open("GET",url,true);

xmlhttp4.send(null);

}

function stateChanged4()
{
if (xmlhttp4.readyState==4)
{
document.getElementById("loading-indicator4").style.display='none';
document.getElementById("shopping_list_counter4").style.display='inline';

document.getElementById("searchresult4").style.display='inline';
document.getElementById("txtHint4").style.display='inline';

document.getElementById("txtHint4").innerHTML=xmlhttp4.responseText;

}

}


function showAllgemeinmedizin()
{

document.getElementById("loading-indicator3").style.display='inline';
document.getElementById("searchresult3").style.display='inline';
document.getElementById("txtHint3").style.display='none';

document.getElementById("shopping_list_counter3").style.display='none';

xmlhttp3=GetXmlHttpObject();
if (xmlhttp3==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="modules/mod_right_fachrichtung.php";
url=url+"?sid="+Math.random();
// xhttp ist das XMLHttpRequest Objekt
xmlhttp3.onreadystatechange=stateChanged3;
xmlhttp3.open("GET",url,true);

xmlhttp3.send(null);

}

function stateChanged3()
{
if (xmlhttp3.readyState==4)
{
document.getElementById("loading-indicator3").style.display='none';
document.getElementById("shopping_list_counter3").style.display='inline';

document.getElementById("searchresult3").style.display='inline';
document.getElementById("txtHint3").style.display='inline';
// alert (xmlhttp3.responseText);
document.getElementById("txtHint3").innerHTML=xmlhttp3.responseText;

}

}

function showHigh()
{

document.getElementById("loading-indicator2").style.display='inline';
document.getElementById("searchresult2").style.display='inline';
document.getElementById("txtHint2").style.display='none';

document.getElementById("shopping_list_counter2").style.display='none';

xmlhttp2=GetXmlHttpObject();
if (xmlhttp2==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="modules/mod_high_rated.php";
url=url+"?sid="+Math.random();
// xhttp ist das XMLHttpRequest Objekt
xmlhttp2.onreadystatechange=stateChanged2;
xmlhttp2.open("GET",url,true);

xmlhttp2.send(null);

}

function stateChanged2()
{
if (xmlhttp2.readyState==4)
{
document.getElementById("loading-indicator2").style.display='none';
document.getElementById("shopping_list_counter2").style.display='inline';

document.getElementById("searchresult2").style.display='inline';
document.getElementById("txtHint2").style.display='inline';

document.getElementById("txtHint2").innerHTML=xmlhttp2.responseText;

}

}




function showUser()
{
//str = escape(str);
//document.getElementById("phrasetemp").value = str;
//alert ("temporary phrase: " + document.getElementById("phrasetemp").value);
//alert ("phrase: " + str);

document.getElementById("loading-indicator").style.display='inline';
document.getElementById("searchresult").style.display='inline';
document.getElementById("txtHint").style.display='none';

document.getElementById("shopping_list_counter").style.display='none';

xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="modules/mod_last_comments.php";
url=url+"?sid="+Math.random();
// xhttp ist das XMLHttpRequest Objekt
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);

xmlhttp.send(null);

}

function stateChanged()
{
if (xmlhttp.readyState==4)
{

if (xmlhttp.responseText == "")
{
showUsernoResult()
}
document.getElementById("loading-indicator").style.display='none';
document.getElementById("shopping_list_counter").style.display='inline';

document.getElementById("searchresult").style.display='inline';
document.getElementById("txtHint").style.display='inline';

document.getElementById("txtHint").innerHTML=xmlhttp.responseText;

//("#xtable").trigger("update");
//dopage();
}

}

function showUsernoResult()
{


xmlhttp7=GetXmlHttpObject();
if (xmlhttp7==null)
  {
  alert ("Browser does not support HTTP Request");
  return;
  }
var url="modules/mod_last_comments_noresult.php";
url=url+"?sid="+Math.random();
// xhttp ist das XMLHttpRequest Objekt
xmlhttp7.onreadystatechange=stateChanged7;
xmlhttp7.open("GET",url,true);

xmlhttp7.send(null);

}

function stateChanged7()
{
if (xmlhttp7.readyState==4)
{

document.getElementById("loading-indicator").style.display='none';
document.getElementById("shopping_list_counter").style.display='inline';

document.getElementById("searchresult").style.display='inline';
document.getElementById("txtHint").style.display='inline';

document.getElementById("txtHint").innerHTML=xmlhttp7.responseText;

//("#xtable").trigger("update");
//dopage();
}

}



function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
