window.addEvent('domready', function(){
 if (document.images)
    {
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "http://www.almostmodern.com/assets/1.jpg";
      image_url[1] = "http://www.almostmodern.com/assets/2.jpg";
      image_url[2] = "http://www.almostmodern.com/assets/3.jpg";
      image_url[3] = "http://www.almostmodern.com/assets/4.jpg";
	   image_url[4] = "http://www.almostmodern.com/assets/5.jpg";
      image_url[5] = "http://www.almostmodern.com/assets/6.jpg";
      image_url[6] = "http://www.almostmodern.com/assets/7.jpg";
      image_url[7] = "http://www.almostmodern.com/assets/8.jpg";
	  
	  
	   image_url[8] = "http://www.almostmodern.com/assets/index/1.jpg";
      image_url[9] = "http://www.almostmodern.com/assets/index/2.jpg";
      image_url[10] = "http://www.almostmodern.com/assets/index/3.jpg";
      image_url[11] = "http://www.almostmodern.com/assets/index/4.jpg";
	   image_url[12] = "http://www.almostmodern.com/assets/index/5.jpg";
      image_url[13] = "http://www.almostmodern.com/assets/index/6.jpg";
      image_url[14] = "http://www.almostmodern.com/assets/index/7.jpg";
      image_url[15] = "http://www.almostmodern.com/assets/index/8.jpg";

       var i = 0;
       for(i=0; i<=15; i++) 
         preload_image_object.src = image_url[i];
    }

});


var theImages = new Array() 
theImages[0] = '1.jpg'
theImages[1] = '2.jpg'
theImages[2] = '3.jpg'
theImages[3] = '4.jpg'
theImages[4] = '5.jpg'
theImages[5] = '6.jpg'
theImages[6] = '7.jpg'
theImages[7] = '8.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img class="activeslide" src="http://www.almostmodern.com/assets/'+theImages[whichImage]+'">');
}
function showBeeld(){
document.write('<img class="activeslide" src="http://www.almostmodern.com/assets/index/'+theImages[whichImage]+'">');
}




function MM_changeProp(objId,x,theProp,theValue) { //v9.0
  var obj = null; with (document){ if (getElementById)
  obj = getElementById(objId); }
  if (obj){
    if (theValue == true || theValue == false)
      eval("obj.style."+theProp+"="+theValue);
    else eval("obj.style."+theProp+"='"+theValue+"'");
  }
}
//-->


window.addEvent('domready', function() {
	$('commentform').setStyle('display','none');
	

});


function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}


/*$(document).ready(function(){
      var imgObj = document.getElementById('grey');
            
            if($.browser.msie){
                grayscaleImageIE(imgObj);
            } else {
                imgObj.src = grayscaleImage(imgObj);
            }           
       
    });

    function grayscaleImageIE(imgObj)
    {
        imgObj.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(grayScale=1)';
    }

    function grayscaleImage(imgObj)
    {
        var canvas = 	
        var canvasContext = canvas.getContext('2d');
        
       imgObj2 = new Image;
imgObj2.src = imgObj.src;
var imgW = imgObj2.width;
var imgH = imgObj2.height;
        canvas.width = imgW;
        canvas.height = imgH;
        
        canvasContext.drawImage(imgObj, 0, 0);
        var imgPixels = canvasContext.getImageData(0, 0, imgW, imgH);
        
        for(var y = 0; y < imgPixels.height; y++){
            for(var x = 0; x < imgPixels.width; x++){
                var i = (y * 4) * imgPixels.width + x * 4;
                var avg = (imgPixels.data[i] + imgPixels.data[i + 1] + imgPixels.data[i + 2]) / 3;
                imgPixels.data[i] = avg; 
                imgPixels.data[i + 1] = avg; 
                imgPixels.data[i + 2] = avg;
            }
        }
        
        canvasContext.putImageData(imgPixels, 0, 0, 0, 0, imgPixels.width, imgPixels.height);
        return canvas.toDataURL();
    }
	*/