function commentVote(a){var b=GetMarketAndLang();var c=$(a).parent("footer").parent("article").attr("id");c=c.substring(4);$.ajax({url:"http://"+document.domain+"/inc/commenter_vote_run",type:"GET",data:{nr:c,market:b.market,lang:b.lang}});$(a).replaceWith(function(){return"<span>"+(parseInt($(a).text())+1)+$("<div/>").append($("img",a).clone()).html()+" "+GetText("cmnt_text_thanks_short")+"</span>"})}function submitComment(a){var b=GetMarketAndLang();var c=$(a).parent("div").parent("article");var d=$('[name="answerTo"]',a).val();var e=$('[name="name"]',a).val();var f=$('[name="email"]',a).val();var g=$('[name="comment"]',a).val();var h=$(".submitBtn",a);$(h).attr("disabled","disabled");$(h).after('<div id="waitAnim" class="send"></div>');$("article",c).last().after('<article id="theNewComment" class="oneAnswer"></article>');if($("#theNewComment").length==0)$(".comment_comment",c).after('<article id="theNewComment" class="oneAnswer"></article>');$("#theNewComment").hide();$.ajax({url:"http://"+document.domain+"/inc/commenterWriteRun",type:"POST",data:{answerTo:d,market:b.market,lang:b.lang,name:e,email:f,comment:g,ajax:1},success:function(b){$("#theNewComment").html(b);$(a).slideUp("slow",function(){$("#waitAnim").remove();$(".new_comment",c).slideUp("slow");$(".new_comment",c).remove();$("#theNewComment").slideDown("slow",function(){$("#theNewComment").animate({borderLeftColor:"#a03030"},"slow");$("#theNewComment").removeAttr("id")})})}})}function LoadCommentAnswerForm(a){var b=GetMarketAndLang();var c=$(a).parent("footer").parent("article").attr("id");c=c.substring(4);var d="#answerform"+c;if($("div").is(d)){if($(a).hasClass("clicked"))$(a).removeClass("clicked");else $(a).addClass("clicked");$(d).slideToggle();$(d).find(".nameinput").focus()}else{$(a).addClass("clicked");$(a).parent("footer").before('<div id="answerform'+c+'" class="new_comment"></div>\n      ');$(d).before('<div id="waitAnim"></div>');$(d).hide();$.ajax({type:"POST",url:"http://"+document.domain+"/inc/commenterWrite",data:{lang:b.lang,market:b.market,answerTo:c},success:function(a){$(d).html(a);$("#waitAnim").fadeOut("slow",function(){$("#waitAnim").remove();$(d).slideDown("slow",function(){$(d).find(".name input").focus()})})}})}}function LimitMessageLength(a){var b=$(a).val();var c=2e3;if(b.length>c){$(a).val(b.substr(0,c))}}function showTaxiCostFor(a){var b=GetMarketAndLang();var c;$("#taxiPrice").before('<div id="waitAnimSmall"></div>');$("#taxiPrice").hide();$.ajax({url:"http://"+document.domain+"/inc/taxiCost",type:"GET",dataType:"html",async:false,data:{market:b.market,lang:b.lang,metro:a},success:function(a){$("#waitAnimSmall").fadeOut("slow",function(){$("#taxiPrice").fadeIn("slow");$(this).remove()});c=a}});return c}function generateTaxiSelect(a){var b;$.ajax({type:"GET",url:"http://"+document.domain+"/inc/generatedMetroSelect",dataType:"html",async:false,success:function(a){b=a}});var c=b.indexOf(a);b=b.substr(0,c-1)+' selected="selected"'+b.substr(c-1);return b}function GetText(a){var b=GetMarketAndLang();var c="Felkod: 109. sib.js";$.ajax({url:"http://"+document.domain+"/inc/ajaxGetText",type:"GET",data:{lang:b.lang,market:b.market,name:a},async:false,success:function(a){c=a}});return c}function GetMarketAndLang(){pathname=window.location.pathname;var a=pathname.substr(pathname.lastIndexOf("/")+1);var b=pathname.substr(pathname.lastIndexOf("/")-2,2);if(b!="sv"&&b!="tr"&&b!="de")b="en";return{market:a,lang:b}}function showProductsMenu(){$(".dropMenu",this).stop(true,true).slideDown("fast")}function hideProductsMenu(){$(".dropMenu",this).stop(true,true).slideUp("fast")}function showMarketsMenu(){$(".dropMenu",this).stop(true,true).slideDown("fast")}function hideMarketsMenu(){$(".dropMenu",this).stop(true,true).slideUp("fast")}$(document).ready(function(){var a={over:showMarketsMenu,interval:50,timeout:200,sensitivity:9,out:hideMarketsMenu};var b={over:showProductsMenu,interval:50,timeout:200,sensitivity:9,out:hideProductsMenu};$("#marketsLink").hoverIntent(a);$("#productsLink").hoverIntent(b);if($("#slider").length>0)$("#slider").nivoSlider({effect:"fade",animSpeed:500,pauseTime:5e3,directionNav:true,directionNavHide:true});$("#fromStation").html(generateTaxiSelect($("#fromStation").text()));$("#taxiSection select").change(function(){var a=$("select option:selected").text();$("#taxiPrice").html(showTaxiCostFor(a))});$("*").click(function(){if($("#waitAnim").length>0)$("#waitAnim").remove()});$("a.reply").live("click",function(){LoadCommentAnswerForm(this);return false});$(".oneComment form").live("submit",function(){submitComment(this);return false});$("[name=comment]").live("keypress",function(){LimitMessageLength(this)}).live("keyup",function(){LimitMessageLength(this)});$("footer a.vote").live("click",function(){commentVote(this);return false});$("#nearestHotels").bxSlider({auto:true,pager:true,pause:2e4,controls:true,autoControls:true,prevText:"&lt;",startImage:"../images/icons/bxSliderPlayBtn.png",stopImage:"../images/icons/bxSliderPauseBtn.png",nextText:"&gt;",stopText:"||",startText:"►"})});window.Modernizr=function(a,b,c){function j(a){r.cssText=a}function i(a,b){return j(v.join(a+";")+(b||""))}function h(a,b){return typeof a===b}function g(a,b){return!!~(""+a).indexOf(b)}function f(a,b){for(var d in a)if(r[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function e(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+w.join(c+" ")+c).split(" ");return f(d,b)}function d(){l.inputtypes=function(a){for(var d=0,e,f,g,h=a.length;d<h;d++)s.setAttribute("type",f=a[d]),e=s.type!=="text",e&&(s.value=t,s.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&s.style.WebkitAppearance!==c?(n.appendChild(s),g=b.defaultView,e=g.getComputedStyle&&g.getComputedStyle(s,null).WebkitAppearance!=="textfield"&&s.offsetHeight!==0,n.removeChild(s)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=s.checkValidity&&s.checkValidity()===!1:/^color$/.test(f)?(n.appendChild(s),n.offsetWidth,e=s.value!=t,n.removeChild(s)):e=s.value!=t)),y[a[d]]=!!e;return y}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var k="2.0.6",l={},m=!0,n=b.documentElement,o=b.head||b.getElementsByTagName("head")[0],p="modernizr",q=b.createElement(p),r=q.style,s=b.createElement("input"),t=":)",u=Object.prototype.toString,v=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),w="Webkit Moz O ms Khtml".split(" "),x={},y={},z={},A=[],B=function(a,c,d,e){var f,g,h,i=b.createElement("div");if(parseInt(d,10))while(d--)h=b.createElement("div"),h.id=e?e[d]:p+(d+1),i.appendChild(h);f=["­","<style>",a,"</style>"].join(""),i.id=p,i.innerHTML+=f,n.appendChild(i),g=c(i,a),i.parentNode.removeChild(i);return!!g},C,D={}.hasOwnProperty,E;!h(D,c)&&!h(D.call,c)?E=function(a,b){return D.call(a,b)}:E=function(a,b){return b in a&&h(a.constructor.prototype[b],c)},x.rgba=function(){j("background-color:rgba(150,255,150,.5)");return g(r.backgroundColor,"rgba")},x.borderradius=function(){return e("borderRadius")},x.opacity=function(){i("opacity:.55");return/^0.55$/.test(r.opacity)},x.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";j((a+v.join(b+a)+v.join(c+a)).slice(0,-a.length));return g(r.backgroundImage,"gradient")},x.csstransitions=function(){return e("transitionProperty")};for(var F in x)E(x,F)&&(C=F.toLowerCase(),l[C]=x[F](),A.push((l[C]?"":"no-")+C));l.input||d(),j(""),q=s=null,a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function d(a){var b=-1;while(++b<h)a.createElement(g[b])}a.iepp=a.iepp||{};var e=a.iepp,f=e.html5elements||"abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",g=f.split("|"),h=g.length,i=new RegExp("(^|\\s)("+f+")","gi"),j=new RegExp("<(/*)("+f+")","gi"),k=/^\s*[\{\}]\s*$/,l=new RegExp("(^|[^\\n]*?\\s)("+f+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),m=b.createDocumentFragment(),n=b.documentElement,o=n.firstChild,p=b.createElement("body"),q=b.createElement("style"),r=/print|all/,s;e.getCSS=function(a,b){if(a+""===c)return"";var d=-1,f=a.length,g,h=[];while(++d<f){g=a[d];if(g.disabled)continue;b=g.media||b,r.test(b)&&h.push(e.getCSS(g.imports,b),g.cssText),b="all"}return h.join("")},e.parseCSS=function(a){var b=[],c;while((c=l.exec(a))!=null)b.push(((k.exec(c[1])?"\n":c[1])+c[2]+c[3]).replace(i,"$1.iepp_$2")+c[4]);return b.join("\n")},e.writeHTML=function(){var a=-1;s=s||b.body;while(++a<h){var c=b.getElementsByTagName(g[a]),d=c.length,e=-1;while(++e<d)c[e].className.indexOf("iepp_")<0&&(c[e].className+=" iepp_"+g[a])}m.appendChild(s),n.appendChild(p),p.className=s.className,p.id=s.id,p.innerHTML=s.innerHTML.replace(j,"<$1font")},e._beforePrint=function(){q.styleSheet.cssText=e.parseCSS(e.getCSS(b.styleSheets,"all")),e.writeHTML()},e.restoreHTML=function(){p.innerHTML="",n.removeChild(p),n.appendChild(s)},e._afterPrint=function(){e.restoreHTML(),q.styleSheet.cssText=""},d(b),d(m);e.disablePP||(o.insertBefore(q,o.firstChild),q.media="print",q.className="iepp-printshim",a.attachEvent("onbeforeprint",e._beforePrint),a.attachEvent("onafterprint",e._afterPrint))}(a,b),l._version=k,l._prefixes=v,l._domPrefixes=w,l.testProp=function(a){return f([a])},l.testAllProps=e,l.testStyles=B,n.className=n.className.replace(/\bno-js\b/,"")+(m?" js "+A.join(" "):"");return l}(this,this.document),function(a,b,c){function k(){var a=H;a.loader={load:j,i:0};return a}function j(a,b,c){var d=b=="c"?z:y;q=0,b=b||"j",C(a)?i(d,a,b,this.i++,l,c):(p.splice(this.i++,0,a),p.length==1&&h());return this}function i(a,c,f,g,i,j){function k(){!o&&d(l.readyState)&&(r.r=o=1,!q&&e(),l.onload=l.onreadystatechange=null,m(function(){u.removeChild(l)},0))}var l=b.createElement(a),o=0,r={t:f,s:c,e:j};l.src=l.data=c,!s&&(l.style.display="none"),l.width=l.height="0",a!="object"&&(l.type=f),l.onload=l.onreadystatechange=k,a=="img"?l.onerror=k:a=="script"&&(l.onerror=function(){r.e=r.r=1,h()}),p.splice(g,0,r),u.insertBefore(l,s?null:n),m(function(){o||(u.removeChild(l),r.r=r.e=o=1,e())},H.errorTimeout)}function h(){var a=p.shift();q=1,a?a.t?m(function(){a.t=="c"?g(a):f(a)},0):(a(),e()):q=0}function g(a){var c=b.createElement("link"),d;c.href=a.s,c.rel="stylesheet",c.type="text/css";if(!a.e&&(w||r)){var f=function(a){m(function(){if(!d)try{a.sheet.cssRules.length?(d=1,e()):f(a)}catch(b){b.code==1e3||b.message=="security"||b.message=="denied"?(d=1,m(function(){e()},0)):f(a)}},0)};f(c)}else c.onload=function(){d||(d=1,m(function(){e()},0))},a.e&&c.onload();m(function(){d||(d=1,e())},H.errorTimeout),!a.e&&n.parentNode.insertBefore(c,n)}function f(a){var c=b.createElement("script"),f;c.src=a.s,c.onreadystatechange=c.onload=function(){!f&&d(c.readyState)&&(f=1,e(),c.onload=c.onreadystatechange=null)},m(function(){f||(f=1,e())},H.errorTimeout),a.e?c.onload():n.parentNode.insertBefore(c,n)}function e(){var a=1,b=-1;while(p.length- ++b)if(p[b].s&&!(a=p[b].r))break;a&&h()}function d(a){return!a||a=="loaded"||a=="complete"}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=r&&!s,u=s?l:n.parentNode,v=a.opera&&o.call(a.opera)=="[object Opera]",w="webkitAppearance"in l.style,x=w&&"async"in b.createElement("script"),y=r?"object":v||x?"img":"script",z=w?"img":y,A=Array.isArray||function(a){return o.call(a)=="[object Array]"},B=function(a){return Object(a)===a},C=function(a){return typeof a=="string"},D=function(a){return o.call(a)=="[object Function]"},E=[],F={},G,H;H=function(a){function e(a,b){function c(a){if(C(a))d(a,h,b,0,e);else if(B(a))for(i in a)a.hasOwnProperty(i)&&d(a[i],h,b,i,e)}var e=!!a.test,f=e?a.yep:a.nope,g=a.load||a.both,h=a.callback,i;c(f),c(g),a.complete&&b.load(a.complete)}function d(a,d,e,f,g){var h=b(a),i=h.autoCallback;if(!h.bypass){d&&(d=D(d)?d:d[a]||d[f]||d[a.split("/").pop().split("?")[0]]);if(h.instead)return h.instead(a,d,e,f,g);e.load(h.url,h.forceCSS||!h.forceJS&&/css$/.test(h.url)?"c":c,h.noexec),(D(d)||D(i))&&e.load(function(){k(),d&&d(h.origUrl,g,f),i&&i(h.origUrl,g,f)})}}function b(a){var b=a.split("!"),c=E.length,d=b.pop(),e=b.length,f={url:d,origUrl:d,prefixes:b},g,h;for(h=0;h<e;h++)g=F[b[h]],g&&(f=g(f));for(h=0;h<c;h++)f=E[h](f);return f}var f,g,h=this.yepnope.loader;if(C(a))d(a,0,h,0);else if(A(a))for(f=0;f<a.length;f++)g=a[f],C(g)?d(g,0,h,0):A(g)?H(g):B(g)&&e(g,h);else B(a)&&e(a,h)},H.addPrefix=function(a,b){F[a]=b},H.addFilter=function(a){E.push(a)},H.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",G=function(){b.removeEventListener("DOMContentLoaded",G,0),b.readyState="complete"},0)),a.yepnope=k()}(this,this.document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};(function(a){a.fn.hoverIntent=function(b,c){var d={sensitivity:7,interval:100,timeout:0};d=a.extend(d,c?{over:b,out:c}:b);var e,f,g,h;var i=function(a){e=a.pageX;f=a.pageY};var j=function(b,c){c.hoverIntent_t=clearTimeout(c.hoverIntent_t);if(Math.abs(g-e)+Math.abs(h-f)<d.sensitivity){a(c).unbind("mousemove",i);c.hoverIntent_s=1;return d.over.apply(c,[b])}else{g=e;h=f;c.hoverIntent_t=setTimeout(function(){j(b,c)},d.interval)}};var k=function(a,b){b.hoverIntent_t=clearTimeout(b.hoverIntent_t);b.hoverIntent_s=0;return d.out.apply(b,[a])};var l=function(b){var c=jQuery.extend({},b);var e=this;if(e.hoverIntent_t){e.hoverIntent_t=clearTimeout(e.hoverIntent_t)}if(b.type=="mouseenter"){g=c.pageX;h=c.pageY;a(e).bind("mousemove",i);if(e.hoverIntent_s!=1){e.hoverIntent_t=setTimeout(function(){j(c,e)},d.interval)}}else{a(e).unbind("mousemove",i);if(e.hoverIntent_s==1){e.hoverIntent_t=setTimeout(function(){k(c,e)},d.timeout)}}};return this.bind("mouseenter",l).bind("mouseleave",l)}})(jQuery);(function(a){a.fn.bxSlider=function(b){function u(){t(b.startingSlide);if(b.mode=="horizontal"){x.wrap('<div class="'+b.wrapperClass+'" style="width:'+E+'px; position:relative;"></div>').wrap('<div class="bx-window" style="position:relative; overflow:hidden; width:'+E+'px;"></div>').css({width:"999999px",position:"relative",left:"-"+R+"px"});x.children().css({width:C,"float":"left",listStyle:"none"});A=x.parent().parent();z.addClass("pager")}else if(b.mode=="vertical"){x.wrap('<div class="'+b.wrapperClass+'" style="width:'+O+'px; position:relative;"></div>').wrap('<div class="bx-window" style="width:'+O+"px; height:"+F+'px; position:relative; overflow:hidden;"></div>').css({height:"999999px",position:"relative",top:"-"+S+"px"});x.children().css({listStyle:"none",height:P});A=x.parent().parent();z.addClass("pager")}else if(b.mode=="fade"){x.wrap('<div class="'+b.wrapperClass+'" style="width:'+O+'px; position:relative;"></div>').wrap('<div class="bx-window" style="height:'+P+"px; width:"+O+'px; position:relative; overflow:hidden;"></div>');x.children().css({listStyle:"none",position:"absolute",top:0,left:0,zIndex:98});A=x.parent().parent();z.not(":eq("+Q+")").fadeTo(0,0);z.eq(Q).css("zIndex",99)}if(b.captions&&b.captionsSelector==null){A.append('<div class="bx-captions"></div>')}}function t(){if(b.mode=="horizontal"||b.mode=="vertical"){var d=c(z,0,b.moveSlideQty,"backward");a.each(d,function(b){x.prepend(a(this))});var e=z.length+b.moveSlideQty-1;var f=z.length-b.displaySlideQty;var g=e-f;var h=c(z,0,g,"forward");if(b.infiniteLoop){a.each(h,function(b){x.append(a(this))})}}}function s(){if(b.nextImage!=""){nextContent=b.nextImage;nextType="image"}else{nextContent=b.nextText;nextType="text"}if(b.prevImage!=""){prevContent=b.prevImage;prevType="image"}else{prevContent=b.prevText;prevType="text"}k(nextType,nextContent,prevType,prevContent)}function r(){if(b.auto){if(!b.infiniteLoop){if(b.autoDirection=="next"){H=setInterval(function(){Q+=b.moveSlideQty;if(Q>Z){Q=Q%z.length}w.goToSlide(Q,false)},b.pause)}else if(b.autoDirection=="prev"){H=setInterval(function(){Q-=b.moveSlideQty;if(Q<0){negativeOffset=Q%z.length;if(negativeOffset==0){Q=0}else{Q=z.length+negativeOffset}}w.goToSlide(Q,false)},b.pause)}}else{if(b.autoDirection=="next"){H=setInterval(function(){w.goToNextSlide(false)},b.pause)}else if(b.autoDirection=="prev"){H=setInterval(function(){w.goToPreviousSlide(false)},b.pause)}}}else if(b.ticker){b.tickerSpeed*=10;a(".pager",A).each(function(b){T+=a(this).width();U+=a(this).height()});if(b.tickerDirection=="prev"&&b.mode=="horizontal"){x.css("left","-"+(T+R)+"px")}else if(b.tickerDirection=="prev"&&b.mode=="vertical"){x.css("top","-"+(U+S)+"px")}if(b.mode=="horizontal"){V=parseInt(x.css("left"));q(V,T,b.tickerSpeed)}else if(b.mode=="vertical"){W=parseInt(x.css("top"));q(W,U,b.tickerSpeed)}if(b.tickerHover){n()}}}function q(a,c,d){if(b.mode=="horizontal"){if(b.tickerDirection=="next"){x.animate({left:"-="+c+"px"},d,"linear",function(){x.css("left",a);q(a,T,b.tickerSpeed)})}else if(b.tickerDirection=="prev"){x.animate({left:"+="+c+"px"},d,"linear",function(){x.css("left",a);q(a,T,b.tickerSpeed)})}}else if(b.mode=="vertical"){if(b.tickerDirection=="next"){x.animate({top:"-="+c+"px"},d,"linear",function(){x.css("top",a);q(a,U,b.tickerSpeed)})}else if(b.tickerDirection=="prev"){x.animate({top:"+="+c+"px"},d,"linear",function(){x.css("top",a);q(a,U,b.tickerSpeed)})}}}function p(){if(b.startImage!=""){startContent=b.startImage;startType="image"}else{startContent=b.startText;startType="text"}if(b.stopImage!=""){stopContent=b.stopImage;stopType="image"}else{stopContent=b.stopText;stopType="text"}h(startType,startContent,stopType,stopContent)}function o(){A.find(".bx-window").hover(function(){if(M){w.stopShow(false)}},function(){if(M){w.startShow(false)}})}function n(){x.hover(function(){if(M){w.stopTicker(false)}},function(){if(M){w.startTicker(false)}})}function m(){z.not(":eq("+Q+")").fadeTo(b.speed,0).css("zIndex",98);z.eq(Q).css("zIndex",99).fadeTo(b.speed,1,function(){X=false;if(jQuery.browser.msie){z.eq(Q).get(0).style.removeAttribute("filter")}b.onAfterSlide(Q,z.length,z.eq(Q))})}function l(c){if(b.pagerType=="full"&&b.pager){a("a",G).removeClass(b.pagerActiveClass);a("a",G).eq(c).addClass(b.pagerActiveClass)}else if(b.pagerType=="short"&&b.pager){a(".bx-pager-current",G).html(Q+1)}}function k(c,d,e,f){var g=a('<a href="" class="bx-next"></a>');var h=a('<a href="" class="bx-prev"></a>');if(c=="text"){g.html(d)}else{g.html('<img src="'+d+'" />')}if(e=="text"){h.html(f)}else{h.html('<img src="'+f+'" />')}if(b.prevSelector){a(b.prevSelector).append(h)}else{A.append(h)}if(b.nextSelector){a(b.nextSelector).append(g)}else{A.append(g)}g.click(function(){w.goToNextSlide();return false});h.click(function(){w.goToPreviousSlide();return false})}function j(c){var d=z.length;if(b.moveSlideQty>1){if(z.length%b.moveSlideQty!=0){d=Math.ceil(z.length/b.moveSlideQty)}else{d=z.length/b.moveSlideQty}}var e="";if(b.buildPager){for(var f=0;f<d;f++){e+=b.buildPager(f,z.eq(f*b.moveSlideQty))}}else if(c=="full"){for(var f=1;f<=d;f++){e+='<a href="" class="pager-link pager-'+f+'">'+f+"</a>"}}else if(c=="short"){e='<span class="bx-pager-current">'+(b.startingSlide+1)+"</span> "+b.pagerShortSeparator+' <span class="bx-pager-total">'+z.length+"</span>"}if(b.pagerSelector){a(b.pagerSelector).append(e);G=a(b.pagerSelector)}else{var g=a('<div class="bx-pager"></div>');g.append(e);if(b.pagerLocation=="top"){A.prepend(g)}else if(b.pagerLocation=="bottom"){A.append(g)}G=a(".bx-pager",A)}G.children().click(function(){if(b.pagerType=="full"){var a=G.children().index(this);if(b.moveSlideQty>1){a*=b.moveSlideQty}w.goToSlide(a)}return false})}function i(){var c=a("img",z.eq(Q)).attr("title");if(c!=""){if(b.captionsSelector){a(b.captionsSelector).html(c)}else{a(".bx-captions",A).html(c)}}else{if(b.captionsSelector){a(b.captionsSelector).html(" ")}else{a(".bx-captions",A).html(" ")}}}function h(c,d,e,f){I=a('<a href="" class="bx-start"></a>');if(c=="text"){K=d}else{K='<img src="'+d+'" />'}if(e=="text"){L=f}else{L='<img src="'+f+'" />'}if(b.autoControlsSelector){a(b.autoControlsSelector).append(I)}else{A.append('<div class="bx-auto"></div>');a(".bx-auto",A).html(I)}I.click(function(){if(b.ticker){if(a(this).hasClass("stop")){w.stopTicker()}else if(a(this).hasClass("start")){w.startTicker()}}else{if(a(this).hasClass("stop")){w.stopShow(true)}else if(a(this).hasClass("start")){w.startShow(true)}}return false})}function g(){if(!b.infiniteLoop&&b.hideControlOnEnd){if(Q==Y){a(".bx-prev",A).hide()}else{a(".bx-prev",A).show()}if(Q==Z){a(".bx-next",A).hide()}else{a(".bx-next",A).show()}}}function f(b,c){if(c=="left"){var d=a(".pager",A).eq(b).position().left}else if(c=="top"){var d=a(".pager",A).eq(b).position().top}return d}function e(){var a=B.outerWidth()*b.displaySlideQty;return a}function d(){var a=B.outerHeight()*b.displaySlideQty;return a}function c(b,c,d,e){var f=[];var g=d;var h=false;if(e=="backward"){b=a.makeArray(b);b.reverse()}while(g>0){a.each(b,function(b,d){if(g>0){if(!h){if(b==c){h=true;f.push(a(this).clone());g--}}else{f.push(a(this).clone());g--}}else{return false}})}return f}var v={mode:"horizontal",infiniteLoop:true,hideControlOnEnd:false,controls:true,speed:500,easing:"swing",pager:false,pagerSelector:null,pagerType:"full",pagerLocation:"bottom",pagerShortSeparator:"/",pagerActiveClass:"pager-active",nextText:"next",nextImage:"",nextSelector:null,prevText:"prev",prevImage:"",prevSelector:null,captions:false,captionsSelector:null,auto:false,autoDirection:"next",autoControls:false,autoControlsSelector:null,autoStart:true,autoHover:false,autoDelay:0,pause:3e3,startText:"start",startImage:"",stopText:"stop",stopImage:"",ticker:false,tickerSpeed:5e3,tickerDirection:"next",tickerHover:false,wrapperClass:"bx-wrapper",startingSlide:0,displaySlideQty:1,moveSlideQty:1,randomStart:false,onBeforeSlide:function(){},onAfterSlide:function(){},onLastSlide:function(){},onFirstSlide:function(){},onNextSlide:function(){},onPrevSlide:function(){},buildPager:null};var b=a.extend(v,b);var w=this;var x="";var y="";var z="";var A="";var B="";var C="";var D="";var E="";var F="";var G="";var H="";var I="";var J="";var K="";var L="";var M=true;var N=false;var O=0;var P=0;var Q=0;var R=0;var S=0;var T=0;var U=0;var V=0;var W=0;var X=false;var Y=0;var Z=z.length-1;this.goToSlide=function(a,c){if(!X){X=true;Q=a;b.onBeforeSlide(Q,z.length,z.eq(Q));if(typeof c=="undefined"){var c=true}if(c){if(b.auto){w.stopShow(true)}}slide=a;if(slide==Y){b.onFirstSlide(Q,z.length,z.eq(Q))}if(slide==Z){b.onLastSlide(Q,z.length,z.eq(Q))}if(b.mode=="horizontal"){x.animate({left:"-"+f(slide,"left")+"px"},b.speed,b.easing,function(){X=false;b.onAfterSlide(Q,z.length,z.eq(Q))})}else if(b.mode=="vertical"){x.animate({top:"-"+f(slide,"top")+"px"},b.speed,b.easing,function(){X=false;b.onAfterSlide(Q,z.length,z.eq(Q))})}else if(b.mode=="fade"){m()}g();if(b.moveSlideQty>1){a=Math.floor(a/b.moveSlideQty)}l(a);i()}};this.goToNextSlide=function(a){if(typeof a=="undefined"){var a=true}if(a){if(b.auto){w.stopShow(true)}}if(!b.infiniteLoop){if(!X){var c=false;Q=Q+b.moveSlideQty;if(Q<=Z){g();b.onNextSlide(Q,z.length,z.eq(Q));w.goToSlide(Q)}else{Q-=b.moveSlideQty}}}else{if(!X){X=true;var c=false;Q=Q+b.moveSlideQty;if(Q>Z){Q=Q%z.length;c=true}b.onNextSlide(Q,z.length,z.eq(Q));b.onBeforeSlide(Q,z.length,z.eq(Q));if(b.mode=="horizontal"){var d=b.moveSlideQty*D;x.animate({left:"-="+d+"px"},b.speed,b.easing,function(){X=false;if(c){x.css("left","-"+f(Q,"left")+"px")}b.onAfterSlide(Q,z.length,z.eq(Q))})}else if(b.mode=="vertical"){var e=b.moveSlideQty*P;x.animate({top:"-="+e+"px"},b.speed,b.easing,function(){X=false;if(c){x.css("top","-"+f(Q,"top")+"px")}b.onAfterSlide(Q,z.length,z.eq(Q))})}else if(b.mode=="fade"){m()}if(b.moveSlideQty>1){l(Math.ceil(Q/b.moveSlideQty))}else{l(Q)}i()}}};this.goToPreviousSlide=function(c){if(typeof c=="undefined"){var c=true}if(c){if(b.auto){w.stopShow(true)}}if(!b.infiniteLoop){if(!X){var d=false;Q=Q-b.moveSlideQty;if(Q<0){Q=0;if(b.hideControlOnEnd){a(".bx-prev",A).hide()}}g();b.onPrevSlide(Q,z.length,z.eq(Q));w.goToSlide(Q)}}else{if(!X){X=true;var d=false;Q=Q-b.moveSlideQty;if(Q<0){negativeOffset=Q%z.length;if(negativeOffset==0){Q=0}else{Q=z.length+negativeOffset}d=true}b.onPrevSlide(Q,z.length,z.eq(Q));b.onBeforeSlide(Q,z.length,z.eq(Q));if(b.mode=="horizontal"){var e=b.moveSlideQty*D;x.animate({left:"+="+e+"px"},b.speed,b.easing,function(){X=false;if(d){x.css("left","-"+f(Q,"left")+"px")}b.onAfterSlide(Q,z.length,z.eq(Q))})}else if(b.mode=="vertical"){var h=b.moveSlideQty*P;x.animate({top:"+="+h+"px"},b.speed,b.easing,function(){X=false;if(d){x.css("top","-"+f(Q,"top")+"px")}b.onAfterSlide(Q,z.length,z.eq(Q))})}else if(b.mode=="fade"){m()}if(b.moveSlideQty>1){l(Math.ceil(Q/b.moveSlideQty))}else{l(Q)}i()}}};this.goToFirstSlide=function(a){if(typeof a=="undefined"){var a=true}w.goToSlide(Y,a)};this.goToLastSlide=function(){if(typeof a=="undefined"){var a=true}w.goToSlide(Z,a)};this.getCurrentSlide=function(){return Q};this.getSlideCount=function(){return z.length};this.stopShow=function(a){clearInterval(H);if(typeof a=="undefined"){var a=true}if(a&&b.autoControls){I.html(K).removeClass("stop").addClass("start");M=false}};this.startShow=function(a){if(typeof a=="undefined"){var a=true}r();if(a&&b.autoControls){I.html(L).removeClass("start").addClass("stop");M=true}};this.stopTicker=function(a){x.stop();if(typeof a=="undefined"){var a=true}if(a&&b.ticker){I.html(K).removeClass("stop").addClass("start");M=false}};this.startTicker=function(a){if(b.mode=="horizontal"){if(b.tickerDirection=="next"){var c=parseInt(x.css("left"));var d=T+c+z.eq(0).width()}else if(b.tickerDirection=="prev"){var c=-parseInt(x.css("left"));var d=c-z.eq(0).width()}var e=d*b.tickerSpeed/T;q(V,d,e)}else if(b.mode=="vertical"){if(b.tickerDirection=="next"){var f=parseInt(x.css("top"));var d=U+f+z.eq(0).height()}else if(b.tickerDirection=="prev"){var f=-parseInt(x.css("top"));var d=f-z.eq(0).height()}var e=d*b.tickerSpeed/U;q(W,d,e);if(typeof a=="undefined"){var a=true}if(a&&b.ticker){I.html(L).removeClass("start").addClass("stop");M=true}}};this.initShow=function(){x=a(this);y=x.clone();z=x.children();A="";B=x.children(":first");C=B.width();O=0;D=B.outerWidth();P=0;E=e();F=d();X=false;G="";Q=0;R=0;S=0;H="";I="";J="";K="";L="";M=true;N=false;T=0;U=0;V=0;W=0;Y=0;Z=z.length-1;z.each(function(b){if(a(this).outerHeight()>P){P=a(this).outerHeight()}if(a(this).outerWidth()>O){O=a(this).outerWidth()}});if(b.randomStart){var c=Math.floor(Math.random()*z.length);Q=c;R=D*(b.moveSlideQty+c);S=P*(b.moveSlideQty+c)}else{Q=b.startingSlide;R=D*(b.moveSlideQty+b.startingSlide);S=P*(b.moveSlideQty+b.startingSlide)}u();if(b.pager&&!b.ticker){if(b.pagerType=="full"){j("full")}else if(b.pagerType=="short"){j("short")}}if(b.controls&&!b.ticker){s()}if(b.auto||b.ticker){if(b.autoControls){p()}if(b.autoStart){setTimeout(function(){w.startShow(true)},b.autoDelay)}else{w.stopShow(true)}if(b.autoHover&&!b.ticker){o()}}if(b.moveSlideQty>1){l(Math.ceil(Q/b.moveSlideQty))}else{l(Q)}g();if(b.captions){i()}b.onAfterSlide(Q,z.length,z.eq(Q))};this.destroyShow=function(){clearInterval(H);a(".bx-next, .bx-prev, .bx-pager, .bx-auto",A).remove();x.unwrap().unwrap().removeAttr("style");x.children().removeAttr("style").not(".pager").remove();z.removeClass("pager")};this.reloadShow=function(){w.destroyShow();w.initShow()};this.each(function(){if(a(this).children().length>0){w.initShow()}});return this};jQuery.fx.prototype.cur=function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var a=parseFloat(jQuery.css(this.elem,this.prop));return a}})(jQuery)
