var appPath = "/";

(function(B){B.fn.bgIframe=B.fn.bgiframe=function(A){if(B.browser.msie&&/6.0/.test(navigator.userAgent)){A=B.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},A||{});var F=function(C){return C&&C.constructor==Number?C+"px":C},E='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+A.src+'"style="display:block;position:absolute;z-index:-1;'+(A.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(A.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":F(A.top))+";left:"+(A.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":F(A.left))+";width:"+(A.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":F(A.width))+";height:"+(A.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":F(A.height))+';"/>';return this.each(function(){if(B("> iframe.bgiframe",this).length==0){this.insertBefore(document.createElement(E),this.firstChild)}})}return this}})(jQuery);(function(H){var J=H.ajax;var G={};var I=[];var F=[];H.ajax=function(B){B=jQuery.extend(B,jQuery.extend({},jQuery.ajaxSettings,B));var D=B.port;switch(B.mode){case"abort":if(G[D]){G[D].abort()}return G[D]=J.apply(this,arguments);case"queue":var A=B.complete;B.complete=function(){if(A){A.apply(this,arguments)}jQuery([J]).dequeue("ajax"+D)};jQuery([J]).queue("ajax"+D,function(){J(B)});return;case"sync":var C=I.length;I[C]={error:B.error,success:B.success,complete:B.complete,done:false};F[C]={error:[],success:[],complete:[]};B.error=function(){F[C].error=arguments};B.success=function(){F[C].success=arguments};B.complete=function(){F[C].complete=arguments;I[C].done=true;if(C==0||!I[C-1]){for(var E=C;E<I.length&&I[E].done;E++){if(I[E].error){I[E].error.apply(jQuery,F[E].error)}if(I[E].success){I[E].success.apply(jQuery,F[E].success)}if(I[E].complete){I[E].complete.apply(jQuery,F[E].complete)}I[E]=null;F[E]=null}}}}return J.apply(this,arguments)}})(jQuery);(function(B){B.fn.extend({autocomplete:function(A,F){var E=typeof A=="string";F=B.extend({},B.Autocompleter.defaults,{url:E?A:null,data:E?null:A,delay:E?B.Autocompleter.defaults.delay:10,max:F&&!F.scroll?10:150},F);F.highlight=F.highlight||function(C){return C};F.formatMatch=F.formatMatch||F.formatItem;return this.each(function(){new B.Autocompleter(this,F)})},result:function(A){return this.bind("result",A)},search:function(A){return this.trigger("search",[A])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(A){return this.trigger("setOptions",[A])},unautocomplete:function(){return this.trigger("unautocomplete")}});B.Autocompleter=function(b,m){var A={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var h=B(b).attr("autocomplete","off").addClass(m.inputClass);var Y;var p="";var c=B.Autocompleter.Cache(m);var k=0;var n;var s={mouseDownOnSelect:false};var a=B.Autocompleter.Select(m,b,j,s);var Z;B.browser.opera&&B(b.form).bind("submit.autocomplete",function(){if(Z){Z=false;return false}});h.bind((B.browser.opera?"keypress":"keydown")+".autocomplete",function(C){n=C.keyCode;switch(C.keyCode){case A.UP:C.preventDefault();if(a.visible()){a.prev()}else{f(0,true)}break;case A.DOWN:C.preventDefault();if(a.visible()){a.next()}else{f(0,true)}break;case A.PAGEUP:C.preventDefault();if(a.visible()){a.pageUp()}else{f(0,true)}break;case A.PAGEDOWN:C.preventDefault();if(a.visible()){a.pageDown()}else{f(0,true)}break;case m.multiple&&B.trim(m.multipleSeparator)==","&&A.COMMA:case A.TAB:case A.RETURN:if(j()){C.preventDefault();Z=true;return false}break;case A.ESC:a.hide();break;default:clearTimeout(Y);Y=setTimeout(f,m.delay);break}}).focus(function(){k++}).blur(function(){k=0;if(!s.mouseDownOnSelect){t()}}).click(function(){if(k++>1&&!a.visible()){f(0,true)}}).bind("search",function(){var C=(arguments.length>1)?arguments[1]:null;function D(H,F){var E;if(F&&F.length){for(var G=0;G<F.length;G++){if(F[G].result.toLowerCase()==H.toLowerCase()){E=F[G];break}}}if(typeof C=="function"){C(E)}else{h.trigger("result",E&&[E.data,E.value])}}B.each(q(h.val()),function(F,E){e(E,D,D)})}).bind("flushCache",function(){c.flush()}).bind("setOptions",function(){B.extend(m,arguments[1]);if("data" in arguments[1]){c.populate()}}).bind("unautocomplete",function(){a.unbind();h.unbind();B(b.form).unbind(".autocomplete")});function j(){var D=a.selected();if(!D){return false}var C=D.result;p=C;if(m.multiple){var E=q(h.val());if(E.length>1){C=E.slice(0,E.length-1).join(m.multipleSeparator)+m.multipleSeparator+C}C+=m.multipleSeparator}h.val(C);u();h.trigger("result",[D.data,D.value]);return true}function f(D,E){if(n==A.DEL){a.hide();return}var C=h.val();if(!E&&C==p){return}p=C;C=l(C);if(C.length>=m.minChars){h.addClass(m.loadingClass);if(!m.matchCase){C=C.toLowerCase()}e(C,o,u)}else{d();a.hide()}}function q(C){if(!C){return[""]}var D=C.split(m.multipleSeparator);var E=[];B.each(D,function(G,F){if(B.trim(F)){E[G]=B.trim(F)}});return E}function l(C){if(!m.multiple){return C}var D=q(C);return D[D.length-1]}function r(D,C){if(m.autoFill&&(l(h.val()).toLowerCase()==D.toLowerCase())&&n!=A.BACKSPACE){h.val(h.val()+C.substring(l(p).length));B.Autocompleter.Selection(b,p.length,p.length+C.length)}}function t(){clearTimeout(Y);Y=setTimeout(u,200)}function u(){var C=a.visible();a.hide();clearTimeout(Y);d();if(m.mustMatch){h.search(function(E){if(!E){if(m.multiple){var D=q(h.val()).slice(0,-1);h.val(D.join(m.multipleSeparator)+(D.length?m.multipleSeparator:""))}else{h.val("")}}})}if(C){B.Autocompleter.Selection(b,b.value.length,b.value.length)}}function o(D,C){if(C&&C.length&&k){d();a.display(C,D);r(D,C[0].value);a.show()}else{u()}}function e(F,D,E){if(!m.matchCase){F=F.toLowerCase()}var G=c.load(F);if(G&&G.length){D(F,G)}else{if((typeof m.url=="string")&&(m.url.length>0)){var C={timestamp:+new Date()};B.each(m.extraParams,function(H,I){C[H]=typeof I=="function"?I():I});B.ajax({mode:"abort",port:"autocomplete"+b.name,dataType:m.dataType,url:m.url,data:B.extend({q:l(F),limit:m.max},C),success:function(I){var H=m.parse&&m.parse(I)||g(I);c.add(F,H);D(F,H)}})}else{a.emptyList();E(F)}}}function g(F){var D=[];var E=F.split("\n");for(var G=0;G<E.length;G++){var C=B.trim(E[G]);if(C){C=C.split("|");D[D.length]={data:C,value:C[0],result:m.formatResult&&m.formatResult(C,C[0])||C[0]}}}return D}function d(){h.removeClass(m.loadingClass)}};B.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(A){return A[0]},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(A,D){return A.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+D.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:180};B.Autocompleter.Cache=function(N){var K={};var A=0;function J(D,C){if(!N.matchCase){D=D.toLowerCase()}var E=D.indexOf(C);if(E==-1){return false}return E==0||N.matchContains}function L(D,C){if(A>N.cacheLength){I()}if(!K[D]){A++}K[D]=C}function M(){if(!N.data){return false}var G={},Q=0;if(!N.url){N.cacheLength=1}G[""]=[];for(var D=0,E=N.data.length;D<E;D++){var C=N.data[D];C=(typeof C=="string")?[C]:C;var F=N.formatMatch(C,D+1,N.data.length);if(F===false){continue}var R=F.charAt(0).toLowerCase();if(!G[R]){G[R]=[]}var H={value:F,data:C,result:N.formatResult&&N.formatResult(C)||F};G[R].push(H);if(Q++<N.max){G[""].push(H)}}B.each(G,function(P,O){N.cacheLength++;L(P,O)})}setTimeout(M,25);function I(){K={};A=0}return{flush:I,add:L,populate:M,load:function(D){if(!N.cacheLength||!A){return null}if(!N.url&&N.matchContains){var E=[];for(var C in K){if(C.length>0){var F=K[C];B.each(F,function(P,H){if(J(H.value,D)){E.push(H)}})}}return E}else{if(K[D]){return K[D]}else{if(N.matchSubset){for(var G=D.length-1;G>=N.minChars;G--){var F=K[D.substr(0,G)];if(F){var E=[];B.each(F,function(P,H){if(J(H.value,D)){E[E.length]=H}});return E}}}}}return null}}};B.Autocompleter.Select=function(f,T,A,e){var a={ACTIVE:"ac_over"};var Z,j=-1,h,V="",g=true,Y,d;function c(){if(!g){return}Y=B("<div/>").hide().addClass(f.resultsClass).css("position","absolute").appendTo(document.body);d=B("<ul/>").appendTo(Y).mouseover(function(C){if(U(C).nodeName&&U(C).nodeName.toUpperCase()=="LI"){j=B("li",d).removeClass(a.ACTIVE).index(U(C));B(U(C)).addClass(a.ACTIVE)}}).click(function(C){B(U(C)).addClass(a.ACTIVE);A();T.focus();return false}).mousedown(function(){e.mouseDownOnSelect=true}).mouseup(function(){e.mouseDownOnSelect=false});if(f.width>0){Y.css("width",f.width)}g=false}function U(C){var D=C.target;while(D&&D.tagName!="LI"){D=D.parentNode}if(!D){return[]}return D}function W(C){Z.slice(j,j+1).removeClass(a.ACTIVE);k(C);var D=Z.slice(j,j+1).addClass(a.ACTIVE);if(f.scroll){var E=0;Z.slice(0,j).each(function(){E+=this.offsetHeight});if((E+D[0].offsetHeight-d.scrollTop())>d[0].clientHeight){d.scrollTop(E+D[0].offsetHeight-d.innerHeight())}else{if(E<d.scrollTop()){d.scrollTop(E)}}}}function k(C){j+=C;if(j<0){j=Z.size()-1}else{if(j>=Z.size()){j=0}}}function X(C){return f.max&&f.max<C?f.max:C}function b(){d.empty();var F=X(h.length);for(var E=0;E<F;E++){if(!h[E]){continue}var C=f.formatItem(h[E].data,E+1,F,h[E].value,V);if(C===false){continue}var D=B("<li/>").html(f.highlight(C,V)).addClass(E%2==0?"ac_even":"ac_odd").appendTo(d)[0];B.data(D,"ac_data",h[E])}Z=d.find("li");if(f.selectFirst){Z.slice(0,1).addClass(a.ACTIVE);j=0}if(B.fn.bgiframe){d.bgiframe()}}return{display:function(C,D){c();h=C;V=D;b()},next:function(){W(1)},prev:function(){W(-1)},pageUp:function(){if(j!=0&&j-8<0){W(-j)}else{W(-8)}},pageDown:function(){if(j!=Z.size()-1&&j+8>Z.size()){W(Z.size()-1-j)}else{W(8)}},hide:function(){Y&&Y.hide();Z&&Z.removeClass(a.ACTIVE);j=-1},visible:function(){return Y&&Y.is(":visible")},current:function(){return this.visible()&&(Z.filter("."+a.ACTIVE)[0]||f.selectFirst&&Z[0])},show:function(){var D=B(T).offset();Y.css({width:typeof f.width=="string"||f.width>0?f.width:B(T).width(),top:D.top+T.offsetHeight,left:D.left}).show();if(f.scroll){d.scrollTop(0);d.css({maxHeight:f.scrollHeight,overflow:"auto"});if(B.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var C=0;Z.each(function(){C+=this.offsetHeight});var E=C>f.scrollHeight;d.css("height",E?f.scrollHeight:C);if(!E){Z.width(d.width()-parseInt(Z.css("padding-left"))-parseInt(Z.css("padding-right")))}}}},selected:function(){var C=Z&&Z.filter("."+a.ACTIVE).removeClass(a.ACTIVE);return C&&C.length&&B.data(C[0],"ac_data")},emptyList:function(){d&&d.empty()},unbind:function(){Y&&Y.remove()}}};B.Autocompleter.Selection=function(H,F,G){if(H.createTextRange){var A=H.createTextRange();A.collapse(true);A.moveStart("character",F);A.moveEnd("character",G);A.select()}else{if(H.setSelectionRange){H.setSelectionRange(F,G)}else{if(H.selectionStart){H.selectionStart=F;H.selectionEnd=G}}}H.focus()}})(jQuery);var timeout=300;var closetimer=3000;var ddmenuitem=0;function dropdownmenu_open(){dropdownmenu_canceltimer();dropdownmenu_close();ddmenuitem=$(this).find("ul").css("visibility","visible")}function dropdownmenu_close(){if(ddmenuitem){ddmenuitem.css("visibility","hidden")}}function dropdownmenu_timer(){closetimer=window.setTimeout(dropdownmenu_close,timeout)}function dropdownmenu_canceltimer(){if(closetimer){window.clearTimeout(closetimer);closetimer=null}}$(document).ready(function(){$(".dropdownmenu > li").bind("mouseover",dropdownmenu_open);$(".dropdownmenu > li").bind("mouseout",dropdownmenu_timer)});document.onclick=dropdownmenu_close;function setActiveStyleSheet(E){var G,F,H;for(G=0;(F=document.getElementsByTagName("link")[G]);G++){if(F.getAttribute("rel").indexOf("style")!=-1&&F.getAttribute("title")){F.disabled=true;if(F.getAttribute("title")==E){F.disabled=false}}}}function getActiveStyleSheet(){var D,C;for(D=0;(C=document.getElementsByTagName("link")[D]);D++){if(C.getAttribute("rel").indexOf("style")!=-1&&C.getAttribute("title")&&!C.disabled){return C.getAttribute("title")}}return null}function getPreferredStyleSheet(){var D,C;for(D=0;(C=document.getElementsByTagName("link")[D]);D++){if(C.getAttribute("rel").indexOf("style")!=-1&&C.getAttribute("rel").indexOf("alt")==-1&&C.getAttribute("title")){return C.getAttribute("title")}}return null}function createCookie(F,J,I){if(I){var G=new Date();G.setTime(G.getTime()+(I*24*60*60*1000));var H="; expires="+G.toGMTString()}else{H=""}document.cookie=F+"="+J+H+"; path=/"}function readCookie(F){var J=F+"=";var G=document.cookie.split(";");for(var I=0;I<G.length;I++){var H=G[I];while(H.charAt(0)==" "){H=H.substring(1,H.length)}if(H.indexOf(J)==0){return H.substring(J.length,H.length)}}return null}window.onload=function(F){var E=readCookie("style");var D=E?E:getPreferredStyleSheet();setActiveStyleSheet(D)};window.onunload=function(D){var C=getActiveStyleSheet();createCookie("style",C,365)};var cookie=readCookie("style");var title=cookie?cookie:getPreferredStyleSheet();setActiveStyleSheet(title);(function(F){var D=F.scrollTo=function(A,B,C){F(window).scrollTo(A,B,C)};D.defaults={axis:"xy",duration:parseFloat(F.fn.jquery)>=1.3?0:1};D.window=function(A){return F(window).scrollable()};F.fn.scrollable=function(){return this.map(function(){var A=this,B=!A.nodeName||F.inArray(A.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!B){return A}var C=(A.contentWindow||A).document||A.ownerDocument||A;return F.browser.safari||C.compatMode=="BackCompat"?C.body:C.documentElement})};F.fn.scrollTo=function(C,B,A){if(typeof B=="object"){A=B;B=0}if(typeof A=="function"){A={onAfter:A}}if(C=="max"){C=9000000000}A=F.extend({},D.defaults,A);B=B||A.speed||A.duration;A.queue=A.queue&&A.axis.length>1;if(A.queue){B/=2}A.offset=E(A.offset);A.over=E(A.over);return this.scrollable().each(function(){var O=this,P=F(O),R=C,Q,S={},T=P.is("html,body");switch(typeof R){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px)?$/.test(R)){R=E(R);break}R=F(R,this);case"object":if(R.is||R.style){Q=(R=F(R)).offset()}}F.each(A.axis.split(""),function(H,I){var K=I=="x"?"Left":"Top",J=K.toLowerCase(),G="scroll"+K,L=O[G],M=I=="x"?"Width":"Height";if(Q){S[G]=Q[J]+(T?0:L-P.offset()[J]);if(A.margin){S[G]-=parseInt(R.css("margin"+K))||0;S[G]-=parseInt(R.css("border"+K+"Width"))||0}S[G]+=A.offset[J]||0;if(A.over[J]){S[G]+=R[M.toLowerCase()]()*A.over[J]}}else{S[G]=R[J]}if(/^\d+$/.test(S[G])){S[G]=S[G]<=0?0:Math.min(S[G],V(M))}if(!H&&A.queue){if(L!=S[G]){U(A.onAfterFirst)}delete S[G]}});U(A.onAfter);function U(G){P.animate(S,B,A.easing,G&&function(){G.call(this,C,A)})}function V(K){var G="scroll"+K;if(!T){return O[G]}var I="client"+K,H=O.ownerDocument.documentElement,J=O.ownerDocument.body;return Math.max(H[G],J[G])-Math.min(H[I],J[I])}}).end()};function E(A){return typeof A=="object"?A:{top:A,left:A}}})(jQuery);(function(B){B.fn.lazyload=function(F){var A={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window};if(F){B.extend(A,F)}var E=this;if("scroll"==A.event){B(A.container).bind("scroll",function(C){var D=0;E.each(function(){if(B.abovethetop(this,A)||B.leftofbegin(this,A)){}else{if(!B.belowthefold(this,A)&&!B.rightoffold(this,A)){B(this).trigger("appear")}else{if(D++>A.failurelimit){return false}}}});var H=B.grep(E,function(G){return !G.loaded});E=B(H)})}this.each(function(){var C=this;if(undefined==B(C).attr("original")){B(C).attr("original",B(C).attr("src"))}if("scroll"!=A.event||undefined==B(C).attr("src")||A.placeholder==B(C).attr("src")||(B.abovethetop(C,A)||B.leftofbegin(C,A)||B.belowthefold(C,A)||B.rightoffold(C,A))){if(A.placeholder){B(C).attr("src",A.placeholder)}else{B(C).removeAttr("src")}C.loaded=false}else{C.loaded=true}B(C).one("appear",function(){if(!this.loaded){B("<img />").bind("load",function(){B(C).hide().attr("src",B(C).attr("original"))[A.effect](A.effectspeed);C.loaded=true}).attr("src",B(C).attr("original"))}});if("scroll"!=A.event){B(C).bind(A.event,function(D){if(!C.loaded){B(C).trigger("appear")}})}});B(A.container).trigger(A.event);return this};B.belowthefold=function(F,E){if(E.container===undefined||E.container===window){var A=B(window).height()+B(window).scrollTop()}else{var A=B(E.container).offset().top+B(E.container).height()}return A<=B(F).offset().top-E.threshold};B.rightoffold=function(F,E){if(E.container===undefined||E.container===window){var A=B(window).width()+B(window).scrollLeft()}else{var A=B(E.container).offset().left+B(E.container).width()}return A<=B(F).offset().left-E.threshold};B.abovethetop=function(F,E){if(E.container===undefined||E.container===window){var A=B(window).scrollTop()}else{var A=B(E.container).offset().top}return A>=B(F).offset().top+E.threshold+B(F).height()};B.leftofbegin=function(F,E){if(E.container===undefined||E.container===window){var A=B(window).scrollLeft()}else{var A=B(E.container).offset().left}return A>=B(F).offset().left+E.threshold+B(F).width()};B.extend(B.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery);(function(B){var C="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 G=B(this);var H=E.slideExpr?B(E.slideExpr,this):G.children();var I=H.get();if(I.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+I.length)}return}var F=B.extend({},B.fn.cycle.defaults,E||{},B.metadata?G.metadata():B.meta?G.data():{});F.before=F.before?[F.before]:[];F.after=F.after?[F.after]:[];F.after.unshift(function(){F.busy=0});var L=this.className;F.width=parseInt((L.match(/w:(\d+)/)||[])[1])||F.width;F.height=parseInt((L.match(/h:(\d+)/)||[])[1])||F.height;F.timeout=parseInt((L.match(/t:(\d+)/)||[])[1])||F.timeout;if(G.css("position")=="static"){G.css("position","relative")}if(F.width){G.width(F.width)}if(F.height&&F.height!="auto"){G.height(F.height)}var J=0;H.css({position:"absolute",top:0,left:0}).hide().each(function(M){B(this).css("z-index",I.length-M)});B(I[J]).css("opacity",1).show();if(B.browser.msie){I[J].style.removeAttribute("filter")}if(F.fit&&F.width){H.width(F.width)}if(F.fit&&F.height&&F.height!="auto"){H.height(F.height)}if(F.pause){G.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}B.fn.cycle.transitions.fade(G,H,F);H.each(function(){var M=B(this);this.cycleH=(F.fit&&F.height)?F.height:M.height();this.cycleW=(F.fit&&F.width)?F.width:M.width()});H.not(":eq("+J+")").css({opacity:0});if(F.cssFirst){B(H[J]).css(F.cssFirst)}if(F.timeout){if(F.speed.constructor==String){F.speed={slow:600,fast:200}[F.speed]||400}if(!F.sync){F.speed=F.speed/2}while((F.timeout-F.speed)<250){F.timeout+=F.speed}}F.speedIn=F.speed;F.speedOut=F.speed;F.slideCount=I.length;F.currSlide=J;F.nextSlide=1;var K=H[J];if(F.before.length){F.before[0].apply(K,[K,K,F,true])}if(F.after.length>1){F.after[1].apply(K,[K,K,F,true])}if(F.click&&!F.next){F.next=F.click}if(F.next){B(F.next).bind("click",function(){return A(I,F,F.rev?-1:1)})}if(F.prev){B(F.prev).bind("click",function(){return A(I,F,F.rev?1:-1)})}if(F.timeout){this.cycleTimeout=setTimeout(function(){D(I,F,0,!F.rev)},F.timeout+(F.delay||0))}})};function D(L,M,K,H){if(M.busy){return}var G=L[0].parentNode,J=L[M.currSlide],I=L[M.nextSlide];if(G.cycleTimeout===0&&!K){return}if(K||!G.cyclePause){if(M.before.length){B.each(M.before,function(N,O){O.apply(I,[J,I,M,H])})}var E=function(){if(B.browser.msie){this.style.removeAttribute("filter")}B.each(M.after,function(N,O){O.apply(I,[J,I,M,H])})};if(M.nextSlide!=M.currSlide){M.busy=1;B.fn.cycle.custom(J,I,M,E)}var F=(M.nextSlide+1)==L.length;M.nextSlide=F?0:M.nextSlide+1;M.currSlide=F?L.length-1:M.nextSlide-1}if(M.timeout){G.cycleTimeout=setTimeout(function(){D(L,M,0,!M.rev)},M.timeout)}}function A(H,I,G){var F=H[0].parentNode,E=F.cycleTimeout;if(E){clearTimeout(E);F.cycleTimeout=0}I.nextSlide=I.currSlide+G;if(I.nextSlide<0){I.nextSlide=H.length-1}else{if(I.nextSlide>=H.length){I.nextSlide=0}}D(H,I,1,G>=0);return false}B.fn.cycle.custom=function(G,K,E,F){var I=B(G),H=B(K);H.css({opacity:0});var J=function(){H.animate({opacity:1},E.speedIn,E.easeIn,F)};I.animate({opacity:0},E.speedOut,E.easeOut,function(){I.css({display:"none"});if(!E.sync){J()}});if(E.sync){J()}};B.fn.cycle.transitions={fade:function(G,E,F){E.not(":eq(0)").css("opacity",0);F.before.push(function(){B(this).show()})}};B.fn.cycle.ver=function(){return C};B.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery);var validate=true;var scripts=document.getElementsByTagName("script");var myScript=scripts[scripts.length-1];var queryString=myScript.src.replace(/^[^\?]+\??/,"");var config=parseQuery(queryString);var appPath=config["appPath"];var autoCompleteUrl=appPath+"Search.ashx?Type=";function fncAppPath(){return config["appPath"]}function parseQuery(D){var F=new Object();if(!D){return F}var G=D.split(/[;&]/);for(var B=0;B<G.length;B++){var E=G[B].split("=");if(!E||E.length!=2){continue}var A=unescape(E[0]);var C=unescape(E[1]);C=C.replace(/\+/g," ");F[A]=C}return F}function closeWindow(){window.close()}function printPage(){window.print()}function back(){history.go(-1);return false}function deleteObject(A){if(confirm("Are you sure you want to delete this "+A+"?\nNote: There is no Undo.")){return true}else{return false}}function alertAndFocus(B,A){hideShow(1,("error_"+B.id));B.focus()}function alertAndShow(B,A){hideShow(1,(A));fncScrollTo("#"+A);B.focus()}function hide(A){hideShow(0,A)}function show(A){hideShow(1,A)}function hideShow(A,B){if(document.getElementById(B)){if(A==1){document.getElementById(B).style.display="block"}else{document.getElementById(B).style.display="none"}}}function setFocus(A){if(document.getElementById(A)){document.getElementById(A).focus()}}function resetErrorElement(A){hideShow(0,("error_"+A.id))}function resetErrorElementID(A){hideShow(0,(A))}function isEmpty(B,A,C){if((B.value=="")||(B.value==A)){alertAndFocus(B,C);return true}else{resetErrorElement(B);return false}}function isEmptyAndShow(B,A,C){if((B.value=="")||(B.value==A)){alertAndShow(B,C);return true}else{resetErrorElementID(C);return false}}function isBothEmptyAndShow(C,B,A,D){if(((C.value=="")||(C.value==A))&&(B.value=="")){alertAndShow(C,D);return true}else{resetErrorElementID(D);return false}}function isBothMatchAndShow(B,A,C){if(!(B.value==A.value)){alertAndShow(B,C);return true}else{resetErrorElementID(C);return false}}function isNotCheckedAndShow(A,B){if(!isElementChecked(A)){alertAndShow(A,B);return true}else{resetErrorElementID(B);return false}}function isGroupNotCheckedAndShow(A,B,C){if(!isChecked(A)){alertAndShow(B,C);return true}else{resetErrorElementID(C);return false}}function isEmailInvalidAndShow(B,A,C){if(!validateEmail(B.value,"")){alertAndShow(B,C);return true}else{resetErrorElementID(C);return false}}function isSelectedIndex(B,C,A){if(B.selectedIndex==A){alertAndFocus(B,C);return false}return true}function isElementChecked(A){if(A.checked==true){return true}else{return false}}function isChecked(A){formElement=document.getElementsByName(A);for(i=0;i<formElement.length;i++){if(formElement[i].checked==true){return true}}return false}function isNumerical(A,C){var D=0;var B=false;if(C.indexOf(".")!=-1){B=true}for(i=0;i<A.length;i++){ch=A.charAt(i);if(C.indexOf(ch)==-1){return false}if((B==true)&&(ch==".")){D++;if(D>1){return false}}}return true}function validateEmail(A,B){if((A=="")||(A==B)){return false}else{eLength=A.length;eAt=A.indexOf("@");eDot=A.lastIndexOf(".");eSpace=A.indexOf(" ");if((eAt==-1)||(eAt==0)||(eAt==eLength-1)){return false}else{if((eDot==-1)||(eDot==0)||(eDot==eLength-1)||(eDot<=eAt+1)){return false}}if(eSpace!=-1){return false}}return true}function clearInput(A,B){element=document.getElementById(B);if(element.value==A){element.value=""}}function fncCheckForAjaxHeader(A){if(!A.getResponseHeader("AJAX")){window.location=appPath+"Login.aspx?ReturnUrl="+window.location}}function getRecordIDFromID(C){var B=C.lastIndexOf("_");if(B==-1){B=C.lastIndexOf("-")}var A=C.substring(B+1,C.length);return A}function fncScrollTo(A){$.scrollTo(A,"none",{axis:"y"})}function fncHighlight(A){fncHighlightMaster(A,"#FFFF66","#ffffff",1000)}function fncHighlightMaster(C,D,A,B){$("#"+C).css("backgroundColor",D);$("#"+C).animate({backgroundColor:A},B)}function fncGetLoadingHTML(){return'<span class="loading"><span>Loading...</span></span>'}function fncRequest(A){return fncRequest(A,window.location)}function fncRequest(B,D){var C="";var A=D.indexOf(B+"=");if(A>=0){indexOfQuestionMark=D.indexOf("?");if(indexOfQuestionMark>=0){qs=D.substring(indexOfQuestionMark+1)}else{qs=D}qsItems=qs.split("&");if(qsItems.length>0){for(i=0;i<qsItems.length;i++){nameAndValue=qsItems=qsItems[i].split("=");if(nameAndValue.length==2){if(nameAndValue[0]==B){return nameAndValue[1]}}}}}return C}function fncAddImgOnError(A){$(A).error(function(){var B=$(this).attr("src");B=fncGetErrorImageFromFilename(B);$(this).unbind("error").attr("src",B);return true})}function fncGetErrorImageFromFilename(C){var B=C.lastIndexOf("/");var A="m.gif";if(B>-1){switch(C.substring(B-1,B)){case"p":A="p.gif";break;case"t":A="t.gif";break;case"t":A="t.gif";break;case"m":A="m.gif";break;case"l":case"xl":A="l.gif";break;default:A="m.gif"}}C=appPath+"images/no-image/"+A;return C}function fncImgError(A,B){A.onerror="";A.src=B;return true}function fncStarRating(A){$caption=$("<span/>");$(A).children().not(":input").hide();$(A).stars({cancelShow:false});$caption.appendTo(A)}function fncAutocomplete(D,C,A,B){$("#"+D).autocomplete(C,{minChars:0,max:20,autoFill:false,mustMatch:true,multipleSeparator:",, ",formatItem:function(G,F,E){if(G[2]){return G[0]+" ("+G[2]+")"}else{return G[0]}}});$("#"+D).result(function(F,G,E){if(B){$("#"+A).val(!G?"":G[1])}else{$("#"+A).val(G[1])}}).blur(function(){});$("#"+D).keyup(function(){if($("#"+D).val==""){$("#"+A).val("")}})}function fncSetUrls(){var A=$("form#search").serialize();newUrl=autoCompleteUrl+"1&"+A;$("#Category_Search").setOptions({url:newUrl});$("#Category_Search").flushCache();newUrl=autoCompleteUrl+"3&"+A;$("#Manufacturer_Search").setOptions({url:newUrl});$("#Manufacturer_Search").flushCache();newUrl=autoCompleteUrl+"4&"+A;$("#Model_Search").setOptions({url:newUrl});$("#Model_Search").flushCache();newUrl=autoCompleteUrl+"3&"+$("form#search-manufacturers").serialize();$("#Manufacturer_Keywords").setOptions({url:newUrl});$("#Manufacturer_Keywords").flushCache();newUrl=autoCompleteUrl+"4&"+$("form#search-models").serialize();$("#Model_Keywords").setOptions({url:newUrl});$("#Model_Keywords").flushCache()}function fncSearchAutocomplete(D,E,B,C){var A=autoCompleteUrl+D;$("#"+E).autocomplete(A,{minChars:0,max:20,autoFill:false,mustMatch:false,multipleSeparator:",, ",formatItem:function(H,G,F){if(H[2]){return H[0]+" ("+H[2]+")"}else{return H[0]}}});$("#"+E).result(function(G,H,F){if(C){$("#"+B).val(!H?"":H[1])}else{$("#"+B).val(H[1])}fncSetUrls()}).blur(function(){fncSetUrls()});$("#"+E).keyup(function(){if($("#"+E).val()==""){$("#"+B).val("0");fncSetUrls()}});$("#"+E).change(function(){fncSetUrls()})}function InitModels(){if($(".fits .manufacturer").length>1){$(".fits .manufacturer .models").hide()}$(".fits .manufacturer h3").css("cursor","pointer");$(".fits .manufacturer h3").click(function(){$(this).next(".models").slideToggle("fast");return false})}function InitProduct(){$(document).ready(function(){if($("a[rel='picture']").length>0){$("a[rel='picture']").colorbox({photo:true,innerWidth:640,innerHeight:640,opacity:0.8,current:""})}$("div.tabs").tabs({cache:true});InitModels()})}$(document).ready(function(){jQuery.ajaxSetup({"beforeSend":function(A){A.setRequestHeader("AJAX","true")}});$(".scrollTo").click(function(){target=$(this).attr("href");fncScrollTo(target);return false});$(".autoSubmit").change(function(){$(this).closest("form").submit()});$("a.addNewAddress").click(function(){fncScrollTo("#regionAddNewAddress");return false});$("#Address_CountryID").change(function(){$.getJSON(appPath+"Ajax/CountryRegions.ashx",{country_ID:$(this).val(),ajax:"true"},function(C){var B="";B+='<option value="">Select your Region</option>';for(var A=0;A<C.length;A++){B+='<option value="'+C[A].value+'">'+C[A].name+"</option>"}$("#Address_CountryRegionID").html(B);if(C.length==1&&C[0].value=="0"){$("#Row_Address_CountryRegionID").hide();$("#Row_Address_RegionName").show()}else{$("#Row_Address_RegionName").hide();$("#Row_Address_CountryRegionID").show()}})});fncAddImgOnError("img");if(jQuery().lazyload){$(".product img.thumb:not(.slideshow img, .orders img), .product img.thumb2").lazyload({effect:"fadeIn",placeholder:function(){return fncGetErrorImageFromFilename($(this).attr("src"))}})}fncSearchAutocomplete("1","Category_Search","Category_ID",true);fncSearchAutocomplete("3","Manufacturer_Search","Manufacturer_ID",true);fncSearchAutocomplete("4","Model_Search","Model_ID",true);fncSearchAutocomplete("3","Manufacturer_Keywords","Manufacturer_Keywords_ID",true);fncSearchAutocomplete("4","Model_Keywords","Model_Keywords_ID",true);fncSetUrls()});

