// JavaScript Document
var wwwurl="http://www.gastrokauf24.de/";
function fenster(NeueBreite, NeueHoehe)
{
    window.resizeTo(NeueBreite, NeueHoehe);
    window.moveTo((screen.availWidth-NeueBreite)/2, (screen.availHeight-NeueHoehe-60)/2);
}
function Fensterbreite () {
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.offsetWidth) {
    return document.body.offsetWidth;
  } else {
    return 0;
  }
}

    function zeige(src) {
     var topf=0;
     if(Fensterhoehe() < 570){
       topf=Math.round((Fensterhoehe()-400-25)/2);
     }
     else
     {
       topf=Math.round(125+(Fensterhoehe()-400-50)/2);
     }
     if(topf < 0){
       topf=0;
     }
     if(topf > 50){
       topf=50;
     }
	 topf=topf+getScrollY();
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height="400px";
	  document.getElementById("ab1").style.width="580px";
	  document.getElementById("ac1").style.height="385px";
	  document.getElementById("ac1").style.width="580px";
	  document.getElementById("ekopf").style.width="580px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width="580px";
	};

function Fensterhoehe () {
var hoehe=0;
if (self.innerHeight)
{
   hoehe = self.innerHeight;
}

// Explorer 6 Strict Mode
else if (document.documentElement && document.documentElement.clientHeight)

{
        hoehe = document.documentElement.clientHeight;
}

// andere Explorers
else if (document.body)
{
        hoehe = document.body.clientHeight;
}
return hoehe;
}

function get_top(e)
{
var o = document.getElementById(e);	
if(!o.offsetTop) return;
var top = 0;
while (o)
{
   top += parseInt(o.offsetTop );
   o = o.offsetParent;
}
return top;
}


function resizebox(){
     var h=Fensterhoehe()-199;
     if(get_top("mitte_u")){
	   if(Fensterhoehe()-get_top("mitte_u") > 20){	 
//	     alert(get_top("mitte_u")+'--'+ Fensterhoehe());
		 var h1=Fensterhoehe();
	     document.getElementById("content").style.height= h+'px';
	     document.getElementById("inhalt").style.height= h1+'px';
	     document.getElementById("inhalt").style.overflow= 'hidden';		 
	   }
	   else
	   {
		 var h1=get_top("mitte_u")+20;
	     document.getElementById("inhalt").style.height= h1+'px';
	     document.getElementById("inhalt").style.overflow= 'hidden';		 
	   }
	}
}
	function zeigegr(src, breite, hoehe) {
     var topf=0;
	 if(hoehe == 0){
	   hoehe= Fensterhoehe()-20;
	 }
	 var mleft=Math.round((Fensterbreite()-breite)/2);
	 topf=Math.round((Fensterhoehe()-hoehe - 15)/2);
     if(topf < 10){
       topf=10;
     }
  	  topf=topf+getScrollY();
  	  document.getElementById("abt").style.height=getheight(document.getElementById("inhaltm"))+'px';
	  document.getElementById("ac1").src = "image.php?src=" + src + "&w=" + breite + "&h=" + hoehe;
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("ab1").style.marginLeft=mleft + "px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
    };	
    function zeige_npreis(){
     var topf=0;
	 var breite=380;
	 var hoehe=270;
	 var mleft=Math.round((Fensterbreite()-breite)/2);
	 topf=Math.round((Fensterhoehe()-hoehe - 15)/2);
     if(topf < 10){
       topf=10;
     }
  	  topf=topf+getScrollY();
  	  document.getElementById("abt").style.height=getheight(document.getElementById("inhaltm"))+'px';
	  document.getElementById("ac1").src = wwwurl+"npreis.php";
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("ab1").style.marginLeft=mleft + "px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
	}
	function linkbox(src) {
     var topf=0;
	 var breite=380;
	 var hoehe=280;
	 var mleft=Math.round((Fensterbreite()-breite)/2);
	 topf=Math.round((Fensterhoehe()-hoehe - 15)/2);
     if(topf < 10){
       topf=10;
     }
  	  topf=topf+getScrollY();
  	  document.getElementById("abt").style.height=getheight(document.getElementById("inhaltm"))+'px';
	  document.getElementById("ac1").src = wwwurl+"linktext.php?link="+src;
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("ab1").style.marginLeft=mleft + "px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
    };	

   function zeige_gr(src, breite, hoehe) {
 	 var fhoehe=getheight(document.getElementById("rahmen"))+150;
	 if(Fensterhoehe() > fhoehe){
	   fhoehe=Fensterhoehe(); 
	 }
    var topf=0;
     topf=Math.round((Fensterhoehe()-hoehe)/2);
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	 topf=topf+getScrollY();
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("abt").style.height=fhoehe+"px";	  
	  document.getElementById("ac1").src = "image.php?src=" + src + "&w=" + breite + "&h=" + hoehe;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
    };	 

   function zeige_grl(src, breite, hoehe) {
 	 var fhoehe=getheight(document.getElementById("rahmen"))+150;
	 if(Fensterhoehe() > fhoehe){
	   fhoehe=Fensterhoehe(); 
	 }
    var topf=0;
     topf=Math.round((Fensterhoehe()-hoehe)/2);
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	 topf=topf+getScrollY();
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("abt").style.height=fhoehe+"px";	  
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
    };	 

   function katalog(src, breite, hoehe) {
 	 var fhoehe=getheight(document.getElementById("rahmen"))+150;
	 if(Fensterhoehe() > fhoehe){
	   fhoehe=Fensterhoehe(); 
	 }
    var topf=0;
     topf=Math.round((Fensterhoehe()-hoehe)/2);
     if(topf < 0){
       topf=0;
     }
     if(topf > 150){
       topf=150;
     }
	 topf=topf+getScrollY();
	  document.getElementById("abt").onclick='';
	  document.getElementById("abr").onclick='';
	  document.getElementById("ab1").onclick='';
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("abt").style.height=fhoehe+"px";	  
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
	  
    return true;
    };	 

  function zeige_grz(src, breite, hoehe) {
     var topf=0;
     topf=Math.round((Fensterhoehe()-hoehe)/2);
     if(topf < 0){
       topf=0;
     }
	 topf=topf+getScrollY();
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("abt").style.height=getheight(document.getElementById("inhaltm"))+"px";	  
	  document.getElementById("ac1").src = src;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
    };	
    function hide() {
    document.getElementById("ab1").style.visibility = "hidden";
	  document.getElementById("abr").style.visibility="hidden";
	  document.getElementById("abt").style.visibility="hidden";
      document.getElementById("ac1").src="";
	  document.getElementById("ab1").style.height="0px";
	  document.getElementById("ab1").style.width="0px";
   }

  function show_am(am) {
  	close_am();
	document.getElementById(am).style.height='auto';
	document.getElementById(am).style.visibility="visible";
  }
  function close_am() {
  	document.getElementById("am1").style.height='0px';
	document.getElementById("am1").style.visibility="hidden";
  	document.getElementById("am2").style.height='0px';
	document.getElementById("am2").style.visibility="hidden";
  	document.getElementById("am3").style.height='0px';
	document.getElementById("am3").style.visibility="hidden";
  	document.getElementById("am4").style.height='0px';
	document.getElementById("am4").style.visibility="hidden";
  	document.getElementById("am5").style.height='0px';
	document.getElementById("am5").style.visibility="hidden";
  	document.getElementById("am6").style.height='0px';
	document.getElementById("am6").style.visibility="hidden";
  	document.getElementById("am7").style.height='0px';
	document.getElementById("am7").style.visibility="hidden";
  	document.getElementById("am8").style.height='0px';
	document.getElementById("am8").style.visibility="hidden";
  	document.getElementById("am9").style.height='0px';
	document.getElementById("am9").style.visibility="hidden";
    };	

function getScrollY() {
var x,y;
if (self.pageYOffset) // all except Explorer
{
	y = self.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
{
	y = document.documentElement.scrollTop;
}
else if (document.body) // all other Explorers
{
	y = document.body.scrollTop;
}
    return y;
}
function getheight(elem){
  var h=0;
   h=elem.offsetHeight;     
   return h;
}

function int_bt(id, text){
  if(document.getElementById(id).value==''){
	document.getElementById(id).value=text;
	document.getElementById(id).style.color='#aaaaaa';
  }
}
function int_ft(id, text){
  if(document.getElementById(id).value==text){
	document.getElementById(id).value='';
	document.getElementById(id).style.color='#494949';
  }
}

function int_t(id, text){
  if(document.getElementById(id)){	
    document.getElementById(id).onfocus= function(){int_ft(id, text)};
    document.getElementById(id).onblur = function(){int_bt(id, text)};
	document.getElementById(id).value=text;
	document.getElementById(id).style.color='#aaaaaa';
  }
}

function int_p(id, text){
  if(document.getElementById(id)){	
    document.getElementById(id).onfocus= function(){int_fp(id, text)};
    document.getElementById(id).onblur = function(){int_bp(id, text)};
	document.getElementById(id).value=text;
	document.getElementById(id).style.color='#aaaaaa';
  }
}

function int_bp(id, text){
  if(document.getElementById(id).value==''){
	document.getElementById(id).style.color='#aaaaaa';
  }
}
function int_fp(id, text){
  if(document.getElementById(id).value==text){
	document.getElementById(id).type='password';
	document.getElementById(id).value='';
	document.getElementById(id).style.color='#494949';
  }
}


function init_page(){
    int_t('osuchi', 'Suchbegriff');
    int_t('rbenutzer', 'Benutzername');
    int_p('rpasswort', 'Passwort');
}

    function zeige_gra(src, breite, hoehe) {
	 var fhoehe=getheight(document.getElementById("verw"));
	 if(Fensterhoehe() > fhoehe){
	   fhoehe=Fensterhoehe(); 
	 }
	 var breitea=breite;
     var topf=0;
     topf=50;
	 topf=topf+getScrollY();
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.left = "50px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("abt").style.height= fhoehe+"px";	  
	  document.getElementById("ac1").src = "image.php?src=" + src + "&w=" + breitea + "&h=" + hoehe;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
      document.getElementById("infoank").innerHTML= '';
	  document.getElementById("infoank").style.width=breite+"px";
    };	

    function zeige_grai(src, breite, hoehe, id) {
	 var fhoehe=getheight(document.getElementById("verw"));
	 if(Fensterhoehe() > fhoehe){
	   fhoehe=Fensterhoehe(); 
	 }
	 var breitea=breite;
     var topf=0;
     topf=50;
	 topf=topf+getScrollY();
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("abr").style.left = "50px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("abt").style.height= fhoehe+"px";	  
	  document.getElementById("ac1").src = "image.php?src=" + src + "&w=" + breitea + "&h=" + hoehe;
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
	  document.getElementById("infoank").style.width=breite+"px";
	  document.getElementById("infoank").style.height= '14px';
	  document.getElementById("infoank").style.overflow='hidden';
      document.getElementById("infoank").innerHTML='<div id="binfo"><img src="picture/bild_info.gif" alt="Bildinformationen anzeigen" title="Bildinformationen anzeigen" onclick="zeige_bildinfo('+id+')"></div>';
    };	
    function zeige_bildinfo(id){
	  document.getElementById("infoank").style.height= 'auto';
	  document.getElementById("infoank").innerHTML='<div id="binfo"><img src="picture/bild_info_z.gif" alt="Bildinformationen schließen" title="Bildinformationen schließen" onclick="close_bildinfo('+id+')"></div><div id="info_d">'+infotext[id]+'</div>';	
	}
    function close_bildinfo(id){
	  document.getElementById("infoank").style.height= '14px';
	  document.getElementById("infoank").style.overflow='hidden';
      document.getElementById("infoank").innerHTML='<div id="binfo"><img src="picture/bild_info.gif" alt="Bildinformationen anzeigen" title="Bildinformationen anzeigen" onclick="zeige_bildinfo('+id+')"></div>';
	}
function zeige_bainfo(id){
      document.getElementById('c_'+id).style.visibility='visible';  
}
function hide_bainfo(id){
      document.getElementById('c_'+id).style.visibility='hidden';  
}
function int_bt(id, text){
  if(document.getElementById(id).value==''){
	document.getElementById(id).value=text;
	document.getElementById(id).style.color='#aaaaaa';
  }
}
function int_ft(id, text){
  if(document.getElementById(id).value==text){
	document.getElementById(id).value='';
	document.getElementById(id).style.color='#494949';
  }
}

function int_t(id, text){
  if(document.getElementById(id)){	
    document.getElementById(id).onfocus= function(){int_ft(id, text)};
    document.getElementById(id).onblur = function(){int_bt(id, text)};
	document.getElementById(id).value=text;
	document.getElementById(id).style.color='#aaaaaa';
  }
}

function int_p(id, text){
  if(document.getElementById(id)){	
    document.getElementById(id).onfocus= function(){int_fp(id, text)};
    document.getElementById(id).onblur = function(){int_bp(id, text)};
	document.getElementById(id).value=text;
	document.getElementById(id).style.color='#aaaaaa';
  }
}

function int_bp(id, text){
  if(document.getElementById(id).value==''){
	document.getElementById(id).style.color='#aaaaaa';
  }
}
function int_fp(id, text){
  if(document.getElementById(id).value==text){
	document.getElementById(id).type='password';
	document.getElementById(id).value='';
	document.getElementById(id).style.color='#494949';
  }
}


function init_page(){
    int_t('osuchi', 'Ihr Suchbegriff');
}

  function test_search(){
    return window.external.IsSearchProviderInstalled('http://www.gastrokauf24.de');
  }
  function install_search(){
    window.external.AddSearchProvider('http://www.gastrokauf24.de/gastrokauf24-search.xml');
  }
function opensearchbox(){ 
  if (window.external && ("AddSearchProvider" in window.external)){
    if (!test_search()){
     document.getElementById("searchprovider").className = "linkboxa1";
    }
  }
}

	function fv(breite, hoehe, src) {
     var topf=0;
	 if(hoehe == 0){
	   hoehe= Fensterhoehe()-20;
	 }
	 var mleft=Math.round((Fensterbreite()-breite)/2);
	 topf=Math.round((Fensterhoehe()-hoehe - 15)/2);
     if(topf < 10){
       topf=10;
     }
  	  topf=topf+getScrollY();
  	  document.getElementById("abt").style.height=getheight(document.getElementById("rahmen"))+'px';
	  document.getElementById("ac1").src = "flash_video.php?src=" + src + "&w=" + breite + "&h=" + hoehe;
	  document.getElementById("ekopf").style.width=breite+"px";
	  document.getElementById("abr").style.top = topf+"px";
	  document.getElementById("ab1").style.marginLeft=mleft + "px";
	  document.getElementById("abr").style.visibility="visible";
	  document.getElementById("abt").style.visibility="visible";
	  document.getElementById("ab1").style.visibility="visible";
	  document.getElementById("ab1").style.height=(hoehe+15)+"px";
	  document.getElementById("ab1").style.width=breite+"px";
	  document.getElementById("ac1").style.height=hoehe+"px";
	  document.getElementById("ac1").style.width=breite+"px";
    };	

