//hieronder niets wijzigen 
startingColor = new Array() 
endingColor = new Array() 

//hieronder je eigen plaatjes invullen 
var yourImages = new Array (
'images/assort_button_out.jpg',
'images/assort_button_over.jpg',
'images/dealer_button_out.jpg',
'images/dealer_button_over.jpg',
'images/aboutus_out.jpg',
'images/aboutus_over.jpg',
'images/header_01.jpg',
'images/header_01_1.jpg',
'images/header_01_2.jpg',
'images/header_01_3.jpg',
'images/header_02.jpg',
'images/header_03.jpg',
'images/header_bus_04.jpg',
'images/header_bus_light_04.jpg',
'images/header_golf_04.jpg',
'images/header_golf_light_04.jpg',
'images/menu_aanbieding_out.jpg',
'images/menu_aanbieding_over.jpg',
'images/menu_contact_out.jpg',
'images/menu_contact_over.jpg',
'images/menu_gallery_out.jpg',
'images/menu_gallery_over.jpg',
'images/menu_gastboek_out.jpg',
'images/menu_gastboek_over.jpg',
'images/menu_home_out.jpg',
'images/menu_home_over.jpg',
'images/menu_nieuws_out.jpg',
'images/menu_nieuws_over.jpg',
'images/assortiment_1.jpg',
'images/assortiment_2.jpg',
'images/assortiment_3.jpg',
'images/assortiment_4.jpg',
'images/assortiment_5.jpg',
'images/assortiment_6.jpg',
'images/assortiment_7.jpg',
'images/assortiment_8.jpg',
'images/assortiment_9.jpg',
'images/assortiment_10.jpg',
'images/assortiment_11.jpg',
'images/assortiment_12.jpg',
'images/assortiment_13.jpg',
'images/assortiment_14.jpg',
'images/exclusive_out.jpg',
'images/exclusive_over.jpg',
'images/oldskool_out.jpg',
'images/oldskool_over.jpg')

var locationAfterPreload = "index.php?menu=home" //de pagina die wordt geopend na het preloaden 
var preloadbarWidth = 200 //de lengte van de preloader 
var preloadbarHeight = 15 //de hoogte van de preloader 
var backgroundOfGradient = "#000000" //de kleur van de balk als hij 'opvult' 

//de kleur waarmee de preloader mee begint - vul de 1e, 23 en 3e kleur in van de kleurcode 
startingColor[0] = "F" 
startingColor[1] = "F" 
startingColor[2] = "6" 

//de kleur waar de preloader mee eindigd - vul de 1e, 23 en 3e kleur in van de kleurcode 
endingColor[0] = "6" 
endingColor[1] = "0" 
endingColor[2] = "0" 



//foutafhandeling: 
var gap = 3 //aantal malen herhalen bij fouten - 2 is de minimaal vereist! 


//hieronder niets wijzigen 
if (!document.all) location.replace(locationAfterPreload) 
var a = 10, b = 11, c = 12, d = 13, e = 14, f=15, i, j, ones = new Array(), sixteens = new Array(), diff = new Array(); 
var convert = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"), imgLen = yourImages.length; 
var loaded = new Array(), preImages = new Array(), currCount = 0, pending = 0, h = 0, hilite = new Array(), cover = new Array(); 
var num = Math.floor(preloadbarWidth/gap); 
for (i = 0; i < 3; i++) { 
   startingColor[i] = startingColor[i].toLowerCase(); 
   endingColor[i] = endingColor[i].toLowerCase(); 
   startingColor[i] = eval(startingColor[i]); 
   endingColor[i] = eval(endingColor[i]); 
   diff[i] = (endingColor[i]-startingColor[i])/num; 
   ones[i] = Math.floor(diff[i]); 
   sixteens[i] = Math.round((diff[i] - ones[i])*15); 
} 
endingColor[0] = 0; 
endingColor[1] = 0; 
endingColor[2] = 0; 
i = 0, j = 0; 
while (i <= num) { 
   hilite[i] = "#"; 
   while (j < 3) { 
      hilite[i] += convert[startingColor[j]]; 
      hilite[i] += convert[endingColor[j]]; 
      startingColor[j] += ones[j]; 
      endingColor[j] += sixteens[j]; 
      if (endingColor[j] > 15) { 
         endingColor[j] -= 15; 
         startingColor[j]++; 
      } 
      j++; 
   } 
   j = 0; 
   i++; 
} 
function loadImages() { 
   for (i = 0; i < imgLen; i++) { 
      preImages[i] = new Image(); 
      preImages[i].src = yourImages[i]; 
      loaded[i] = 0; 
      cover[i] = Math.floor(num/imgLen)*(i+1) 
   } 
   cover[cover.length-1] += num%imgLen 
   checkLoad(); 
} 
function checkLoad() { 
   if (pending) { changeto(); return } 
   if (currCount == imgLen) { location.replace(locationAfterPreload); return } 
   for (i = 0; i < imgLen; i++) { 
      if (!loaded[i] && preImages[i].complete) { 
         loaded[i] = 1; pending++; currCount++; 
         checkLoad(); 
         return; 
      } 
   } 
   setTimeout("checkLoad()",10); 
} 
function changeto() { 
   if (h+1 > cover[currCount-1]) { 
      var percent = Math.round(100/imgLen)*currCount; 
      if (percent > 100) while (percent != 100) percent--; 
      if (currCount == imgLen && percent < 100) percent = 100; 
      defaultStatus = "Loaded " + currCount + " out of " + imgLen + " images [" + percent + "%]."; 
      pending--; 
      checkLoad(); 
      return; 
   } 
   eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]");; 
   h++; 
   setTimeout("changeto()",1); 
} 
defaultStatus = "Loaded 0 out of " + imgLen + " images [0%]." 
