

function resultat(web){
if (web.ysearchresponse.count==0){ //wenn Resultat nicht vorhanden
document.getElementById('foo').innerHTML = "<div align=center style=font-family:verdana; font-size: 12px; margin-top: 50px;>Keine Web-Treffer gefunden.</div>";
document.getElementById('ergebnis').innerHTML = "0 Ergebnisse";
}
else {
if (web.ysearchresponse.count > 10){
var ende = 10;
}
else {
var ende = web.ysearchresponse.count;
}
var html = "";
var q1 = "";
var display = "";
var clicks = "";
var aoURL = "";
var aoQuery = "";
var aoTitle = "";
var t = "";
var s = "";
for (var i = 0; i < ende; i++){

if (i==0){ // top result
var top = "";
var topx = web.ysearchresponse.resultset_web[i].dispurl;
//if (topx.search(/.wikipedia\..+/i)!=-1){top = top+"<img src='Logos/wikipedia.GIF' width='19' height='18' alt= /> "}
//if (topx.search(/.apple\..+/i)!=-1){top = top+"<img src='Logos/apple.GIF' width='15' height='15' alt= /> "}
//if (topx.search(/.t-mobile\..+/i)!=-1){top = top+"<img src='Logos/t-mobile.GIF' width='17' height='16' alt= /> "}
//if (topx.search(/.ciao\..+/i)!=-1){top = top+"<img src='Logos/ciao.GIF' width='21' height='18' alt= /> "}
//if (topx.search(/.kelkoo\..+/i)!=-1){top = top+"<img src='Logos/kelkoo.GIF' width='19' height='18' alt= /> "}
//if (topx.search(/.opodo\..+/i)!=-1){top = top+"<img src='Logos/opodo.GIF' width='16' height='16' alt= /> "}
//if (topx.search(/.news4press\..+/i)!=-1){top = top+"<img src='Logos/news4press.GIF' width='16' height='16' alt= /> "}
//if (topx.search(/.spiegel\..+/i)!=-1){top = top+"<img src='Logos/spiegel.gif' width='16' height='16' alt= /> "}
//if (topx.search(/.stern\..+/i)!=-1){top = top+"<img src='Logos/stern.GIF' width='13' height='16' alt= /> "}
//if (topx.search(/.bild\..+/i)!=-1){top = top+"<img src='Logos/bild.GIF' width='18' height='13' alt= /> "}
//if (topx.search(/.selfhtml\..+/i)!=-1){top = top+"<img src='Logos/selfhtml.GIF' width='18' height='17' alt= /> "}
//if (topx.search(/.expedia\..+/i)!=-1){top = top+"<img src='Logos/expedia.GIF' width='21' height='19' alt= /> "}
//if (topx.search(/.rtl\..+/i)!=-1){top = top+"<img src='Logos/rtl.GIF' alt= /> "}
//if (topx.search(/.prosieben\..+/i)!=-1){top = top+"<img src='Logos/pro7.GIF' alt= /> "}
//if (topx.search(/.zdf\..+/i)!=-1){top = top+"<img src='Logos/zdf.GIF' alt= /> "}
//if (topx.search(/.amazon\..+/i)!=-1){top = top+"<img src='Logos/amazon.GIF' alt= /> "}
//if (topx.search(/.ebay\..+/i)!=-1){top = top+"<img src='Logos/ebay.GIF' alt= /> "}
//if (topx.search(/.yahoo\..+/i)!=-1){top = top+"<img src='Logos/yahoo.GIF' width='21' height='19' alt= /> "}
//if (topx.search(/.youtube\..+/i)!=-1){top = top+"<img src='Logos/youtube.GIF' width='21' height='20' alt= /> "}
//if (topx.search(/.focus\..+/i)!=-1){top = top+"<img src='Logos/focus.GIF' width='15' height='16' alt= /> "}
//if (topx.search(/.faz\..+/i)!=-1){top = top+"<img src='Logos/faz.GIF' width='21' height='20' alt= /> "}
//if (topx.search(/.bmw\..+/i)!=-1){top = top+"<img src='Logos/bmw.GIF' alt= /> "}
//if (topx.search(/.opel\..+/i)!=-1){top = top+"<img src='Logos/opel.GIF' alt= /> "}
//if (topx.search(/.audi\..+/i)!=-1){top = top+"<img src='Logos/audi.GIF' alt= /> "}
//if (topx.search(/.volkswagen\..+/i)!=-1){top = top+"<img src='Logos/vw.GIF' alt= /> "}
//if (topx.search(/.daimler\..+/i)!=-1){top = top+"<img src='Logos/mercedes.GIF' alt= /> "}
//if (topx.search(/.porsche\..+/i)!=-1){top = top+"<img src='Logos/porsche.GIF' alt= /> "}
//if (topx.search(/.microsoft\..+/i)!=-1){top = top+"<img src='Logos/microsoft.GIF' alt= /> "}
//if (topx.search(/.google\..+/i)!=-1){top = top+"<img src='Logos/google.GIF' alt= /> "}
//if (topx.search(/.gmx\..+/i)!=-1){top = top+"<img src='Logos/gmx.GIF' alt= /> "}
//if (topx.search(/.web\..+/i)!=-1){top = top+"<img src='Logos/web.GIF' alt= /> "}
//if (topx.search(/.wer-kennt-wen\..+/i)!=-1){top = top+"<img src='Logos/wkw.GIF' alt= /> "}
//if (topx.search(/.freenet\..+/i)!=-1){top = top+"<img src='Logos/freenet.GIF' alt= /> "}
//if (topx.search(/.mobile\..+/i)!=-1){top = top+"<img src='Logos/mobile.GIF' alt= /> "}
//if (topx.search(/.postbank\..+/i)!=-1){top = top+"<img src='Logos/postbank.GIF' alt= /> "}
//if (topx.search(/.schuelervz\..+/i)!=-1){top = top+"<img src='Logos/schuelervz.GIF' alt= /> "}
//if (topx.search(/.leo\..+/i)!=-1){top = top+"<img src='Logos/leo.GIF' alt= /> "}
//if (topx.search(/.pdf.+/i)!=-1){top = top+"<img src='Logos/pdf.gif' alt= /> "}
q1 = document.getElementById('suchfeld').value;
display = web.ysearchresponse.resultset_web[i].dispurl;
display = display.replace(/<b>/g, "");
display = display.replace(/<\/b>/g, "");
display = display.replace(/<wbr>/g, "");
display = encodeURIComponent(display);
display = display.replace(/%3B/g, "xxxx");
t = web.ysearchresponse.resultset_web[i].title
t = t.replace(/<b>/g, "");
t = t.replace(/<\/b>/g, "");
t = encodeURIComponent(t);
t = t.replace(/%3B/g, "xxxx");
s = web.ysearchresponse.resultset_web[i].abstract
s = s.replace(/<b>/g, "");
s = s.replace(/<\/b>/g, "");
s = s.replace(/\:/g, "");
s = encodeURIComponent(s);
s = s.replace(/%3B/g, "xxxx");
s = s.replace(/www/g, "");
s = s.replace(/.de/g, "");
aoURL = encodeURIComponent(web.ysearchresponse.resultset_web[i].url);
aoQuery = encodeURIComponent(q1);
aoTitle = encodeURIComponent(t);
clicks = encodeURIComponent(web.ysearchresponse.resultset_web[i].clickurl);
//Link erstellen für StatVerlauf - wird mit function Ping(nummer) übermittelt 


//clicks = clicks.replace(/<\?/g, "%3F");
top = top+"<span class='titel'><a href='go' lang='http://www.fireball.de/tago/Verlauf.asp?v="+aoURL+"&t="+aoTitle+"' id='"+web.ysearchresponse.resultset_web[i].clickurl+"' onclick='fluss(this.href,this.lang,this.id);return false;'>"+web.ysearchresponse.resultset_web[i].title+"</a></span><br>";
if (web.ysearchresponse.resultset_web[i].abstract.length > 0) {
top = top+"<font class='beschreibung'>"+web.ysearchresponse.resultset_web[i].abstract+"</font><br>";
}else{
top = top+"<font class='beschreibung'>"+web.ysearchresponse.resultset_web[i].title+"</font><br>";
}

top = top+"<span class='link'><a href='go' lang='http://www.fireball.de/tago/Verlauf.asp?v="+aoURL+"&t="+aoTitle+"' id='"+web.ysearchresponse.resultset_web[i].clickurl+"' onclick='meineL("+[i]+");flussNeu(this.href,this.lang,this.id);return false;' target='nex' style='text-decoration:none;'><img src='http://www.fireball.de/Logos/Lesezeichen/plus.JPG' width='12' height='12' border='0' id='5"+[i]+"'> "+web.ysearchresponse.resultset_web[i].dispurl+" </a></span>";
top = top+"<a href='http://www.fireball.de/MyLinks/Zwischenspeicher.asp' onclick='changexx(1001);' target='MeineLinks' style='font-family:arial;font-size:12px;color:gray;margin-left:10px;text-decoration:none;'>Verlauf</a>";
top = top+"<a href='http://www.fireball.de/MyLinks/ZwischenspeicherInKollektorSpeichernMini.asp?Link="+aoURL+"&t="+t+" "+q1+"' id='"+[i]+"' target='Links"+[i]+"' style='display:none;text-decoration:none;font-family:arial;font-size:12px;color:black;margin-left:15px;'>";
top = top+"<br><img src='http://www.fireball.de/Logos/Lesezeichen/plus.JPG' width='17' height='17' border='0'> <div style='background-color:#80FF00;padding:2px;border:1px solid green;display:inline;width:220px;text-align:center;cursor:pointer;' onclick='meineLoffen("+[i]+");return true;'><strong>Speichern in 'Meine Links'</strong></div><div style='background-color:white;padding:2px;border:1px solid green;display:inline;width:30px;text-align:center;cursor:pointer;text-decoration:none;' onclick='meineLzu("+[i]+");return false;'>X</div></a>";
top = top+"<div id='Links"+[i]+"' style='display:none;'><br><iframe src='#' frameborder='0' name='Links"+[i]+"' title='Links"+[i]+"'  scrolling='No' style='width:250px; height:18px; border: 0px solid green;margin:0px;margin-left:5px;background-color:white;'></iframe></div><br><br>";
}  //top fertig
else {  // nicht top
q1 = document.getElementById('suchfeld').value;
display = web.ysearchresponse.resultset_web[i].dispurl;
display = display.replace(/<b>/g, "");
display = display.replace(/<\/b>/g, "");
display = display.replace(/<wbr>/g, "");
display = encodeURIComponent(display);
display = display.replace(/%3B/g, "xxxx");
t = web.ysearchresponse.resultset_web[i].title
t = t.replace(/<b>/g, "");
t = t.replace(/<\/b>/g, "");
t = encodeURIComponent(t);
t = t.replace(/%3B/g, "xxxx");
s = web.ysearchresponse.resultset_web[i].abstract
s = s.replace(/<b>/g, "");
s = s.replace(/<\/b>/g, "");
s = s.replace(/\:/g, "");
s = encodeURIComponent(s);
s = s.replace(/%3B/g, "xxxx");
s = s.replace(/www/g, "");
s = s.replace(/.de/g, "");
aoURL = encodeURIComponent(web.ysearchresponse.resultset_web[i].url);
aoQuery = encodeURIComponent(q1);
aoTitle = encodeURIComponent(t);
clicks = encodeURIComponent(web.ysearchresponse.resultset_web[i].clickurl);
//clicks = clicks.replace(/<\?/g, "%3F");
html = html+"<span class='titel'><a href='go' lang='http://www.fireball.de/tago/Verlauf.asp?v="+aoURL+"&t="+aoTitle+"' id='"+web.ysearchresponse.resultset_web[i].clickurl+"' onclick='fluss(this.href,this.lang,this.id);return false;'>"+web.ysearchresponse.resultset_web[i].title+"</a></span><br>";
if (web.ysearchresponse.resultset_web[i].abstract.length > 0) {
html = html+"<font class='beschreibung'>"+web.ysearchresponse.resultset_web[i].abstract+"</font><br>";
}else{
html = html+"<font class='beschreibung'>"+web.ysearchresponse.resultset_web[i].title+"</font><br>";
}

html = html+"<span class='link'><a href='go' lang='http://www.fireball.de/tago/Verlauf.asp?v="+aoURL+"&t="+aoTitle+"' id='"+web.ysearchresponse.resultset_web[i].clickurl+"' onclick='meineL("+[i]+");flussNeu(this.href,this.lang,this.id);return false;' target='nex' style='text-decoration:none;'><img src='http://www.fireball.de/Logos/Lesezeichen/plus.JPG' width='12' height='12' border='0' id='5"+[i]+"'> "+web.ysearchresponse.resultset_web[i].dispurl+" </a></span>";
html = html+"<a href='http://www.fireball.de/MyLinks/Zwischenspeicher.asp' onclick='changexx(1001);' target='MeineLinks' style='font-family:arial;font-size:12px;color:gray;margin-left:10px;text-decoration:none;'>Verlauf</a>";
html = html+"<a href='http://www.fireball.de/MyLinks/ZwischenspeicherInKollektorSpeichernMini.asp?Link="+aoURL+"&t="+t+" "+q1+"' id='"+[i]+"' target='Links"+[i]+"' style='display:none;text-decoration:none;font-family:arial;font-size:12px;color:black;margin-left:15px;'>";
html = html+"<br><img src='http://www.fireball.de/Logos/Lesezeichen/plus.JPG' width='17' height='17' border='0'> <div style='background-color:#80FF00;padding:2px;border:1px solid green;display:inline;width:220px;text-align:center;cursor:pointer;' onclick='meineLoffen("+[i]+");return true;'><strong>Speichern in 'Meine Links'</strong></div><div style='background-color:white;padding:2px;border:1px solid green;display:inline;width:30px;text-align:center;cursor:pointer;text-decoration:none;' onclick='meineLzu("+[i]+");return false;'>X</div></a>";
html = html+"<div id='Links"+[i]+"' style='display:none;'><br><iframe src='#' frameborder='0' name='Links"+[i]+"' title='Links"+[i]+"'  scrolling='No' style='width:250px; height:18px; border: 0px solid green;margin:0px;margin-left:5px;background-color:white;'></iframe></div><br><br>";

}  // Nicht Top fertig
} //Schlaufe Fertig

html = html + "";
document.getElementById('top').innerHTML = top;
document.getElementById('foo').innerHTML = html;
document.getElementById('ergebnis').innerHTML = web.ysearchresponse.totalhits+" Ergebnisse";
}

//var treffer = web.ysearchresponse.totalhits;
//var start = web.ysearchresponse.start;
//paging(treffer,start); //Paging aufrufen
}




function suchen(s,dimension){
var q = document.getElementById('suchfeld').value;
var lang = document.getElementById('lang').value;
var land = ''
if (lang == ''){
land = 'de';
lang = 'de';
}
if (lang == 'de'){
land = 'de';
lang = 'de';
}
if (lang == 'at'){
land = 'at';
lang = 'de';
}
if (lang == 'ch'){
land = 'ch';
lang = 'de';
}
if (lang == 'us'){
land = 'us';
lang = 'en';
}


//Indexfehler von Yahoo Kompensieren
q = q.replace(/Dresden/m,"Dresden -schwanz"); //25.08.2009 Suchanfrage= Präsentationstrainer Dresden
q = q.replace(/dresden/m,"dresden -schwanz"); //25.08.2009 Suchanfrage= Präsentationstrainer Dresden
q = q.replace(/Bruhn/m,"Bruhn -porno"); //03.12.2009 Suchanfrage= Bruhn Porno (Kinderporno) Anwaltdrohung
q = q.replace(/bruhn/m,"bruhn -porno"); //03.12.2009 Suchanfrage= Bruhn Porno (Kinderporno) Anwaltdrohung
q = q.replace(/Cseckay/m,""); //01.04.2010  Anwaltdrohung
q = q.replace(/cseckay/m,""); //01.04.2009  Anwaltdrohung
q = q.replace(/systech lauf/m,"systech lauf -vertrieb"); //05.08.2010  Klaus Hofmann Mitarbeiter Klage


var starten = 0;
if (s==2){
starten = 7
}
if (s==3){
starten = 14
}
if (s==4){
starten = 21
}
if (s==5){
starten = 28
}
if (s==6){
starten = 35
}
if (s==7){
starten = 42
}
if (s==8){
starten = 49
}
if (s==9){
starten = 56
}
if (s==10){
starten = 63
}
if (s==11){
starten = 70
}
if (s==12){
starten = 77
}
if (s==13){
starten = 84
}
if (s==14){
starten = 91
}
if (s==15){
starten = 98
}
if (s==16){
starten = 105
}
if (s==17){
starten = 112
}
if (s==18){
starten = 119
}
if (s==19){
starten = 126
}
if (s==20){
starten = 133
}



var url = "http://boss.yahooapis.com/ysearch/web/v1/"+q+"?appid=U0.nuiHIkY9sPv_Mw0wGOmgzsYjy4FEmy4Ca1nePnQ&start="+starten+"&count=7&region="+land+"&lang="+lang+"&output=json&callback=resultat";
//var url = "http://boss.yahooapis.com/ysearch/web/v1/"+q+"?appid=U0.nuiHIkY9sPv_Mw0wGOmgzsYjy4FEmy4Ca1nePnQ&start="+starten+"&count=7&lang=de&output=json&callback=resultat";
var s = document.createElement('script');
s.setAttribute('src',url);
s.setAttribute('type','text/javascript');
document.getElementsByTagName('head')[0].appendChild(s);


//statistik
var iframestatistik = "<iframe name='d' style='width:0px; height:0px; border: 0px;'";
iframestatistik = iframestatistik + "src='http://www.fireball.de/StatistikFrame.asp?q="+q+"&IP=nA&Auswahl=Mobile'></iframe>";
document.getElementById('statistik').innerHTML =  iframestatistik;

}

function neu(s,dimension){
suchen(s,dimension);
if (s == 0){
s=1;
}
document.getElementById('seite').innerHTML = s+". Seite";
}

function meineL(u){
document.getElementById(u).style.display = '';
var b = "5"+u
document.getElementById(b).style.display = 'none';
}
function meineLzu(u){
document.getElementById(u).style.display = 'none';
var c = "Links"+u
//iFrame unsichtbar
document.c.style.display = 'none';
document.getElementById(c).style.display = 'inline';
}
function meineLoffen(u){
document.getElementById(u).style.display = 'none';
var c = "Links"+u
document.getElementById(c).style.display = 'inline';
}

//StatVerlauf
function fluss(links,verlauf,yahoo){
document.getElementById('StatVerlauf').innerHTML="<iframe src='"+verlauf+"'  style='border: 0px solid black; width: 1px; height: 1px;'></iframe>";
//document.location.href = yahoo;
window.setTimeout("b('"+yahoo+"')", 1000);
}
function b(weiterl) {
document.location.href = weiterl;
}

function flussNeu(links,verlauf,yahoo){
//alert(links);
//alert(verlauf);
//alert(yahoo);
//alert(weiter);
//var hopla = weiter;
//alert(hopla);
document.getElementById('StatVerlauf').innerHTML="<iframe src='"+verlauf+"'  style='border: 0px solid black; width: 1px; height: 1px;'></iframe>";
window.open (yahoo,"mywindow"); 
}
