$.fn.tab=function(d){function b(n){var k=decodeURI(location.search);if(k){k=k.split("?")[1].split("&");for(var p=0;p<k.length;++p){k[p]=k[p].split("=");if(k[p][0]==n)return k[p][1]}}return null}function g(){j.eq(e).addClass(a.css).siblings().removeClass(a.css);if(a.effect[0]=="none")f.eq(e).css("display","block").siblings().hide();else a.effect[0]=="rollUp"||a.effect[0]=="rollLeft"?l.animate(a.effect[0]=="rollUp"?{marginTop:m*e}:{marginLeft:m*e},a.effect[1]):f.eq(e)[a.effect[0]](a.effect[1],a.effect[2]).css("display",
"block").siblings().hide()}function c(){clearInterval(h);h=setInterval(function(){e=(e+1)%i;g()},a.time)}var a=$.extend({no:0,isRandom:false,urlparam:null,header:">ul>li",body:"div>div",event:"mouseenter",delay:200,css:"on",effect:["none","",""],isAuto:false,time:3500},d);d=$(this);var j=d.find(a.header),f=d.find(a.body),l=f.parent(),i=f.length,e=a.no;if(a.urlparam&&a.isRandom)b(a.urlparam)?e=b(a.urlparam)-1:e=Math.floor(Math.random()*i);else if(a.urlparam){if(b(a.urlparam))e=b(a.urlparam)-1}else if(a.isRandom)e=
Math.floor(Math.random()*i);var h,o,m=f[a.effect[0]=="rollUp"?"height":"width"]()*-1;j.eq(e).addClass(a.css).siblings().removeClass(a.css);a.effect[0]=="rollUp"||a.effect[0]=="rollLeft"?l.css(a.effect[0]=="rollUp"?"marginTop":"marginLeft",m*e):f.eq(e).css("display","block").siblings().hide();j[a.event](function(){e=j.index(this);clearTimeout(o);o=setTimeout(g,a.delay)});if(a.isAuto){c();d.hover(function(){clearInterval(h)},c)}return d};
$.fn.roll=function(d,b){function g(){clearInterval(o);o=setInterval(function(){if(d)if(c.go=="left"||c.go=="up"){if(m>=n)m=0;a[i](++m)}else{if(m<=0)m=n;a[i](--m)}else{if(c.go=="left"||c.go=="up")a[i]()==n&&a[i](0);else a[i]()==0&&a[i](n);l?a.animate(c.go=="up"?{scrollTop:"+="+h}:{scrollTop:"-="+h},c.speed):a.animate(c.go=="left"?{scrollLeft:"+="+h}:{scrollLeft:"-="+h},c.speed)}},c.time)}for(var c=$.extend({time:d?120:3E3,speed:700,go:"down"},b),a=$(this),j=a.children(),f=j.children(),l=c.go=="up"||
c.go=="down"?1:0,i=l?"scrollTop":"scrollLeft",e=l?"outerHeight":"outerWidth",h=f[e](),o,m=0,n=0,k=0;k<f.length;++k)n+=f.eq(k)[e]();g();j.append(f.clone());a.hover(function(){clearInterval(o)},g);return a};
$.fn.nav=function(d){var b=$.extend({header:">li",child:">li>div",effect:["slideDown","slideUp",200,""],delay:[100,400],css:"on"},d);d=$(this);var g=d.find(b.header),c=d.find(b.child),a=c.attr("tagName"),j=0,f;!$.support.cssFloat&&$.browser.version=="6.0"&&c.append('<iframe style="filter: alpha(opacity=0);z-index:-1;position:absolute;border:0;left:0;top:0;overflow:hidden;width:100%;height:50px;"/>');g.mouseenter(function(){var l=$(this),i=l.children(a),e=l.siblings().children(a);clearTimeout(f);f=
setTimeout(function(){l.addClass(b.css).siblings().removeClass(b.css);j?i.show():i[b.effect[0]](b.effect[2],b.effect[3]);e.hide();j=1},b.delay[0])});d.mouseleave(function(){clearTimeout(f);f=setTimeout(function(){j=0;c.filter(":visible")[b.effect[1]](b.effect[2],b.effect[3],function(){g.removeClass(b.css)})},b.delay[1])});return d};
$.fn.loadSWF=function(d,b){function g(){swfobject.embedSWF(d,j,f,l,"10","",false,a)}var c=$(this),a=$.extend({menu:"false",wmode:"transparent"},b),j=c.attr("id"),f=c.width(),l=c.height();if(j)typeof swfobject=="undefined"?$.getScript("//ajax.googleapis.com/ajax/libs/swfobject/2/swfobject.js",g):g();else alert("Element have no set id");return c};
$.getURL=function(d){var b,g;if(typeof d=="number"){b=location.pathname.split("/");g=b.length;return d==0?b[g-1]:d==1?b[g-1].split(".")[0]:b[g-d]}else{b=decodeURI(location);if(/\?./.test(b)){b=b.split("?")[1].split("&");g=b.length;for(var c=0,a;c<g;++c){a=b[c].split("=");if(a[0]==d)return a[1]}}return null}};
$(function(){function d(q,r){q[0].addClass("on");r[0].removeClass("on");q[1].show();r[1].hide()}var b=$("body");$(document);var g=$(window),c=$("#nav_st"),a=$("#nav_ctg"),j=$("#nav_bd_st"),f=$("#nav_bd_ctg"),l=b.attr("id")=="cat"?1:0;l&&d([a,f],[c,j]);c.add(a).click(function(){$(this).attr("id")=="nav_st"?d([c,j],[a,f]):d([a,f],[c,j]);return false});j.add(f).nav();for(var i=$("#exp2"),e=i.find("a"),h=0;h<e.length;++h)e.eq(h).css({backgroundPosition:"-102px -"+(10+h*54)+"px"});i.roll(false,{time:2800,
speed:700,go:"down"});i=$("#htb").find("blockquote");e=i.find("a");for(h=0;h<e.length;++h)e.eq(h).css({backgroundPosition:(10+h*150)*-1+"px -10px"});i.roll(true,{time:30,go:"left"});h=$("#sv_top");var o=h.find(">ul>li"),m=$("#sv_top_bd"),n=m.find(">div");i=$("#sv_bt");$("#sv_an");var k;$("#ns").find("ol").find("li:odd").addClass("odd");m.add(n).hide();o.mouseenter(function(){var q=$(this),r=q.index();q.addClass("on").siblings().removeClass("on");m.slideDown(300,function(){n.eq(r).css("display","block").siblings().hide()})});
h.hover(function(){clearTimeout(k)},function(){k=setTimeout(function(){m.slideUp(300);n.hide();o.removeClass("on")},400)});i.tab({header:">ul>li",body:"#sv_bt_bd>div"});if(l&&!b.hasClass("red")){$("#mn_tl").find("dl:first").nav({header:">dd",child:">dd>span",effect:["show","hide",200,""]});b.hasClass("red")}$("#sm_tab").tab({header:"#sm_tab_hd>li",body:"#sm_tab_bd>blockquote"});var p=$("#wtb");g.scroll(function(){p.animate({top:g.scrollTop()},{duration:700,queue:false})});b=$("#vdo_swf");b.length&&
b.loadSWF("//www.payeasy.com.tw/cf/index_s.swf")});

