//set external links
$(document).ready(function() {
	$('a[rel = external]').attr('target','blank');
});





//count number of footer stockists
$(document).ready(function() {
    var st = $('.stockists');
    if(st.find('li').length > 10){
        st.find('h3').append("<span class='more'>Show More...</span>");
        $('.stockists .more').toggle(function(){
            $(this).text("hide more...");
            $(this).parent().parent().addClass('tall');
            return false;
        },function(){
            $(this).text("show more...");
            $(this).parent().parent().removeClass('tall');
            return false;
        });
        //if time add in toggle slide :-)
    };
});

(function($){
 
    $.fn.shuffle = function() {
 
        var allElems = this.get(),
            getRandom = function(max) {
                return Math.floor(Math.random() * max);
            },
            shuffled = $.map(allElems, function(){
                var random = getRandom(allElems.length),
                    randEl = $(allElems[random]).clone(true)[0];
                allElems.splice(random, 1);
                return randEl;
           });
 
        this.each(function(i){
            $(this).replaceWith($(shuffled[i]));
        });
 
        return $(shuffled);
 
    };
 
})(jQuery);

$(document).ready(function() {
    $('ul#randomList li').shuffle();
});

function hello(){
	return "Hello World";
}
// Shuffle all list items within a list:


