$(document).ready(function(){

		   
        $('#sig2').append( $('#gal') );
      	$('.lightbox').lightBox();
 
		
	$(".print").click(function(){
		window.print();
		return false;
	});

	sfHover();
	
	$('#banner').cycle({
				fx: 'fade' 
	});
	
	var ci = 1;
	$('.mainlevel').each(function() {
	if ($(this).hasClass('mainlevel') )
	   {
		 $(this).removeClass('mainlevel');
		 $(this).addClass('cloud' + ci);
	   } 
	ci++;

	});		

	$("#keurmerken img").each(function() {
		grayscale($(this));
		
		$(this).mouseover(function () { 
			grayscale.reset($(this));
		}); 
	  
		$(this).mouseout(function () { 
			grayscale($(this));
		});  		
		
	}); 

	if ($('#productTagCloud').length) { 
	  setHeight();
	}
	else {  
	  setsubHeight();
	}

	
});


 sfHover = function() {
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");
    for (var i = 0; i < sfEls.length; i++) {
        sfEls[i].onmouseover = function() {
            this.className += " ie_does_hover";
        }
        sfEls[i].onmouseout = function() {
            this.className = this.className.replace(new RegExp(" ie_does_hover\\b"), "");
        }
    }
}

function resize() {    
    setHeight();
}

function setHeight() {
    document.getElementById('pageholder').style.height = getDocHeight() + "px";        
    document.getElementById('contentholder').style.height = (getContentHeight() + 330) + "px";
}

function setsubHeight() {
    document.getElementById('contentholder').style.height = (getsubContentHeight() + 160) + "px";
}

function getContentHeight() {
  return Math.max(
      Math.max(document.getElementById('maincontentblocks').offsetHeight,document.getElementById('maincontentblocks').offsetHeight),
      Math.max(document.getElementById('home-right-holder').offsetHeight, document.getElementById('home-right-holder').offsetHeight)
  )
}

function getsubContentHeight() {
  return Math.max(
      Math.max(document.getElementById('subcontentblocks').offsetHeight, document.getElementById('subcontentblocks').offsetHeight)
  )
}

function getDocHeight() {
  var D = document;
  return Math.max(
	  Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
	  Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
	  Math.max(D.body.clientHeight, D.documentElement.clientHeight)
  );
}

function showTagcloud() {
    document.getElementById('productTeaser').style.display = "none";
    document.getElementById('productTagCloud').style.display = "block";
}

function closeTagcloud() {
    document.getElementById('productTeaser').style.display = "block";
    document.getElementById('productTagCloud').style.display = "none";
}



