if (typeof(nl) == "undefined") {
	var nl = {}
}
if (typeof(nl.havl) == "undefined") {
	nl.havl = {}
}






nl.havl.Brandbox = (function() {
	var config = {
		selector: "",
		cycleSpeed: 6000
	}
	var cycleTimer
	var cycleIndex = 0

	function showItem(index) {
		// reset items
		jQuery(config.selector).find("dt").removeClass("active")
		jQuery(config.selector).find("dd:visible").fadeOut()
		jQuery(config.selector).find("div.intro:visible").fadeOut()
		// set active item
		jQuery(config.selector).find("dt:eq("+ index +")").addClass("active")
		jQuery(config.selector).find("dd:eq(" + index + ")").fadeIn()
	}
	
	function cycle() {
		if (cycleIndex >= 4) {
			cycleIndex = 0
		}
		showItem(cycleIndex)
		cycleIndex++
	}
	
	
	
	/* Start public */
	return {
		Init: function(selector) {
			config.selector = selector
			jQuery(config.selector).addClass("brandboxJSEnabled")
			jQuery(config.selector).find("dt").each(function(index) {
				jQuery(this).click( function() {
					switch(index) {
						case 0:
							document.location = '/Kantoorinrichting.aspx'
							break
						case 1:
							document.location = '/Automatisering.aspx'
							break
						case 2:
							document.location = '/Document-solutions.aspx'
							break
						case 3:
							document.location = '/Kantoorartikelen.aspx'
							break
					}
				})
			})
			jQuery(config.selector).find("dd").each(function() {
				if (jQuery(this).find("div.links a:eq(0)").size() > 0) {
					var url = jQuery(this).find("div.links a:eq(0)").attr("href")
					var quoteDiv = jQuery(this).find("div.quote")
					var personDiv = jQuery(this).find("div.brandboxItemBottom")
					jQuery(quoteDiv).click(function() { document.location = url })
					jQuery(quoteDiv).css("cursor", "pointer")
					jQuery(personDiv).click(function() { document.location = url })
					jQuery(personDiv).css("cursor", "pointer")
				}
			})

			cycleTimer = setInterval("nl.havl.Brandbox.Cycle()", config.cycleSpeed)
		},
		
		Cycle: function() {
			cycle()
		}
	}
	/* End public */
})();






nl.havl.IE6 = (function() {
	function setBorderBlocks(block) {
		var width = jQuery(block).width()
		var height = jQuery(block).height()
		jQuery(block).find("div.borderTopLeft").width((width + 4) + "px")
		jQuery(block).find("div.borderTopRight").height((height + 4) + "px")
		jQuery(block).find("div.borderBottomRight").width((width - 3) + "px")
		jQuery(block).find("div.borderBottomRight").css("bottom", "-12px")
		jQuery(block).find("div.borderBottomLeft").height((height + 4) + "px")
	}



	/* Start public */
	return {
	FixBlock: function(selector) {
			jQuery(selector).each( function() {
				setBorderBlocks(this)
			})
		}
	}
	/* End public */
})();

