var lsCurMenu="bs-lf-p";function loginShow(a){var b=["bs-lf-b","bs-lf-p"];if(lsCurMenu=="bs-lf-p"){if(a){$('.bs-lf-p div:not(".text")').hide();$('.bs-lf-b div:not(".text")').show()}else{$('.bs-lf-p div:not(".text")').slideUp("fast",function(){$('.bs-lf-b div:not(".text")').slideDown()})}$(".bs-lf-b a").eq(0).addClass("current");$(".bs-lf-p a").eq(0).removeClass("current");lsCurMenu="bs-lf-b";SetCookie("dlb",1,30*24*3600)}else{if(lsCurMenu=="bs-lf-b"){$('.bs-lf-b div:not(".text")').slideUp("fast",function(){$('.bs-lf-p div:not(".text")').slideDown()});$(".bs-lf-p a").eq(0).addClass("current");$(".bs-lf-b a").eq(0).removeClass("current");lsCurMenu="bs-lf-p";DeleteCookie("dlb")}}}function loginDo(sel){var params=$(sel+" form:first").serialize()+(($(sel+" form:first").hasClass("scl"))?"&f=1":"");$(sel+" .bs-lf-s").after('<img class="bs-lf-li" src="/imgs/loading-c.gif" />');$.ajax({type:"POST",url:"/aj_login.php",dataType:"html",data:params,success:function(result){$(sel+" .bs-lf-li").remove();if(result.length>2){r=eval("("+result+")");window.location="https://"+VIP_DOMAIN+"/"+r.d+"/sms.php";return}switch(result){case"1":window.location="http://"+window.location.host+"/sms.php";break;case"0":loginShowErr(sel,"грешна парола и/или имейл");$(sel+" .captcha").remove();break;case"-1":loginShowErr(sel,"грешен код");loginShowCaptcha(sel);break;case"-2":loginShowErr(sel,"грешена парола и/или имейл");loginShowCaptcha(sel);break;case"-3":loginShowErr(sel,"Потребителя е деактивиран");break;case"se":SetCookie("errMsg","se",0,"/");window.location.href="/";break}}})}function loginShowErr(b,c,a){if($(b+" .text:first").length!=0){$(b+" .text:first").hide()}a=a||"password";$pass=$(b+' input[name="'+a+'"]');$label=$(b+' input[for="'+a+'"]');if($label.length==0){$pass.after('<label for="'+a+'" generated="true" class="error">'+c+"</label>");setStatusImg($pass,"err")}else{$label.html(c)}}function loginShowCaptcha(a){if($(a+" .text").length!=0){$(a+" .text").hide()}if($(a+" .captcha").length!=0){$(a+" .captcha img").attr("src","/c/?sid="+Math.random());return}$(a+' input[type="submit"]').before('<div class="captcha"><label style="margin-top:11px">Въведете кода:</label> <input id="scode_t" type="text" name="scode" autocomplete="off" /><img class="sci" id="scode_img" src="/c" onclick="$(this).attr(\'src\', \'/c/?sid='+Math.random()+'\')" alt="кликнете за нов код" title="кликнете за нов код"></div>')}function loginValidate(a){$(a+" form:first").validate({onkeyup:false,onfocusout:false,rules:{email:{requiredD:true,email:true,maxlength:255},password:{requiredD:true,minlength:5,maxlength:35}},messages:{email:{requiredD:"Въведете имейл",email:"Моля, въведете валиден имейл адрес"},password:{requiredD:"Въведете парола",minlength:"Дължината трябва да е поне 5 символа",maxlength:"Дължината трябва да не е повече от 35 символа"}},errorPlacement:function(c,b){if($(a+" .text:first").length!=0){$(a+" .text:first").hide()}if(b.next("img").length==0){c.insertAfter(b)}else{c.insertAfter(b.next())}setStatusImg(b,"err")},submitHandler:function(b){if($(a+" .text:first").length!=0&&$(".captcha").length==0){$(a+" .text:first").show()}b.submit()},success:function(c){var b=(c.prev("input").length!=0)?c.prev():c.prev().prev();c.remove();setStatusImg(b,"info",true)}})}$.validator.addMethod("requiredD",function(b,a){return(b!="email@address.com"&&b!="12345678"&&b!="")},"");function loginForgotten(b){var c=$(b).parent().parent();if($("#forgotten").length>0){$("#forgotten").prev().show();$("#forgotten").remove()}c.after('<form id="forgotten" onsubmit="return false" style="display:none">'+((c.hasClass("scl"))?'<input type="hidden" name="f" value="1" />':"")+'<a class="register" onclick="loginBack();return false" href="#">&#171; назад</a><h3>Забравена парола</h3><div class="text">Моля, въведете имейл адреса, с който влизате в профила си.</div><input class="form-input" type="text" name="email" value="" /><br /><input class="b_button bs-lf-s s" type="submit" value="ИЗПРАТИ" /></form>');inputDescToggle($('#forgotten [name="email"]'),"f_desc","email@address.com");c.fadeOut("fast",function(){$("#forgotten").fadeIn()});var d=$("#forgotten").validate({rules:{email:{requiredD:true,email:true,maxlength:255}},messages:{email:{requiredD:"Въведете имейл",email:"Моля, въведете валиден имейл адрес"}},errorPlacement:function(e,a){if(a.next("img").length==0){e.insertAfter(a)}else{e.insertAfter(a.next())}setStatusImg(a,"err")},submitHandler:function(a){var e="a=S&"+$(a).serialize();$.ajax({type:"POST",url:"aj_forgotten.php",dataType:"html",data:e,success:function(f){var g="#forgotten";switch(f){case"-1":loginShowErr(g,"Невалиден имейл адрес","email");break;case"-2":loginShowErr(g,"Няма регистрация с този имейл адрес","email");break;case"-3":loginShowErr(g,"Не са минали 60мин. от последната Ви заявка","email");break;case"-4":loginShowErr(g,"Вече има изпратен линк на този имейл","email");break;case"-5":loginShowErr(g,"Бисквитките(cookies) на Вашия браузър са забранени","email");break;case"1":$(g).html('<br /><br /><h3>Моля проверете имела, <br />който въведохте за повече информация.</h3><br /><center><a class="register"  href="#" onclick="loginBack();return false">към формата за вход</a></center>');break}}})},success:function(e){var a=(e.prev("input").length!=0)?e.prev():e.prev().prev();setStatusImg(a,"info",true);e.remove()}})}function loginBack(){$prev=$("#forgotten").prev();$("#forgotten").fadeOut("fast",function(){$prev.fadeIn()})}var imgPath="";$(document).ready(function(){if(typeof fl_do!="undefined"){return}$(".bs-lf-b a:first, .bs-lf-p a:first").click(function(){loginShow()});if(GetCookie("lsc")){loginShowCaptcha(".bs-lf-p");loginShowCaptcha(".bs-lf-b")}if(GetCookie("dlb")||window.location.href.indexOf("#paid")!=-1){loginShow(true)}if(GetCookie("errMsg")){var b=(GetCookie("dlb")||window.location.href.indexOf("#paid")!=-1)?".bs-lf-b":".bs-lf-p";if(GetCookie("errMsg")=="se"){loginShowErr(b,"Грешка при ауторизация на заявката")}else{loginShowErr(b,urlDecode(GetCookie("errMsg").replace(/\+/g," ")))}DeleteCookie("errMsg","/")}inputDescToggle($('.bs-lf-b [name="email"]'),"f_desc","email@address.com");$('.bs-lf-f [name="email"]').focus(function(){if($(this).next().val()=="12345678"&&$(this).next().hasClass("f_desc")){$(this).next().removeClass("f_desc").val("")}});inputDescToggle($('.bs-lf-b [name="password"]'),"f_desc","12345678");inputDescToggle($('.bs-lf-p [name="email"]:first'),"f_desc","email@address.com");inputDescToggle($('.bs-lf-p [name="password"]'),"f_desc","12345678");loginValidate(".bs-lf-p");loginValidate(".bs-lf-b");if(GetCookie("msi")&&un!=""&&!GetCookie("pnd")){if(getIEVersion()>0&&getIEVersion()<8){var c="margin-top:20;";var j=191}else{var c="";var j=171}var g='<div class="lgd" style="height:'+j+'px"><h4 style="'+c+'margin-bottom:50px;">Привет '+un+',</h4>Можеш да продължиш към <a href="sms.php">Изпрати SMS</a> или да <a href="logout.php">Излезеш</a> от профила си.</div>';$(".bs-lf-p form").hide().after(g)}else{if(GetCookie("msi")&&GetCookie("pnd")){var e=urlDecode(GetCookie("pnd")).split(":");var a="https://"+VIP_DOMAIN+"/"+e[1]+"/";var i=1,d=8,h=32,f=64;var g='<div class="lgd" style="height:171px"><h4 style="margin-bottom:40px">Здравейте '+e[0].replace(/\+/," ")+"</h4>Връзки от профила Ви:<br />"+(((e[2]&i)==i)?'<a href="'+a+'sms.php#Ново съобщение">SMS Mедия</a><br />':"")+(((e[2]&d)==d)?'<a href="'+a+'sms.php#SMS Маркетинг 2.0">SMS Mаркетинг 2.0</a><br />':"")+(((e[2]&h)==h)?'<a href="'+a+'sms.php#Плащания">Плащания</a><br />':"")+(((e[2]&f)==f)?'<a href="'+a+'sms.php#Справки">Справки</a><br />':"")+'<a href="'+a+'logout.php">Изход от профила</a></div>';$(".bs-lf-b form").hide().after(g)}}$(".ssc").cycle({fx:"scrollHorz",speed:350,timeout:10000,pause:1,prev:".ss img:first",next:".ss img:not('.arl')"})});var restarea=6;var maxspeed=7;var maxwidth=1000;var startpos=0;var endofgallerymsg='<span style="font-size: 11px;"></span>';function enlargeimage(d,a,f){var c=typeof a!="undefined"?a:"600px";var e=typeof f!="undefined"?f:"500px";var b="width="+c+",height="+e+",resizable=yes";window.open(d,"",b)}var iedom=document.all||document.getElementById,scrollspeed=0,movestate="",actualwidth="",cross_scroll,ns_scroll,statusdiv,loadedyes=0,lefttime,righttime;function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}function creatediv(){statusdiv=document.createElement("div");statusdiv.setAttribute("id","statusdiv");document.body.appendChild(statusdiv);statusdiv=document.getElementById("statusdiv");statusdiv.innerHTML=endofgallerymsg}function positiondiv(){var c=getposOffset(crossmain,"left"),a=parseInt(crossmain.offsetHeight),b=getposOffset(crossmain,"top");statusdiv.style.left=c+(menuwidth/2)-(statusdiv.offsetWidth/2)+"px";statusdiv.style.top=a+b+"px"}function showhidediv(a){if(endofgallerymsg!=""){positiondiv();statusdiv.style.visibility=a}}function getposOffset(d,a){var c=(a=="left")?d.offsetLeft:d.offsetTop;var b=d.offsetParent;while(b!=null){c=(a=="left")?c+b.offsetLeft:c+b.offsetTop;b=b.offsetParent}return c}function moveleft(){if(loadedyes){movestate="left";if(iedom&&parseInt(cross_scroll.style.left)>(menuwidth-actualwidth)){cross_scroll.style.left=parseInt(cross_scroll.style.left)-scrollspeed+"px";showhidediv("hidden")}else{showhidediv("visible")}}lefttime=setTimeout("moveleft()",10)}function moveright(){if(loadedyes){movestate="right";if(iedom&&parseInt(cross_scroll.style.left)<0){cross_scroll.style.left=parseInt(cross_scroll.style.left)+scrollspeed+"px";showhidediv("hidden")}else{showhidediv("visible")}}righttime=setTimeout("moveright()",10)}function motionengine(g){var f=getposOffset(crossmain,"left"),h=(window.pageXOffset)?pageXOffset:ietruebody().scrollLeft,d=(window.pageYOffset)?pageYOffset:ietruebody().scrollTop,b=window.event?event.clientX:g.clientX?g.clientX:"";b-=f-h;var a=(menuwidth-restarea)/2;var c=(menuwidth+restarea)/2;if(b>c){scrollspeed=(b-c)/((menuwidth-restarea)/2)*maxspeed;clearTimeout(righttime);if(movestate!="left"){moveleft()}}else{if(b<a){scrollspeed=(a-b)/((menuwidth-restarea)/2)*maxspeed;clearTimeout(lefttime);if(movestate!="right"){moveright()}}else{scrollspeed=0}}}function contains_ns6(d,c){if(c!==null){while(c.parentNode){if((c=c.parentNode)==d){return true}}}return false}function stopmotion(a){if(!window.opera||(window.opera&&a.relatedTarget!==null)){if((window.event&&!crossmain.contains(event.toElement))||(a&&a.currentTarget&&a.currentTarget!=a.relatedTarget&&!contains_ns6(a.currentTarget,a.relatedTarget))){clearTimeout(lefttime);clearTimeout(righttime);movestate=""}}}function fillup(){if(iedom){crossmain=document.getElementById?document.getElementById("motioncontainer"):document.all.motioncontainer;if(typeof crossmain.style.maxWidth!=="undefined"){crossmain.style.maxWidth=maxwidth+"px"}menuwidth=crossmain.offsetWidth;cross_scroll=document.getElementById?document.getElementById("motiongallery"):document.all.motiongallery;actualwidth=document.getElementById?document.getElementById("trueContainer").offsetWidth:document.all.trueContainer.offsetWidth;if(startpos){cross_scroll.style.left=(menuwidth-actualwidth)/startpos+"px"}crossmain.onmousemove=function(a){motionengine(a)};crossmain.onmouseout=function(a){stopmotion(a);showhidediv("hidden")}}loadedyes=1;if(endofgallerymsg!=""){creatediv();positiondiv()}if(document.body.filters){onresize()}}window.onload=fillup;onresize=function(){if(typeof motioncontainer!=="undefined"&&motioncontainer.filters){motioncontainer.style.width="0";motioncontainer.style.width="";motioncontainer.style.width=Math.min(motioncontainer.offsetWidth,maxwidth)+"px"}menuwidth=crossmain.offsetWidth;try{cross_scroll.style.left=startpos?(menuwidth-actualwidth)/startpos+"px":0}catch(a){}};/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.88 (08-JUN-2010)
 * Dual licensed under the MIT and GPL licenses.
 * http://jquery.malsup.com/license.html
 * Requires: jQuery v1.2.6 or later
 */
(function(i){var l="2.88";if(i.support==undefined){i.support={opacity:!(i.browser.msie)}}function b(r){if(i.fn.cycle.debug){h(r)}}function h(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "))}}i.fn.cycle=function(s,r){var t={s:this.selector,c:this.context};if(this.length===0&&s!="stop"){if(!i.isReady&&t.s){h("DOM not ready, queuing slideshow");i(function(){i(t.s,t.c).cycle(s,r)});return this}h("terminating; zero elements found by selector"+(i.isReady?"":" (DOM not ready)"));return this}return this.each(function(){var x=a(this,s,r);if(x===false){return}x.updateActivePagerLink=x.updateActivePagerLink||i.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=this.cyclePause=0;var y=i(this);var z=x.slideExpr?i(x.slideExpr,this):y.children();var w=z.get();if(w.length<2){h("terminating; too few slides: "+w.length);return}var u=m(y,z,w,x,t);if(u===false){return}var v=u.continuous?10:f(w[u.currSlide],w[u.nextSlide],u,!u.rev);if(v){v+=(u.delay||0);if(v<10){v=10}b("first timeout: "+v);this.cycleTimeout=setTimeout(function(){g(w,u,0,(!u.rev&&!x.backwards))},v)}})};function a(r,v,s){if(r.cycleStop==undefined){r.cycleStop=0}if(v===undefined||v===null){v={}}if(v.constructor==String){switch(v){case"destroy":case"stop":var w=i(r).data("cycle.opts");if(!w){return false}r.cycleStop++;if(r.cycleTimeout){clearTimeout(r.cycleTimeout)}r.cycleTimeout=0;i(r).removeData("cycle.opts");if(v=="destroy"){o(w)}return false;case"toggle":r.cyclePause=(r.cyclePause===1)?0:1;u(r.cyclePause,s,r);return false;case"pause":r.cyclePause=1;return false;case"resume":r.cyclePause=0;u(false,s,r);return false;case"prev":case"next":var w=i(r).data("cycle.opts");if(!w){h('options not found, "prev/next" ignored');return false}i.fn.cycle[v](w);return false;default:v={fx:v}}return v}else{if(v.constructor==Number){var t=v;v=i(r).data("cycle.opts");if(!v){h("options not found, can not advance slide");return false}if(t<0||t>=v.elements.length){h("invalid slide index: "+t);return false}v.nextSlide=t;if(r.cycleTimeout){clearTimeout(r.cycleTimeout);r.cycleTimeout=0}if(typeof s=="string"){v.oneTimeFx=s}g(v.elements,v,1,t>=v.currSlide);return false}}return v;function u(A,y,x){if(!A&&y===true){var z=i(x).data("cycle.opts");if(!z){h("options not found, can not resume");return false}if(x.cycleTimeout){clearTimeout(x.cycleTimeout);x.cycleTimeout=0}g(z.elements,z,1,(!w.rev&&!w.backwards))}}}function k(r,s){if(!i.support.opacity&&s.cleartype&&r.style.filter){try{r.style.removeAttribute("filter")}catch(t){}}}function o(r){if(r.next){i(r.next).unbind(r.prevNextEvent)}if(r.prev){i(r.prev).unbind(r.prevNextEvent)}if(r.pager||r.pagerAnchorBuilder){i.each(r.pagerAnchors||[],function(){this.unbind().remove()})}r.pagerAnchors=null;if(r.destroy){r.destroy(r)}}function m(y,L,u,A,F){var C=i.extend({},i.fn.cycle.defaults,A||{},i.metadata?y.metadata():i.meta?y.data():{});if(C.autostop){C.countdown=C.autostopCount||u.length}var s=y[0];y.data("cycle.opts",C);C.$cont=y;C.stopCount=s.cycleStop;C.elements=u;C.before=C.before?[C.before]:[];C.after=C.after?[C.after]:[];C.after.unshift(function(){C.busy=0});if(!i.support.opacity&&C.cleartype){C.after.push(function(){k(this,C)})}if(C.continuous){C.after.push(function(){g(u,C,0,(!C.rev&&!C.backwards))})}n(C);if(!i.support.opacity&&C.cleartype&&!C.cleartypeNoBg){e(L)}if(y.css("position")=="static"){y.css("position","relative")}if(C.width){y.width(C.width)}if(C.height&&C.height!="auto"){y.height(C.height)}if(C.startingSlide){C.startingSlide=parseInt(C.startingSlide)}else{if(C.backwards){C.startingSlide=u.length-1}}if(C.random){C.randomMap=[];for(var I=0;I<u.length;I++){C.randomMap.push(I)}C.randomMap.sort(function(N,w){return Math.random()-0.5});C.randomIndex=1;C.startingSlide=C.randomMap[1]}else{if(C.startingSlide>=u.length){C.startingSlide=0}}C.currSlide=C.startingSlide||0;var x=C.startingSlide;L.css({position:"absolute",top:0,left:0}).hide().each(function(w){var N;if(C.backwards){N=x?w<=x?u.length+(w-x):x-w:u.length-w}else{N=x?w>=x?u.length-(w-x):x-w:u.length-w}N+=800;i(this).css("z-index",N)});i(u[x]).css("opacity",1).show();k(u[x],C);if(C.fit&&C.width){L.width(C.width)}if(C.fit&&C.height&&C.height!="auto"){L.height(C.height)}var E=C.containerResize&&!y.innerHeight();if(E){var v=0,D=0;for(var G=0;G<u.length;G++){var r=i(u[G]),M=r[0],B=r.outerWidth(),J=r.outerHeight();if(!B){B=M.offsetWidth||M.width||r.attr("width")}if(!J){J=M.offsetHeight||M.height||r.attr("height")}v=B>v?B:v;D=J>D?J:D}if(v>0&&D>0){y.css({width:v+"px",height:D+"px"})}}if(C.pause){y.hover(function(){this.cyclePause++},function(){this.cyclePause--})}if(c(C)===false){return false}var t=false;A.requeueAttempts=A.requeueAttempts||0;L.each(function(){var P=i(this);this.cycleH=(C.fit&&C.height)?C.height:(P.height()||this.offsetHeight||this.height||P.attr("height")||0);this.cycleW=(C.fit&&C.width)?C.width:(P.width()||this.offsetWidth||this.width||P.attr("width")||0);if(P.is("img")){var N=(i.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var Q=(i.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var O=(i.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var w=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(N||Q||O||w){if(F.s&&C.requeueOnImageNotLoaded&&++A.requeueAttempts<100){h(A.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){i(F.s,F.c).cycle(A)},C.requeueTimeout);t=true;return false}else{h("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}}}return true});if(t){return false}C.cssBefore=C.cssBefore||{};C.animIn=C.animIn||{};C.animOut=C.animOut||{};L.not(":eq("+x+")").css(C.cssBefore);if(C.cssFirst){i(L[x]).css(C.cssFirst)}if(C.timeout){C.timeout=parseInt(C.timeout);if(C.speed.constructor==String){C.speed=i.fx.speeds[C.speed]||parseInt(C.speed)}if(!C.sync){C.speed=C.speed/2}var K=C.fx=="shuffle"?500:250;while((C.timeout-C.speed)<K){C.timeout+=C.speed}}if(C.easing){C.easeIn=C.easeOut=C.easing}if(!C.speedIn){C.speedIn=C.speed}if(!C.speedOut){C.speedOut=C.speed}C.slideCount=u.length;C.currSlide=C.lastSlide=x;if(C.random){if(++C.randomIndex==u.length){C.randomIndex=0}C.nextSlide=C.randomMap[C.randomIndex]}else{if(C.backwards){C.nextSlide=C.startingSlide==0?(u.length-1):C.startingSlide-1}else{C.nextSlide=C.startingSlide>=(u.length-1)?0:C.startingSlide+1}}if(!C.multiFx){var H=i.fn.cycle.transitions[C.fx];if(i.isFunction(H)){H(y,L,C)}else{if(C.fx!="custom"&&!C.multiFx){h("unknown transition: "+C.fx,"; slideshow terminating");return false}}}var z=L[x];if(C.before.length){C.before[0].apply(z,[z,z,C,true])}if(C.after.length>1){C.after[1].apply(z,[z,z,C,true])}if(C.next){i(C.next).bind(C.prevNextEvent,function(){return q(C,C.rev?-1:1)})}if(C.prev){i(C.prev).bind(C.prevNextEvent,function(){return q(C,C.rev?1:-1)})}if(C.pager||C.pagerAnchorBuilder){j(u,C)}d(C,u);return C}function n(r){r.original={before:[],after:[]};r.original.cssBefore=i.extend({},r.cssBefore);r.original.cssAfter=i.extend({},r.cssAfter);r.original.animIn=i.extend({},r.animIn);r.original.animOut=i.extend({},r.animOut);i.each(r.before,function(){r.original.before.push(this)});i.each(r.after,function(){r.original.after.push(this)})}function c(x){var v,t,s=i.fn.cycle.transitions;if(x.fx.indexOf(",")>0){x.multiFx=true;x.fxs=x.fx.replace(/\s*/g,"").split(",");for(v=0;v<x.fxs.length;v++){var w=x.fxs[v];t=s[w];if(!t||!s.hasOwnProperty(w)||!i.isFunction(t)){h("discarding unknown transition: ",w);x.fxs.splice(v,1);v--}}if(!x.fxs.length){h("No valid transitions named; slideshow terminating.");return false}}else{if(x.fx=="all"){x.multiFx=true;x.fxs=[];for(p in s){t=s[p];if(s.hasOwnProperty(p)&&i.isFunction(t)){x.fxs.push(p)}}}}if(x.multiFx&&x.randomizeEffects){var u=Math.floor(Math.random()*20)+30;for(v=0;v<u;v++){var r=Math.floor(Math.random()*x.fxs.length);x.fxs.push(x.fxs.splice(r,1)[0])}b("randomized fx sequence: ",x.fxs)}return true}function d(s,r){s.addSlide=function(u,w){var t=i(u),v=t[0];if(!s.autostopCount){s.countdown++}r[w?"unshift":"push"](v);if(s.els){s.els[w?"unshift":"push"](v)}s.slideCount=r.length;t.css("position","absolute");t[w?"prependTo":"appendTo"](s.$cont);if(w){s.currSlide++;s.nextSlide++}if(!i.support.opacity&&s.cleartype&&!s.cleartypeNoBg){e(t)}if(s.fit&&s.width){t.width(s.width)}if(s.fit&&s.height&&s.height!="auto"){$slides.height(s.height)}v.cycleH=(s.fit&&s.height)?s.height:t.height();v.cycleW=(s.fit&&s.width)?s.width:t.width();t.css(s.cssBefore);if(s.pager||s.pagerAnchorBuilder){i.fn.cycle.createPagerAnchor(r.length-1,v,i(s.pager),r,s)}if(i.isFunction(s.onAddSlide)){s.onAddSlide(t)}else{t.hide()}}}i.fn.cycle.resetState=function(s,r){r=r||s.fx;s.before=[];s.after=[];s.cssBefore=i.extend({},s.original.cssBefore);s.cssAfter=i.extend({},s.original.cssAfter);s.animIn=i.extend({},s.original.animIn);s.animOut=i.extend({},s.original.animOut);s.fxFn=null;i.each(s.original.before,function(){s.before.push(this)});i.each(s.original.after,function(){s.after.push(this)});var t=i.fn.cycle.transitions[r];if(i.isFunction(t)){t(s.$cont,i(s.elements),s)}};function g(x,r,y,z){if(y&&r.busy&&r.manualTrump){b("manualTrump in go(), stopping active transition");i(x).stop(true,true);r.busy=false}if(r.busy){b("transition active, ignoring new tx request");return}var v=r.$cont[0],C=x[r.currSlide],B=x[r.nextSlide];if(v.cycleStop!=r.stopCount||v.cycleTimeout===0&&!y){return}if(!y&&!v.cyclePause&&!r.bounce&&((r.autostop&&(--r.countdown<=0))||(r.nowrap&&!r.random&&r.nextSlide<r.currSlide))){if(r.end){r.end(r)}return}var A=false;if((y||!v.cyclePause)&&(r.nextSlide!=r.currSlide)){A=true;var w=r.fx;C.cycleH=C.cycleH||i(C).height();C.cycleW=C.cycleW||i(C).width();B.cycleH=B.cycleH||i(B).height();B.cycleW=B.cycleW||i(B).width();if(r.multiFx){if(r.lastFx==undefined||++r.lastFx>=r.fxs.length){r.lastFx=0}w=r.fxs[r.lastFx];r.currFx=w}if(r.oneTimeFx){w=r.oneTimeFx;r.oneTimeFx=null}i.fn.cycle.resetState(r,w);if(r.before.length){i.each(r.before,function(D,E){if(v.cycleStop!=r.stopCount){return}E.apply(B,[C,B,r,z])})}var t=function(){i.each(r.after,function(D,E){if(v.cycleStop!=r.stopCount){return}E.apply(B,[C,B,r,z])})};b("tx firing; currSlide: "+r.currSlide+"; nextSlide: "+r.nextSlide);r.busy=1;if(r.fxFn){r.fxFn(C,B,r,t,z,y&&r.fastOnEvent)}else{if(i.isFunction(i.fn.cycle[r.fx])){i.fn.cycle[r.fx](C,B,r,t,z,y&&r.fastOnEvent)}else{i.fn.cycle.custom(C,B,r,t,z,y&&r.fastOnEvent)}}}if(A||r.nextSlide==r.currSlide){r.lastSlide=r.currSlide;if(r.random){r.currSlide=r.nextSlide;if(++r.randomIndex==x.length){r.randomIndex=0}r.nextSlide=r.randomMap[r.randomIndex];if(r.nextSlide==r.currSlide){r.nextSlide=(r.currSlide==r.slideCount-1)?0:r.currSlide+1}}else{if(r.backwards){var u=(r.nextSlide-1)<0;if(u&&r.bounce){r.backwards=!r.backwards;r.nextSlide=1;r.currSlide=0}else{r.nextSlide=u?(x.length-1):r.nextSlide-1;r.currSlide=u?0:r.nextSlide+1}}else{var u=(r.nextSlide+1)==x.length;if(u&&r.bounce){r.backwards=!r.backwards;r.nextSlide=x.length-2;r.currSlide=x.length-1}else{r.nextSlide=u?0:r.nextSlide+1;r.currSlide=u?x.length-1:r.nextSlide-1}}}}if(A&&r.pager){r.updateActivePagerLink(r.pager,r.currSlide,r.activePagerClass)}var s=0;if(r.timeout&&!r.continuous){s=f(x[r.currSlide],x[r.nextSlide],r,z)}else{if(r.continuous&&v.cyclePause){s=10}}if(s>0){v.cycleTimeout=setTimeout(function(){g(x,r,0,(!r.rev&&!r.backwards))},s)}}i.fn.cycle.updateActivePagerLink=function(r,t,s){i(r).each(function(){i(this).children().removeClass(s).eq(t).addClass(s)})};function f(w,u,v,s){if(v.timeoutFn){var r=v.timeoutFn.call(w,w,u,v,s);while((r-v.speed)<250){r+=v.speed}b("calculated timeout: "+r+"; speed: "+v.speed);if(r!==false){return r}}return v.timeout}i.fn.cycle.next=function(r){q(r,r.rev?-1:1)};i.fn.cycle.prev=function(r){q(r,r.rev?1:-1)};function q(u,w){var t=u.elements;var v=u.$cont[0],s=v.cycleTimeout;if(s){clearTimeout(s);v.cycleTimeout=0}if(u.random&&w<0){u.randomIndex--;if(--u.randomIndex==-2){u.randomIndex=t.length-2}else{if(u.randomIndex==-1){u.randomIndex=t.length-1}}u.nextSlide=u.randomMap[u.randomIndex]}else{if(u.random){u.nextSlide=u.randomMap[u.randomIndex]}else{u.nextSlide=u.currSlide+w;if(u.nextSlide<0){if(u.nowrap){return false}u.nextSlide=t.length-1}else{if(u.nextSlide>=t.length){if(u.nowrap){return false}u.nextSlide=0}}}}var r=u.onPrevNextEvent||u.prevNextClick;if(i.isFunction(r)){r(w>0,u.nextSlide,t[u.nextSlide])}g(t,u,1,w>=0);return false}function j(s,t){var r=i(t.pager);i.each(s,function(u,v){i.fn.cycle.createPagerAnchor(u,v,r,s,t)});t.updateActivePagerLink(t.pager,t.startingSlide,t.activePagerClass)}i.fn.cycle.createPagerAnchor=function(v,w,t,u,x){var s;if(i.isFunction(x.pagerAnchorBuilder)){s=x.pagerAnchorBuilder(v,w);b("pagerAnchorBuilder("+v+", el) returned: "+s)}else{s='<a href="#">'+(v+1)+"</a>"}if(!s){return}var y=i(s);if(y.parents("body").length===0){var r=[];if(t.length>1){t.each(function(){var z=y.clone(true);i(this).append(z);r.push(z[0])});y=i(r)}else{y.appendTo(t)}}x.pagerAnchors=x.pagerAnchors||[];x.pagerAnchors.push(y);y.bind(x.pagerEvent,function(C){C.preventDefault();x.nextSlide=v;var B=x.$cont[0],A=B.cycleTimeout;if(A){clearTimeout(A);B.cycleTimeout=0}var z=x.onPagerEvent||x.pagerClick;if(i.isFunction(z)){z(x.nextSlide,u[x.nextSlide])}g(u,x,1,x.currSlide<v)});if(!/^click/.test(x.pagerEvent)&&!x.allowPagerClickBubble){y.bind("click.cycle",function(){return false})}if(x.pauseOnPagerHover){y.hover(function(){x.$cont[0].cyclePause++},function(){x.$cont[0].cyclePause--})}};i.fn.cycle.hopsFromLast=function(u,t){var s,r=u.lastSlide,v=u.currSlide;if(t){s=v>r?v-r:u.slideCount-r}else{s=v<r?r-v:r+u.slideCount-v}return s};function e(t){b("applying clearType background-color hack");function s(u){u=parseInt(u).toString(16);return u.length<2?"0"+u:u}function r(x){for(;x&&x.nodeName.toLowerCase()!="html";x=x.parentNode){var u=i.css(x,"background-color");if(u.indexOf("rgb")>=0){var w=u.match(/\d+/g);return"#"+s(w[0])+s(w[1])+s(w[2])}if(u&&u!="transparent"){return u}}return"#ffffff"}t.each(function(){i(this).css("background-color",r(this))})}i.fn.cycle.commonReset=function(x,u,v,s,t,r){i(v.elements).not(x).hide();v.cssBefore.opacity=1;v.cssBefore.display="block";if(s!==false&&u.cycleW>0){v.cssBefore.width=u.cycleW}if(t!==false&&u.cycleH>0){v.cssBefore.height=u.cycleH}v.cssAfter=v.cssAfter||{};v.cssAfter.display="none";i(x).css("zIndex",v.slideCount+(r===true?1:0)+800);i(u).css("zIndex",v.slideCount+(r===true?0:1)+800)};i.fn.cycle.custom=function(D,w,r,s,v,x){var A=i(D),y=i(w);var u=r.speedIn,B=r.speedOut,t=r.easeIn,C=r.easeOut;y.css(r.cssBefore);if(x){if(typeof x=="number"){u=B=x}else{u=B=1}t=C=null}var z=function(){y.animate(r.animIn,u,t,s)};A.animate(r.animOut,B,C,function(){if(r.cssAfter){A.css(r.cssAfter)}if(!r.sync){z()}});if(r.sync){z()}};i.fn.cycle.transitions={fade:function(s,t,r){t.not(":eq("+r.currSlide+")").css("opacity",0);r.before.push(function(w,u,v){i.fn.cycle.commonReset(w,u,v);v.cssBefore.opacity=0});r.animIn={opacity:1};r.animOut={opacity:0};r.cssBefore={top:0,left:0}}};i.fn.cycle.ver=function(){return l};i.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!i.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:false}})(jQuery);
/*
 * jQuery Cycle Plugin Transition Definitions
 * This script is a plugin for the jQuery Cycle Plugin
 * Examples and documentation at: http://malsup.com/jquery/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version:	 2.72
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(a){a.fn.cycle.transitions.scrollUp=function(d,e,c){d.css("overflow","hidden");c.before.push(a.fn.cycle.commonReset);var b=d.height();c.cssBefore={top:b,left:0};c.cssFirst={top:0};c.animIn={top:0};c.animOut={top:-b}};a.fn.cycle.transitions.scrollHorz=function(c,d,b){c.css("overflow","hidden").width();b.before.push(function(h,f,g,e){a.fn.cycle.commonReset(h,f,g);g.cssBefore.left=e?(f.cycleW-1):(1-f.cycleW);g.animOut.left=e?-h.cycleW:h.cycleW});b.cssFirst={left:0};b.cssBefore={top:0};b.animIn={left:0};b.animOut={top:0}}})(jQuery);
