
Cufon.replace('h1', {hover: true});
Cufon.replace('h2', {hover: true});
Cufon.replace('h3', {hover: true});
Cufon.replace('.price', {hover: true});


$(document).ready(function()
{


	// font resizen
	
	originalFontSize = 16;
  
	$(".textresizer").click(function() {
		var textsize = $('html').css('font-size').replace("px", "");
		
		if (textsize > originalFontSize) {
			$('html').css('font-size', '1.0em');
            $.get("/includes/ajax_font.php", {size: "1.0em"});
		} else {
			$('html').css('font-size', '1.3em');
            $.get("/includes/ajax_font.php", {size: "1.3em"});
		}
	});	

	// menu collapse
	
	$(".submenu:not(.no_display)").hide();
	$(".knop").click(function()
	{
		$(this).next(".submenu").slideToggle(500);
		
	});
	  
	$(".knop, .knop_zonder_sub").mouseover(function () {
	$(this).stop().animate({ marginLeft: "-10px", width: "310px" }, 100 );
	});
	$(".knop, .knop_zonder_sub").mouseout(function () {
	$(this).stop().animate({ marginLeft: "0px", width: "300px" }, 100 );
	});
	
	$(".product").mouseover(function () {
	$(this).stop().animate({ opacity: "0.7" }, 500 );
	});
	$(".product").mouseout(function () {
	$(this).stop().animate({ opacity: "1" }, 500 );
	});	
	
	//product images
				
    var images = $(".productbigimg img");            
                
	if (images.length > 1) {
	   
    	$(".productbigimg img").each(function() {
    		var src = $(this).attr("src");
    		src = src.replace("resized", "small");
    		var div = $("<div></div>").appendTo("#productthumbs");
    		var img = $("<img></img>").appendTo(div);
    		$(img).attr("src", src);
    	});
    
    } else {
        $("#productthumbs").css({"display":"none"});
    }
	
	$("#productthumbs").css({
		"opacity": 0.5,
		"z-index": 20
	});
	$(".productbigimg, #productthumbs").hover(function() {
		//over
		$("#productthumbs").stop().animate({"opacity": 1}, 400);
	}, function() {
		//out
		$("#productthumbs").stop().animate({"opacity": 0.5}, 400);
	});
	
	
	$("#productthumbs div").hover(function() {
		var curent = $(this);
		var teller = 0;
		var item = 0;
	
		$("#productthumbs div").each(function() {
			if ($(curent).html() == $(this).html()) {
				item = teller;
			}
			teller++;
		});
		
		var positionLeft = (item * 130) - 10;
		
		$(this).css({
			backgroundImage: "url(/images/img_box.png)",
			backgroundPosition: "top left",
			width: "170px",
			height: "134px",
			paddingTop: "31px",
			marginTop: "-31px",
			paddingLeft: "10px",
			marginLeft: positionLeft + "px",
			zIndex: 25,
			position: "absolute",
			left: 0 //added to kill trip effect in IE7
		});
		$(this).next().css({marginLeft: "130px"});
	}, function() {
		$(this).css({
			backgroundImage: "none",
			width: "130px",
			height: "125px",
			paddingTop: "10px",
			marginTop: "0px",
			paddingLeft: "0px",
			marginLeft: "0px",
			zIndex: 20,
			position: "static"
		});
		$(this).next().css({marginLeft: "0px"});
	});
	
	$("#productthumbs div img").click(function() {
		var src = $(this).attr("src");
		src = src.replace("small", "resized");
        
		$(".productbigimg img").each(function() {
			if ($(this).attr("src").indexOf(src) > -1) {
				var obj = $(this).parent().clone();
				$(obj).prependTo($(".productbigimg"));
				$(this).remove();
			}
		});
	});
	//banner 
	
	
});	
