var slides;
var next = 1;
function initIntro(){
        slides = $(".imgsingleselecter").length;
}

function introSlide(){
                if (next < slides){next++;}else{next=1;};
                var nextSlide = $("#image_selecter_" + next ).children("a").attr("onclick");
                if (typeof nextSlide == "function"){
                nextSlide();
                }
}                        
$(function(){ 
        initIntro();
        var slidesIntro = window.setInterval(function (){
                var tempLoop = window.setInterval(function(){        $(".imgsingleselecter").click(function(){clearInterval(slidesIntro);});clearInterval(tempLoop);}, 100);
                introSlide();
        }, 4000);
});


