// Javascript function for detailpage - picture changer, with hover
function detail_replace_src(url) {
    document.getElementById('imgGrootImg').src = url;   
}
function detail_replace_href(url) { 
    document.getElementById('imgGrootAZoom').href = url;
    document.getElementById('imgGrootAPicture').href = url;
}       


// JQUERY CUSTOM COMMANDS
$(document).ready( function() {  // start javascript when document is loaded
	
	// EXTENDED LINKING ON PARENT ELEMENTS
	attachButtonHandling();
	
	
    $('.menu_sub li, .winkelmand, .aanbiedingen .ad').hover(function() { // IE6 does not support :hover on elements other than <a>
        $(this).addClass('hover');
    }, function() {
        $(this).removeClass('hover');
    });
	
	
	/*
	//ACCOUNT VIEW TOGGLE
    var productOverviewAnimating = false;   
    $('.sidebar .account .content').hide();
    $('.sidebar .account .title').hover(function() {       
        if (!productOverviewAnimating) {
            $(this).parents(".account").find(".content").slideDown(200); // Show current answer
            productOverviewAnimating = true;
        }
    }); 
    // HIDE --> SLIDEUP
    $(".sidebar .account").mouseleave(function() {            
        $('.sidebar .account .content').slideUp(300).queue(function() { productOverviewAnimating = false; $(this).dequeue(); });
    }); 
	*/
	
	
	
	
	/* A IMG BUTTON HOVERS */
    // HOVER
    var hoverStateButtonsAnimating = false;     
    $('a img:not(.picture_big a img), .pre_inloggen .submit').mouseover(function() {            
        if (!hoverStateButtonsAnimating) {
            $(this).fadeTo(100, 0.75);      //SET
            hoverStateButtonsAnimating = true;
        }
    }); 
    // UNHOVER
    $("a img, .pre_inloggen .submit").mouseleave(function() {           
        $(this).fadeTo(100, 1.00).queue(function() {    //RESET
            hoverStateButtonsAnimating = false; $(this).dequeue();  
        });     
    }); 
	
	
   
}); // end ready function






function attachButtonHandling() {
    /* SUB MENU ALL LINK */
    $('.winkelmand, .aanbiedingen .ad').click(function() {
        document.location.href = $(this).find('a').attr('href');
    });
}


