var version = false;

function browser () {
   this.name         = navigator.appName.toLowerCase ();
   this.majversion   = parseInt ( navigator.appVersion.toLowerCase () );
   this.minversion   =
      parseInt ( ( 
            parseFloat ( 
               navigator.appVersion.toLowerCase () 
            ) - this.majversion 
         )
         * 10
      );
   this.agent     = navigator.userAgent.toLowerCase ();

   this.dom       = ( document.getElementById );
   
   this.opera     = ( this.agent.indexOf ( 'opera' ) >= 0 );
   this.IE        = ( this.agent.indexOf ( 'msie' ) >= 0 && !this.opera );
   this.NS        = ( this.agent.indexOf ( 'netscape' ) >= 0 && !this.opera );
   this.NS4       = ( this.majversion >= 4 );
   this.NS6       = ( this.majversion >= 5 );
   this.IE4       = ( this.majversion >= 4 );
   this.IE5       = ( this.majversion >= 5 );
   this.IE55      = ( this.IE5 && this.minversion >= 5 );
   this.IE6       = ( this.majversion >= 6 );
}

var is = new browser ();
var version = ( is.NS4 || is.IE4 || is.opera );
var button = [];

if ( version ) {
   for ( var t = 1; t <= 18; t ++ ) {
      button [ t ] = new Image ();   
   }

      button [ 1 ] .src = "./gfx/home-1.jpg";
      button [ 2 ] .src = "./gfx/home-2.jpg";
      button [ 3 ] .src = "./gfx/activiteit-1.jpg";
      button [ 4 ] .src = "./gfx/activiteit-2.jpg";
      button [ 5 ] .src = "./gfx/visie-1.jpg";
      button [ 6 ] .src = "./gfx/visie-2.jpg";
      button [ 7 ] .src = "./gfx/ondersteuning-1.jpg";
      button [ 8 ] .src = "./gfx/ondersteuning-2.jpg";
      button [ 9 ] .src = "./gfx/sponsoring-1.jpg";
      button [ 10 ] .src = "./gfx/sponsoring-2.jpg";
      button [ 11 ] .src = "./gfx/contact-1.jpg";
      button [ 12 ] .src = "./gfx/contact-2.jpg";
      button [ 13 ] .src = "./gfx/nieuws-1.jpg";
      button [ 14 ] .src = "./gfx/nieuws-2.jpg";
      button [ 15 ] .src = "./gfx/depaarden-1.jpg";
      button [ 16 ] .src = "./gfx/depaarden-2.jpg";
      button [ 17 ] .src = "./gfx/gastenboek-1.jpg";
      button [ 18 ] .src = "./gfx/gastenboek-2.jpg";
   }

function display ( img, num ) { 
   if ( version ) 
      document.images [ img ].src = button [ num ].src;
}

function popUp (fileName, popUpWidth, popUpHeight) {
   margeLeft = (screen.width - popUpWidth) / 2;
   margeTop = (screen.height - popUpHeight) / 2;
   
   parameterString = "width=" + popUpWidth + ",height=" + popUpHeight + ",left=" + margeLeft + ",top=" + margeTop + ",scrollbars=no";
   popWindow = window.open(fileName, "_blank", parameterString);
   popWindow.focus();
}
