// Links zusammensetzen

function jlink()
{
   var url = "";
   for (i = 0; i < arguments.length; i++)
   {
      url = url + arguments[i];
   }
   //gotopage(url);
   window.open(url, "Werbung", "");
}

function verbindungsobjekt() {
  var vo;
  try { // MSIE 6
    vo = new ActiveXObject("Msxml2.XMLHTTP");
  } catch(e) {
    try { // MSIE 5
	vo = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) { // Mozilla
    vo = new XMLHttpRequest();
    }
  }
  return vo;
}

var http = verbindungsobjekt();
var alt  = '';

function senden(action) {
  if(alt != action) {
    alt = action;
    action = escape(action);
    http.open('get', '/include_ajax.php?q='+action);
    http.send(null);
  }
}

function senden2(action) 
{
  if(action.length > 4) {
    action = escape(action);
	div = action.substr(0,1);
	if(div == "o") {
	    document.getElementById('ausgabe_f').innerHTML = "";
		document.form.sid.value="";
	} else {
	    document.getElementById('ausgabe_o').innerHTML = "";
		document.form.sid.value="";			
	}
    http.open('get', '/suche_ajax.php?q='+action);
    http.onreadystatechange = handleResponse;
    http.send(null);
  }
}

function handleResponse() 
{
  if(http.readyState == 4){
    if(http.responseText.indexOf("<br/>") == -1) {
      document.getElementById('ausgabe_o').innerHTML = "";
	  document.getElementById('ausgabe_f').innerHTML = "";
    } else {
      feld = http.responseText.substr(0,1);
	  if(feld == "o") {
	     document.getElementById('ausgabe_o').innerHTML = http.responseText.substr(1);
	  } 
	  else if(feld == "f") {
	     document.getElementById('ausgabe_f').innerHTML = http.responseText.substr(1);	  
	  }
    }
  }
}



