var lastID = " "; //Globale Variable

function leere_textfeld(name)
{
    document.getElementById(name).value = "";
}


  function popup(seite) // AGB's in Kaufabwicklung
  {
   	window.open(seite, "xyz", "left=20,top=100, resizable=no, scrollbars=yes, dependent=1");
  }

function text_short_long(text_div_hoehe)
{

  bildPfeilAuf = new Image(); 
  bildPfeilAuf.src = 'img_general/btn_weiterlesen.png';

  bildPfeilZu = new Image(); 
  bildPfeilZu.src = 'img_general/btn_schliessen.png';

 if(document.getElementById('text').style.height == text_div_hoehe)
   {
     document.getElementById('text').style.height = '';
     document.images['btn_short_long'].src = bildPfeilZu.src;  
   }
   else
   {
     document.getElementById('text').style.height = text_div_hoehe;
     document.images['btn_short_long'].src = bildPfeilAuf.src;  
   }
}

/* Start Auf Detailseite KONI genutzt ! */		
function artikelbeschreibung_close_short()
{ //function
     document.getElementById('artikelbeschreibung_kurz').style.display = 'none';
     document.getElementById('artikelbeschreibung_kmpl').style.display = 'block';
} // function
function artikelbeschreibung_close_long()
{ //function
     document.getElementById('artikelbeschreibung_kurz').style.display = 'block';
     document.getElementById('artikelbeschreibung_kmpl').style.display = 'none';
} // function
/* Ende Auf Detailseite KONI genutzt ! */

function detailseite_bestellen(zaehler)
{ //function
  bestelldiv = "bestellen"+zaehler;
		detaildiv = "Detail_Daten_erweitert"+zaehler;

 if (document.getElementById(bestelldiv).style.display == 'none') 
    {
     document.getElementById(bestelldiv).style.display = 'block';
     document.getElementById(detaildiv).style.display = 'none';
    }
    else
    {
     document.getElementById(bestelldiv).style.display = 'none';
    }
} // function

function detailseite_zeige_detail(zaehler)
{ //function
  bestelldiv = "bestellen"+zaehler;
		detaildiv = "Detail_Daten_erweitert"+zaehler;

 if (document.getElementById(detaildiv).style.display == 'none') 
    {
     document.getElementById(detaildiv).style.display = 'block';
     document.getElementById(bestelldiv).style.display = 'none';
    }
    else
    {
     document.getElementById(detaildiv).style.display = 'none';
    }
} // function

function um_zeigen(id)
{ //function
   if (document.getElementById(id).style.display == 'none') 
    {
     document.getElementById(id).style.display = 'block';
    }
    else
    {
     document.getElementById(id).style.display = 'none';
    }
} // function


function wechselDich(id)
{ //function
   if (document.getElementById(id).style.display == 'none') 
    {
     document.getElementById(id).style.display = 'block';
    }
    else
    {
     document.getElementById(id).style.display = 'none';
    }
} // function

function farbwechsel(id,design)
  {
  document.getElementById(id).className = design;
  document.getElementById(id).style.cursor = "pointer";
  }
function show_info(id)
{ //function
   if (document.getElementById(id).style.display == 'none') 
    {
     document.getElementById(id).style.display = 'block';
    }
    else
    {
     document.getElementById(id).style.display = 'none';
    }
} //function

//===
function zeige_tophit(id,letztes)
  { // function
  		document.getElementById('div_start').style.display = 'none'
		  //document.getElementById(id).style.cursor = "pointer";
    if (document.getElementById(id).style.display == 'none') 
     { //if
      lastID = letztes; 
      document.getElementById(id).style.display = 'block';
      if (lastID != " " && lastID != id)
	        { //if2
		         document.getElementById(lastID).style.display = 'none';
		       }
	     lastID = id;
     }
     else // Falls geöffntet, wird geschlossen
     {
      document.getElementById(id).style.display = 'none';
     } 
  }  // function

//===

function Aufklappen(id,letztes,anker)
  { // function
    if (document.getElementById(id).style.display == 'none') 
     { //if1
      lastID = letztes; 
						//location.href = "#home";
						//location.href = "#"+anker;
      document.getElementById(id).style.display = 'block';
      if (lastID != " " && lastID != id)
	        { //if2
		         document.getElementById(lastID).style.display = 'none';
		       }
	     lastID = id;
     }
     else // Falls geöffntet, wird geschlossen
     {
      document.getElementById(id).style.display = 'none';
     } 
  }  // function
		
function anzeigen_div_iFrame(anzeigescript)
 {
        document.getElementById("DIVallg").style.height = Hoehe-100;
								links = (Weite/2)-699;
        document.getElementById("DIVallg").style.left = links;
        document.getElementById("iFrameallg").style.height = Hoehe-175;
        document.getElementById("DIVallg").style.visibility = 'visible';
        document.getElementById("iFrameallg").src = anzeigescript;
 }

function schliessen_div_iFrame()
 {
        top.document.getElementById("iFrameallg").src = "";
        top.document.getElementById("DIVallg").style.visibility = 'hidden';
 }

function jsLink_einZiel(verweis)
  {
  verweis_url = verweis; //+"?para="+para;
//  top.location.href = verweis_url;
  self.location.href = verweis_url;
  }

function jsLink_einZiel_parent(verweis)
  {
  verweis_url = verweis; //+"?para="+para;
//  top.location.href = verweis_url;
  parent.location.href = verweis_url;
  }

function Fenster_ueberwachen ()
{ // function
/* Überwachung von "Netscape & Co" initialisieren */
if (!window.Weite && window.innerWidth) 
 {
   window.onresize = neuAufbau;
   Weite = Fensterweite();
   Hoehe = Fensterhoehe();
   AbzugHead = 30;
   AbzugFeet = 30;
   Korrektur = 0;
   HoeheInhalt = (Hoehe-(AbzugHead+AbzugFeet+Korrektur)); //- (HoeheBannerOben+HoeheFusszeile)-Browserkorrektur

 }

/* Überwachung von Internet Explorer initialisieren */
if (!window.Weite && document.body && document.body.clientWidth)
 {
   window.onresize = neuAufbau;
   Weite = Fensterweite();
   Hoehe = Fensterhoehe();
   AbzugHead = 30;
   AbzugFeet = 30;
   Korrektur = 4;
   HoeheInhalt = (Hoehe-(AbzugHead+AbzugFeet+Korrektur)); //- (HoeheBannerOben+HoeheFusszeile)-Browserkorrektur
 }
} // function

function Fensterweite () 
{ //function
  if (window.innerWidth) {
    return window.innerWidth;
  } else if (document.body && document.body.clientWidth) {
    return document.body.clientWidth;
  } else {
    return 0;
  }
} // function

function Fensterhoehe () 
{ //function
  if (window.innerHeight) 
     {
       return window.innerHeight;
     } else if (document.body && document.body.clientHeight) {
    return document.body.clientHeight;
  } else {
    return 0;
  }
} // function
//------------------------------------------------------------------------------------------
function neuAufbau () 
// Muss direkt nach <body> notiert werden 
{ // function
  if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
    location.href = location.href;
} // function

