$.tools.tabs.addEffect("mp", function(i, done) {
		var conf = this.getConf(), panes = this.getPanes();
		if(speed){
			runTimer();
		}
		panes.hide();
		if(!start){
			$("div.activepic div").fadeOut(speed);
			$("div.activepic div").eq(i).fadeIn(speed, done);
			panes.eq(i).fadeIn(speed, done);
		}else{
			$("div.activepic div").hide();
			$("div.activepic div").eq(i).show();
			panes.eq(i).show();
			start=false;
			done.call();
		}

});
function runTimer(){
	stopTimer();
	$("div.activetimer").show();
	$("div.activetimer div.sec").show();
	for(var i=0;i<5;i++){
		$("div.activetimer div.sec").eq(i).delay((1000*(4-i))).animate({opacity:0.1}, 1500, 'linear');
	}
}
function stopTimer(){
	$("div.activetimer").hide();
	$("div.activetimer div.sec").clearQueue();
	$("div.activetimer div.sec").stop();
	$("div.activetimer div.sec").css("opacity",0.6);
}
$(function() {
	start=true;
	defspeed=750;
	speed=defspeed;
	$("#activebuttons").tabs("div.activetext-in", {event:'mouseover', effect:'mp', rotate: true}).slideshow({autoplay: true, interval: 5000, autopause:false, 
	onPause:function(event) {$("div.activepause").show();speed=0;stopTimer();}, onPlay:function(event) {$("div.activepause").hide();speed=defspeed;runTimer();}
	});
	$("div.activeinfo").hover(function () {$("#activebuttons").data("slideshow").pause();},function () {$("#activebuttons").data("slideshow").play();});
	$("a.activearrow").click(function(e){e.preventDefault();});
});
