$(document).ready(function(){
	$('div.scrollable').scrollable({
		interval: 4500,
		loop: true,
		speed: 750,
		vertical:true,
		keyboard: false,
		size: 1,
		next: 'div.below',
		prev: 'div.above'
	});
// RIGHT BIGGER LINK
//$('.scbox .items li').biggerlink();
// document end


	intId = Array();
	intId.push( setInterval("loop()",4000));

	$("ul.items li a").click(function(event){
		event.preventDefault();
	});


	$("ul.items li").mouseover(function(){
		$(this).css("background","#FDF2D3");
		if ($(this).children().find("img").attr("src").match(/_norm./)){
			$(this).children().find("img").each(function(){
				$(this).attr("src",$(this).attr("src").replace("_norm.", "_over."));
			});
		}
		for(var i=0; i<intId.length; i++){
			clearInterval(intId[i]);
		}
		intId = Array();
	}).mouseout(function(){
		$(this).css("background","none");
		if ($(this).children().find("img").attr("src").match(/_over./)){
			$(this).children().find("img").each(function(){
				$(this).attr("src",$(this).attr("src").replace("_over.", "_norm."));
			});
		}
		intId.push( setInterval("loop()",4000));
	}).click(function(){
		if ($(this).children().find("a").attr("href").match(/home/)){
			window.open($(this).children().find("a").attr("href") , "") ;
			return false;
		}
	});
});
function loop() {
	if($("div.scrollable").scrollable().getIndex() >= $("div.scrollable").scrollable().getSize() - 1 - 2){
		$("div.scrollable").scrollable().begin();
	} else {
		$("div.scrollable").scrollable().next();
	}
}

