$(function() { $('.field, textarea').focus(function() { if(this.title==this.value) { this.value = ''; } }).blur(function(){ if(this.value=='') { this.value = this.title; } }); $(".projects-slider").jcarousel({ scroll: 1, auto: 3, wrap: 'both' }); $('#main-slider').jcarousel({ scroll: 1, wrap: 'both', itemFirstInCallback: { onBeforeAnimation : mainSliderCallBack }, buttonNextHTML: null, buttonPrevHTML: null }); $('#thumbs-slider-inner').jcarousel({ scroll: 1, wrap: 'both', initCallback: thumbsInitCallback, buttonNextHTML: null, buttonPrevHTML: null }); if ($.browser.msie && $.browser.version == 6) { DD_belatedPNG.fix('#slider, #slider img, .jcarousel-next, .jcarousel-prev'); } }); function mainSliderCallBack(carousel, item, idx, state) { curr = idx; $('#thumbs-slider-inner li a').live('click', function(){ var _index = $('#thumbs-slider-inner li a').index(this); carousel.scroll(_index+1); return false; }); $('#thumbs-slider-inner li').removeClass('active'); $('#thumbs-slider-inner li').eq(curr-1).addClass('active'); } function thumbsInitCallback(carousel){ $('#prev-btn').bind('click', function() { carousel.prev(); return false; }); $('#next-btn').bind('click', function() { carousel.next(); return false; }); }