// JavaScript Document

// Pauze plugin -- Eerst wachten voordat de rest wordt ingeladen
$j.fn.pause = function(duration) {
	$j(this).animate({ dummy: 1 }, duration);
	return this;
};
							 
$j(document).ready(function() {
	// slider navigatie homepage
	$j('.prev').hide();
	$j('.next').hide();
	$j('.sluiten').hide();
	
	// navigatie tonen
	$j('.slide').mouseenter(function() {
		$j('.prev').fadeIn(400);	
		$j('.next').fadeIn(400);	
	});
	
	// navigatie weg laten faden
	$j('.slide').mouseleave(function() {
		$j('.prev').pause(800).fadeOut(400);	
		$j('.next').pause(800).fadeOut(400);
	});
	
	
	// partner slider
	$j('.bttnOpenPrt').click(function() {
		if ( !($j.browser.msie && $j.browser.version == 7.0) ){					   
			$j( ".bedrijfSlide" ).animate({"top": "-114px"}, 800);
		} else {
			$j( ".bedrijfSlide" ).animate({"top": "-95px"}, 800);
		}
		$j('.bttnOpenPrt').fadeOut(400);
		$j('.bttnClosePrt').pause(400).fadeIn(400);
	});
	
	$j('.partners').click(function() {
		if ( !($j.browser.msie && $j.browser.version == 7.0) ){					   
			$j( ".bedrijfSlide" ).animate({"top": "-114px"}, 800);
		} else {
			$j( ".bedrijfSlide" ).animate({"top": "-95px"}, 800);
		}
		$j('.bttnOpenPrt').fadeOut(400);
		$j('.bttnClosePrt').pause(400).fadeIn(400);
	});
	
	// Aanroepen mailformulie
	$j('.bttnClosePrt').click(function(){
		if ( !($j.browser.msie && $j.browser.version == 7.0) ){					   
			$j( ".bedrijfSlide" ).animate({"top": "-270px"}, 800);
		} else {
			$j( ".bedrijfSlide" ).animate({"top": "-270px"}, 800);
		}
		$j('.bttnClosePrt').fadeOut(400);
		$j('.bttnOpenPrt').pause(400).fadeIn(400);
	});
	
	// Aanroepen mailformulie
	$j( ".contactLogin" ).click(function(){
		if ( !($j.browser.msie && $j.browser.version == 7.0) ){					   
			$j( ".topSlide" ).animate({'z-index':'40400'},10).animate({"top": "-60px"}, 800);
		} else {
			$j( ".topSlide" ).animate({'z-index':'40400'},10).animate({"top": "-45px"}, 800);
		}
		$j('.sluiten').pause(200).fadeIn(400);
	});
	
	// Aanroepen mailformulie
	$j( ".sluiten" ).click(function(){
		if ( !($j.browser.msie && $j.browser.version == 7.0) ){					   
			$j( ".topSlide" ).animate({"top": "-402px"}, 800).animate({'z-index':'20200'},10);
		} else {
			$j( ".topSlide" ).animate({"top": "-382px"}, 800).animate({'z-index':'20200'},10);
		}
		$j('.sluiten').pause(200).fadeOut(400);
	});
	
	//jQuery('.cartSummaryItem').text('Uw winkelwagen is leeg');

	// Replace all 'text' words with 'TEXT'
	//$('.cartSummaryItem *').replaceText( /\bShopping cart is empty\b/gi, 'Uw winkelwagen is leeg' );
	
	$j(".cartSummaryItem").html($j(".cartSummaryItem").html().replace(/Shopping cart is empty/, 'Uw winkelwagen is leeg'));
	$j(".cartSummaryItem").html($j(".cartSummaryItem").html().replace(/Total/, 'Totaal'));
	$j(".cartSummaryItem").html($j(".cartSummaryItem").html().replace(/View Cart/, 'Bestellen'));
	/*$j(".shippingDiv").html($j(".shippingDiv").html().replace(/Choose Shipping Option/, 'Kies een verzendmethode'));
	$j("a.cartLink").html($j("a.cartLink").html().replace(/Shopping cart is empty. Continue Shopping./, 'Uw winkelwagen is leeg. Ga verder met winkelen.'));*/
	
	


});


//slider
$j(function(){
	$j('#slides').slides({
		//preload: true,
		play: 5000,
		effect: 'fade',
		generatePagination: false
	});
});


