(function(a){ a.fn.webwidget_slideshow_dot=function(p){ var p=p||{}; var m=p&&p.slideshow_time_interval?p.slideshow_time_interval:"2000"; var q=p&&p.slideshow_window_width?p.slideshow_window_width:"400"; var r=p&&p.slideshow_window_height?p.slideshow_window_height:"400"; var fw=p&&p.slideshow_flash_width?p.slideshow_flash_width:"400"; var fh=p&&p.slideshow_flash_height?p.slideshow_flash_height:"400"; var sf=p&&p.soldeshow_foreColor?p.soldeshow_foreColor:"#000"; var stc=p&&p.slideshow_title_color?p.slideshow_title_color:"#17CCCC"; var d=p&&p.directory?p.directory:"images/"; q += "px"; r += "px"; fw += "px"; fh += "px"; var v; var w=-1; var x=a(this); var y=x.find("ul:first").children("li").length; if(x.find("ul").length==0||x.find("li").length==0){ x.append("Require content"); return null } init(); play(); function init(){ x.find("ul:first").wrap('
'); x.css("width",q).css("height",r); x.find(".slides_box").css("width",fw).css("height",fh); x.find("ul:first").width(parseInt(fw)*y); x.find("ul:first").children("li").css("width",fw).css("height",fh); x.find("ul:first").children("li").children("a").children("img").css("width",fw).css("height",fh); x.find(".slides_box").after('
'); x.find(".title_thumb_box").append('
'); x.find(".title_thumb_box").append('
'); x.find(".thumb_box").append(''); x.find(".title_thumb_box").css("background-color",sf); for (i = 0; i <= y-1; i++) { x.find(".thumb_box").append(''); } x.find(".thumb_box").append(''); x.find(".thumb_box").children("div").children("img").click( function(){ switch(jQuery(this).attr("class")){ case "thumb_p": previous(); break; case "thumb_num": if(parseInt(jQuery(this).attr("id").replace('circle_index_','')) == 0){ w = y -1; }else{ w = parseInt(jQuery(this).attr("id").replace('circle_index_', '')) -1 ; } play(); break; case "thumb_n": next(); break; } } ) x.find(".thumb_box").children("div").children("img").hover( function(){ switch(jQuery(this).attr("class")){ case "thumb_p": jQuery(this).attr("src",d+"carousel_back_hoverhit.gif"); break; case "thumb_num": if (parseInt(jQuery(this).attr("id").replace('circle_index_', '')) != w){ jQuery(this).attr("src",d+"carousel_circle_hoverhit.gif"); } break; case "thumb_n": jQuery(this).attr("src",d+"carousel_next_hoverhit.gif"); break; } }, function(){ switch(jQuery(this).attr("class")){ case "thumb_p": jQuery(this).attr("src",d+"carousel_back_normal.gif"); break; case "thumb_num": if(parseInt(jQuery(this).attr("id").replace('circle_index_','')) != w){ jQuery(this).attr("src",d+"carousel_circle_normal.gif"); } break; case "thumb_n": jQuery(this).attr("src",d+"carousel_next_normal.gif"); break; } } ); x.find(".thumb_box").children("div").click( function(){ } ); x.hover( function(){ stop(); }, function(){ v=setTimeout(play,m); } ); } function previous(){ if(w==0){ w=y-2 }else{ if(w==1){ w=y-1 }else{ w-=2 } } play() } function next(){ play() } function play(){ clearTimeout(v); w++; if(w>=y){ w=0 } x.find(".slides_box").children("ul").animate({ left:-(w*parseInt(fw)) },600); x.find(".thumb_box").children("div").children("img[class='thumb_num']").attr("src",d+"carousel_circle_normal.gif"); x.find(".thumb_box").children("div").children("img[class='thumb_num']").eq(w).attr("src",d+"carousel_circle_solid.gif"); x.find(".title_box").html(''+x.find(".slides_box").children("ul").children("li").children("a").eq(w).attr("title")+''); v=setTimeout(play,m) } function stop(){ clearTimeout(v); } } })(jQuery);