      var rollImages = new Array();

      function rollOver(img)
      {
        document.images[img].src = rollImages[img]['over'].src;
      }
      function rollOut(img)
      {
        document.images[img].src = rollImages[img]['out'].src;
      }

      function setActiveStyleSheet(title) 
      {
        var i, a, main;
        for(i=0; (a = document.getElementsByTagName('link')[i]); i++) 
        {
          if(a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title')) 
          {
            a.disabled = true;
            if(a.getAttribute('title') == title)
            {
              a.disabled = false;
            }
          }
        }
      }
      
      function getActiveStyleSheet() 
      {
        var i, a;
        for(i=0; (a = document.getElementsByTagName('link')[i]); i++) 
        {
          if(a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title') && !a.disabled) return a.getAttribute('title');
        }
        return null;
      }
      
      function getPreferredStyleSheet() 
      {
        var i, a;
        for(i=0; (a = document.getElementsByTagName('link')[i]); i++) 
        {
          if(a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('rel').indexOf('alt') == -1 && a.getAttribute('title')) 
          {
            return a.getAttribute('title');
          }
        }
        return null;
      }
      
      function createCookie(name,value,days) 
      {
        if(days) 
        {
          var date = new Date();
          date.setTime(date.getTime()+(days*24*60*60*1000));
          var expires = '; expires='+date.toGMTString();
        }
        else 
        {
          expires = '';
        }
        document.cookie = name+'='+value+expires+'; path=/';
      }
      
      function readCookie(name) 
      {
        var nameEQ = name + '=';
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) 
        {
          var c = ca[i];
          while (c.charAt(0)==' ') c = c.substring(1,c.length);
          if (c.indexOf(nameEQ) == 0) 
          {
            return c.substring(nameEQ.length,c.length);
          }
        }
        return null;
      }
      
      window.onload = function(e) 
      {
        var cookie = readCookie('style');
        var title = cookie ? cookie : getPreferredStyleSheet();
        setActiveStyleSheet(title); 
      }
      
      window.onunload = function(e) 
      {
        var title = getActiveStyleSheet();
        createCookie('style', title, 365);
      }
      
      var cookie = readCookie('style');
      var title = cookie ? cookie : getPreferredStyleSheet();
      setActiveStyleSheet(title);
      
  function setMailAdress()
  {
    document.forms.the_form.Mto.value = document.forms.the_form.mailaddress.options[document.forms.the_form.mailaddress.options.selectedIndex].value;
    document.forms.the_form.subject.value = document.forms.the_form.mailaddress.options[document.forms.the_form.mailaddress.options.selectedIndex].text;
  }

  function chkFormular()
  {
    if(document.forms.the_form.mailAdress.value == '')
    {
      alert('Bitte wählen Sie einen Themenbereich aus!');
      document.forms.the_form.mailAdress.focus();
      return false;
    }
    if(document.forms.the_form.kundenmail.value== '')
    {
      alert('Bitte geben Sie uns Ihre E-mail Adresse bekannt!');
      document.forms.the_form.kundenmail.focus();
      return false;
    }
  }

  function startExtendedSearch()
  {
    if(!document.forms.the_form_7.search_exp.value)
    {
      alert('Bitte geben Sie einen Suchbegriff an!');
    }
    else
    {
//      document.forms.the_form_7.search_exp.value = document.forms.the_form.search_exp_extended.value;
//      document.forms.the_form_7.thema = 'suchen'; 
      document.forms.the_form_7.submit();
    }
  }
  
  function startRegularSearch()
  {
    if(!document.forms.the_form_5.search_exp_regular.value)
    {
      alert('Bitte geben Sie einen Suchbegriff an!');
    }
    else
    {
      document.forms.the_form_5.search_exp.value = document.forms.the_form_5.search_exp_regular.value;
      document.forms.the_form_5.area = 'searchresults'; 
      document.forms.the_form_5.submit();
    }
  }
      
  function startSearch()
  {
    document.forms.the_form.action = './suche1.php';
    document.forms.the_form.area = 'searchresults'; 
    document.forms.the_form.submit();
  }
      
  function searchOutlet(type)
  {
    if(type == 'exact' && document.forms.the_form.outlet_zip.value == '')
    {
      alert('Sie haben keine Postleitzahl angegeben');
    }
    else
    {
      document.forms.the_form.outlet_search.value = type;
      document.forms.the_form.submit();
    }
  }
  
  function searchOutletExact()
  {
    if(document.forms.the_form_2.outlet_zip.value == '')
    {
      alert('Sie haben keine Postleitzahl angegeben');
    }
    else
    {
      document.forms.the_form_2.outlet_search.value = 'exact';
      document.forms.the_form_2.submit();
    }
  }
  
  function searchOutletRange()
  {
    document.forms.the_form_3.outlet_search.value = 'range';
    document.forms.the_form_3.submit();
  }
  
  function switchLanguage()
  {
    document.location.href = './index.php?kategorie=sprachen&thema=' + document.forms.the_form_10.language.options[document.forms.the_form_10.language.selectedIndex].value;
  }
  
  function switchQuicklink(value)
  {
    document.location.href = value;
  }
  
  
  function printPage()
  {
    setActiveStyleSheet('print');
    window.print();
  }
    
/* window resizer */      
/*
      function openImagePopup(imagename)
      {
        MM_openBrWindow('popup.php?image='+imagename, 'popup', 'width=900,height=900,scrollbars=no,resizeable=yes');
      }
*/
      function openImagePopup(image)
      {
        MM_openBrWindow('index.php?kategorie=popup&thema=bild&image='+image, 'popup', 'width=900,height=900,scrollbars=no,resizeable=yes');
      }      
      
      function openJobPopup(job_id)
      {
        MM_openBrWindow('index.php?kategorie=popup&thema=job&job_id='+job_id, 'popup', 'width=700,height=900,scrollbars=yes,resizeable=yes');
      }

/*
      function openStoryPopup(story_id)
      {
        MM_openBrWindow('popup.php?story='+story_id, 'popup', 'width=700,height=900,scrollbars=no,resizeable=yes');
      }

      function openFormPopup(form)
      {
        MM_openBrWindow('https://www.orf-gis.at/Formulare/?Form='+form, 'GISAnmeldung', 'width=773,height=550');
      }
*/
      
      function openWindow(call, name, features)
      {
        window.open(call, name, features);
      }
      
      function MM_openBrWindow(theURL,winName,features) 
      { //v2.0
        window.open(theURL,winName,features);
      }
      
      var arrTemp=self.location.href.split("?");
      var picUrl = (arrTemp.length>0) ? arrTemp[1] : "";
      var NS = (navigator.appName=="Netscape") ? true:false;

      function FitPic() 
      {
        var w, h;
        iWidth = (NS)?window.innerWidth:document.body.clientWidth;
        iHeight = (NS)?window.innerHeight:document.body.clientHeight;
        iWidth = document.images[0].width - iWidth + 30;
        iHeight = document.images[0].height - iHeight + 50;
        window.resizeBy(iWidth, iHeight);
        self.focus();
     }
     
     function newWin(mypage,myname,w,h,features) 
     {
    if(screen.width){
    var winl = (screen.width-w)/8;
    var wint = (screen.height-h)/3;
    }else{winl = 0;wint =0;}
    if (winl < 0) winl = 0;
    if (wint < 0) wint = 0;
    var settings = 'height=' + h + ',';
    settings += 'width=' + w + ',';
    settings += 'top=' + wint + ',';
    settings += 'left=' + winl + ',';
    settings += features;
    win = window.open(mypage,myname,settings);
    win.window.focus();
  }

function newWinScr(mypage,myname,w,h,features) {
  if(screen.width){
  var winl = (screen.width-w)/8;
  var wint = (screen.height-h)/3;
  }else{winl = 0;wint =0;}
  if (winl < 0) winl = 0;
  if (wint < 0) wint = 0;
  var settings = 'height=' + h + ',';
  settings += 'width=' + w + ',';
  settings += 'top=' + wint + ',';
  settings += 'left=' + winl + ',';
  settings += 'scrollbars=yes' + ',';
  settings += 'status=yes';
  settings += features;
  win = window.open(mypage,myname,settings);
  win.window.focus();
}

function submitContact()
{
  if(document.forms.the_form.email.value == '')
  {
    alert('Bitte geben Sie eine E-Mail Adresse an!');
  }
  else
  {
    document.forms.the_form.submit();
  }
}
