///////////////////////////////////////////////////
// preload images:
// n[i].gif = normal state
// v[i].gif = on mouseover

/*
n1 = new Image();      n1.src = "/_img/nav/nav1n.gif";
h1 = new Image();      h1.src = "/_img/nav/nav1h.gif";

n2 = new Image();      n2.src = "_img/nav/nav2n.gif";
h2 = new Image();      h2.src = "_img/nav/nav2h.gif";

n3 = new Image();      n3.src = "_img/nav/nav3n.gif";
h3 = new Image();      h3.src = "_img/nav/nav3h.gif";

n4 = new Image();      n4.src = "_img/nav/nav4n.gif";
h4 = new Image();      h4.src = "_img/nav/nav4h.gif";

n5 = new Image();      n5.src = "_img/nav/nav5n.gif";
h5 = new Image();      h5.src = "_img/nav/nav5h.gif";

n6 = new Image();      n6.src = "_img/nav/nav6n.gif";
h6 = new Image();      h6.src = "_img/nav/nav6h.gif";
*/

///////////////////////////////////////////////////
// change images on mouseover
var Bildname,Bildobjekt;
function ImgSwap(Bildname,Bildobjekt)
{
   if (document.images)
   {
      var a = document[Bildname].name;
      document[a].src = Bildobjekt.src;
   }
}
///////////////////////////////////////////////////


///////////////////////////////////////////////////
// Show and hide Popup menue
function showDiv(divId) {
   
   if (document.getElementById){
      if ( divId != "" ) {	    
      document.getElementById(divId).style.visibility = "visible";
       }
   }
   
}

function hideDiv(divId) {
   if (document.getElementById){
   
      if ( divId != "" ) {	
      document.getElementById(divId).style.visibility = "hidden";
       }
   }
}
///////////////////////////////////////////////////



/* Expando Image Script ©2008 John Davenport Scheuer
   as first seen in http://www.dynamicdrive.com/forums/
   username: jscheuer1 - This Notice Must Remain for Legal Use
   */

if (document.images){
 (function(){
  var cos, a = /Apple/.test(navigator.vendor), times = a? 20 : 40, speed = a? 40 : 20;
  var expConIm = function(im){
   im = im || window.event;
   if (!expConIm.r.test (im.className))
    im = im.target || im.srcElement || null;
   if (!im || !expConIm.r.test (im.className))
    return;
   var e = expConIm,
   widthHeight = function(dim){
    return dim[0] * cos + dim[1] + 'px';
   },
   resize = function(){
    cos = (1 - Math.cos((e.ims[i].jump / times) * Math.PI)) / 2;
    im.style.width = widthHeight (e.ims[i].w);
    im.style.height = widthHeight (e.ims[i].h);
    if (e.ims[i].d && times > e.ims[i].jump){
     ++e.ims[i].jump;
     e.ims[i].timer = setTimeout(resize, speed);
    } else if (!e.ims[i].d && e.ims[i].jump > 0){
     --e.ims[i].jump;
     e.ims[i].timer = setTimeout(resize, speed);
    }
   }, d = document.images, i = d.length - 1;
   for (i; i > -1; --i)
    if(d[i] == im) break;
   i = i + im.src;
   if (!e.ims[i]){
    im.title = '';
    e.ims[i] = {im : new Image(), jump : 0};
    e.ims[i].im.onload = function(){
     e.ims[i].w = [e.ims[i].im.width - im.width, im.width];
     e.ims[i].h = [e.ims[i].im.height - im.height, im.height];
     e (im);
    };
    e.ims[i].im.src = im.src;
    return;
    }
   if (e.ims[i].timer) clearTimeout(e.ims[i].timer);
   e.ims[i].d = !e.ims[i].d;
   resize ();
  };

  expConIm.ims = {};

  expConIm.r = new RegExp('\\bexpando\\b');

  if (document.addEventListener){
   document.addEventListener('mouseover', expConIm, false);
   document.addEventListener('mouseout', expConIm, false);
  }
  else if (document.attachEvent){
   document.attachEvent('onmouseover', expConIm);
   document.attachEvent('onmouseout', expConIm);
  }
 })();
}


