(function(a){var e={start:function(d){function e(a){(k=a)?($play.show(),$pause.hide()):(h(),$play.hide(),$pause.show())}function h(){k||(f++,f>=l&&(f=0),clearInterval(i),m())}function m(){n("Update desc from slide no. "+f);var c=a(o[f]).find("a"),d=a("#bannerDesc #cont");a("#bannerDesc #bck");var e=a("#bannerDesc #plus");c.attr("href")==""||c.attr("href")=="#"?e.hide():e.show();e.attr("href",c.attr("href"));d.html(c.html());a(j[p]).removeClass("activeBullet");a(j[f]).addClass("activeBullet");q.animate({left:-b.width*f+"px"},900,function(){i=setTimeout(h,b.speed)});p=f}function n(c,b){g++;g>20&&(a("#debug").html(""),g=0);b&&(c="<span style='background:"+b+"'>"+c+"</span>");a("#debug").html(g+". "+c+"<br />"+a("#debug").html())}var b={width:730,height:285,speed:30,banner:"#homebanner",contents:".tabContainer #tabContents .tabContent",tabContainer:".tabContainer #tabContents",playBtn:"#homebanner #playSlider",pauseBtn:"#homebanner #pauseSlider"};d&&a.extend(b,d);var g=0,f=-1,p,k=!1,i,q=a(b.banner+" ul"),o=a(b.banner+" li"),j=[],l=a(b.banner+" ul li").length;n("Total images "+l);q.css({position:"relative"});var r=a("<div class='bulletsCont' />");a(b.banner).append(r);b.playBtn&&($play=a(b.playBtn),$play.click(function(a){a.preventDefault();e(!1)}));b.pauseBtn&&($pause=a(b.pauseBtn),$pause.click(function(a){a.preventDefault();e(!0)}));$play.hide();$pause.show();o.each(function(c){a(this).css({position:"absolute",left:b.width*c+"px"});c=a("<a id='"+c+"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>").css({display:"none"}).bind("click",function(){f=a(this).attr("id");clearInterval(i);m()}).appendTo(r);j.push(c);c.fadeIn(500)});h()}};a.fn.gvahomebanner=function(d){if(e[d])return e[d].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof d==="object"||!d)return e.init.apply(this,arguments);else a.error("Method "+d+" does not exist on jQuery.gva.ui")}})(jQuery);
