/*
 * Version: 
 * Date: 2011-03-14 15:11
 */

(function(e){e.mailing_list_email_api={list:function(c,a,b){e.ajax({type:"GET",cache:false,url:"/mailing_list_email/all/",data:{order_by:c,page:a},success:function(d){b(d)},dataType:"json"})},get:function(c,a){e.ajax({type:"GET",cache:false,url:"/mailing_list_email/"+c+"/",success:function(b){a(b)},dataType:"json"})},create:function(c,a,b){typeof a==="undefined"||typeof b==="undefined"||e.ajax({type:"POST",cache:false,url:"/mailing_list_email/create/",data:{query:JSON.stringify({email:c})},success:function(d){a(d)},
failure:function(d){b(d)},dataType:"json"})}}})(jQuery);
(function(e){e.feedback_api={list:function(c,a,b,d){e.ajax({type:"GET",cache:false,url:"/feedback/all/",data:{order_by:c,page:a},success:function(f,g,h){typeof b!=="undefined"&&b(f,g,h)},error:function(f,g,h){typeof d!=="undefined"&&d(f,g,h);typeof console!=="undefined"&&console.log(f,g,h)},dataType:"json"})},get:function(c,a,b){e.ajax({type:"GET",cache:false,url:"/feedback/"+c+"/",success:function(d,f,g){typeof a!=="undefined"&&a(d,f,g)},error:function(d,f,g){typeof b!=="undefined"&&b(d,f,g);typeof console!==
"undefined"&&console.log(d,f,g)},dataType:"json"})},create:function(c,a,b){e.ajax({type:"POST",cache:false,url:"/feedback/create/",data:{query:JSON.stringify(c)},success:function(d,f,g){typeof a!=="undefined"&&a(d,f,g)},error:function(d,f,g){typeof b!=="undefined"&&b(d,f,g);typeof console!=="undefined"&&console.log(d,f,g)},dataType:"json"})},edit:function(c,a,b,d){e.ajax({type:"POST",cache:false,url:"/feedback/"+c+"/save/",data:{query:JSON.stringify(a)},success:function(f,g,h){typeof b!=="undefined"&&
b(f,g,h)},error:function(f,g,h){typeof d!=="undefined"&&d(f,g,h);typeof console!=="undefined"&&console.log(f,g,h)},dataType:"json"})}}})(jQuery);
(function(e,c){if(e.cleanData){var a=e.cleanData;e.cleanData=function(d){for(var f=0,g;(g=d[f])!=null;f++)e(g).triggerHandler("remove");a(d)}}else{var b=e.fn.remove;e.fn.remove=function(d,f){return this.each(function(){if(!f)if(!d||e.filter(d,[this]).length)e("*",this).add([this]).each(function(){e(this).triggerHandler("remove")});return b.call(e(this),d,f)})}}e.widget=function(d,f,g){var h=d.split(".")[0],i;d=d.split(".")[1];i=h+"-"+d;if(!g){g=f;f=e.Widget}e.expr[":"][i]=function(k){return!!e.data(k,
d)};e[h]=e[h]||{};e[h][d]=function(k,j){arguments.length&&this._createWidget(k,j)};f=new f;f.options=e.extend(true,{},f.options);e[h][d].prototype=e.extend(true,f,{namespace:h,widgetName:d,widgetEventPrefix:e[h][d].prototype.widgetEventPrefix||d,widgetBaseClass:i},g);e.widget.bridge(d,e[h][d])};e.widget.bridge=function(d,f){e.fn[d]=function(g){var h=typeof g==="string",i=Array.prototype.slice.call(arguments,1),k=this;g=!h&&i.length?e.extend.apply(null,[true,g].concat(i)):g;if(h&&g.charAt(0)==="_")return k;
h?this.each(function(){var j=e.data(this,d),l=j&&e.isFunction(j[g])?j[g].apply(j,i):j;if(l!==j&&l!==c){k=l;return false}}):this.each(function(){var j=e.data(this,d);j?j.option(g||{})._init():e.data(this,d,new f(g,this))});return k}};e.Widget=function(d,f){arguments.length&&this._createWidget(d,f)};e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(d,f){e.data(f,this.widgetName,this);this.element=e(f);this.options=e.extend(true,{},this.options,
this._getCreateOptions(),d);var g=this;this.element.bind("remove."+this.widgetName,function(){g.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]},_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(d,f){var g=d;if(arguments.length===0)return e.extend({},this.options);if(typeof d==="string"){if(f===c)return this.options[d];g={};g[d]=f}this._setOptions(g);return this},_setOptions:function(d){var f=this;e.each(d,function(g,h){f._setOption(g,h)});return this},_setOption:function(d,f){this.options[d]=f;if(d==="disabled")this.widget()[f?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",f);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(d,f,g){var h=this.options[d];f=e.Event(f);f.type=(d===this.widgetEventPrefix?d:this.widgetEventPrefix+d).toLowerCase();g=g||{};if(f.originalEvent){d=e.event.props.length;for(var i;d;){i=e.event.props[--d];f[i]=f.originalEvent[i]}}this.element.trigger(f,g);return!(e.isFunction(h)&&h.call(this.element[0],f,g)===false||f.isDefaultPrevented())}}})(jQuery);
(function(e){e.widget("thomaskahn.smoothDivScroll",{options:{scrollingHotSpotLeft:"div.scrollingHotSpotLeft",scrollingHotSpotRight:"div.scrollingHotSpotRight",scrollableArea:"div.scrollableArea",scrollWrapper:"div.scrollWrapper",hiddenOnStart:false,ajaxContentURL:"",countOnlyClass:"",scrollStep:15,scrollInterval:10,mouseDownSpeedBooster:3,autoScroll:"",autoScrollDirection:"right",autoScrollStep:5,autoScrollInterval:10,visibleHotSpots:"",hotSpotsVisibleTime:5,startAtElementId:""},_create:function(){var c=
this,a=this.options,b=this.element;b.data("scrollWrapper",b.find(a.scrollWrapper));b.data("scrollingHotSpotRight",b.find(a.scrollingHotSpotRight));b.data("scrollingHotSpotLeft",b.find(a.scrollingHotSpotLeft));b.data("scrollableArea",b.find(a.scrollableArea));b.data("speedBooster",1);b.data("motherElementOffset",b.offset().left);b.data("scrollXPos",0);b.data("hotSpotWidth",b.find(a.scrollingHotSpotLeft).width());b.data("scrollableAreaWidth",0);b.data("startingPosition",0);b.data("rightScrollInterval",
null);b.data("leftScrollInterval",null);b.data("autoScrollInterval",null);b.data("hideHotSpotBackgroundsInterval",null);b.data("previousScrollLeft",0);b.data("pingPongDirection","right");b.data("getNextElementWidth",true);b.data("swapAt",null);b.data("startAtElementHasNotPassed",true);b.data("swappedElement",null);b.data("originalElements",b.data("scrollableArea").children(a.countOnlyClass));b.data("visible",true);b.data("initialAjaxContentLoaded",false);b.data("enabled",true);if(a.autoScroll!=="always")switch(a.visibleHotSpots){case "always":c.showHotSpotBackgrounds();
break;case "onstart":c.showHotSpotBackgrounds();b.data("hideHotSpotBackgroundsInterval",setTimeout(function(){c.hideHotSpotBackgrounds("slow")},a.hotSpotsVisibleTime*1E3))}b.data("scrollingHotSpotRight").bind("mousemove",function(d){d=d.pageX-(this.offsetLeft+b.data("motherElementOffset"));b.data("scrollXPos",Math.round(d/b.data("hotSpotWidth")*a.scrollStep));b.data("scrollXPos")===Infinity&&b.data("scrollXPos",0)});b.data("scrollingHotSpotRight").bind("mouseover",function(){if(a.autoScroll==="onstart"&&
b.data("autoScrollInterval")!==null){clearInterval(b.data("autoScrollInterval"));b.data("autoScrollInterval",null);c._trigger("autoScrollIntervalStopped")}b.data("rightScrollInterval",setInterval(function(){if(b.data("scrollXPos")>0&&b.data("enabled")){b.data("scrollWrapper").scrollLeft(b.data("scrollWrapper").scrollLeft()+b.data("scrollXPos")*b.data("speedBooster"));c._showHideHotSpots()}},a.scrollInterval));c._trigger("mouseOverRightHotSpot")});b.data("scrollingHotSpotRight").bind("mouseout",function(){clearInterval(b.data("rightScrollInterval"));
b.data("scrollXPos",0)});b.data("scrollingHotSpotRight").bind("mousedown",function(){b.data("speedBooster",a.mouseDownSpeedBooster)});e("body").bind("mouseup",function(){b.data("speedBooster",1)});b.data("scrollingHotSpotLeft").bind("mousemove",function(d){d=b.data("scrollingHotSpotLeft").innerWidth()-(d.pageX-b.data("motherElementOffset"));b.data("scrollXPos",Math.round(d/b.data("hotSpotWidth")*a.scrollStep));b.data("scrollXPos")===Infinity&&b.data("scrollXPos",0)});b.data("scrollingHotSpotLeft").bind("mouseover",
function(){if(a.autoScroll==="onstart"&&b.data("autoScrollInterval")!==null){clearInterval(b.data("autoScrollInterval"));b.data("autoScrollInterval",null);c._trigger("autoScrollIntervalStopped")}b.data("leftScrollInterval",setInterval(function(){if(b.data("scrollXPos")>0&&b.data("enabled")){b.data("scrollWrapper").scrollLeft(b.data("scrollWrapper").scrollLeft()-b.data("scrollXPos")*b.data("speedBooster"));c._showHideHotSpots()}},a.scrollInterval));c._trigger("mouseOverLeftHotSpot")});b.data("scrollingHotSpotLeft").bind("mouseout",
function(){clearInterval(b.data("leftScrollInterval"));b.data("scrollXPos",0)});b.data("scrollingHotSpotLeft").bind("mousedown",function(){b.data("speedBooster",a.mouseDownSpeedBooster)});e(window).bind("resize",function(){a.hiddenOnStart||c._showHideHotSpots();c._trigger("windowResized")});a.ajaxContentURL.length>0?c.replaceContent(a.ajaxContentURL):c.recalculateScrollableArea();a.hiddenOnStart&&c.hide();a.autoScroll.length>0&&!a.hiddenOnStart&&a.ajaxContentURL.length<=0&&c.startAutoScroll()},showHotSpotBackgrounds:function(c){var a=
this.element;if(c!==undefined){a.data("scrollingHotSpotLeft").css("opacity","0.0");a.data("scrollingHotSpotRight").css("opacity","0.0");a.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");a.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");a.data("scrollingHotSpotLeft").fadeTo(c,0.35);a.data("scrollingHotSpotRight").fadeTo(c,0.35)}else{a.data("scrollingHotSpotLeft").addClass("scrollingHotSpotLeftVisible");a.data("scrollingHotSpotLeft").removeAttr("style");a.data("scrollingHotSpotRight").addClass("scrollingHotSpotRightVisible");
a.data("scrollingHotSpotRight").removeAttr("style")}this._showHideHotSpots()},hideHotSpotBackgrounds:function(c){var a=this.element;if(c!==undefined){a.data("scrollingHotSpotLeft").fadeTo(c,0,function(){a.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible")});a.data("scrollingHotSpotRight").fadeTo(c,0,function(){a.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible")})}else{a.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible");a.data("scrollingHotSpotLeft").removeAttr("style");
a.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible");a.data("scrollingHotSpotRight").removeAttr("style")}},_showHideHotSpots:function(){var c=this.element;if(this.options.autoScroll!=="always")if(c.data("scrollableAreaWidth")<=c.data("scrollWrapper").innerWidth()){c.data("scrollingHotSpotLeft").hide();c.data("scrollingHotSpotRight").hide()}else if(c.data("scrollWrapper").scrollLeft()===0){c.data("scrollingHotSpotLeft").hide();c.data("scrollingHotSpotRight").show();this._trigger("scrollLeftLimitReached");
clearInterval(c.data("leftScrollInterval"));c.data("leftScrollInterval",null)}else if(c.data("scrollableAreaWidth")<=c.data("scrollWrapper").innerWidth()+c.data("scrollWrapper").scrollLeft()){c.data("scrollingHotSpotLeft").show();c.data("scrollingHotSpotRight").hide();this._trigger("scrollRightLimitReached");clearInterval(c.data("rightScrollInterval"));c.data("rightScrollInterval",null)}else{c.data("scrollingHotSpotLeft").show();c.data("scrollingHotSpotRight").show()}else{c.data("scrollingHotSpotLeft").hide();
c.data("scrollingHotSpotRight").hide()}},moveToElement:function(c,a){var b=this.element,d=this.options,f=0;switch(c){case "first":b.data("scrollXPos",0);this._trigger("movedToFirstElement");break;case "start":b.data("scrollableArea").children(d.countOnlyClass).each(function(){d.startAtElementId.length>0&&e(this).attr("id")===d.startAtElementId&&b.data("startingPosition",f);f+=e(this).outerWidth(true)});b.data("scrollXPos",b.data("startingPosition"));this._trigger("movedToStartElement");break;case "last":b.data("scrollXPos",
b.data("scrollableAreaWidth"));this._trigger("movedToLastElement");break;case "number":isNaN(a)||b.data("scrollableArea").children(d.countOnlyClass).each(function(g){g===a-1&&b.data("scrollXPos",f);f+=e(this).outerWidth(true)});this._trigger("movedToElementNumber",null,{elementNumber:a})}b.data("scrollWrapper").scrollLeft(b.data("scrollXPos"));this._showHideHotSpots()},addContent:function(c,a){var b=this,d=this.element;e.get(c,function(f){a==="first"?d.data("scrollableArea").children(":first").before(f):
d.data("scrollableArea").children(":last").after(f);b.recalculateScrollableArea();b._showHideHotSpots()})},replaceContent:function(c){var a=this,b=this.element;b.data("scrollableArea").load(c,function(){a.recalculateScrollableArea();a.moveToElement("first");a._showHideHotSpots();b.data("startingPosition",0)})},recalculateScrollableArea:function(){var c=0,a=false,b=this.options,d=this.element;d.data("scrollableArea").children(b.countOnlyClass).each(function(){if(b.startAtElementId.length>0&&e(this).attr("id")===
b.startAtElementId){d.data("startingPosition",c);a=true}c+=e(this).outerWidth(true)});a||d.data("startAtElementId","");d.data("scrollableAreaWidth",c);d.data("scrollableArea").width(d.data("scrollableAreaWidth"));d.data("scrollWrapper").scrollLeft(d.data("startingPosition"));d.data("scrollXPos",d.data("startingPosition"));if(!d.data("initialAjaxContentLoaded"))if(b.autoScroll.length>0&&!b.hiddenOnStart&&b.ajaxContentURL.length>0){this.startAutoScroll();d.data("initialAjaxContentLoaded",true)}},stopAutoScroll:function(){var c=
this.element;clearInterval(c.data("autoScrollInterval"));c.data("autoScrollInterval",null);this._showHideHotSpots();this._trigger("autoScrollStopped")},startAutoScroll:function(){var c=this,a=this.element,b=this.options;c._showHideHotSpots();clearInterval(a.data("autoScrollInterval"));a.data("autoScrollInterval",null);c._trigger("autoScrollStarted");a.data("autoScrollInterval",setInterval(function(){if(!a.data("visible")||a.data("scrollableAreaWidth")<=a.data("scrollWrapper").innerWidth()){clearInterval(a.data("autoScrollInterval"));
a.data("autoScrollInterval",null)}else{a.data("previousScrollLeft",a.data("scrollWrapper").scrollLeft());switch(b.autoScrollDirection){case "right":a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()+b.autoScrollStep);if(a.data("previousScrollLeft")===a.data("scrollWrapper").scrollLeft()){c._trigger("autoScrollRightLimitReached");clearInterval(a.data("autoScrollInterval"));a.data("autoScrollInterval",null);c._trigger("autoScrollIntervalStopped")}break;case "left":a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()-
b.autoScrollStep);if(a.data("previousScrollLeft")===a.data("scrollWrapper").scrollLeft()){c._trigger("autoScrollLeftLimitReached");clearInterval(a.data("autoScrollInterval"));a.data("autoScrollInterval",null);c._trigger("autoScrollIntervalStopped")}break;case "backandforth":a.data("pingPongDirection")==="right"?a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()+b.autoScrollStep):a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()-b.autoScrollStep);if(a.data("previousScrollLeft")===
a.data("scrollWrapper").scrollLeft())if(a.data("pingPongDirection")==="right"){a.data("pingPongDirection","left");c._trigger("autoScrollRightLimitReached")}else{a.data("pingPongDirection","right");c._trigger("autoScrollLeftLimitReached")}break;case "endlessloopright":if(a.data("getNextElementWidth")){if(b.startAtElementId.length>0&&a.data("startAtElementHasNotPassed")){a.data("swapAt",e("#"+b.startAtElementId).outerWidth(true));a.data("startAtElementHasNotPassed",false)}else a.data("swapAt",a.data("scrollableArea").children(":first").outerWidth(true));
a.data("getNextElementWidth",false)}a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()+b.autoScrollStep);if(a.data("swapAt")<=a.data("scrollWrapper").scrollLeft()){a.data("swappedElement",a.data("scrollableArea").children(":first").detach());a.data("scrollableArea").append(a.data("swappedElement"));a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()-a.data("swappedElement").outerWidth(true));a.data("getNextElementWidth",true)}break;case "endlessloopleft":if(a.data("getNextElementWidth")){if(b.startAtElementId.length>
0&&a.data("startAtElementHasNotPassed")){a.data("swapAt",e("#"+b.startAtElementId).outerWidth(true));a.data("startAtElementHasNotPassed",false)}else a.data("swapAt",a.data("scrollableArea").children(":first").outerWidth(true));a.data("getNextElementWidth",false)}a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()-b.autoScrollStep);if(a.data("scrollWrapper").scrollLeft()===0){a.data("swappedElement",a.data("scrollableArea").children(":last").detach());a.data("scrollableArea").prepend(a.data("swappedElement"));
a.data("scrollWrapper").scrollLeft(a.data("scrollWrapper").scrollLeft()+a.data("swappedElement").outerWidth(true));a.data("getNextElementWidth",true)}}}},b.autoScrollInterval))},restoreOriginalElements:function(){var c=this.element;c.data("scrollableArea").html(c.data("originalElements"));this.recalculateScrollableArea();this.moveToElement("first")},show:function(){var c=this.element;c.data("visible",true);c.show()},hide:function(){var c=this.element;c.data("visible",false);c.hide()},enable:function(){this.element.data("enabled",
true)},disable:function(){var c=this.element;clearInterval(c.data("autoScrollInterval"));clearInterval(c.data("rightScrollInterval"));clearInterval(c.data("leftScrollInterval"));clearInterval(c.data("hideHotSpotBackgroundsInterval"));c.data("enabled",false)},destroy:function(){var c=this.element;clearInterval(c.data("autoScrollInterval"));clearInterval(c.data("rightScrollInterval"));clearInterval(c.data("leftScrollInterval"));clearInterval(c.data("hideHotSpotBackgroundsInterval"));c.data("scrollingHotSpotRight").unbind("mouseover");
c.data("scrollingHotSpotRight").unbind("mouseout");c.data("scrollingHotSpotRight").unbind("mousedown");c.data("scrollingHotSpotLeft").unbind("mouseover");c.data("scrollingHotSpotLeft").unbind("mouseout");c.data("scrollingHotSpotLeft").unbind("mousedown");c.data("scrollableArea").html(c.data("originalElements"));c.data("scrollableArea").removeAttr("style");c.data("scrollingHotSpotRight").removeAttr("style");c.data("scrollingHotSpotLeft").removeAttr("style");c.data("scrollWrapper").scrollLeft(0);c.data("scrollingHotSpotLeft").removeClass("scrollingHotSpotLeftVisible");
c.data("scrollingHotSpotRight").removeClass("scrollingHotSpotRightVisible");c.data("scrollingHotSpotRight").hide();c.data("scrollingHotSpotLeft").hide();e.Widget.prototype.destroy.apply(this,arguments)}})})(jQuery);

