var xmlHttp

WaitLoopContract = new Array("0");
WaitLoopContract.push("InVisible()");
WaitLoopContract.push("GetArea()");
WaitLoopContract.push("GetSubArea()");
WaitLoopContract.push("GetCountry()");
WaitLoopContract.push("GetRegion()");
WaitLoopContract.push("GetCity()");
WaitLoopContract.push("CountItemChange()");
WaitLoopContract.push("SelectTypeJob()");
WaitLoopContract.push("ReVisible()");

function InVisible() {
	document.getElementById("searchbox").style.display = 'none';
	document.getElementById("image").style.display = 'block';
	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
	
}

function ReVisible() {
	document.getElementById("searchbox").style.display = 'block';
	document.getElementById("image").style.display = 'none';
	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
}

function StartContract(functionID){
  if (functionID<WaitLoopContract.length){
   	if (WaitLoopContract[0]=="0"){
    	WaitLoopContract[0]="1";
    	eval(WaitLoopContract[functionID]);
    	StartContract(functionID+1);
  	}
  	else setTimeout("StartContract("+functionID+")",10);
 	}
}

WaitLoopArea = new Array("0");
WaitLoopArea.push("InVisible()");
WaitLoopArea.push("GetContract()");
WaitLoopArea.push("GetSubArea()");
WaitLoopArea.push("GetCountry()");
WaitLoopArea.push("GetRegion()");
WaitLoopArea.push("GetCity()");
WaitLoopArea.push("CountItemChange()");
WaitLoopArea.push("SelectTypeJob()");
WaitLoopArea.push("ReVisible()");

function StartArea(functionID){
  if (functionID<WaitLoopArea.length){
   	if (WaitLoopArea[0]=="0"){
    	WaitLoopArea[0]="1";
    	eval(WaitLoopArea[functionID]);
    	StartArea(functionID+1);
  	}
  	else setTimeout("StartArea("+functionID+")",10);
 	}
}

WaitLoopSubArea = new Array("0");
WaitLoopSubArea.push("InVisible()");
WaitLoopSubArea.push("GetArea()");
WaitLoopSubArea.push("GetContract()");
WaitLoopSubArea.push("GetCountry()");
WaitLoopSubArea.push("GetRegion()");
WaitLoopSubArea.push("GetCity()");
WaitLoopSubArea.push("CountItemChange()");
WaitLoopSubArea.push("SelectTypeJob()");
WaitLoopSubArea.push("ReVisible()");

function StartSubArea(functionID){
  if (functionID<WaitLoopSubArea.length){
   	if (WaitLoopSubArea[0]=="0"){
    	WaitLoopSubArea[0]="1";
    	eval(WaitLoopSubArea[functionID]);
    	StartSubArea(functionID+1);
  	}
  	else setTimeout("StartSubArea("+functionID+")",10);
 	}
}

WaitLoopCountry = new Array("0");
WaitLoopCountry.push("InVisible()");
WaitLoopCountry.push("GetArea()");
WaitLoopCountry.push("GetSubArea()");
WaitLoopCountry.push("GetContract()");
WaitLoopCountry.push("GetRegion()");
WaitLoopCountry.push("GetCity()");
WaitLoopCountry.push("CountItemChange()");
WaitLoopCountry.push("SelectTypeJob()");
WaitLoopCountry.push("ReVisible()");

function StartCountry(functionID){
  if (functionID<WaitLoopCountry.length){
   	if (WaitLoopCountry[0]=="0"){
    	WaitLoopCountry[0]="1";
    	eval(WaitLoopCountry[functionID]);
    	StartCountry(functionID+1);
  	}
  	else setTimeout("StartCountry("+functionID+")",10);
 	}
}

WaitLoopRegion = new Array("0");
WaitLoopRegion.push("InVisible()");
WaitLoopRegion.push("GetArea()");
WaitLoopRegion.push("GetSubArea()");
WaitLoopRegion.push("GetCountry()");
WaitLoopRegion.push("GetContract()");
WaitLoopRegion.push("GetCity()");
WaitLoopRegion.push("CountItemChange()");
WaitLoopRegion.push("SelectTypeJob()");
WaitLoopRegion.push("ReVisible()");

function StartRegion(functionID){
  if (functionID<WaitLoopRegion.length){
   	if (WaitLoopRegion[0]=="0"){
    	WaitLoopRegion[0]="1";
    	eval(WaitLoopRegion[functionID]);
    	StartRegion(functionID+1);
  	}
  	else setTimeout("StartRegion("+functionID+")",10);
 	}
}

WaitLoopCity = new Array("0");
WaitLoopCity.push("InVisible()");
WaitLoopCity.push("GetArea()");
WaitLoopCity.push("GetSubArea()");
WaitLoopCity.push("GetCountry()");
WaitLoopCity.push("GetRegion()");
WaitLoopCity.push("GetContract()");
WaitLoopCity.push("CountItemChange()");
WaitLoopCity.push("SelectTypeJob()");
WaitLoopCity.push("ReVisible()");

function StartCity(functionID){
  if (functionID<WaitLoopRegion.length){
   	if (WaitLoopCity[0]=="0"){
    	WaitLoopCity[0]="1";
    	eval(WaitLoopCity[functionID]);
    	StartCity(functionID+1);
  	}
  	else setTimeout("StartCity("+functionID+")",10);
 	}
}

WaitLoopStart = new Array("0");
WaitLoopStart.push("InVisible()");
WaitLoopStart.push("CountItem()");
WaitLoopStart.push("SelectTypeJob()");
WaitLoopStart.push("ReVisible()");

function StartSite(functionID){
  if (functionID<WaitLoopRegion.length){
   	if (WaitLoopStart[0]=="0"){
    	WaitLoopStart[0]="1";
    	eval(WaitLoopStart[functionID]);
    	StartSite(functionID+1);
  	}
  	else setTimeout("StartSite("+functionID+")",10);
 	}
}

function CountItem()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var qc = document.getElementById('contract').value;
var rc = document.getElementById('area').value;
var sc = document.getElementById('subarea').value;
var tc = document.getElementById('country').value;
var uc = document.getElementById('region').value;
var vc = document.getElementById('city').value;
var wc = document.getElementById('scriptname').value;
var xc = document.getElementById('startold').value;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getCountItem.php"
url=url+"?qc="+qc+"&rc="+rc+"&sc="+sc+"&tc="+tc+"&uc="+uc+"&vc="+vc+"&wc="+wc+"&xc="+xc
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateCount
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function CountItemChange()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var qc = document.getElementById('contract').value;
var rc = document.getElementById('area').value;
var sc = document.getElementById('subarea').value;
var tc = document.getElementById('country').value;
var uc = document.getElementById('region').value;
var vc = document.getElementById('city').value;
var wc = document.getElementById('scriptname').value;
var xc = document.getElementById('startold').value = 1;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getCountItem.php"
url=url+"?qc="+qc+"&rc="+rc+"&sc="+sc+"&tc="+tc+"&uc="+uc+"&vc="+vc+"&wc="+wc+"&xc="+xc
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateCount
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function stateCount() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("search_info").innerHTML=xmlHttp.responseText;
 //SelectTypeJob();
	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 } 
}

function SelectTypeJob()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var q = document.getElementById('contract').value;
var r = document.getElementById('area').value;
var s = document.getElementById('subarea').value;
var t = document.getElementById('country').value;
var u = document.getElementById('region').value;
var v = document.getElementById('city').value;
var w = document.getElementById('sortby').value;
var x = document.getElementById('startold').value;

var y = document.getElementById('scriptname').value;

if (y == 'v_joboffer') {
var url="http://www.praktikumsanzeigen.info/fileadmin/php/getOfferResult.php"
url=url+"?q="+q+"&r="+r+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&x="+x
}
if (y == 'v_request'){
var z = document.getElementById('account').value;
	
var url="http://www.praktikumsanzeigen.info/fileadmin/php/getRequestResult.php"
url=url+"?q="+q+"&r="+r+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&x="+x+"&z="+z
}
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("search_resultat").innerHTML=xmlHttp.responseText;
	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 }
 
}

function GetContract()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var p = document.getElementById('contract').value;
var q = document.getElementById('area').value;
var s = document.getElementById('subarea').value;
var t = document.getElementById('country').value;
var u = document.getElementById('region').value;
var v = document.getElementById('city').value;
var w = document.getElementById('scriptname').value;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getContract.php";
url=url+"?q="+q+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&p="+p;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateContract; 
xmlHttp.open("GET",url,true);
xmlHttp.send(null);

}

function stateContract() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("contractdiv").innerHTML=xmlHttp.responseText;
 	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 } 
}

function GetArea()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var p = document.getElementById('area').value;
var q = document.getElementById('contract').value;
var s = document.getElementById('subarea').value;
var t = document.getElementById('country').value;
var u = document.getElementById('region').value;
var v = document.getElementById('city').value;
var w = document.getElementById('scriptname').value;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getArea.php"
url=url+"?q="+q+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&p="+p
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateArea 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function stateArea() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("areadiv").innerHTML=xmlHttp.responseText;
 	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 } 
}


function GetSubArea()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var p = document.getElementById('subarea').value;
var q = document.getElementById('contract').value;
var s = document.getElementById('area').value;
var t = document.getElementById('country').value;
var u = document.getElementById('region').value;
var v = document.getElementById('city').value;
var w = document.getElementById('scriptname').value;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getSubArea.php"
url=url+"?q="+q+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&p="+p
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateSubarea 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function stateSubarea() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("subareadiv").innerHTML=xmlHttp.responseText;
 	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 } 
}

function GetCountry()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var p = document.getElementById('country').value;
var q = document.getElementById('contract').value;
var s = document.getElementById('area').value;
var t = document.getElementById('subarea').value;
var u = document.getElementById('region').value;
var v = document.getElementById('city').value;
var w = document.getElementById('scriptname').value;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getCountry.php"
url=url+"?q="+q+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&p="+p
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateCountry 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function stateCountry() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("countrydiv").innerHTML=xmlHttp.responseText;
 	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 } 
}

function GetRegion()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var p = document.getElementById('region').value;
var q = document.getElementById('contract').value;
var s = document.getElementById('area').value;
var t = document.getElementById('subarea').value;
var u = document.getElementById('country').value;
var v = document.getElementById('city').value;
var w = document.getElementById('scriptname').value;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getRegion.php"
url=url+"?q="+q+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&p="+p
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateRegion 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function stateRegion() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("regiondiv").innerHTML=xmlHttp.responseText;
 	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 } 
}

function GetCity()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }

var p = document.getElementById('city').value;
var q = document.getElementById('contract').value;
var s = document.getElementById('area').value;
var t = document.getElementById('subarea').value;
var u = document.getElementById('country').value;
var v = document.getElementById('region').value;
var w = document.getElementById('scriptname').value;

var url="http://www.praktikumsanzeigen.info/fileadmin/php/getCity.php"
url=url+"?q="+q+"&s="+s+"&t="+t+"&u="+u+"&v="+v+"&w="+w+"&p="+p
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateCity 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)

}

function stateCity() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("citydiv").innerHTML=xmlHttp.responseText;
 	WaitLoopStart[0]="0";
	WaitLoopContract[0]="0";
	WaitLoopArea[0]="0";
	WaitLoopSubArea[0]="0";
	WaitLoopCountry[0]="0";
	WaitLoopRegion[0]="0";
	WaitLoopCity[0]="0";
 } 
}

function GetXmlHttpObject()
{
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;
}
