/*
window.onload = init;
		
		function init(){
			var i = 1;
			var elements = $("#headerchanger > a > img");
			var timeout = 5000;
			var delay = 1000;
			var imgWidth = $(elements[0]).width();
			$("#headerchanger").width(imgWidth * elements.length);
			
			var timer = setInterval(function(){
				$("#headerchanger").animate({marginLeft:imgWidth * i * -1}, delay);
				i++;
				if(i >= elements.length) i = 0;
			}, timeout);

				
      	 	$("#zoekertje").attr("initvalue", $("#zoekertje").val()).focus(function(){
					if($(this).val() == $(this).attr("initvalue")){
						$(this).val("");
					} else {
						$(this).select();
					}
				});
      	 	
      	 	$("#zoekertje").blur(function(){
				if($(this).val() == ""){
					$(this).val($(this).attr("initval"));
				}				
			});
				
      	 		$("#zoekertje2").attr("initvalue", $("#zoekertje").val()).focus(function(){
					if($(this).val() == $(this).attr("initvalue")){
						$(this).val("");
					} else {
						$(this).select();
					}
				});
      	 	$("#zoekertje2").blur(function(){
				if($(this).val() == ""){
					$(this).val($(this).attr("initval"));
				}				
			});

	};

*/	
		window.onload = function()
		{
			// init the carrousel function on window load
			initCarroussel(
			{
				container: "#carroussel",
				items:		"a",
				delay:		5000,
				duration:	1000
			});
		};
		
		function initCarroussel(p){		
			// fetch image width and height
			var cWidth = $(p.container).find(p.items).width();
			var cHeight = $(p.container).find(p.items).height();
			var pause = false;
			
			// retain width and height even with positions on absolute
			$(p.container).width(cWidth);
			$(p.container).height(cHeight);
			
			// pause the animation on rollover
			$(p.container).hover(
				function()
				{
					pause = true;		
				},
				function()
				{
					pause = false;
				}
			);
			
			// set items to position absolute and place them next to each other
			$(p.container).find(p.items).each(function(i)
			{
				$(this).css(
				{
					"position"	: "absolute",
					"display"	: "block",
					"left" 		: cWidth * i
				});
			});
			
			// Init interval for the slide animation
			var cInterval = setInterval(function(){
				if(!pause)
				{
					$(p.container).find(p.items).each(function(i)
					{
						$(this).animate(
						{
							"left" : "-=" + cWidth
						}, p.duration, function()
						{
							// check if the item is hidden the left area
							if($(this).css("left").indexOf("-") > -1)
							{
								// place the item to the far right
								$(this).css("left", ($(p.container).find(p.items).length - 1) * cWidth);
							}
						});
					});
				}
			}, p.delay);
		}
		
		
	
$(document).ready(function(){
    $("#tooltip").hide();
   
    $("#imgcont").mousemove(function(e){
        $("#tooltip").show();
        $("#tooltip").css({
            top: (e.pageY - 470) + "px",
            left: (e.pageX - 563) + "px"
        });
    });
    
     $("#imgcont").mouseout(function(e){
        $("#tooltip").hide();
    });
   
         
    $('.password').focus(function() {  
      
        $('.password-label').animate({ opacity: "0" }, "fast");  
      
            if($(this).val() == "Zoek hier uw winkel:") {  
                $(this).val() == "";  
            }  
        }).blur(function() {  
      
            if($(this).val() == "") {  
                $(this).val() == "Zoek hier uw winkel:";  
                $('.password-label').animate({ opacity: "0.4" }, "fast");  
            }  
    });  
		
   
});


