/**
 *
 * Copyright (c) 2002 CRS Unternehmensberatung GmbH
 *
 */

window.onerror=null;

    email_out       = new Image();
    email_out.src   = "images/gib-email.gif";
    email_over      = new Image();
    email_over.src  = "images/gib-email-over.gif";

    expose_out       = new Image();
    expose_out.src   = "images/exposel.jpg";
    expose_over      = new Image();
    expose_over.src  = "images/exposer.jpg";

    pfeil_over        = new Array();
    pfeil_over[0]     = new Image();
    pfeil_over[0].src = "images/pfeil-9r.gif";
    pfeil_over[1]     = new Image();
    pfeil_over[1].src = "images/pfeil-7r.gif";
    pfeil_over[2]     = new Image();
    pfeil_over[2].src = "images/pfeil-6r.gif";
    pfeil_over[3]     = new Image();
    pfeil_over[3].src = "images/pfeil-8r.gif";

    pfeil_out        = new Array();
    pfeil_out[0]     = new Image();
    pfeil_out[0].src = "images/pfeil-9.gif";
    pfeil_out[1]     = new Image();
    pfeil_out[1].src = "images/pfeil-7.gif";
    pfeil_out[2]     = new Image();
    pfeil_out[2].src = "images/pfeil-6.gif";
    pfeil_out[3]     = new Image();
    pfeil_out[3].src = "images/pfeil-8.gif";

    help_out            = new Image();
    help_out.src        = "images/fragezeichen.gif";
    help_over           = new Image();
    help_over.src       = "images/fragezeichen1.gif";

    out            = new Image();
    out.src        = "images/logo-gib-41.gif";
    over           = new Image();
    over.src       = "images/logo-gib-42.gif";
    click          = new Image();
    click.src      = "images/logo-gib-43.gif";

    out_100         = new Image();
    out_100.src     = "images/button-100-out.gif";
    over_100        = new Image();
    over_100.src    = "images/button-100-over.gif";
    click_100       = new Image();
    click_100.src   = "images/button-100-click.gif";
    over_106        = new Image();
    over_106.src    = "images/button-100-over-a.gif";
    out_30         = new Image();
    out_30.src     = "images/button-30-out.gif";
    over_30        = new Image();
    over_30.src    = "images/button-ksort.gif";
    click_30       = new Image();
    click_30.src   = "images/button-kclick.gif";

    out_150        = new Image();
    out_150.src    = "images/button-150-out.gif";
    over_150       = new Image();
    over_150.src   = "images/button-gib-over.gif";
    over_cls       = new Image();
    over_cls.src   = "images/button-gib-over.gif";
    click_150      = new Image();
    click_150.src  = "images/button-gib-click.gif";

    activeId        = new String();
    activeId        = "M150B03";
    active_100      = new String();
    active_100      = "M100S01";
    activeSrt       = new String();
    activeSrt       = "M030B30";
    active_106      = new String();
    active_106      = " ";

function init_active_button(Id, Srt)   // Id = Objektauswahl, Srt=Sortierung
{
activeId        = Id;
activeSrt       = Srt;
}
function mouse_001(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks101f00.document.getElementById(id);
  switch(type) {
         case(0): // over
                  z.src    = over.src;
                  z.width  = over.width;
                  z.height = over.height;
                break;
         case(1): // out
                  z.src    = out.src;
                  z.width  = out.width;
                  z.height = out.height;
               break;
                 }  // end of switch
}   // end of function

function mouse_cls(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks102f00.document.getElementById(id);
  switch(type) {
         case(0): // over
                  z.src    = over_cls.src;
                  z.width  = over_cls.width;
                  z.height = over_cls.height;
                break;
         case(1): // out
                  z.src    = out_150.src;
                  z.width  = out_150.width;
                  z.height = out_150.height;
               break;
         case(2): // click
                  Close();
                  break;
                 }  // end of switch
}   // end of function

function mouse_hlp(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks101f00.document.getElementById(id);
  switch(type) {
         case(0): // over
                  z.src    = help_over.src;
                  z.width  = help_over.width;
                  z.height = help_over.height;
                break;
         case(1): // out
                  z.src    = help_out.src;
                  z.width  = help_out.width;
                  z.height = help_out.height;
               break;
         case(2): // click
                  z.src    = help_out.src;
                  z.width  = help_out.width;
                  z.height = help_out.height;
               var URL = "ks991f00.html";
  MeinFenster =
  window.open(URL, "Help", "width=800,height=500,left=180,top=160,resizable=yes, dependent=yes,scrollbars=yes,toolbar=no,menubar=no, ");
  MeinFenster.focus();
                  break;
                 }  // end of switch
}   // end of function


function mouse_hlp2(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ var URL = "ks991f00.html";
  MeinFenster =
  window.open(URL, "Help", "width=800,height=500,left=180,top=160,resizable=yes, dependent=yes,scrollbars=yes,toolbar=no,menubar=no, ");
  MeinFenster.focus();
}   // end of function

function mouse_015(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  id = "I" + id.substr(1,4);
  var idx = id.substr(4,1);
  z = parent.ks105f00.document.getElementById(id);
  switch(type) {
         case(0): // over
                 z.src = pfeil_over[idx].src;
                 break;
         case(1): // out
                 z.src = pfeil_out[idx].src;
                 break;
         case(2): // click
                 parent.ks105f00.location.href=URL;
                 break;
           }  // end of switch
}   // end of function

function mouse_016(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks105f00.document.getElementById(id);
  switch(type) {
         case(0): // over
                 z.style.color = "#ff0000";
                 break;
         case(1): // out
                 z.style.color = "#ffffff";
                 break;
         case(2): // click
                 parent.ks105f00.location.href=URL;
                 break;
           }  // end of switch
}   // end of function

function mouse_018(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks105f00.document.getElementById(id);
  switch(type) {
         case(0): // over
                 z.style.color = "#ff0000";
                 break;
         case(1): // out
                 z.style.color = "#ffffff";
                 break;
         case(2): // click
                 parent.ks105f00.location.href=URL;
                 break;
           }  // end of switch
}   // end of function

function mouse_70(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ var id = new String();
  id = img.id;
  z = parent.ks101f00.document.getElementById(id);
  switch(type) {
         case(0): // over
              if (id != activeId)           {
                   z.src    = over_100.src;
                   z.width  = over_100.width;
                   z.height = over_100.height; }
                break;
         case(1): // out
               if (!(id == activeId))           {
                   z.src    = out_100.src;
                   z.width  = out_100.width;
                   z.height = out_100.height; }
                break;
         case(2): // click
               parent.frames[2].location.href=URL;
               var old = activeId;
               z.className ="b0"
               z.src    = click_100.src;
               z.width  = click_100.width;
               z.height = click_100.height;
               activeId = id;
               if (id != old) { out_all(old); }
               break;
           }  // end of switch
}   // end of function

function mouse_150(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ var id = new String();
  id = img.id;
  z = parent.ks102f00.document.getElementById(id);
  switch(type) {
         case(0): // over
              if (id != activeId)           {
                   z.src    = over_150.src;
                   z.width  = over_150.width;
                   z.height = over_150.height; }
                break;
         case(1): // out
               if (!(id == activeId))           {
                   z.src    = out_150.src;
                   z.width  = out_150.width;
                   z.height = out_150.height; }
                break;
         case(2): // click
               getparm(URL);
               var old = activeId;
               z.className ="b0"
               z.src    = click_150.src;
               z.width  = click_150.width;
               z.height = click_150.height;
               activeId = id;
               if (id != old) { out_all(old); }
               break;
           }  // end of switch
}   // end of function


function mouse_100(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks104f00.document.getElementById(id);
  switch(type) {
         case(0): // over
              if (id != active_100)           {
                  z.src    = over_100.src;
                  z.width  = over_100.width;
                  z.height = over_100.height; }
              break;
         case(1): // out
               if (id != active_100)           {
                   z.src    = out_100.src;
                   z.width  = out_100.width;
                   z.height = out_100.height; }
                break;
         case(2): // click
//               alert(parent.ks105f00.document.im034t00.O_typ.value);
               if (id != active_100)           {
               z.className ="b0"
               z.src    = click_100.src;
               z.width  = click_100.width;
               z.height = click_100.height;
               var old = active_100;
               z = parent.ks104f00.document.getElementById(old);
               z.src    = out_100.src;
               z.width  = out_100.width;
               z.height = out_100.height;
               old = active_100.substr(4,3);
               z = parent.ks105f00.document.getElementById(old).style;
               z.visibility = "hidden";
               active_100 = id;
               old = id.substr(4,3);
               z = parent.ks105f00.document.getElementById(old).style;
               z.visibility = "visible";
               parent.ks105f00.document.onmousedown = hide_106; }
               else { // Click auf den aktiven Landkreis öffnet Top-Down-Menue
               old = id.substr(4,3);
               z = parent.ks105f00.document.getElementById(old).style;
               z.visibility = "visible";
               parent.ks105f00.document.onmousedown = hide_106; }
               break;
           }  // end of switch
}   // end of function


function hide_106()
 { if (parent.ks105f00.event.srcElement.id.substr(0,4) != "M106")
   {
   id = active_100.substr(4,3);
   z = parent.ks105f00.document.getElementById(id).style;
   z.visibility = "hidden";
   document.onmousedown = null;
 }
}
function coords_3(x,y)
 {  // x, y, width, height werden von init_mouse() eingefangen/übergeben
    // coords steuert die Cursor-Verfolgung
    if (parent.ks105f00.document.getElementById('S01'))
    parent.ks105f00.document.getElementById('S01').style.top  = y;
 if (parent.ks105f00.document.getElementById('S02'))
    parent.ks105f00.document.getElementById('S02').style.top  = y;
 if (parent.ks105f00.document.getElementById('S03'))
    parent.ks105f00.document.getElementById('S03').style.top  = y;
 if (parent.ks105f00.document.getElementById('S04'))
    parent.ks105f00.document.getElementById('S04').style.top  = y;
 if (parent.ks105f00.document.getElementById('S05'))
    parent.ks105f00.document.getElementById('S05').style.top  = y;
 }
function mouse_106(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks105f00.document.getElementById(id);
  switch(type) {
         case(0): // over
              if (id != active_106)            {
                   z.src    = over_106.src;
                   z.width  = over_106.width;
                   z.height = over_106.height;  }
              break;
         case(1): // out
               if (id != active_106)           {
                   z.src    = out_100.src;
                   z.width  = out_100.width;
                   z.height = out_100.height; }
                break;
         case(2): // click
//             parent.frames[2].location.href=URL;
               var old = active_106;
               z.src    = click_100.src;
               z.width  = click_100.width;
               z.height = click_100.height;
               active_106 = id;
               if (old != " ")           {
                   z = parent.ks105f00.document.getElementById(old);

                   z.src    = out_100.src;
                   z.width  = out_100.width;
                   z.height = out_100.height; }
               break;
           }  // end of switch
}   // end of function

function mouse_030(img, type, URL)   // obj = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks102f00.document.getElementById(id);
  switch(type) {
         case(0): // over
              if (id != activeSrt)           {
                  z.src    = over_30.src;
                  z.width  = over_30.width;
                  z.height = over_30.height; }
              break;
         case(1): // out
               if (id != activeSrt)           {
                   z.src    = out_30.src;
                   z.width  = out_30.width;
                   z.height = out_30.height; }
                break;
         case(2): // click
               getparm(URL);
               var old = activeSrt;
               z.src    = click_30.src;
               z.width  = click_30.width;
               z.height = click_30.height;
               activeSrt = id;
               if (id != old) {
                   z = parent.ks102f00.document.getElementById(old);
                   z.src    = out_30.src;
                   z.width  = out_30.width;
                   z.height = out_30.height; }
               break;
           }  // end of switch
}   // end of function

function getparm(parm)
{
if (parm.indexOf("O_kls") != -1)     // neue Objektklasse
{
var Sort   = parent.ks105f00.document.getElementById("sort").value;
var Ldk    = parent.ks105f00.document.getElementById("Ldk").value;
var Ort    = parent.ks105f00.document.getElementById("Ort").value;
URL = "ib100p00.php4?fkt=get&seite=1&sort=" + Sort + "&Ldk=" + Ldk + "&Ort=" + Ort + "&" + parm;
}
if (parm.indexOf("sort") != -1)     // neue Sortierung
{
var Ldk    = parent.ks105f00.document.getElementById("Ldk").value;
var Ort    = parent.ks105f00.document.getElementById("Ort").value;
var O_kls  = parent.ks105f00.document.getElementById("O_kls").value;
var Zi_anz = parent.ks105f00.document.getElementById("Zi_anz").value;
URL = "ib100p00.php4?fkt=get&seite=1&O_kls=" + O_kls + "&Zi_anz=" + Zi_anz + "&" + parm + "&Ldk=" + Ldk + "&Ort=" + Ort;
}
parent.ks105f00.location.href=URL;
}

function New(URL)
{
  MeinFenster =
  window.open(URL, "Expose", "top=0,left=0,width=1000,height=760,resizable=yes, dependent=yes,scrollbars=yes,toolbar=no,menubar=no, ");
  MeinFenster.focus();
}

function out_all(old)   // Fenster schliessen
{
  if (old.substr(0,5) == "M100B")
   { z = parent.ks104f00.document.getElementById(old);
     z.src    = out_100.src;
     z.width  = out_100.width;
     z.height = out_100.height;  }
 if (old.substr(0,5) == "M150B")
   { z = parent.ks102f00.document.getElementById(old);
     z.src    = out_150.src;
     z.width  = out_150.width;
     z.height = out_150.height;  }
}   // end of function

function Close()   // Fenster schliessen
{
  parent.close();
}   // end of function

function email_004(img, type, URL)   // img = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  id = "M" + id.substr(1,7);
  z = parent.ks105f00.document.getElementById(id);
  switch(type) {
         case(0):                    // onMouseOver()
               z.src    = email_over.src;
               z.width  = email_over.width;
               z.height = email_over.height;
               break;
         case(1):                   // onMouseOut()
               z.src    = email_out.src;
               z.width  = email_out.width;
               z.height = email_out.height;
               break;
         case(2):                   // onClick()
               if (URL.substr(0,2) == "00") kontakt00(URL);
               if (URL.substr(0,2) == "01") kontakt01(URL);
               if (URL.substr(0,2) == "02") kontakt02(URL);
               if (URL.substr(0,2) == "03") kontakt03(URL);
               break;
           }  // end of switch
}   // end of function

function kontakt00(text)
{
text = text.substr(2,text.length);
var URL = "ks008f05.html?" + escape(text);
MeinFenster =  window.open(URL, "Email1", "width=800,height=500,left=180,top=100,resizable=yes, dependent=yes,scrollbars=yes,toolbar=no,menubar=no, ");
               MeinFenster.focus();
}

function kontakt01(text)
{
text = text.substr(2,text.length);
var URL = "ib005f00.html?" + escape(text);
parent.frames[2].location.href=URL;
}

function kontakt02(text)
{
text = text.substr(2,text.length);
var URL = "ib006f00.html?" + escape(text);
parent.frames[2].location.href=URL;
}

function kontakt03(text)
{
text = text.substr(2,text.length);
var URL = "ks008f08.html?" + escape(text);
MeinFenster =  window.open(URL, "Email1", "width=800,height=500,left=180,top=100,resizable=yes, dependent=yes,scrollbars=yes,toolbar=no,menubar=no, ");
               MeinFenster.focus();
}

function kontakt04(text)
{
text = text.substr(2,text.length);
var URL = "ks008f08.html?" + escape(text);
MeinFenster =  window.open(URL, "Email1", "width=800,height=500,left=180,top=100,resizable=yes, dependent=yes,scrollbars=yes,toolbar=no,menubar=no, ");
               MeinFenster.focus();
}

function expose_004(img, type, URL)   // img = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  id = "M" + id.substr(1,7);
  z = parent.ks105f00.document.getElementById(id);
  switch(type) {
         case(0):                    // onMouseOver()
               z.src    = expose_over.src;
               z.width  = expose_over.width;
               z.height = expose_over.height;
               break;
         case(1):                    // onMouseOut()
               z.src    = expose_out.src;
               z.width  = expose_out.width;
               z.height = expose_out.height;
               break;
         case(2):                   // onClick()
               Expose = window.open(URL, "Expose", "width=1000, height=700, left=0, top=0, resizable=yes, dependent=yes, scrollbars=yes, toolbar=no, menubar=no, ");
               Expose.focus();
               break;
           }  // end of switch
}   // end of function

function objekt_004(img, type, URL)   // img = Objekt, URL = Adresse der Frame-Seite
{ id = img.id;
  z = parent.ks105f00.document.getElementById(id);
  switch(type) {
         case(0):                     // onMouseOver()
               z.className = "a3";
               break;
         case(1):                     // onMouseOut()
               z.className = "a2";
               break;
         case(2):                     // onClick()
               Expose = window.open(URL, "Expose", "width=1000, height=700, left=0, top=0, resizable=yes, dependent=yes, scrollbars=yes, toolbar=no, menubar=no, ");
               Expose.focus();
               break;
           }  // end of switch
}   // end of function
