var aryImages = new Array();
  //nog te preloaden
  aryImages[0] = "images/about.gif";
  aryImages[1] = "images/fairs.gif";
  aryImages[2] = "images/catalogue.gif";
  aryImages[3] = "images/colours.gif";
  aryImages[4] = "images/shop.gif";
  aryImages[5] = "images/contact.gif"; 
  aryImages[6] = "images/onetone.gif";
  aryImages[7] = "images/2tone.gif";
  aryImages[8] = "images/combi.gif";

  //reeds geladen
   aryImages[10] = "images/about_on.gif";
  aryImages[11] = "images/fairs_on.gif";
  aryImages[12] = "images/catalogue_on.gif";
  aryImages[13] = "images/colours_on.gif";
  aryImages[14] = "images/shop_on.gif";
  aryImages[15] = "images/contact_on.gif";
  aryImages[16] = "images/onetone_on.gif";
  aryImages[17] = "images/2tone_on.gif";
  aryImages[18] = "images/combi_on.gif";


  for (i=0; i < 9; i++) {
    var preload = new Image();
    preload.src = aryImages[i];
  }



  function swap(imgIndex,name) {
   
    document[name].src = aryImages[imgIndex];

  }



function setHeight(){


    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
         myHeight = document.body.clientHeight;
    }
    
    containerHeight = (myHeight-462)/2;
    if(containerHeight<0){containerHeight=0;}
    
    if (is.dom){ 
            obj = document.getElementById('top').style; 
            obj.height = containerHeight + 'px'; 
            
            
        } else if(is.ie) { 
            obj = document.all['top'].style; 
            obj.height = containerHeight + 'px'; 
            
    } else if(is.ns4) { 
            obj = document.layers['top']; 
            obj.height = containerHeight + 'px'; 
            
    } 

    showDiv('container') ;
}

function positionDiv(id,x)
{
        if (is.dom){ 
            document.getElementById(id).style.left =  x + 'px'; 
        } else if(is.ie) { 
            
            document.all[id].style.left = x + 'px'; 
            
        } else if(is.ns4) {  
            document.layers[id].left = x + 'px'; 
        } 
    
}

function positionDiv2(id,y)
{
        if (is.dom){ 
            document.getElementById(id).style.top =  y + 'px'; 
        } else if(is.ie) { 
            
            document.all[id].style.top = y + 'px'; 
            
        } else if(is.ns4) {  
            document.layers[id].top = y + 'px'; 
        } 
    
}


function showDiv(id)
{

if (is.dom){ 
            document.getElementById(id).style.visibility ='visible'; 
        } else if(is.ie) { 
            document.all[id].style.visibility ='visible'; 
    } else if(is.ns4) { 
            document.layers[id].visibility ='visible';
    } 
    
}


function hideDiv(id)
{

if (is.dom){ 
            document.getElementById(id).style.visibility ='hidden'; 
        } else if(is.ie) { 
            document.all[id].style.visibility ='hidden'; 
    } else if(is.ns4) { 
            document.layers[id].visibility ='hidden';
    } 
    
}


//Deze functie onderzoekt wat de desbetreffende browser ondersteunt.
function Is() { 
this.ie = document.all ? 1 : 0
this.ns4 = document.layers ? 1 : 0
this.dom = document.getElementById ? 1 : 0
} 

var is = new Is();

function writeLayer(layerID,txt){

if(document.getElementById){
document.getElementById(layerID).innerHTML=txt;
}else if(document.all){
document.all[layerID].innerHTML=txt;
}else if(document.layers){
with(document.layers[layerID].document){
open();
write(txt);
close();}}

}


