(function(b){var a="Lite-1.0";b.fn.cycle=function(e){return this.each(function(){e=e||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var i=b(this);var h=e.slideExpr?b(e.slideExpr,this):i.children();var k=h.get();if(k.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+k.length)}return}var j=b.extend({},b.fn.cycle.defaults,e||{},b.metadata?i.metadata():b.meta?i.data():{});j.before=j.before?[j.before]:[];j.after=j.after?[j.after]:[];j.after.unshift(function(){j.busy=0});var l=this.className;j.width=parseInt((l.match(/w:(\d+)/)||[])[1])||j.width;j.height=parseInt((l.match(/h:(\d+)/)||[])[1])||j.height;j.timeout=parseInt((l.match(/t:(\d+)/)||[])[1])||j.timeout;if(i.css("position")=="static"){i.css("position","relative")}if(j.width){i.width(j.width)}if(j.height&&j.height!="auto"){i.height(j.height)}var g=0;h.css({position:"absolute",top:0,left:0}).hide().each(function(m){b(this).css("z-index",k.length-m)});b(k[g]).css("opacity",1).show();if(b.browser.msie){k[g].style.removeAttribute("filter")}if(j.fit&&j.width){h.width(j.width)}if(j.fit&&j.height&&j.height!="auto"){h.height(j.height)}if(j.pause){i.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}b.fn.cycle.transitions.fade(i,h,j);h.each(function(){var m=b(this);this.cycleH=(j.fit&&j.height)?j.height:m.height();this.cycleW=(j.fit&&j.width)?j.width:m.width()});h.not(":eq("+g+")").css({opacity:0});if(j.cssFirst){b(h[g]).css(j.cssFirst)}if(j.timeout){if(j.speed.constructor==String){j.speed={slow:600,fast:200}[j.speed]||400}if(!j.sync){j.speed=j.speed/2}while((j.timeout-j.speed)<250){j.timeout+=j.speed}}j.speedIn=j.speed;j.speedOut=j.speed;j.slideCount=k.length;j.currSlide=g;j.nextSlide=1;var f=h[g];if(j.before.length){j.before[0].apply(f,[f,f,j,true])}if(j.after.length>1){j.after[1].apply(f,[f,f,j,true])}if(j.click&&!j.next){j.next=j.click}if(j.next){b(j.next).bind("click",function(){return c(k,j,j.rev?-1:1)})}if(j.prev){b(j.prev).bind("click",function(){return c(k,j,j.rev?1:-1)})}if(j.timeout){this.cycleTimeout=setTimeout(function(){d(k,j,0,!j.rev)},j.timeout+(j.delay||0))}})};function d(h,m,i,g){if(m.busy){return}var j=h[0].parentNode,e=h[m.currSlide],f=h[m.nextSlide];if(j.cycleTimeout===0&&!i){return}if(i||!j.cyclePause){if(m.before.length){b.each(m.before,function(o,n){n.apply(f,[e,f,m,g])})}var l=function(){if(b.browser.msie){this.style.removeAttribute("filter")}b.each(m.after,function(o,n){n.apply(f,[e,f,m,g])})};if(m.nextSlide!=m.currSlide){m.busy=1;b.fn.cycle.custom(e,f,m,l)}var k=(m.nextSlide+1)==h.length;m.nextSlide=k?0:m.nextSlide+1;m.currSlide=k?h.length-1:m.nextSlide-1}if(m.timeout){j.cycleTimeout=setTimeout(function(){d(h,m,0,!m.rev)},m.timeout)}}function c(i,h,e){var f=i[0].parentNode,g=f.cycleTimeout;if(g){clearTimeout(g);f.cycleTimeout=0}h.nextSlide=h.currSlide+e;if(h.nextSlide<0){h.nextSlide=i.length-1}else{if(h.nextSlide>=i.length){h.nextSlide=0}}d(i,h,1,e>=0);return false}b.fn.cycle.custom=function(e,h,g,k){var f=b(e),i=b(h);i.css({opacity:0});var j=function(){i.animate({opacity:1},g.speedIn,g.easeIn,k)};f.animate({opacity:0},g.speedOut,g.easeOut,function(){f.css({display:"none"});if(!g.sync){j()}});if(g.sync){j()}};b.fn.cycle.transitions={fade:function(f,e,g){e.not(":eq(0)").css("opacity",0);g.before.push(function(){b(this).show()})}};b.fn.cycle.ver=function(){return a};b.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:0,fit:0,pause:1,delay:0,slideExpr:null}})(jQuery);$.fn.droppy=function(a){a=$.extend({speed:250,zIndex:1000},a||{});this.each(function(){var c=this,g=a.zIndex;function f(i){if(i.nodeName.toLowerCase()=="li"){var h=$("> ul",i);return h.length?h[0]:null}else{return i}}function d(h){if(h.nodeName.toLowerCase()=="ul"){return $(h).parents("li")[0]}else{return h}}function e(){var h=f(this);if(!h){return}$.data(h,"cancelHide",false);setTimeout(function(){if(!$.data(h,"cancelHide")){$(h).slideUp(a.speed)}},200)}function b(){var i=f(this);if(!i){return}$.data(i,"cancelHide",true);$(i).css({zIndex:g++}).slideDown(a.speed);if(this.nodeName.toLowerCase()=="ul"){var h=d(this);$(h).addClass("hover");$("> a",h).addClass("hover")}}$("ul, li",this).hoverIntent(b,e);$("li",this).hover(function(){$(this).addClass("hover");$("> a",this).addClass("hover")},function(){$(this).removeClass("hover");$("> a",this).removeClass("hover")})})};(function(a){a.fn.hoverIntent=function(k,j){var l={sensitivity:7,interval:100,timeout:0};l=a.extend(l,j?{over:k,out:j}:k);var n,m,h,d;var e=function(f){n=f.pageX;m=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-n)+Math.abs(d-m))<l.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return l.over.apply(f,[g])}else{h=n;d=m;f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return l.out.apply(f,[g])};var b=function(q){var o=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(o&&o!=this){try{o=o.parentNode}catch(q){o=this}}if(o==this){return false}var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},l.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);(function(c){function b(j,h,f,e){var i=j[h];if(c.isFunction(i)){try{return i.call(f,e)}catch(g){if(j.alert){alert("Error calling scrollable."+h+": "+g)}else{throw g}return false}}return true}var d=null;function a(o,m){var r=this;if(!d){d=r}var e=!m.vertical;var g=c(m.items,o);var k=0;var p=o.siblings(m.navi).eq(0);var h=o.siblings(m.prev).eq(0);var j=o.siblings(m.next).eq(0);var i=o.siblings(m.prevPage).eq(0);var n=o.siblings(m.nextPage).eq(0);c.extend(r,{getVersion:function(){return[1,0,1]},getIndex:function(){return k},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getRoot:function(){return o},getItemWrap:function(){return g},getItems:function(){return g.children()},seekTo:function(t,z,u){z=z||m.speed;if(c.isFunction(z)){u=z;z=m.speed}if(t<0){t=0}if(t>r.getSize()-m.size){return r}var v=r.getItems().eq(t);if(!v.length){return r}if(b(m,"onBeforeSeek",r,t)===false){return r}if(e){var y=-(v.outerWidth(true)*t);g.animate({left:y},z,m.easing,u?function(){u.call(r)}:null)}else{var x=-(v.outerHeight(true)*t);g.animate({top:x},z,m.easing,u?function(){u.call(r)}:null)}if(p.length){var s=m.activeClass;var w=Math.ceil(t/m.size);w=Math.min(w,p.children().length-1);p.children().removeClass(s).eq(w).addClass(s)}if(t===0){h.add(i).addClass(m.disabledClass)}else{h.add(i).removeClass(m.disabledClass)}if(t>=r.getSize()-m.size){j.add(n).addClass(m.disabledClass)}else{j.add(n).removeClass(m.disabledClass)}d=r;k=t;b(m,"onSeek",r,t);return r},move:function(u,t,s){var v=k+u;if(m.loop&&v>(r.getSize()-m.size)){v=0}return this.seekTo(v,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(u,t,s){return this.move(m.size*u,t,s)},setPage:function(w,x,u){var t=m.size;var s=t*w;var v=s+t>=this.getSize();if(v){s=this.getSize()-m.size}return this.seekTo(s,x,u)},prevPage:function(t,s){return this.setPage(this.getPageIndex()-1,t,s)},nextPage:function(t,s){return this.setPage(this.getPageIndex()+1,t,s)},begin:function(t,s){return this.seekTo(0,t,s)},end:function(t,s){return this.seekTo(this.getSize()-m.size,t,s)},reload:function(){return q()},click:function(t,w,u){var v=r.getItems().eq(t);var s=m.activeClass;if(!v.hasClass(s)&&(t>=0||t<this.getSize())){r.getItems().removeClass(s);v.addClass(s);var y=Math.floor(m.size/2);var x=t-y;if(x>r.getSize()-m.size){x--}if(x!==t){return this.seekTo(x,w,u)}}return r}});if(c.isFunction(c.fn.mousewheel)){o.bind("mousewheel.scrollable",function(t,u){var s=c.browser.opera?1:-1;r.move(u>0?s:-s,50);return false})}h.addClass(m.disabledClass).click(function(){r.prev()});j.click(function(){r.next()});n.click(function(){r.nextPage()});i.addClass(m.disabledClass).click(function(){r.prevPage()});if(m.keyboard){c(window).unbind("keypress.scrollable").bind("keypress.scrollable",function(s){var t=d;if(!t){return}if(e&&(s.keyCode==37||s.keyCode==39)){t.move(s.keyCode==37?-1:1);return s.preventDefault()}if(!e&&(s.keyCode==38||s.keyCode==40)){t.move(s.keyCode==38?-1:1);return s.preventDefault()}return true})}function q(){p.each(function(){var v=c(this);if(v.is(":empty")||v.data("me")==r){v.empty();v.data("me",r);for(var t=0;t<r.getPageAmount();t++){var u=c("<"+m.naviItem+"/>").attr("href",t).click(function(x){var w=c(this);w.parent().children().removeClass(m.activeClass);w.addClass(m.activeClass);r.setPage(w.attr("href"));return x.preventDefault()});if(t===0){u.addClass(m.activeClass)}v.append(u)}}else{var s=v.children();s.each(function(w){var x=c(this);x.attr("href",w);if(w===0){x.addClass(m.activeClass)}x.click(function(){v.find("."+m.activeClass).removeClass(m.activeClass);x.addClass(m.activeClass);r.setPage(x.attr("href"))})})}});if(m.clickable){r.getItems().each(function(t,s){var u=c(this);if(!u.data("set")){u.bind("click.scrollable",function(){r.click(t)});u.data("set",true)}})}if(m.hoverClass){r.getItems().hover(function(){c(this).addClass(m.hoverClass)},function(){c(this).removeClass(m.hoverClass)})}return r}q();var f=null;function l(){f=setInterval(function(){r.next()},m.interval)}if(m.interval>0){o.hover(function(){clearInterval(f)},function(){l()});c("div#scrollable-nav").hover(function(){clearInterval(f)},function(){l()});l()}}jQuery.prototype.scrollable=function(e){var f=this.eq(typeof e=="number"?e:0).data("scrollable");if(f){return f}var g={size:5,vertical:false,clickable:true,loop:false,interval:0,speed:400,keyboard:true,activeClass:"active",disabledClass:"disabled",hoverClass:null,easing:"swing",items:".items",prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",navi:".navi",naviItem:"a",onBeforeSeek:null,onSeek:null,alert:true};c.extend(g,e);this.each(function(){var h=new a(c(this),g);c(this).data("scrollable",h)});return this}})(jQuery);jQuery.fn.extend({selectbox:function(a){return this.each(function(){new jQuery.SelectBox(this,a)})}});if(!window.console){var console={log:function(a){}}}jQuery.SelectBox=function(t,e){var b=e||{};b.inputClass=b.inputClass||"selectbox";b.containerClass=b.containerClass||"selectbox-wrapper";b.hoverClass=b.hoverClass||"current";b.currentClass=b.selectedClass||"selected";b.debug=b.debug||false;var k=t.id;var f=0;var d=false;var s=0;var r=$(t);var p=h(b);var c=m(b);r.hide().before(c).before(p);q();c.click(function(){if(!d){p.toggle()}}).focus(function(){if(p.not(":visible")){d=true;p.show()}}).keydown(function(u){switch(u.keyCode){case 38:u.preventDefault();l(-1);break;case 40:u.preventDefault();l(1);break;case 13:u.preventDefault();$("li."+b.hoverClass).trigger("click");break;case 27:i();break}}).blur(function(){if(p.is(":visible")&&s>0){if(b.debug){console.log("container visible and has focus")}}else{if($.browser.msie||$.browser.safari){if(document.activeElement.getAttribute("id").indexOf("_container")==-1){i()}else{c.focus()}}else{i()}}});function i(){s=0;p.hide()}function q(){p.append(n(c.attr("id"))).hide();var u=c.css("width");p.width(u)}function h(v){var u=document.createElement("div");p=$(u);p.attr("id",k+"_container");p.addClass(v.containerClass);return p}function m(v){var u=document.createElement("input");var w=$(u);w.attr("id",k+"_input");w.attr("type","text");w.addClass(v.inputClass);w.attr("autocomplete","off");w.attr("readonly","readonly");w.attr("tabIndex",r.attr("tabindex"));return w}function l(v){var u=$("li",p);if(!u||u.length==0){return false}f+=v;if(f<0){f=u.size()}else{if(f>u.size()){f=0}}a(u,f);u.removeClass(b.hoverClass);$(u[f]).addClass(b.hoverClass)}function a(v,w){var u=$(v[w]).get(0);var v=p.get(0);if(u.offsetTop+u.offsetHeight>v.scrollTop+v.clientHeight){v.scrollTop=u.offsetTop+u.offsetHeight-v.clientHeight}else{if(u.offsetTop<v.scrollTop){v.scrollTop=u.offsetTop}}}function g(){var u=$("li."+b.currentClass,p).get(0);var v=(""+u.id).split("_");var w=v[v.length-1];r.val(w);c.val($(u).html());return true}function o(){return r.val()}function j(){return c.val()}function n(v){var w=new Array();var u=document.createElement("ul");r.children("option").each(function(){var x=document.createElement("li");x.setAttribute("id",v+"_"+$(this).val());x.innerHTML=$(this).html();if($(this).is(":selected")){c.val($(this).html());$(x).addClass(b.currentClass)}u.appendChild(x);$(x).mouseover(function(y){s=1;if(b.debug){console.log("over on : "+this.id)}jQuery(y.target,p).addClass(b.hoverClass)}).mouseout(function(y){s=-1;if(b.debug){console.log("out on : "+this.id)}jQuery(y.target,p).removeClass(b.hoverClass)}).click(function(y){var z=$("li."+b.hoverClass,p).get(0);if(b.debug){console.log("click on :"+this.id)}$("li."+b.currentClass).removeClass(b.currentClass);$(this).addClass(b.currentClass);g();r.get(0).blur();i()})});return u}};$(document).ready(function(){$(".ad-pics").cycle();$("#state").selectbox();$(".submit").live("click",function(){$(this).parents("form").submit();return false});$("a.b_link").click(function(){var a=$(this).attr("id").split("|");$.ajax({type:"GET",url:"tools/stats.php",data:"bID="+a[0]+"&catDetail="+a[1]})});$("input#q").focus(function(){if($(this).val()=="Type it here..."){$(this).val("")}});$(".nav").droppy({speed:100,zIndex:1500});$(".nav2").droppy({speed:100,zIndex:500});$("div.scrollable").scrollable({interval:3000,size:5,loop:true});$("div.items div").hoverIntent(function(){$(this).stop().animate({width:"200px",height:"200px",fontSize:"15px",marginTop:"-7px",marginLeft:"-4px",marginRight:"-5px"},"fast");$("img",this).animate({width:"170px",height:"118px"},"fast")},function(){$(this).stop().animate({width:"155px",height:"155px",fontSize:"11px",marginTop:"18px",marginLeft:"18px",marginRight:"18px"},"fast");$("img",this).animate({width:"130px",height:"90px"},"fast")});$("div#scrollable-nav a.prev").click(function(){var a=$("div.scrollable").scrollable();a.prev()});$("div#scrollable-nav a.next").click(function(){var a=$("div.scrollable").scrollable();a.next()})});
