$(function() {
$('#RunSticky').cycle({pause:1,before:onAfter,after:dimmCaruzl});

var l = $('#RunCarusl > li:not(".cloned")')
var ha = $('#RunCarusl > li:not(".cloned") > h2 > a');
var ia = $('#RunCarusl > li:not(".cloned") > a');

ha.click(function () {
l.animate({opacity:.5})
$(this).parent().parent().animate({opacity:1},'fast')
return false;
});

ia.click(function () {
l.animate({opacity:.5})
$(this).parent().animate({opacity:1},'fast')
return false;
});

});

function onKlik(curr) {
$('#RunSticky').cycle(curr);
}

function onAfter(curr, next, opts) {
var l = $('#RunCarusl > li:not(".cloned")');
l.removeClass('selected');
}

function dimmCaruzl(curr, next, opts) {
var cl = $(next).attr('class');
var l = $('#RunCarusl > li.' + cl);
l.addClass('selected');
}

function onSticky() {
$('#RunSticky').cycle('pause');
}


