(function(e){e.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(b,a){this.defaults.type=b;this.defaults.name=a},get:function(b,a){a=e.extend({},this.defaults,a);if(!a.single.length)a.single="metadata";var c=e.data(b,a.single);if(c)return c;c="{}";var h=function(d){if(typeof d!="string")return d;return d=eval("("+d+")")};if(a.type=="html5"){var g={};e(b.attributes).each(function(){var d=this.nodeName;if(d.match(/^data-/))d=d.replace(/^data-/, "");else return true;g[d]=h(this.nodeValue)})}else{if(a.type=="class"){var f=a.cre.exec(b.className);if(f)c=f[1]}else if(a.type=="elem"){if(!b.getElementsByTagName)return;f=b.getElementsByTagName(a.name);if(f.length)c=e.trim(f[0].innerHTML)}else if(b.getAttribute!=undefined)if(f=b.getAttribute(a.name))c=f;g=h(c.indexOf("{")<0?"{"+c+"}":c)}e.data(b,a.single,g);return g}}});e.fn.metadata=function(b){return e.metadata.get(this[0],b)}})(jQuery);;
(function($){$.dm={defaults:{ajaxData:{dm_cpi:dm_configuration.page_id||0,dm_xhr:1}},base:{}};$.ajaxSetup({global:false,timeout:false,type:"GET",cache:false,data:$.dm.defaults.ajaxData});if($.datepicker)
{$.datepicker.setDefaults($.datepicker.regional[dm_configuration.culture]);}
if($.blockUI)
{$.blockUI.defaults=$.extend($.blockUI.defaults,{css:{},overlayCSS:{},message:' ',fadeIn:0,fadeOut:0});}
if($.fn.tipsy)
{$.fn.tipsy.elementOptions=function(elem,options){return options;};$.fn.tipsy.defaults.delayIn=500;$.fn.tipsy.autoNorth=function(){return $(this).offset().left>100?($(this).offset().left<($(window).width()-100)?'n':'e'):'w';};$.fn.tipsy.autoSouth=function(){return $(this).offset().left>100?($(this).offset().left<($(window).width()-100)?'s':'e'):'w';};}})(jQuery);;
(function($)
{$.dbg=function()
{if(typeof console!=='object'||($.dm.ctrl&&$.dm.ctrl.options&&!$.dm.ctrl.options.debug))
{return;}
try
{console.debug(arguments);}
catch(e)
{}};$.loadStylesheets=function(stylesheets)
{$.each(stylesheets,function()
{if(!$('link[rel=stylesheet][href='+this+']').length)
{$("head").append('<link rel="stylesheet" href="'+this+'">');}});};$.fn.extend({orNot:function()
{return this.length==0?false:this;},rebind:function(type,data,fn)
{return this.unbind(type,fn).bind(type,data,fn);},bindKey:function(key,fn)
{if(!window.hotkeys)
{return this;}
return this.bind('keydown',key,function(e)
{e.stopPropagation();return fn(e);});},unbindKey:function(key)
{if(!window.hotkeys)
{return this;}
return this.unbind('keydown',key);}});})(jQuery);;
(function($)
{$.dm.coreCtrl={getHref:function(action)
{return this.options.script_name+action;}};$(function()
{$.dm.ctrl.options=$.extend($.dm.defaults,dm_configuration);$.dm.ctrl.init();});})(jQuery);;
(function($)
{$.dm.ctrl=$.extend($.dm.coreCtrl,{init:function()
{$('#dm_page div.dm_widget').trigger('dmWidgetLaunch');}});})(jQuery);;/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=$.extend({},options);options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};;
(function(jQuery){var
_doc=null,_win=null,_docHeight=0,_winHeight=0,_winWidth=0,_t=null,_event=null,_target=null,_escapedContent='',_title='',_caption='',_container=null,_content=null;jQuery.fn.simpleDialog=function(options){var opts=jQuery.extend({},$.fn.simpleDialog.defaults,options);return this.each(function(i,e){var $this=jQuery(e);var triggerEvent=($this.is('form'))?'submit':'click';$this.bind(triggerEvent+'.simpledialog',function(event){event.preventDefault();_t=this;_t.opts=opts;_event=event;_initialize();_prepare();var $t=jQuery(this);if(_t.opts.title!='')
_title=_t.opts.title;if($t.is('a')||$t.is('area')){if(_t.opts.useTitleAttr){var title=$t.attr('title');if(typeof title!='undefined'&&title!='')
_title=title;}
var href=$t.attr('href');if(href.match(/^#/)){var c=jQuery('#'+$t.attr('rel'));if(c.length==0)return false;_target=c;_escapedContent=_target.clone().html();_target.empty();_show(_escapedContent);}else if($t.find('img').length>0){if(_t.opts.showCaption)
_caption=$t.find('img').attr('title');_load(href);}else{_request(href,{});}}else if($t.is(':submit',':button')){var f=$t.parents('form');_request(f.attr('action'),f.serialize(),f.attr('method'));}else if($t.is('form')){_request($t.attr('action'),$t.serialize(),$t.attr('method'));}else{jQuery.simpleDialog.close(event);}
return false;});});};jQuery.fn.simpleDialog.defaults={title:'',useTitleAttr:true,containerId:'sd_container',containerClass:'sd_container',overlayId:'sd_overlay',overlayClass:'sd_overlay',loadingClass:'sd_loading',closeLabelClass:'sd_closelabel',showCloseLabel:false,closeLabel:'close &times;',opacity:0.8,duration:400,easing:'linear',zIndex:1000,width:null,height:null,showCaption:true,open:null,close:null,closeSelector:'.close'};jQuery.simpleDialog={close:function(event){if($.isFunction(_t.opts.close))
_t.opts.close.apply(this,[(typeof event=='undefined')?null:event,_t]);if(_container!=null)
_container.remove();if(_target!=null)
_target.html(_escapedContent);jQuery('#'+_t.opts.overlayId).remove();return false;}};var _initialize=function(){_doc=jQuery(document);_win=jQuery(window);_docHeight=_doc.height();_winHeight=_win.height();_winWidth=_win.width();_title='';_caption='';};var _show=function(content){var body='';if(_title!='')
body+='<div class="sd_header">'+_title+'</div>';body+='<div class="sd_content">'+content+'</div>';if(_caption!=''&&typeof _caption!='undefined')
body+=' <div class="sd_footer">'+_caption+'</div>';var tmp=jQuery('<div />').addClass(_t.opts.containerClass).hide().css({position:'absolute',height:'auto'}).html(body).appendTo(document.body);var w=(_t.opts.width)?parseInt(_t.opts.width):tmp.width();var h=(_t.opts.height)?parseInt(_t.opts.height):tmp.height();tmp.remove();var pos=_center(w,h);_container.removeClass(_t.opts.loadingClass).animate({width:w+'px',height:h+'px',left:pos[0]+'px',top:pos[1]+'px'},_t.opts.duration,_t.opts.easing,function(){_container.css('height','auto').html(body).find(_t.opts.closeSelector).bind('click.simpledialog',jQuery.simpleDialog.close);if(_t.opts.showCloseLabel){var sc='<div id="sd_closelabel" class="'+_t.opts.closeLabelClass+'">'+'<a href="#">'+_t.opts.closeLabel+'</a></div>';_container.hover(function(){$(this).append(sc);var scObj=$('#sd_closelabel');scObj.css({position:'absolute',top:0,left:(w-scObj.width())+'px',opacity:0.85}).find('a').click(jQuery.simpleDialog.close);},function(){$('#sd_closelabel').remove()});}
if(jQuery.isFunction(_t.opts.open))
_t.opts.open.apply(_container,[_event,_t]);});};var _request=function(url,data,method){jQuery.ajax({type:(typeof method=='undefined')?'GET':method,url:url,data:data,dataType:'html',success:_show});};var _load=function(url){$(document.body).append('<div id="sd_tmp_image" style="display:none;"><img src="'+url+'" alt="" /></div>');var tmp=$('#sd_tmp_image');tmp.find('img').load(function(){var h=tmp.html();tmp.remove();_show(h);}).error(function(e){$.simpleDialog.close(e);tmp.remove();});};var _prepare=function(){jQuery('<div />').attr('id',_t.opts.overlayId).addClass(_t.opts.overlayClass).css({position:'absolute',width:_winWidth,height:_docHeight,opacity:_t.opts.opacity,zIndex:_t.opts.zIndex}).bind('click.simpledialog',jQuery.simpleDialog.close).appendTo(document.body);_container=jQuery('<div />').attr('id',_t.opts.containerId).addClass(_t.opts.loadingClass).addClass(_t.opts.containerClass).hide().appendTo(document.body);var w=_container.width();var h=_container.height();var pos=_center(w,h);_container.css({position:'absolute',left:pos[0]+'px',top:pos[1]+'px',width:w+'px',height:h+'px',zIndex:_t.opts.zIndex+1000}).show();};var _center=function(w,h){return[(_docHeight>_winHeight)?_winWidth/2-w/2-18:_winWidth/2-w/2,_doc.scrollTop()+_winHeight/2-h/2];};})(jQuery);;/*!
 * jQuery UI 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI
 */
jQuery.ui||function(c){c.ui={version:"1.8.1",plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")=="hidden")return false;
b=b&&b=="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,f,g){return c.ui.isOverAxis(a,d,f)&&c.ui.isOverAxis(b,e,g)},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,
PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none")},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||
/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==
undefined)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b=="absolute"||b=="relative"||b=="fixed"){b=parseInt(a.css("zIndex"));if(!isNaN(b)&&b!=0)return b}a=a.parent()}}return 0}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b||"area"==b?a.href||!isNaN(d):!isNaN(d))&&
!c(a)["area"==b?"parents":"closest"](":hidden").length},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}})}(jQuery);
;/*!
 * jQuery UI Widget 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Widget
 */
(function(b){var j=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add(this).each(function(){b(this).triggerHandler("remove")});return j.call(b(this),a,c)})};b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend({},c.options);b[e][a].prototype=
b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.substring(0,1)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==undefined){h=i;return false}}):this.each(function(){var g=
b.data(this,a);if(g){d&&g.option(d);g._init()}else b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){this.element=b(c).data(this.widgetName,this);this.options=b.extend(true,{},this.options,b.metadata&&b.metadata.get(c)[this.widgetName],a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();
this._init()},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a,e=this;if(arguments.length===0)return b.extend({},e.options);if(typeof a==="string"){if(c===undefined)return this.options[a];d={};d[a]=c}b.each(d,function(f,
h){e._setOption(f,h)});return e},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=
b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
 * jQuery UI Mouse 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Mouse
 *
 * Depends:
 *	jquery.ui.widget.js
 */
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(a._preventClickEvent){a._preventClickEvent=false;b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&
this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();
return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.browser.safari||a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&
this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=a.target==this._mouseDownEvent.target;this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-
a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
 * jQuery UI Draggable 1.8.1
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Draggables
 *
 * Depends:
 *	jquery.ui.core.js
 *	jquery.ui.mouse.js
 *	jquery.ui.widget.js
 */
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,
b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment==
"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&
a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),
10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():
f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+
this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+
Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-
this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=
this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.1"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");
if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;
c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=
1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;
this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=
this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=
d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;
if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!=
"HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-
b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&
o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=
p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&
(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
;
(function(jQuery){jQuery.each(['backgroundColor','borderBottomColor','borderLeftColor','borderRightColor','borderTopColor','color','outlineColor'],function(i,attr){jQuery.fx.step[attr]=function(fx){if(fx.state==0){fx.start=getColor(fx.elem,attr);fx.end=getRGB(fx.end);}
fx.elem.style[attr]="rgb("+[Math.max(Math.min(parseInt((fx.pos*(fx.end[0]-fx.start[0]))+fx.start[0]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[1]-fx.start[1]))+fx.start[1]),255),0),Math.max(Math.min(parseInt((fx.pos*(fx.end[2]-fx.start[2]))+fx.start[2]),255),0)].join(",")+")";}});function getRGB(color){var result;if(color&&color.constructor==Array&&color.length==3)
return color;if(result=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
return[parseInt(result[1]),parseInt(result[2]),parseInt(result[3])];if(result=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
return[parseFloat(result[1])*2.55,parseFloat(result[2])*2.55,parseFloat(result[3])*2.55];if(result=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
return[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)];if(result=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
return[parseInt(result[1]+result[1],16),parseInt(result[2]+result[2],16),parseInt(result[3]+result[3],16)];return colors[jQuery.trim(color).toLowerCase()];}
function getColor(elem,attr){var color;do{color=jQuery.curCSS(elem,attr);if(color!=''&&color!='transparent'||jQuery.nodeName(elem,"body"))
break;attr="backgroundColor";}while(elem=elem.parentNode);return getRGB(color);};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]};})(jQuery);;
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});;
jQuery.fn.foldable=function(options,fn){var defaults={};if(options instanceof Object)
{var opts=jQuery.extend({},defaults,options);$(this).attr('name',opts.name);}
var $this=$(this);var $elem=$('> div',this);function updateText()
{var btn=$('#fold-btn-'+$this.attr('name'));btn.text($elem.is(':visible')?'Zwiń':'Rozwiń');}
function hide()
{$elem.hide();updateText();}
function show()
{$elem.slideDown(500,function(){updateText();if(fn)fn();});}
function toggleFold()
{var btn=$('#fold-btn-'+$this.attr('name'));var cookie='foldable-'+$this.attr('name');if($elem.is(':visible')){$elem.slideUp(500,function(){updateText();});$.cookie(cookie,null,{path:'/'});}else{$elem.slideDown();updateText();$.cookie(cookie,'1',{expires:1,path:'/'});}}
switch(options){case'toggle':toggleFold();break;case'hide':hide();break;case'foldDown':case'show':show();break;default:{$('<a/>').attr('href','javascript:void(0)').attr('id','fold-btn-'+opts.name).addClass('toggle_button').addClass('button-grey').appendTo(this).click(toggleFold);updateText();}}};;/*
 * jQuery Cycle Plugin (with Transition Definitions)
 * Examples and documentation at: http://jquery.malsup.com/cycle/
 * Copyright (c) 2007-2010 M. Alsup
 * Version: 2.94 (20-DEC-2010)
 * Dual licensed under the MIT and GPL licenses.
 * http://jquery.malsup.com/license.html
 * Requires: jQuery v1.2.6 or later
 */
(function($){var ver="2.94";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.backwards);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,!opts.backwards);},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,!options.backwards);}}}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevNextEvent);}if(opts.prev){$(opts.prev).unbind(opts.prevNextEvent);}if(opts.pager||opts.pagerAnchorBuilder){$.each(opts.pagerAnchors||[],function(){this.unbind().remove();});}opts.pagerAnchors=null;if(opts.destroy){opts.destroy(opts);}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.backwards);});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}else{if(opts.backwards){opts.startingSlide=els.length-1;}}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=1;opts.startingSlide=opts.randomMap[1];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth||e.width||$e.attr("width");}if(!h){h=e.offsetHeight||e.height||$e.attr("height");}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetHeight||this.height||$el.attr("height")||0);this.cycleW=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetWidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="shuffle"?500:250;while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.backwards){opts.nextSlide=opts.startingSlide==0?(els.length-1):opts.startingSlide-1;}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0);});}if(opts.pager||opts.pagerAnchorBuilder){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$s.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager||opts.pagerAnchorBuilder){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){debug("manualTrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=false;}if(opts.busy){debug("transition active, ignoring new tx request");return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){changed=true;var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing; currSlide: "+opts.currSlide+"; nextSlide: "+opts.nextSlide);opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}}}if(changed||opts.nextSlide==opts.currSlide){opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];if(opts.nextSlide==opts.currSlide){opts.nextSlide=(opts.currSlide==opts.slideCount-1)?0:opts.currSlide+1;}}else{if(opts.backwards){var roll=(opts.nextSlide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=1;opts.currSlide=0;}else{opts.nextSlide=roll?(els.length-1):opts.nextSlide-1;opts.currSlide=roll?0:opts.nextSlide+1;}}else{var roll=(opts.nextSlide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=els.length-2;opts.currSlide=els.length-1;}else{opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}}}}if(changed&&opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(els[opts.currSlide],els[opts.nextSlide],opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.backwards);},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,1);};$.fn.cycle.prev=function(opts){advance(opts,0);};function advance(opts,moveForward){var val=moveForward?1:-1;var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}var cb=opts.onPrevNextEvent||opts.prevNextClick;if($.isFunction(cb)){cb(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,moveForward);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);debug("pagerAnchorBuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}opts.pagerAnchors=opts.pagerAnchors||[];opts.pagerAnchors.push($a);$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}var cb=opts.onPagerEvent||opts.pagerClick;if($.isFunction(cb)){cb(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);});if(!/^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble){$a.bind("click.cycle",function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){debug("applying clearType background-color hack");function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(opts.slideResize&&w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(opts.slideResize&&h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.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,slideResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.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.73
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.fadeout=function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css({display:"block",opacity:1});opts.before.push(function(curr,next,opts,w,h,rev){$(curr).css("zIndex",opts.slideCount+(!rev===true?1:0));$(next).css("zIndex",opts.slideCount+(!rev===true?0:1));});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={opacity:1,display:"block"};opts.cssAfter={zIndex:0};};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){if(opts.rev){fwd=!fwd;}$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){if(opts.rev){fwd=!fwd;}var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;opts.animOut.width=next.cycleW;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0};};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);;
(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var me=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').hide().appendTo(me),$li=$("li",this),curr=$("li.dm_current",this)[0]||$($li[0]).addClass("dm_current")[0];var moved=curr;$li.not(".back").hover(function(){moved=this;move(this);},noop);$(this).hover(function(){$back.stop(true).fadeTo(500,1);setCurr(moved);},function(){$back.stop(true).fadeTo(200,0);move(moved);});$li.click(function(e){setCurr(this);return o.click.apply(this,[e,this]);});function setCurr(el){$back.css({"left":$(el).position().left+"px","width":$(el).width()+"px"});curr=el;}
function move(el){$back.each(function(){$(this).dequeue();}).animate({width:$(el).width(),left:$(el).position().left},o.speed,o.fx);moved=el;}});};})(jQuery);;// ColorBox v1.3.15 - a full featured, light-weight, customizable lightbox based on jQuery 1.3+
// Copyright (c) 2010 Jack Moore - jack@colorpowered.com
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
(function(b,ib){var t="none",M="LoadedContent",c=false,v="resize.",o="y",q="auto",e=true,L="nofollow",m="x";function f(a,c){a=a?' id="'+i+a+'"':"";c=c?' style="'+c+'"':"";return b("<div"+a+c+"/>")}function p(a,b){b=b===m?n.width():n.height();return typeof a==="string"?Math.round(/%/.test(a)?b/100*parseInt(a,10):parseInt(a,10)):a}function U(b){return a.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(b)}function cb(a){for(var c in a)if(b.isFunction(a[c])&&c.substring(0,2)!=="on")a[c]=a[c].call(l);a.rel=a.rel||l.rel||L;a.href=a.href||b(l).attr("href");a.title=a.title||l.title;return a}function w(c,a){a&&a.call(l);b.event.trigger(c)}function jb(){var b,e=i+"Slideshow_",c="click."+i,f,k;if(a.slideshow&&h[1]){f=function(){F.text(a.slideshowStop).unbind(c).bind(V,function(){if(g<h.length-1||a.loop)b=setTimeout(d.next,a.slideshowSpeed)}).bind(W,function(){clearTimeout(b)}).one(c+" "+N,k);j.removeClass(e+"off").addClass(e+"on");b=setTimeout(d.next,a.slideshowSpeed)};k=function(){clearTimeout(b);F.text(a.slideshowStart).unbind([V,W,N,c].join(" ")).one(c,f);j.removeClass(e+"on").addClass(e+"off")};a.slideshowAuto?f():k()}}function db(c){if(!O){l=c;a=cb(b.extend({},b.data(l,r)));h=b(l);g=0;if(a.rel!==L){h=b("."+G).filter(function(){return (b.data(this,r).rel||this.rel)===a.rel});g=h.index(l);if(g===-1){h=h.add(l);g=h.length-1}}if(!u){u=D=e;j.show();if(a.returnFocus)try{l.blur();b(l).one(eb,function(){try{this.focus()}catch(a){}})}catch(f){}x.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":q}).show();a.w=p(a.initialWidth,m);a.h=p(a.initialHeight,o);d.position(0);X&&n.bind(v+P+" scroll."+P,function(){x.css({width:n.width(),height:n.height(),top:n.scrollTop(),left:n.scrollLeft()})}).trigger("scroll."+P);w(fb,a.onOpen);Y.add(H).add(I).add(F).add(Z).hide();ab.html(a.close).show()}d.load(e)}}var gb={transition:"elastic",speed:300,width:c,initialWidth:"600",innerWidth:c,maxWidth:c,height:c,initialHeight:"450",innerHeight:c,maxHeight:c,scalePhotos:e,scrolling:e,inline:c,html:c,iframe:c,photo:c,href:c,title:c,rel:c,opacity:.9,preloading:e,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:c,returnFocus:e,loop:e,slideshow:c,slideshowAuto:e,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:c,onLoad:c,onComplete:c,onCleanup:c,onClosed:c,overlayClose:e,escKey:e,arrowKey:e},r="colorbox",i="cbox",fb=i+"_open",W=i+"_load",V=i+"_complete",N=i+"_cleanup",eb=i+"_closed",Q=i+"_purge",hb=i+"_loaded",E=b.browser.msie&&!b.support.opacity,X=E&&b.browser.version<7,P=i+"_IE6",x,j,A,s,bb,T,R,S,h,n,k,J,K,Z,Y,F,I,H,ab,B,C,y,z,l,g,a,u,D,O=c,d,G=i+"Element";d=b.fn[r]=b[r]=function(c,f){var a=this,d;if(!a[0]&&a.selector)return a;c=c||{};if(f)c.onComplete=f;if(!a[0]||a.selector===undefined){a=b("<a/>");c.open=e}a.each(function(){b.data(this,r,b.extend({},b.data(this,r)||gb,c));b(this).addClass(G)});d=c.open;if(b.isFunction(d))d=d.call(a);d&&db(a[0]);return a};d.init=function(){var l="hover",m="clear:left";n=b(ib);j=f().attr({id:r,"class":E?i+"IE":""});x=f("Overlay",X?"position:absolute":"").hide();A=f("Wrapper");s=f("Content").append(k=f(M,"width:0; height:0; overflow:hidden"),K=f("LoadingOverlay").add(f("LoadingGraphic")),Z=f("Title"),Y=f("Current"),I=f("Next"),H=f("Previous"),F=f("Slideshow").bind(fb,jb),ab=f("Close"));A.append(f().append(f("TopLeft"),bb=f("TopCenter"),f("TopRight")),f(c,m).append(T=f("MiddleLeft"),s,R=f("MiddleRight")),f(c,m).append(f("BottomLeft"),S=f("BottomCenter"),f("BottomRight"))).children().children().css({"float":"left"});J=f(c,"position:absolute; width:9999px; visibility:hidden; display:none");b("body").prepend(x,j.append(A,J));s.children().hover(function(){b(this).addClass(l)},function(){b(this).removeClass(l)}).addClass(l);B=bb.height()+S.height()+s.outerHeight(e)-s.height();C=T.width()+R.width()+s.outerWidth(e)-s.width();y=k.outerHeight(e);z=k.outerWidth(e);j.css({"padding-bottom":B,"padding-right":C}).hide();I.click(d.next);H.click(d.prev);ab.click(d.close);s.children().removeClass(l);b("."+G).live("click",function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();db(this)}});x.click(function(){a.overlayClose&&d.close()});b(document).bind("keydown",function(b){if(u&&a.escKey&&b.keyCode===27){b.preventDefault();d.close()}if(u&&a.arrowKey&&!D&&h[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();H.click()}else if(b.keyCode===39&&(g<h.length-1||a.loop)){b.preventDefault();I.click()}})};d.remove=function(){j.add(x).remove();b("."+G).die("click").removeData(r).removeClass(G)};d.position=function(f,d){function b(a){bb[0].style.width=S[0].style.width=s[0].style.width=a.style.width;K[0].style.height=K[1].style.height=s[0].style.height=T[0].style.height=R[0].style.height=a.style.height}var e,h=Math.max(document.documentElement.clientHeight-a.h-y-B,0)/2+n.scrollTop(),g=Math.max(n.width()-a.w-z-C,0)/2+n.scrollLeft();e=j.width()===a.w+z&&j.height()===a.h+y?0:f;A[0].style.width=A[0].style.height="9999px";j.dequeue().animate({width:a.w+z,height:a.h+y,top:h,left:g},{duration:e,complete:function(){b(this);D=c;A[0].style.width=a.w+z+C+"px";A[0].style.height=a.h+y+B+"px";d&&d()},step:function(){b(this)}})};d.resize=function(b){if(u){b=b||{};if(b.width)a.w=p(b.width,m)-z-C;if(b.innerWidth)a.w=p(b.innerWidth,m);k.css({width:a.w});if(b.height)a.h=p(b.height,o)-y-B;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=k.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}k.css({height:a.h});d.position(a.transition===t?0:a.speed)}};d.prep=function(m){var c="hidden";function l(s){var p,f,m,c,l=h.length,q=a.loop;d.position(s,function(){function s(){E&&j[0].style.removeAttribute("filter")}if(u){E&&o&&k.fadeIn(100);k.show();w(hb);Z.show().html(a.title);if(l>1){typeof a.current==="string"&&Y.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,l)).show();I[q||g<l-1?"show":"hide"]().html(a.next);H[q||g?"show":"hide"]().html(a.previous);p=g?h[g-1]:h[l-1];m=g<l-1?h[g+1]:h[0];a.slideshow&&F.show();if(a.preloading){c=b.data(m,r).href||m.href;f=b.data(p,r).href||p.href;c=b.isFunction(c)?c.call(m):c;f=b.isFunction(f)?f.call(p):f;if(U(c))b("<img/>")[0].src=c;if(U(f))b("<img/>")[0].src=f}}K.hide();a.transition==="fade"?j.fadeTo(e,1,function(){s()}):s();n.bind(v+i,function(){d.position(0)});w(V,a.onComplete)}})}if(u){var o,e=a.transition===t?0:a.speed;n.unbind(v+i);k.remove();k=f(M).html(m);k.hide().appendTo(J.show()).css({width:function(){a.w=a.w||k.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?q:c}).css({height:function(){a.h=a.h||k.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(s);J.hide();b("#"+i+"Photo").css({cssFloat:t,marginLeft:q,marginRight:q});X&&b("select").not(j.find("select")).filter(function(){return this.style.visibility!==c}).css({visibility:c}).one(N,function(){this.style.visibility="inherit"});a.transition==="fade"?j.fadeTo(e,0,function(){l(0)}):l(e)}};d.load=function(u){var n,c,s,q=d.prep;D=e;l=h[g];u||(a=cb(b.extend({},b.data(l,r))));w(Q);w(W,a.onLoad);a.h=a.height?p(a.height,o)-y-B:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,m)-z-C:a.innerWidth&&p(a.innerWidth,m);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,m)-z-C;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-y-B;a.mh=a.h&&a.h<a.mh?a.h:a.mh}n=a.href;K.show();if(a.inline){f().hide().insertBefore(b(n)[0]).one(Q,function(){b(this).replaceWith(k.children())});q(b(n))}else if(a.iframe){j.one(hb,function(){var c=b("<iframe frameborder='0' style='width:100%; height:100%; border:0; display:block'/>")[0];c.name=i+ +new Date;c.src=a.href;if(!a.scrolling)c.scrolling="no";if(E)c.allowtransparency="true";b(c).appendTo(k).one(Q,function(){c.src="//about:blank"})});q(" ")}else if(a.html)q(a.html);else if(U(n)){c=new Image;c.onload=function(){var e;c.onload=null;c.id=i+"Photo";b(c).css({border:t,display:"block",cssFloat:"left"});if(a.scalePhotos){s=function(){c.height-=c.height*e;c.width-=c.width*e};if(a.mw&&c.width>a.mw){e=(c.width-a.mw)/c.width;s()}if(a.mh&&c.height>a.mh){e=(c.height-a.mh)/c.height;s()}}if(a.h)c.style.marginTop=Math.max(a.h-c.height,0)/2+"px";h[1]&&(g<h.length-1||a.loop)&&b(c).css({cursor:"pointer"}).click(d.next);if(E)c.style.msInterpolationMode="bicubic";setTimeout(function(){q(c)},1)};setTimeout(function(){c.src=n},1)}else n&&J.load(n,function(d,c,a){q(c==="error"?"Request unsuccessful: "+a.statusText:b(this).children())})};d.next=function(){if(!D){g=g<h.length-1?g+1:0;d.load()}};d.prev=function(){if(!D){g=g?g-1:h.length-1;d.load()}};d.close=function(){if(u&&!O){O=e;u=c;w(N,a.onCleanup);n.unbind("."+i+" ."+P);x.fadeTo("fast",0);j.stop().fadeTo("fast",0,function(){w(Q);k.remove();j.add(x).css({opacity:1,cursor:q}).hide();setTimeout(function(){O=c;w(eb,a.onClosed)},1)})}};d.element=function(){return b(l)};d.settings=gb;b(d.init)})(jQuery,this);
;
(function($){if($.fn.carouFredSel)return;$.fn.carouFredSel=function(o){if(this.length==0){debug(true,'No element found for "'+this.selector+'".');return this;}
if(this.length>1){return this.each(function(){$(this).carouFredSel(o);});}
var $cfs=this,$tt0=this[0];$cfs.init=function(o,setOrig){var obs=['items','scroll','auto','prev','next','pagination'];o=getObject(o);for(var a=0,l=obs.length;a<l;a++){o[obs[a]]=getObject(o[obs[a]]);}
if(typeof o.scroll=='number'){if(o.scroll<=50)o.scroll={items:o.scroll};else o.scroll={duration:o.scroll};}else{if(typeof o.scroll=='string')o.scroll={easing:o.scroll};}
if(typeof o.items=='number')o.items={visible:o.items};else if(typeof o.items=='string')o.items={visible:o.items,width:o.items,height:o.items};if(setOrig)opts_orig=$.extend(true,{},$.fn.carouFredSel.defaults,o);opts=$.extend(true,{},$.fn.carouFredSel.defaults,o);opts.variableVisible=false;opts.d={};direction=(opts.direction=='up'||opts.direction=='left')?'next':'prev';var dims=[['width','innerWidth','outerWidth','height','innerHeight','outerHeight','left','top','marginRight',0,1,2,3],['height','innerHeight','outerHeight','width','innerWidth','outerWidth','top','left','marginBottom',3,2,1,0]];var dn=dims[0].length,dx=(opts.direction=='right'||opts.direction=='left')?0:1;for(var d=0;d<dn;d++){opts.d[dims[0][d]]=dims[dx][d];}
var all_itm=getItems($cfs),lrgst_b=getTrueLargestSize(all_itm,opts,'outerHeight',false);if(opts.padding=='auto'){debug(true,'The option "padding: auto" is deprecated, use "align: center".');opts.padding=false;opts.align='center';}
if(opts[opts.d['height']]=='auto'){opts[opts.d['height']]=lrgst_b;opts.items[opts.d['height']]=lrgst_b;}
if(!opts.items[opts.d['width']]){opts.items[opts.d['width']]=(hasVariableSizes(all_itm,opts,'outerWidth'))?'variable':all_itm[opts.d['outerWidth']](true);}
if(!opts.items[opts.d['height']]){opts.items[opts.d['height']]=(hasVariableSizes(all_itm,opts,'outerHeight'))?'variable':all_itm[opts.d['outerHeight']](true);}
if(!opts[opts.d['height']]){opts[opts.d['height']]=opts.items[opts.d['height']];}
if(!opts.items.visible){if(opts.items[opts.d['width']]=='variable'){opts.items.visible='variable';}else{if(typeof opts[opts.d['width']]=='number'){opts.items.visible=Math.floor(opts[opts.d['width']]/opts.items[opts.d['width']]);}else{var maxS=getTrueInnerSize($wrp.parent(),opts,'innerWidth');opts.items.visible=Math.floor(maxS/opts.items[opts.d['width']]);opts[opts.d['width']]=opts.items.visible*opts.items[opts.d['width']];opts.align=false;}}}
if(!opts[opts.d['width']]){if(opts.items.visible!='variable'&&opts.items[opts.d['width']]!='variable'){opts[opts.d['width']]=opts.items.visible*opts.items[opts.d['width']];opts.align=false;}else{opts[opts.d['width']]='variable';}}
if(opts.items.visible=='variable'){opts.variableVisible=true;opts.maxDimention=(opts[opts.d['width']]=='variable')?getTrueInnerSize($wrp.parent(),opts,'innerWidth'):opts[opts.d['width']];if(opts.align===false){opts[opts.d['width']]='variable';}
opts.items.visible=getVisibleItemsNext($cfs,opts,0);}
if(typeof opts.padding=='undefined'){opts.padding=0;}
if(typeof opts.align=='undefined'){opts.align=(opts[opts.d['width']]=='variable')?false:'center';}
opts.items.oldVisible=opts.items.visible;opts.usePadding=false;opts.padding=getPadding(opts.padding);if(opts.align=='top')opts.align='left';if(opts.align=='bottom')opts.align='right';switch(opts.align){case'center':case'left':case'right':if(opts[opts.d['width']]!='variable'){var p=getAlignPadding(getCurrentItems(all_itm,opts),opts);opts.usePadding=true;opts.padding[opts.d[1]]=p[1];opts.padding[opts.d[3]]=p[0];}
break;default:opts.align=false;opts.usePadding=(opts.padding[0]==0&&opts.padding[1]==0&&opts.padding[2]==0&&opts.padding[3]==0)?false:true;break;}
if(typeof opts.items.minimum!='number')opts.items.minimum=(opts.variableVisible)?1:opts.items.visible;if(typeof opts.scroll.items!='number')opts.scroll.items=(opts.variableVisible)?'variable':opts.items.visible;if(typeof opts.scroll.duration!='number')opts.scroll.duration=500;opts.auto=getNaviObject(opts.auto,false,true);opts.prev=getNaviObject(opts.prev);opts.next=getNaviObject(opts.next);opts.pagination=getNaviObject(opts.pagination,true);opts.auto=$.extend(true,{},opts.scroll,opts.auto);opts.prev=$.extend(true,{},opts.scroll,opts.prev);opts.next=$.extend(true,{},opts.scroll,opts.next);opts.pagination=$.extend(true,{},opts.scroll,opts.pagination);if(typeof opts.pagination.keys!='boolean')opts.pagination.keys=false;if(typeof opts.pagination.anchorBuilder!='function')opts.pagination.anchorBuilder=$.fn.carouFredSel.pageAnchorBuilder;if(typeof opts.auto.play!='boolean')opts.auto.play=true;if(typeof opts.auto.nap!='boolean')opts.auto.nap=true;if(typeof opts.auto.delay!='number')opts.auto.delay=0;if(typeof opts.auto.pauseDuration!='number')opts.auto.pauseDuration=(opts.auto.duration<10)?2500:opts.auto.duration*5;if(opts.debug){debug(true,'Carousel width: '+opts.width);debug(true,'Carousel height: '+opts.height);debug(true,'Item widths: '+opts.items.width);debug(true,'Item heights: '+opts.items.height);debug(true,'Number of items visible: '+opts.items.visible);if(opts.auto.play)debug(true,'Number of items scrolled automatically: '+opts.auto.items);if(opts.prev.button)debug(true,'Number of items scrolled backward: '+opts.prev.items);if(opts.next.button)debug(true,'Number of items scrolled forward: '+opts.next.items);}};$cfs.build=function(){if($cfs.css('position')=='absolute'||$cfs.css('position')=='fixed'){debug(opts.debug,'Carousels CSS-attribute "position" should be "static" or "relative".');}
$wrp.css({position:'relative',overflow:'hidden',marginTop:$cfs.css('marginTop'),marginRight:$cfs.css('marginRight'),marginBottom:$cfs.css('marginBottom'),marginLeft:$cfs.css('marginLeft')});$cfs.data('cfs_origCss',{width:$cfs.css('width'),height:$cfs.css('height'),marginTop:$cfs.css('marginTop'),marginRight:$cfs.css('marginRight'),marginBottom:$cfs.css('marginBottom'),marginLeft:$cfs.css('marginLeft'),'float':$cfs.css('float'),position:$cfs.css('position'),top:$cfs.css('top'),left:$cfs.css('left')}).css({marginTop:0,marginRight:0,marginBottom:0,marginLeft:0,'float':'none',position:'absolute'});if(opts.usePadding){getItems($cfs).each(function(){var m=parseInt($(this).css(opts.d['marginRight']));if(isNaN(m))m=0;$(this).data('cfs_origCssMargin',m);});}};$cfs.bind_events=function(){$cfs.unbind_events();$cfs.bind('stop.cfs',function(e){e.stopPropagation();$cfs.trigger('pause');opts.auto.play=false;isPaused='stopped';});$cfs.bind('pause.cfs',function(e,g){e.stopPropagation();if(typeof g=='boolean'){debug(true,'Pause a carousel globally is deprecated, use the "stop" custom event.');$cfs.trigger('stop');return;}
isPaused=true;if(autoTimeout!=null)clearTimeout(autoTimeout);if(autoInterval!=null)clearInterval(autoInterval);if(timerInterval!=null)clearInterval(timerInterval);var dur1=opts.auto.pauseDuration-pauseTimePassed,perc=100-Math.ceil(dur1*100/opts.auto.pauseDuration);if(perc!=0){if(opts.auto.onPausePause)opts.auto.onPausePause.call($tt0,perc,dur1);}});$cfs.bind('play.cfs',function(e,d,f,g){e.stopPropagation();$cfs.trigger('pause');var a=sortParams([d,f,g],['string','number','boolean']);if(a[0]!='prev'&&a[0]!='next')a[0]=direction;if(typeof a[1]!='number')a[1]=0;if(a[2])opts.auto.play=true;if(!opts.auto.play)return;isPaused=false;var dur1=opts.auto.pauseDuration-pauseTimePassed,dur2=dur1+a[1];perc=100-Math.ceil(dur1*100/opts.auto.pauseDuration);autoTimeout=setTimeout(function(){if($cfs.is(':animated')){$cfs.trigger('play',a[0]);}else{pauseTimePassed=0;$cfs.trigger(a[0],opts.auto);}},dur2);if(opts.auto.pauseOnHover==='resume'){autoInterval=setInterval(function(){pauseTimePassed+=50;},50);}
if(opts.auto.onPauseEnd&&perc==0){opts.auto.onPauseEnd.call($tt0,perc,dur1);}
if(opts.auto.onPauseStart){timerInterval=setTimeout(function(){opts.auto.onPauseStart.call($tt0,perc,dur1);},a[1]);}});$cfs.bind('prev.cfs next.cfs',function(e,o,n,c){e.stopPropagation();if(isPaused=='stopped'||$cfs.is(':animated')||$cfs.is(':hidden')){e.stopImmediatePropagation();return;}
if(opts.items.minimum>=totalItems){debug(opts.debug,'Not enough items: not scrolling');e.stopImmediatePropagation();return;}
pauseTimePassed=0;var a=sortParams([o,n,c],['object','number','function']);if(typeof a[0]!='object')a[0]=opts[e.type];if(typeof a[2]=='function')a[0].onAfter=a[2];if(typeof a[1]!='number'){if(typeof a[0].items=='number')a[1]=a[0].items;else if(typeof opts[e.type].items=='number')a[1]=opts[e.type].items;else a[1]=opts.items.visible;}
if(typeof a[1]!='number')return debug(opts.debug,'Not a valid number: '+a[1]+'. Not scrolling');if(a[0].conditions&&!a[0].conditions.call($tt0))return debug(opts.debug,'Callback "conditions" returned false.');$cfs.trigger('slide_'+e.type,a);});$cfs.bind('slide_prev.cfs',function(e,sO,nI){e.stopPropagation();if(opts.variableVisible){oI=nI;opts.items.oldVisible=opts.items.visible;var a_itm=getItems($cfs);if(opts.usePadding)resetMargin(a_itm,opts);opts.items.visible=getVisibleItemsPrev($cfs,opts,oI);nI=opts.items.visible-opts.items.oldVisible+oI;if(nI<=0){opts.items.visible=getVisibleItemsNext($cfs,opts,totalItems-oI);nI=oI;}
if(opts.usePadding)resetMargin(a_itm,opts,true);}
if(!opts.circular){var nulItem=totalItems-firstItem;if(nulItem-nI<0){nI=nulItem;}
if(firstItem==0){nI=0;}}
firstItem+=nI;if(firstItem>=totalItems)firstItem-=totalItems;if(!opts.circular){if(firstItem==0&&nI!=0&&sO.onEnd)sO.onEnd.call($tt0);if(opts.infinite){if(nI==0){$cfs.trigger('next',totalItems-opts.items.visible);return;}}else enableNavi(opts,firstItem);}
if(nI==0)return;getItems($cfs).slice(totalItems-nI).prependTo($cfs);if(totalItems<opts.items.visible+nI){getItems($cfs).slice(0,(opts.items.visible+nI)-totalItems).clone(true).appendTo($cfs);}
var a_itm=getItems($cfs),c_old=getOldItemsPrev(a_itm,opts,nI),c_new=getNewItemsPrev(a_itm,opts),l_cur=a_itm.eq(nI-1),l_old=c_old.last(),l_new=c_new.last();if(opts.usePadding){resetMargin(l_old,opts);resetMargin(c_new,opts);}
if(opts.align)var p=getAlignPadding(c_new,opts);var i_siz=getTotalSize(a_itm.slice(0,nI),opts,'width'),w_siz=mapWrapperSizes(getSizes(c_new,opts,true),opts,!opts.usePadding);if(opts.usePadding){resetMargin(l_old,opts,opts.padding[opts.d[1]]);resetMargin(l_cur,opts,opts.padding[opts.d[3]]);}
if(opts.align){opts.padding[opts.d[1]]=p[1];opts.padding[opts.d[3]]=p[0];}
var a_cfs={},a_new={},a_cur={},a_old={},a_dur=sO.duration;if(sO.fx=='none')a_dur=0;else if(a_dur=='auto')a_dur=opts.scroll.duration/opts.scroll.items*nI;else if(a_dur<=0)a_dur=0;else if(a_dur<10)a_dur=i_siz/a_dur;var a_conf={duration:a_dur,easing:sO.easing};if(sO.onBefore)sO.onBefore.call($tt0,c_old,c_new,w_siz,a_dur);if(opts.usePadding){var new_m=opts.padding[opts.d[3]];a_cur[opts.d['marginRight']]=l_cur.data('cfs_origCssMargin');a_new[opts.d['marginRight']]=l_new.data('cfs_origCssMargin')+opts.padding[opts.d[1]];a_old[opts.d['marginRight']]=l_old.data('cfs_origCssMargin');l_cur.stop().animate(a_cur,a_conf);l_new.stop().animate(a_new,a_conf);l_old.stop().animate(a_old,a_conf);}else{var new_m=0;}
a_cfs[opts.d['left']]=new_m;if(opts[opts.d['width']]=='variable'||opts[opts.d['height']]=='variable'){$wrp.stop().animate(w_siz,a_conf);}
switch(sO.fx){case'crossfade':case'cover':case'uncover':var $cf2=$cfs.clone().appendTo($wrp);break;}
switch(sO.fx){case'uncover':getItems($cf2).slice(0,nI).remove();case'crossfade':case'cover':getItems($cf2).slice(opts.items.oldVisible).remove();break;}
switch(sO.fx){case'fade':fx_fade(sO,$cfs,0,a_dur);break;case'crossfade':$cf2.css({opacity:0});fx_fade(sO,$cf2,1,a_dur);fx_fade(sO,$cfs,1,a_dur,function(){$cf2.remove();});break;case'cover':fx_cover(sO,$cfs,$cf2,opts,a_dur,true);break;case'uncover':fx_uncover(sO,$cf2,opts,a_dur,true);break;}
switch(sO.fx){case'fade':case'crossfade':case'cover':case'uncover':f_dur=a_dur;a_dur=0;break;}
var c_nI=nI;$cfs.css(opts.d['left'],-i_siz);$cfs.animate(a_cfs,{duration:a_dur,easing:sO.easing,complete:function(){var overFill=opts.items.visible+c_nI-totalItems;if(overFill>0){getItems($cfs).slice(totalItems).remove();c_old=getItems($cfs).slice(totalItems-(c_nI-overFill)).get().concat(getItems($cfs).slice(0,overFill).get());}
if(opts.usePadding){var l_itm=getItems($cfs).eq(opts.items.visible+c_nI-1);l_itm.css(opts.d['marginRight'],l_itm.data('cfs_origCssMargin'));}
var fn=(sO.onAfter)?function(){sO.onAfter.call($tt0,c_old,c_new,w_siz);}:false;switch(sO.fx){case'fade':case'uncover':fx_fade(sO,$cfs,1,f_dur,fn);break;default:if(fn)fn();break;}}});$cfs.trigger('updatePageStatus',[false,w_siz]).trigger('play',a_dur);});$cfs.bind('slide_next.cfs',function(e,sO,nI){e.stopPropagation();if(opts.variableVisible){opts.items.oldVisible=opts.items.visible;var a_itm=getItems($cfs);if(opts.usePadding)resetMargin(a_itm,opts);opts.items.visible=getVisibleItemsNext($cfs,opts,nI);if(opts.items.oldVisible-nI>=opts.items.visible)opts.items.visible=getVisibleItemsNext($cfs,opts,++nI);if(opts.usePadding)resetMargin(a_itm,opts,true);}
if(!opts.circular){if(firstItem==0){if(nI>totalItems-opts.items.visible){nI=totalItems-opts.items.visible;}}else{if(firstItem-nI<opts.items.visible){nI=firstItem-opts.items.visible;}}}
firstItem-=nI;if(firstItem<0)firstItem+=totalItems;if(!opts.circular){if(firstItem==opts.items.visible&&nI!=0&&sO.onEnd)sO.onEnd.call($tt0);if(opts.infinite){if(nI==0){$cfs.trigger('prev',totalItems-opts.items.visible);return;}}else enableNavi(opts,firstItem);}
if(nI==0)return;if(totalItems<opts.items.visible+nI)getItems($cfs).slice(0,(opts.items.visible+nI)-totalItems).clone(true).appendTo($cfs);var a_itm=getItems($cfs),c_old=getOldItemsNext(a_itm,opts),c_new=getNewItemsNext(a_itm,opts,nI),l_cur=c_old.eq(nI-1),l_old=c_old.last(),l_new=c_new.last();if(opts.usePadding){resetMargin(l_old,opts);resetMargin(l_new,opts);}
if(opts.align)var p=getAlignPadding(c_new,opts);var i_siz=getTotalSize(a_itm.slice(0,nI),opts,'width'),w_siz=mapWrapperSizes(getSizes(c_new,opts,true),opts,!opts.usePadding);if(opts.usePadding){resetMargin(l_old,opts,opts.padding[opts.d[1]]);resetMargin(l_new,opts,opts.padding[opts.d[1]]);}
if(opts.align){opts.padding[opts.d[1]]=p[1];opts.padding[opts.d[3]]=p[0];}
var a_cfs={},a_old={},a_cur={},a_dur=sO.duration;if(sO.fx=='none')a_dur=0;else if(a_dur=='auto')a_dur=opts.scroll.duration/opts.scroll.items*nI;else if(a_dur<=0)a_dur=0;else if(a_dur<10)a_dur=i_siz/a_dur;var a_conf={duration:a_dur,easing:sO.easing};if(sO.onBefore)sO.onBefore.call($tt0,c_old,c_new,w_siz,a_dur);if(opts.usePadding){a_old[opts.d['marginRight']]=l_old.data('cfs_origCssMargin');a_cur[opts.d['marginRight']]=l_cur.data('cfs_origCssMargin')+opts.padding[opts.d[3]];l_new.css(opts.d['marginRight'],l_new.data('cfs_origCssMargin')+opts.padding[opts.d[1]]);l_old.stop().animate(a_old,a_conf);l_cur.stop().animate(a_cur,a_conf);}
a_cfs[opts.d['left']]=-i_siz;if(opts[opts.d['width']]=='variable'||opts[opts.d['height']]=='variable'){$wrp.stop().animate(w_siz,a_conf);}
switch(sO.fx){case'crossfade':case'cover':case'uncover':var $cf2=$cfs.clone().appendTo($wrp);break;}
switch(sO.fx){case'crossfade':case'cover':getItems($cf2).slice(0,nI).remove();case'uncover':getItems($cf2).slice(opts.items.visible).remove();break;}
switch(sO.fx){case'fade':fx_fade(sO,$cfs,0,a_dur);break;case'crossfade':$cf2.css({opacity:0});fx_fade(sO,$cf2,1,a_dur);fx_fade(sO,$cfs,1,a_dur,function(){$cf2.remove();});break;case'cover':fx_cover(sO,$cfs,$cf2,opts,a_dur,false);break;case'uncover':fx_uncover(sO,$cf2,opts,a_dur,false);break;}
switch(sO.fx){case'fade':case'crossfade':case'cover':case'uncover':f_dur=a_dur;a_dur=0;break;}
var c_nI=nI;$cfs.animate(a_cfs,{duration:a_dur,easing:sO.easing,complete:function(){var overFill=opts.items.visible+c_nI-totalItems,new_m=(opts.usePadding)?opts.padding[opts.d[3]]:0;$cfs.css(opts.d['left'],new_m);if(overFill>0){getItems($cfs).slice(totalItems).remove();}
var l_itm=getItems($cfs).slice(0,c_nI).appendTo($cfs).last();if(overFill>0){c_new=getCurrentItems(getItems($cfs),opts);}
if(opts.usePadding){if(totalItems<opts.items.visible+c_nI){var l_cur=getItems($cfs).eq(opts.items.visible-1);l_cur.css(opts.d['marginRight'],l_cur.data('cfs_origCssMargin')+opts.padding[opts.d[3]]);}
l_itm.css(opts.d['marginRight'],l_itm.data('cfs_origCssMargin'));}
var fn=(sO.onAfter)?function(){sO.onAfter.call($tt0,c_old,c_new,w_siz);}:false;switch(sO.fx){case'fade':case'uncover':fx_fade(sO,$cfs,1,f_dur,fn);break;default:if(fn)fn();break;}}});$cfs.trigger('updatePageStatus',[false,w_siz]).trigger('play',a_dur);});$cfs.bind('slideTo.cfs',function(e,num,dev,org,obj){e.stopPropagation();if($cfs.is(':animated'))return;num=getItemIndex(num,dev,org,firstItem,totalItems,$cfs);if(num==0)return;if(typeof obj!='object')obj=false;if(opts.circular){if(num<=totalItems/2)$cfs.trigger('next',[obj,num]);else $cfs.trigger('prev',[obj,totalItems-num]);}else{if(firstItem==0||firstItem>num)$cfs.trigger('next',[obj,num]);else $cfs.trigger('prev',[obj,totalItems-num]);}});$cfs.bind('insertItem.cfs',function(e,itm,num,org,dev){e.stopPropagation();if(typeof itm=='object'&&typeof itm.jquery=='undefined')itm=$(itm);if(typeof itm=='string')itm=$(itm);if(typeof itm!='object'||typeof itm.jquery=='undefined'||itm.length==0)return debug(opts.debug,'Not a valid object.');if(typeof num=='undefined'||num=='end'){$cfs.append(itm);}else{num=getItemIndex(num,dev,org,firstItem,totalItems,$cfs);var $cit=getItems($cfs).eq(num);if(opts.usePadding){itm.each(function(){var m=parseInt($(this).css(opts.d['marginRight']));if(isNaN(m))m=0;$(this).data('cfs_origCssMargin',m);});}
if($cit.length){if(num<firstItem)firstItem+=itm.length;if(firstItem>=totalItems)firstItem-=totalItems;$cit.before(itm);}else{$cfs.append(itm);}}
totalItems=getItems($cfs).length;$cfs.trigger('linkAnchors');var sz=setSizes($cfs,opts);showNavi(opts,totalItems);enableNavi(opts,firstItem);$cfs.trigger('updatePageStatus',[true,sz]);});$cfs.bind('removeItem.cfs',function(e,num,org,dev){e.stopPropagation();if(typeof num=='undefined'||num=='end'){getItems($cfs).last().remove();}else{num=getItemIndex(num,dev,org,firstItem,totalItems,$cfs);var $cit=getItems($cfs).eq(num);if($cit.length){if(num<firstItem)firstItem-=$cit.length;$cit.remove();}}
totalItems=getItems($cfs).length;var sz=setSizes($cfs,opts);showNavi(opts,totalItems);enableNavi(opts,firstItem);$cfs.trigger('updatePageStatus',[true,sz]);});$cfs.bind('currentPosition.cfs',function(e,fn){e.stopPropagation();if(firstItem==0)var val=0;else var val=totalItems-firstItem;if(typeof fn=='function')fn.call($tt0,val);return val;});$cfs.bind('currentPage.cfs',function(e,fn){e.stopPropagation();var max=Math.ceil(totalItems/opts.items.visible-1);if(firstItem==0)var nr=0;else if(firstItem<totalItems%opts.items.visible)var nr=0;else if(firstItem==opts.items.visible&&!opts.circular)var nr=max;else var nr=Math.round((totalItems-firstItem)/opts.items.visible);if(nr<0)nr=0;if(nr>max)nr=max;if(typeof fn=='function')fn.call($tt0,nr);return nr;});$cfs.bind('currentVisible.cfs',function(e,fn){e.stopPropagation();$i=getCurrentItems(getItems($cfs),opts);if(typeof fn=='function')fn.call($tt0,$i);return $i;});$cfs.bind('isPaused.cfs',function(e,fn){e.stopPropagation();if(typeof fn=='function')fn.call($tt0,isPaused);return isPaused;});$cfs.bind('configuration.cfs',function(e,a,b,reInit){e.stopPropagation();if(typeof a=='function'){a.call($tt0,opts);}else if(typeof a=='object'){reInit=(b===false)?false:'ObjectConfiguration';for(var c in a){if(typeof a[c]=='object'){for(var d in a[c]){$cfs.trigger('configuration',[c+'.'+d,a[c][d],reInit]);}}else $cfs.trigger('configuration',[c,a[c],reInit]);}
if(b!==false){resetMargin(getItems($cfs),opts);$cfs.init(opts_orig);setSizes($cfs,opts);}}else if(typeof a!='undefined'){if(typeof b=='function'){var val=eval('opts.'+a);if(typeof val=='undefined')val='';b.call($tt0,val);}else if(typeof b!='undefined'){if(typeof reInit=='undefined')reInit=true;if($cfs.is(':animated')){setTimeout(function(){$cfs.trigger('configuration',[a,b,reInit]);},100);return debug(opts.debug,'carousel animated, configuration timeout.');}
eval('opts_orig.'+a+' = b');if(reInit===true){resetMargin(getItems($cfs),opts);$cfs.init(opts_orig);setSizes($cfs,opts);}else if(reInit!='ObjectConfiguration'){eval('opts.'+a+' = b');}}}
return opts;});$cfs.bind('linkAnchors.cfs',function(e,$con,sel){e.stopPropagation();if(typeof $con=='undefined'||$con.length==0)$con=$('body');else if(typeof $con=='string')$con=$($con);if(typeof $con!='object')return debug(opts.debug,'Not a valid object.');if(typeof sel!='string'||sel.length==0)sel='a.caroufredsel';$con.find(sel).each(function(){var h=this.hash||'';if(h.length>0&&getItems($cfs).index($(h))!=-1){$(this).unbind('click').click(function(e){e.preventDefault();$cfs.trigger('slideTo',h);});}});});$cfs.bind('updatePageStatus.cfs',function(e,build,sizes){e.stopPropagation();if(!opts.pagination.container)return;if(typeof build=='boolean'&&build){getItems(opts.pagination.container).remove();for(var a=0,l=Math.ceil(totalItems/opts.items.visible);a<l;a++){var i=getItems($cfs).eq(getItemIndex(a*opts.items.visible,0,true,firstItem,totalItems,$cfs));opts.pagination.container.append(opts.pagination.anchorBuilder(a+1,i));}
getItems(opts.pagination.container).unbind('click').each(function(a){$(this).click(function(e){e.preventDefault();$cfs.trigger('slideTo',[a*opts.items.visible,0,true,opts.pagination]);});});}
$cfs.trigger('currentPage',function(nr){getItems(opts.pagination.container).removeClass('selected').eq(nr).addClass('selected');});});$cfs.bind('destroy.cfs',function(e,orgOrder){e.stopPropagation();if(orgOrder){$cfs.trigger('slideTo',[0,0,true,{duration:0}]);}
if(opts.usePadding){resetMargin(getItems($cfs),opts);}
$cfs.trigger('pause').css($cfs.data('cfs_origCss'));$cfs.unbind_events();$cfs.unbind_buttons();$wrp.replaceWith($cfs);});$cfs.bind('slidePrev.cfs',function(e,sO,nI){e.stopPropagation();debug(true,'The custom event "slidePrev" is deprecated, use "slide_prev".');$cfs.trigger('slide_prev',[sO,nI]);});$cfs.bind('slideNext.cfs',function(e,sO,nI){e.stopPropagation();debug(true,'The custom event "slideNext" is deprecated, use "slide_next".');$cfs.trigger('slide_next',[sO,nI]);});};$cfs.unbind_events=function(){$cfs.unbind('.cfs');};$cfs.bind_buttons=function(){$cfs.unbind_buttons();showNavi(opts,totalItems);enableNavi(opts,firstItem);if(opts.auto.pauseOnHover){$wrp.bind('mouseenter.cfs',function(){$cfs.trigger('pause');});$wrp.bind('mouseleave.cfs',function(){$cfs.trigger('play');});}
if(opts.prev.button){opts.prev.button.bind('click.cfs',function(e){e.preventDefault();$cfs.trigger('prev');});if(opts.prev.pauseOnHover){opts.prev.button.bind('mouseenter.cfs',function(){$cfs.trigger('pause');});opts.prev.button.bind('mouseleave.cfs',function(){$cfs.trigger('play');});}}
if(opts.next.button){opts.next.button.bind('click.cfs',function(e){e.preventDefault();$cfs.trigger('next');});if(opts.next.pauseOnHover){opts.next.button.bind('mouseenter.cfs',function(){$cfs.trigger('pause');});opts.next.button.bind('mouseleave.cfs',function(){$cfs.trigger('play');});}}
if($.fn.mousewheel){if(opts.prev.mousewheel){$wrp.mousewheel(function(e,delta){if(delta>0){e.preventDefault();num=(typeof opts.prev.mousewheel=='number')?opts.prev.mousewheel:'';$cfs.trigger('prev',num);}});}
if(opts.next.mousewheel){$wrp.mousewheel(function(e,delta){if(delta<0){e.preventDefault();num=(typeof opts.next.mousewheel=='number')?opts.next.mousewheel:'';$cfs.trigger('next',num);}});}}
if(opts.pagination.container){if(opts.pagination.pauseOnHover){opts.pagination.container.bind('mouseenter.cfs',function(){$cfs.trigger('pause');});opts.pagination.container.bind('mouseleave.cfs',function(){$cfs.trigger('play');});}}
if(opts.next.key||opts.prev.key){$(document).bind('keyup.cfs',function(e){var k=e.keyCode;if(k==opts.next.key){e.preventDefault();$cfs.trigger('next');}
if(k==opts.prev.key){e.preventDefault();$cfs.trigger('prev');}});}
if(opts.pagination.keys){$(document).bind('keyup.cfs',function(e){var k=e.keyCode;if(k>=49&&k<58){k=(k-49)*opts.items.visible;if(k<=totalItems){e.preventDefault();$cfs.trigger('slideTo',[k,0,true,opts.pagination]);}}});}
if(opts.auto.play){$cfs.trigger('play',opts.auto.delay);if($.fn.nap&&opts.auto.nap){$cfs.nap('pause','play');}}};$cfs.unbind_buttons=function(){$(document).unbind('.cfs');$wrp.unbind('.cfs');if(opts.prev.button)opts.prev.button.unbind('.cfs');if(opts.next.button)opts.next.button.unbind('.cfs');if(opts.pagination.container)opts.pagination.container.unbind('.cfs');showNavi(opts,'hide');enableNavi(opts,'removeClass');if(opts.pagination.container){getItems(opts.pagination.container).remove();}};$cfs.configuration=function(a,b){debug(true,'The "configuration" public method is deprecated, use the "configuration" custom event.');var cr=false;var fn=function(val){cr=val;};if(!a)a=fn;if(!b)b=fn;$cfs.trigger('configuration',[a,b]);return cr;};$cfs.current_position=function(){debug(true,'The "current_position" public method is deprecated, use the "currentPosition" custom event.');var cp=false;$cfs.trigger('currentPosition',function(val){cp=val;});return cp;};$cfs.destroy=function(){debug(true,'The "destroy" public method is deprecated, use the "destroy" custom event.');$cfs.trigger('destroy');return $cfs;};$cfs.link_anchors=function($c,se){debug(true,'The "link_anchors" public method is deprecated, use the "linkAnchors" custom event.');$cfs.trigger('linkAnchors',[$c,se]);return $cfs;};if($cfs.parent().is('.caroufredsel_wrapper')){var $wrp=$cfs.parent();$cfs.trigger('destroy');}
var $wrp=$cfs.wrap('<div class="caroufredsel_wrapper" />').parent(),opts={},opts_orig=o,totalItems=getItems($cfs).length,firstItem=0,autoTimeout=null,autoInterval=null,timerInterval=null,pauseTimePassed=0,isPaused=true,direction='next';$cfs.init(opts_orig,true);$cfs.build();$cfs.bind_events();$cfs.bind_buttons();if(opts.items.start!==0&&opts.items.start!==false){var s=opts.items.start;if(s===true){s=window.location.hash;if(!s.length)s=0;}else if(s==='random'){s=Math.floor(Math.random()*totalItems);}
$cfs.trigger('slideTo',[s,0,true,{duration:0}]);}
var siz=setSizes($cfs,opts,false),itm=getCurrentItems(getItems($cfs),opts);if(opts.onCreate){opts.onCreate.call($tt0,itm,siz);}
$cfs.trigger('updatePageStatus',[true,siz]);$cfs.trigger('linkAnchors');return this;};$.fn.carouFredSel.defaults={debug:false,infinite:true,circular:true,direction:'left',items:{start:0},scroll:{easing:'swing',pauseOnHover:false,mousewheel:false}};$.fn.carouFredSel.pageAnchorBuilder=function(nr,itm){return'<a href="#"><span>'+nr+'</span></a>';};function fx_fade(sO,c,x,d,f){var o={duration:d,easing:sO.easing};if(typeof f=='function')o.complete=f;c.animate({opacity:x},o);}
function fx_cover(sO,c1,c2,o,d,prev){var cur_w=getSizes(getItems(c2),o,true)[0],cur_p=(prev)?-cur_w:cur_w,css_o={},ani_o={};css_o[o.d['width']]=cur_w;css_o[o.d['left']]=cur_p;ani_o[o.d['left']]=0;c1.animate({opacity:'+=0'},d);c2.css(css_o).animate(ani_o,{duration:d,easing:sO.easing,complete:function(){$(this).remove();}});}
function fx_uncover(sO,c,o,d,prev){var cur_w=getSizes(getItems(c),o,true)[0],cur_p=(prev)?cur_w:-cur_w,css_o={},ani_o={};css_o[o.d['width']]=cur_w;ani_o[o.d['left']]=cur_p;c.css(css_o).animate(ani_o,{duration:d,easing:sO.easing,complete:function(){$(this).remove();}});}
function showNavi(o,t){if(t=='show'||t=='hide'){var f=t;}else if(o.items.minimum>=t){debug(o.debug,'Not enough items: not scrolling');var f='hide';}else{var f='show';}
if(o.prev.button)o.prev.button[f]();if(o.next.button)o.next.button[f]();if(o.pagination.container)o.pagination.container[f]();}
function enableNavi(o,f){if(o.circular||o.infinite)return;var fx=(f=='removeClass'||f=='addClass')?f:false;if(o.next.button){var fn=fx||(f==o.items.visible)?'addClass':'removeClass';o.next.button[fn]('disabled');}
if(o.prev.button){var fn=fx||(f==0)?'addClass':'removeClass';o.prev.button[fn]('disabled');}}
function sortParams(vals,typs){var _arr=[];for(var a=0,l1=vals.length;a<l1;a++){for(var b=0,l2=typs.length;b<l2;b++){if(typeof vals[a]==typs[b]&&!_arr[b]){_arr[b]=vals[a];break;}}}
return _arr;}
function getKeyCode(k){if(k=='right')return 39;if(k=='left')return 37;if(k=='up')return 38;if(k=='down')return 40;return-1;}
function getObject(obj){if(typeof obj=='undefined')obj={};return obj;}
function getNaviObject(obj,pagi,auto){if(typeof pagi!='boolean')pagi=false;if(typeof auto!='boolean')auto=false;obj=getObject(obj);if(typeof obj=='string'){var temp=getKeyCode(obj);if(temp==-1)obj=$(obj);else obj=temp;}
if(pagi){if(typeof obj=='boolean')obj={keys:obj};if(typeof obj.jquery!='undefined')obj={container:obj};if(typeof obj.container=='string')obj.container=$(obj.container);if(typeof obj.event!='string')obj.event='click';}else if(auto){if(typeof obj=='boolean')obj={play:obj};if(typeof obj=='number')obj={pauseDuration:obj};}else{if(typeof obj.jquery!='undefined')obj={button:obj};if(typeof obj=='number')obj={key:obj};if(typeof obj.button=='string')obj.button=$(obj.button);if(typeof obj.key=='string')obj.key=getKeyCode(obj.key);if(typeof obj.event!='string')obj.event='click';}
return obj;}
function getItemIndex(num,dev,org,firstItem,totalItems,$cfs){if(typeof num=='string'){if(isNaN(num))num=$(num);else num=parseInt(num);}
if(typeof num=='object'){if(typeof num.jquery=='undefined')num=$(num);num=getItems($cfs).index(num);if(num==-1)num=0;if(typeof org!='boolean')org=false;}else{if(typeof org!='boolean')org=true;}
if(isNaN(num))num=0;else num=parseInt(num);if(isNaN(dev))dev=0;else dev=parseInt(dev);if(org){num+=firstItem;}
num+=dev;if(totalItems>0){while(num>=totalItems){num-=totalItems;}
while(num<0){num+=totalItems;}}
return num;}
function getItems(c,f){var $i=$('> *',c);if(typeof f=='string')$i=$i.filter(f);return $i;}
function getCurrentItems(i,o){return i.slice(0,o.items.visible);}
function getOldItemsPrev(i,o,n){return i.slice(n,o.items.oldVisible+n);}
function getNewItemsPrev(i,o){return i.slice(0,o.items.visible);}
function getOldItemsNext(i,o){return i.slice(0,o.items.oldVisible);}
function getNewItemsNext(i,o,n){return i.slice(n,o.items.visible+n);}
function resetMargin(i,o,m){var x=(typeof m=='boolean')?m:false;if(typeof m!='number')m=0;i.each(function(){var t=parseInt($(this).css(o.d['marginRight']));if(isNaN(t))t=0;$(this).data('cfs_tempCssMargin',t);$(this).css(o.d['marginRight'],((x)?$(this).data('cfs_tempCssMargin'):m+$(this).data('cfs_origCssMargin')));});}
function getSizes(i,o,wrapper){s1=getTotalSize(i,o,'width',wrapper);s2=getLargestSize(i,o,'height',wrapper);return[s1,s2];}
function getLargestSize(i,o,dim,wrapper){if(typeof wrapper!='boolean')wrapper=false;if(typeof o[o.d[dim]]=='number'&&wrapper)return o[o.d[dim]];if(typeof o.items[o.d[dim]]=='number')return o.items[o.d[dim]];var di2=(dim.toLowerCase().indexOf('width')>-1)?'outerWidth':'outerHeight';return getTrueLargestSize(i,o,di2);}
function getTrueLargestSize(i,o,dim){var s=0;i.each(function(){var m=$(this)[o.d[dim]](true);if(s<m)s=m;});return s;}
function getTrueInnerSize($el,o,dim){var siz=$el[o.d[dim]](),arr=(o.d[dim].toLowerCase().indexOf('width')>-1)?['paddingLeft','paddingRight']:['paddingTop','paddingBottom'];for(a=0,l=arr.length;a<l;a++){var m=parseInt($el.css(arr[a]));if(isNaN(m))m=0;siz-=m;}
return siz;}
function getTotalSize(i,o,dim,wrapper){if(typeof wrapper!='boolean')wrapper=false;if(typeof o[o.d[dim]]=='number'&&wrapper)return o[o.d[dim]];if(typeof o.items[o.d[dim]]=='number')return o.items[o.d[dim]]*i.length;var di2=(dim.toLowerCase().indexOf('width')>-1)?'outerWidth':'outerHeight';return getTotalSizeVariable(i,o,di2);}
function getTotalSizeVariable(i,o,dim){var s=0;i.each(function(){s+=$(this)[o.d[dim]](true);});return s;}
function hasVariableSizes(i,o,dim){var s=false,v=false;i.each(function(){c=$(this)[o.d[dim]](true);if(s===false)s=c;else if(s!=c)v=true;});return v;}
function mapWrapperSizes(ws,o,p){if(typeof p!='boolean')p=true;var pad=(o.usePadding&&p)?o.padding:[0,0,0,0];var wra={};wra[o.d['width']]=ws[0]+pad[1]+pad[3];wra[o.d['height']]=ws[1]+pad[0]+pad[2];return wra;}
function setSizes($c,o,p){var $w=$c.parent(),$i=getItems($c),$v=getCurrentItems($i,o),sz=mapWrapperSizes(getSizes($v,o,true),o,p);$w.css(sz);if(o.usePadding){var $l=$v.last();$l.css(o.d['marginRight'],$l.data('cfs_origCssMargin')+o.padding[o.d[1]]);$c.css(o.d['top'],o.padding[o.d[0]]);$c.css(o.d['left'],o.padding[o.d[3]]);}
$c.css(o.d['width'],getTotalSize($i,o,'width')*2);$c.css(o.d['height'],getLargestSize($i,o,'height'));return sz;}
function getPadding(p){if(typeof p=='undefined')return[0,0,0,0];if(typeof p=='number')return[p,p,p,p];else if(typeof p=='string')p=p.split('px').join('').split(' ');if(!is_array(p)){return[0,0,0,0];}
for(var i=0;i<4;i++){p[i]=parseInt(p[i]);}
switch(p.length){case 0:return[0,0,0,0];case 1:return[p[0],p[0],p[0],p[0]];case 2:return[p[0],p[1],p[0],p[1]];case 3:return[p[0],p[1],p[2],p[1]];default:return[p[0],p[1],p[2],p[3]];}}
function getAlignPadding(itm,o){var x=(typeof o[o.d['width']]=='number')?Math.ceil(o[o.d['width']]-getTotalSize(itm,o,'width')):0;switch(o.align){case'left':return[0,x];break;case'right':return[x,0];break;case'center':default:var x1=Math.ceil(x/2),x2=Math.floor(x/2);return[x1,x2];break;}}
function getVisibleItemsPrev($c,o,nI){var items=getItems($c),total=0,start=o.items.visible-nI-1,x=0;if(start<0)start=items.length-1;for(var a=start;a>=0;a--){total+=items.eq(a)[o.d['outerWidth']](true);if(total>o.maxDimention)return x;if(a==0)a=items.length;x++;}}
function getVisibleItemsNext($c,o,nI){var items=getItems($c),total=0,x=0;for(var a=nI,l=items.length-1;a<=l;a++){total+=items.eq(a)[o.d['outerWidth']](true);if(total>o.maxDimention)return x;if(a==items.length-1)a=-1;x++;}}
function is_array(a){return typeof(a)=='object'&&(a instanceof Array);}
function debug(d,m){if(!d)return false;if(typeof m=='string')m='carouFredSel: '+m;if(window.console&&window.console.log)window.console.log(m);return false;}
$.fn.caroufredsel=function(o){return this.carouFredSel(o);};})(jQuery);;
function nl2br(str,is_xhtml){return(str+'').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,'$1'+breakTag+'$2');}
function submitAjax(form,url)
{$('.octopus').css('position','absolute').css('margin-top','-10px');var uid=$(form).attr('id');$(form).hide();$(form).after('<div class="form-loading"><span>Wysyłanie wiadomości...</span></div>');$('.form-loading').height($(form).height());var data=$(form).serializeArray();$.ajax({type:'POST',url:url,data:data,dataType:'json',success:function(data){var newForm=$(data.form);if(data.success){var success='<div class="form-success"><h3>Wiadomość została wysłana.</h3>';var fields=data.fields;for(var i in fields){success+='<p><span class="label">'+i+'</span> '+fields[i]+'</p>';}
success+='</div>';$(form).replaceWith(success);$('.form-success').delay(5000).fadeOut(1000,function(){$(this).replaceWith(newForm);adjustInputWidth();newForm.hide().fadeIn();}).append(data.fields);}else{$(form).replaceWith(newForm);newForm.hide().fadeIn();$('.error_list').each(function(){$(this).css('width','auto');$(this).css('left',(-$(this).width()-20)+'px');});}},error:function(){alert('Przepraszamy, nastąpił błąd wysyłania formularza. Prosimy spróbować później.');$(form).show();},complete:function(){$('.form-loading').remove();}});}
function fontSize(size)
{if(size==undefined){size='normal';}
$('.std').removeClass('size-small').removeClass('size-big').removeClass('size-normal').addClass('size-'+size);$.cookie('font-size',size,{path:'/'});$('.page-title .font-size a').removeClass('current');$('.page-title .font-size .'+size).addClass('current');}
function zoomInGallery(){if($('#gallery-medias-wrapper').hasClass('zoom'))return;$('#gallery-medias-wrapper').addClass('zoom');$("#gallery-medias").cycle('pause');$li=$('#gallery-medias-wrapper li:visible');$('.thumb',$li).fadeOut(500);$('#gallery-help-thumb').fadeOut();$('#magnifier').fadeOut();$('#gallery-help-full').fadeIn();$('.full',$li).fadeIn().not('.ui-draggable').each(function(){var offset=$(this).offset();var w=$(this).width(),h=$(this).height();var ph=$(this).parent().height(),pw=$(this).parent().width();var contain=[offset.left-w+pw,offset.top-h+ph,offset.left,offset.top];$(this).draggable({containment:contain});});if(_gNext!=null){while(_gNext.queue("fx").length>0){_gNext.dequeue();_gNext.stop(false,true);}}}
function zoomOutGallery(){if(!$('#gallery-medias-wrapper').hasClass('zoom'))return;$('#gallery-medias-wrapper').removeClass('zoom');$("#gallery-medias").cycle('resume');$li=$('#gallery-medias-wrapper li:visible');$('.full',$li).fadeOut(1000,function(){$(this).css({left:0,top:0});});$('.thumb',$li).fadeIn();$('#gallery-help-thumb').fadeIn();$('#gallery-help-full').fadeOut();}
function adjustInputWidth()
{$('form div.input_text').each(function(){$('input',this).width($(this).width()-$('label',this).width()-20);});}
function openContact(){$('html, body').animate({scrollTop:$('body').height()},200,function(){if($('.dm_layout_bottom_fold .dm_zones').css('display')=='none'){$('.dm_layout_bottom_fold').foldable('foldDown');$('html, body').animate({scrollTop:$('body').height()},500);}});var loaded=$('.dm_layout_bottom_fold .contact_contact_form').size()>0;if($('.dm_layout_bottom_fold .dm_zone').height()>10){$('.dm_layout_bottom_fold .dm_zone').height($('.dm_layout_bottom_fold .dm_zone').height());}
$('#bottom_sitemap').css('display','none');$('#bottom_contact').fadeIn();$('.dm_layout_bottom_fold .dm_widgets').css('display','block');adjustInputWidth();$('#dm_area_21 .dm_zone').css('height',160);$('.map .dm_google_map').dmGoogleMap();setTimeout("$('.map .dm_google_map').dmGoogleMap()",200);return false;}
function openSitemap(){$('html, body').animate({scrollTop:$('body').height()},200,function(){if($('.dm_layout_bottom_fold .dm_zones').css('display')=='none'){$('.dm_layout_bottom_fold').foldable('foldDown');$('html, body').animate({scrollTop:$('body').height()},500);}});var loaded=$('.dm_layout_bottom_fold .section_menu').size()>0;if($('.dm_layout_bottom_fold .dm_zone').height()>10){$('.dm_layout_bottom_fold .dm_zone').height($('.dm_layout_bottom_fold .dm_zone').height());}
$('#bottom_contact').css('display','none');$('#bottom_sitemap').fadeIn();$('.dm_layout_bottom_fold .dm_widgets').css('display','block');adjustInputWidth();$('#dm_area_21 .dm_zone').css('height',160);return false;}
function valuation_resize(){if($(window).width()<1300){if($('.free-valuation').css('display')=='block'){$('#valuation').css('display','block');$('.free-valuation').css('display','none');}}else{if($('#valuation').css('display')=='block'){$('#valuation').css('display','none');$('.free-valuation').css('display','block');}}}
function load_reference(id){$.ajax({url:dm_configuration.relative_url_root+'/+/reference/show?id='+id,success:function(data){$('#single-reference').html(data);$('.colorbox').colorbox();setTimeout($('.colorbox').colorbox(),500);}});$('li.list').find('img').attr('class','reference');$('li.list').find('img').css('opacity',0);$('#img'+id).attr('class','clicked');$('#img'+id).css('opacity',1);}
(function($)
{$('img.reference').hover(function(){$(this).animate({opacity:1.0},600);},function(){if($(this).attr('class')!='clicked'){$(this).animate({opacity:0.0},600);}});valuation_resize();$(".scroll").carouFredSel({auto:{pauseDuration:5000,items:1,pauseOnHover:true},items:{visible:8}});$(window).resize(function(){valuation_resize();});$('.colorbox').colorbox();if($('body.page_page_show').size())fontSize($.cookie('font-size'));$(".top_menu").lavaLamp({fx:"easeOutCubic",speed:500});$('.dm_layout_top_fold').foldable({name:'top'});$('.dm_layout_bottom_fold').foldable({name:'bottom'});$('input.submit').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});$('#fold-btn-top').click(function(){var elem=$('.contact_valuation_form .valuation-form-wrapper');if(elem.css('position')=='fixed'){var r=elem.css('right');var t=elem.css('top');elem.css({position:'relative',right:0,top:0}).show();var pos=elem.offset();elem.css({position:'fixed',right:r,top:t}).animate({right:$(document).width()-pos.left,top:110-$(document).scrollTop(),opacity:1,width:300,height:360},500,function(){$(this).css({position:'absolute',right:0,top:0});$('.call-or-fill-the-form').fadeIn();$('.valuation-img').fadeIn('fast');});if($(window).width()<1300){$('#valuation').fadeOut();}else{$('.free-valuation').fadeOut();}}else{$('.call-or-fill-the-form').fadeOut();var pos=elem.offset();elem.css('position','fixed').css({right:$(document).width()-pos.left-elem.width(),top:-$(document).scrollTop()+pos.top}).animate({right:-300,top:-200,opacity:0.2,width:1,height:1},1000,function(){$(this).hide();});if($(window).width()<1300){$('#valuation').delay(500).fadeIn();}else{$('.free-valuation').delay(500).fadeIn();}}});$('#fold-btn-bottom').click(function(){if($('.dm_layout_bottom_fold .dm_zones').height()>10){$('.octopus').css('position','relative').css('float','right');var y=$(window).height()-($(this).offset().top-$(document).scrollTop())-100;$('html, body').animate({scrollTop:'-='+y},y);}else{$('html, body').animate({scrollTop:'+=500'},500);$('.octopus').css('position','relative').css('margin-top','5px');$('.map .dm_google_map').dmGoogleMap();}});if($('.page_offer').size()){setTimeout(function(){$('.offer1').fadeIn(500);$('.arrow1').delay(200).slideDown(500);$('.offer2').delay(400).fadeIn(500);$('.arrow2').delay(600).show().css({width:0}).animate({width:48},500);$('.offer3').delay(800).fadeIn(500);$('.arrow3').delay(1000).show().css({width:0}).animate({width:48},500);$('.offer4').delay(1200).fadeIn(500);$('.arrow4').delay(1400).show().css({width:0}).animate({width:56},500);$('.offer5').delay(1600).fadeIn(500);$('.arrow5').delay(1800).slideDown(500);$('.offer6').delay(2000).fadeIn(500);$('.offer7a, .offer7b, .offer7c').delay(2200).slideDown(50);$('.offer8').delay(2400).fadeIn(500);},400);}
if($('body.page_main_root').size())$('.dm_layout_bottom_fold > div').show();$('a.contact').click(openContact);$('#show-valuation-form').simpleDialog();$('#show-valuation-form2').simpleDialog();$('#valuation').simpleDialog();$('#valuation').hover(function(){$(this).animate({opacity:0.6});},function(){$(this).animate({opacity:1.0});});adjustInputWidth();$('.hoverable > *').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')});if($('#projects-list li').size()<4){$('#projects-list').height('200px');}
if($('#projects-list li').size()>3&&$('#projects-list li').size()<7){$('#projects-list').height('400px');}
if($('#projects-list li').size()>6){$('#projects-list').height('600px');}
$('#projects-list li').each(function(index){$(this).delay(index*200).fadeIn();});$('#projects-list li').hover(function(){$(this).find('.thumbnail').stop(true).fadeTo(1,0.1);$(this).find('.excerpt, .project-url').stop(true).fadeTo(1,1);$('.more',this).stop(true).fadeTo(1,1);var c='#CCC';},function(){$(this).find('.thumbnail').stop(true).fadeTo(1,1);$(this).find('.more, .excerpt, .project-url').fadeTo(1,0);var c='#EAEAEA';});$('#projects-list li .more').hover(function(){$(this).stop(true).fadeTo(1,1);},function(){$(this).fadeTo(1,1);});$('.customer-slideshow').cycle({fx:'scrollLeft',pause:true,timeout:10000,random:true});$('.scroll li').css({opacity:0.4}).click(function(){document.location=dm_configuration.relative_url_root+"/referencje";});;$('.scroll li').hover(function(){$(this).stop(true).fadeTo(300,1).find("img:eq(0)").stop(true).fadeTo(300,1);},function(){$(this).fadeTo(1000,0.4).find("img:eq(0)").fadeOut(1000);});$('li a.contact').click(openContact);$('#gallery-medias-wrapper').hover(function(){if($('#gallery-help-thumb').is(':visible'))
$('#magnifier').fadeIn(300);},function(){$('#magnifier').fadeOut(300);});$('#gallery-medias-wrapper').click(function(){if($(this).hasClass("zoom"))
zoomOutGallery();else zoomInGallery();});if(window.location.hash!=undefined)
{var param=window.location.hash.split('=');if(param[1]!=undefined)
{$('#free-valuation-corner').attr('src',$('#free-valuation-corner').attr('src').replace('free_valuation1.png','goback.png'));$('#freeValuationMap area').attr('href','http://oferty.topsolutions.pl/'+param[1]+'.html').unbind("click");}}})(jQuery);;
(function($)
{$.fn.dmGoogleMap=function(opt)
{if(typeof google=="undefined"||typeof google.maps=="undefined")
{alert('Please reload the page to activate the map');return this;}
var
self=this,options=$.extend({zoom:14,mapTypeId:google.maps.MapTypeId.HYBRID},self.metadata(),opt||{}),map,markers=[],infos=[];if(options.center)
{map=new google.maps.Map(self.get(0),$.extend(options,{center:new google.maps.LatLng(options.center[0],options.center[1])}));}
else if(options.address)
{new google.maps.Geocoder().geocode({address:options.address},function(results,status)
{if(status==google.maps.GeocoderStatus.OK&&results.length&&status!=google.maps.GeocoderStatus.ZERO_RESULTS)
{map=new google.maps.Map(self.get(0),$.extend(options,{center:results[0].geometry.location}));new google.maps.Marker({position:results[0].geometry.location,map:map});}
else
{self.text('Sorry, the address "'+options.address+'" can not be found');}});}
$.each(options.markers||[],function(it,data)
{markers[it]=new google.maps.Marker({position:new google.maps.LatLng(data.lat,data.lng),map:map,clickable:true,visible:true,title:data.title});if(data.icon)markers[it].icon=data.icon;if(data.html)
{infos[it]=new google.maps.InfoWindow({content:data.html});google.maps.event.addListener(markers[it],'click',function(){infos[it].open(map,markers[it]);});}});return this;}})(jQuery);;
(function($)
{$('#dm_page div.dm_widget').bind('dmWidgetLaunch',function()
{var $map=$(this).find('.dm_google_map');if($map.length)
{setTimeout(function(){$map.dmGoogleMap();},1000);}});$(function(){$('#dm_admin_content .dm_google_map').each(function(){$(this).dmGoogleMap();});});})(jQuery);;
