
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.5",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,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,WINDOWS:91}});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)},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!==j)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},disableSelection:function(){return this.bind("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c.style(this,h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c.style(this,h,d(this,f,true,g)+"px")})}});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");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});c(function(){var a=document.createElement("div"),b=document.body;c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.appendChild(a).offsetHeight===100;b.removeChild(a).style.display="none"});c.extend(c.ui,{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,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);;(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=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 l.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(true,{},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);if(!g)throw"cannot call methods on "+a+" prior to initialization; attempted to call method '"+d+"'";if(!b.isFunction(g[d]))throw"no such method '"+d+"' for "+a+" widget instance";var i=g[d].apply(g,f);if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():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){b.data(c,this.widgetName,this);this.element=b(c);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===j)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);;(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);;(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");b.disabled&&this.element.addClass("ui-slider-disabled ui-disabled");this.range=d([]);if(b.range){if(b.range===true){this.range=d("<div></div>");if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}else this.range=d("<div></div>");this.range.appendTo(this.element).addClass("ui-slider-range");if(b.range==="min"||b.range==="max")this.range.addClass("ui-slider-range-"+b.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");if(b.values&&b.values.length)for(;d(".ui-slider-handle",this.element).length<b.values.length;)d("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!a.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");h=a._start(c,f);if(h===false)return}break}i=a.options.step;h=a.options.values&&a.options.values.length?(g=a.values(f)):(g=a.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=a._valueMin();break;case d.ui.keyCode.END:g=a._valueMax();break;case d.ui.keyCode.PAGE_UP:g=a._trimAlignValue(h+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=a._trimAlignValue(h-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h===a._valueMax())return;g=a._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===a._valueMin())return;g=a._trimAlignValue(h-i);break}a._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(c,e);a._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(a){var b=this.options,c,e,f,h,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(b.range===true&&this.values(1)===b.min){g+=1;f=d(this.handles[g])}if(this._start(a,g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();b=f.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-f.width()/2,top:a.pageY-b.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b=this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b=this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var e;if(this.options.values&&this.options.values.length){e=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>e||b===1&&c<e))c=e;if(c!==this.values(b)){e=this.values();e[b]=c;a=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e});this.values(b?0:1);a!==false&&this.values(b,c,true)}}else if(c!==this.value()){a=this._trigger("slide",a,{handle:this.handles[b],value:c});a!==false&&this.value(c)}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a);this._refreshValue();this._change(null,0)}return this._value()},values:function(a,b){var c,e,f;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f<c.length;f+=1){c[f]=this._trimAlignValue(e[f]);this._change(null,f)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(a):this.value();else return this._values()},_setOption:function(a,b){var c,e=0;if(d.isArray(this.options.values))e=this.options.values.length;d.Widget.prototype._setOption.apply(this,arguments);switch(a){case"disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(c=0;c<e;c+=1)this._change(null,c);this._animateOff=false;break}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a)},_values:function(a){var b,c;if(arguments.length){b=this.options.values[a];return b=this._trimAlignValue(b)}else{b=this.options.values.slice();for(c=0;c<b.length;c+=1)b[c]=this._trimAlignValue(b[c]);return b}},_trimAlignValue:function(a){if(a<this._valueMin())return this._valueMin();if(a>this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=a%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=this.options.range,b=this.options,c=this,e=!this._animateOff?b.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({width:f-
g+"%"},{queue:false,duration:b.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},b.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:b.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.5"})})(jQuery);;jQuery.effects||function(f,j){function l(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return m.transparent;return m[f.trim(c).toLowerCase()]}function r(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return l(b)}function n(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function o(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in s||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function t(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:f.fx.speeds[b]||f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=r(b.elem,a);b.end=l(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var m={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],transparent:[255,255,255]},p=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){var e=f(this),g=e.attr("style")||" ",h=o(n.call(this)),q,u=e.attr("className");f.each(p,function(v,i){c[i]&&e[i+"Class"](c[i])});q=o(n.call(this));e.attr("className",u);e.animate(t(h,q),a,b,function(){f.each(p,function(v,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.5",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,a){var b;switch(c[0]){case"top":b=0;break;case"middle":b=0.5;break;case"bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case"left":c=0;break;case"center":c=0.5;break;case"right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments);a={options:a[1],duration:a[2],callback:a[3]};var b=f.effects[c];return b&&!f.fx.off?b.call(this,a):this},_show:f.fn.show,show:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||!f.effects[c])return this._show.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||!f.effects[c])return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(!c||typeof c=="number"||f.fx.speeds[c]||!f.effects[c]||typeof c=="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+
b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);;(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","left"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);;(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","left"],e=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(e=="show")a.css(f,b=="pos"?-g:g);var i={};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);;(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);﻿
var changeStyleSheet=function(){}
var minWindowWidth=981;var minWindowHeight=592;var isBelowMinDimensions=false;var ie7=false;var ie9=false;function getInternetExplorerVersion()
{var rv=-1;if(navigator.appName=='Microsoft Internet Explorer'){var ua=navigator.userAgent;var re=new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");if(re.exec(ua)!=null)
rv=parseFloat(RegExp.$1);}
return rv;}
var blockMove=function(event){event.preventDefault();};var IsNull=function(element,val){if(element!==null){return element;}
else{return val;}};var setMainContainerHeight=function(){if($(".officeMap").length>0){minWindowWidth=1200;}
var screenWidth=$(window).width();var screenHeight=$(window).height();if(screenWidth<minWindowWidth){$("#siteContainer").css("width",minWindowWidth);}
else{$("#siteContainer").css("width",screenWidth);};if(screenHeight<minWindowHeight){$("#siteContainer").css("height",minWindowHeight);}
else{$("#siteContainer").css("height",screenHeight);};if((screenWidth<minWindowWidth)||(screenHeight<minWindowHeight)){$("body").css("overflow","auto");}
else{$("body").css("overflow","hidden");};}
var setSocialMediaIcons=function(){if($('#socialMedia').length>0){var toolBar=$('#socialMedia');toolBar.css({"top":parseInt($("#mainContent").outerHeight())-$('#socialMedia').height()-5,"left":parseInt($("#mainContent").outerWidth()-$('#socialMedia').outerWidth()-10)});}}
function isiPad(){return(navigator.platform.indexOf("iPad")!=-1);}
var outputProps=function(myObject){var s="obj\n";for(var property in myObject){s=s+"\n "+property+": "+myObject[property];}
debug(s);}
$(document).ready(function(){if(isiPad()){document.addEventListener('touchmove',function(e){e.preventDefault();},false);};if(getInternetExplorerVersion()==7){ie7=true;}
if(getInternetExplorerVersion()==9){ie9=true;}
setMainContainerHeight();$('#mainMenu').mainMenu();if($('#officeGoogleMap').length>0){var lat=$('#officeGoogleMap').attr("rel").split(",")[0];var long=$('#officeGoogleMap').attr("rel").split(",")[1];var aedasOffice=new google.maps.LatLng(lat,long);var MY_MAPTYPE_ID='aedasmap';var stylez=[{featureType:"administrative",elementType:"all",stylers:[{saturation:-100}]},{featureType:"landscape",elementType:"all",stylers:[{saturation:-100}]},{featureType:"poi",elementType:"all",stylers:[{saturation:-100}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100}]},{featureType:"transit",elementType:"all",stylers:[{saturation:-100}]}];var mapOptions={zoom:15,center:aedasOffice,mapTypeControlOptions:{mapTypeIds:[google.maps.MapTypeId.ROADMAP,MY_MAPTYPE_ID]},mapTypeId:MY_MAPTYPE_ID,navigationControl:true,mapTypeControl:false,scrollwheel:true,streetViewControl:false,disableDoubleClickZoom:true,linksControl:false};var map=new google.maps.Map(document.getElementById("officeGoogleMap"),mapOptions);var marker=new google.maps.Marker({position:aedasOffice,map:map,title:"Aedas "+$("body").find("h2").text()});var styledMapOptions={name:"Aedas"};var jayzMapType=new google.maps.StyledMapType(stylez,styledMapOptions);map.mapTypes.set(MY_MAPTYPE_ID,jayzMapType);};$('#contentBar .mainContent').textContent();if($('#pageImages').children().length!=0){$('#pageImages').aedasBgImage({'slideshow':imageSlideShow,'hasLegend':ShowSlideShowLegend,'Showcase':Showcase,'onfirstImageShown':function(){showMainContent();}});}
else{showMainContent();};$('#searchBar').aedasSearch();$(window).resize(function(){setMainContainerHeight();$('#contentBar .mainContent').textContent();});if(SelectedNav!=""){var navlist=$('#mainMenu').find("a:contains("+SelectedNav+")").parent().addClass("selected");navlist.prev().addClass("nextMenuHoverSelected");};});String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
String.prototype.ltrim=function(){return this.replace(/^\s+/,"");}
String.prototype.rtrim=function(){return this.replace(/\s+$/,"");}
var showMainContent=function(){$('#searchBar').fadeIn(250);var contentBar=$('#contentBar');contentBar.addClass("firstLoad");$.fn.textContent.slideInContent($('#contentBar'))
if(!alwaysShowContent){setTimeout("$.fn.textContent.slideOutContent('#contentBar')",4000);};if($('#countdown').length>0){hasCountdown=true;$('#countdown').aedasCountDownClock({"countDownText":"JOIN US AT MIPIM 2011","countDownToDate":"03/08/2011 9:00 AM","linkURL":"news/mipim-2011"});};contentBar.css("left",0);contentBar.css("left",-1*$('#contentBar').width());if(!alwaysShowContent){$("#siteContainer").mousemove(function(e){var x=e.pageX-$(this).offset().left;mouseX=x;var y=e.pageY-$(this).offset().top;if(x<90){$.fn.textContent.slideInContent($('#contentBar'));};if(x>PanelWidthRollOff){$(".mouseOver").removeClass("mouseOver");if(!$('#contentBar').hasClass("firstLoad")){$.fn.textContent.slideOutContent($('#contentBar'));};};});};};(function($){var checkUndefined=function(a){return typeof a==='undefined';}
$.expr[':'].data=function(elem,counter,params){if(checkUndefined(elem)||checkUndefined(params))return false;var query=params[3];if(!query)return false;var querySplitted=query.split('=');var selectType=querySplitted[0].charAt(querySplitted[0].length-1);if(selectType=='^'||selectType=='$'||selectType=='!'||selectType=='*'){querySplitted[0]=querySplitted[0].substring(0,querySplitted[0].length-1);if(!$.stringQuery&&selectType!='!'){return false;}}
else selectType='=';var dataName=querySplitted[0];var dataNameSplitted=dataName.split('.');var data=$(elem).data(dataNameSplitted[0]);if(checkUndefined(data))return false;if(dataNameSplitted[1]){for(i=1,x=dataNameSplitted.length;i<x;i++){data=data[dataNameSplitted[i]];if(checkUndefined(data))return false;}}
if(querySplitted[1]){var checkAgainst=(data+'');switch(selectType){case'=':return checkAgainst==querySplitted[1];break;case'!':return checkAgainst!=querySplitted[1];break;case'^':return $.stringQuery.startsWith(checkAgainst,querySplitted[1]);break;case'$':return $.stringQuery.endsWith(checkAgainst,querySplitted[1]);break;case'*':return $.stringQuery.contains(checkAgainst,querySplitted[1]);break;default:return false;break;}}
else{return true;}}})(jQuery);(function($){$.event.special.load={add:function(hollaback){if(this.nodeType===1&&this.tagName.toLowerCase()==='img'&&this.src!==''){if(this.complete||this.readyState===4){hollaback.handler.apply(this);}
else if(this.readyState==='uninitialized'&&this.src.indexOf('data:')===0){$(this).trigger('error');}
else{$(this).bind('load',hollaback.handler);}}}};}(jQuery));(function($,sr){var debounce=function(func,threshold,execAsap){var timeout;return function debounced(){var obj=this,args=arguments;function delayed(){if(!execAsap)
func.apply(obj,args);timeout=null;};if(timeout)
clearTimeout(timeout);else if(execAsap)
func.apply(obj,args);timeout=setTimeout(delayed,threshold||100);};}
jQuery.fn[sr]=function(fn){return fn?this.bind('resize',debounce(fn)):this.trigger(sr);};})(jQuery,'smartresize');﻿$.fn.mainMenu=function(){var menuCount=0;var minMenuWidth=125;var mainMenuHeight=0;var firstChildMenu=true;var maxSubMenuHeight=0;var menuHolder=$(this).parent();var showSubMenu=function(menuItem){hideSubMenu();var menuID=$(menuItem).data("menuCount");var childMenu=$(menuHolder).children("ul.subMenu:data(menuCount="+menuID+")");$(childMenu).stop().animate({height:$(childMenu).data("origHeight"),duration:20},function(){}).addClass("menuOpen");return false;};var hideSubMenu=function(){$(menuHolder).children('ul.menuOpen').each(function(){$(this).stop().height(0).removeClass("menuOpen");});return false;};var hideSubMenuSlide=function(){$(menuHolder).children('ul.menuOpen').each(function(){$(this).stop().animate({height:0,duration:'fast'}).removeClass("menuOpen");});return false;};var setupMenuOptions=function(menuItem){var thisMenuCount=$(menuItem).data("menuCount");var childMenu=$(menuHolder).children("ul.subMenu:data(menuCount="+thisMenuCount+")");$(menuItem).hover(function(){$(this).prev().addClass("nextMenuHover");$(this).addClass("menuHover");showSubMenu($(this));},function(){$(this).prev().removeClass("nextMenuHover");$(this).removeClass("menuHover");});if(childMenu.html()!=null){$(menuItem).click(function(){$(this).addClass("menuHover");showSubMenu($(this));return false;});$(childMenu).children("li").hover(function(){$(this).addClass("menuHover");},function(){$(this).removeClass("menuHover");});$(childMenu).children("li:first").addClass("firstItem");$(childMenu).children("li:last").addClass("lastItem");$(childMenu).data("origHeight",$(childMenu).height());$(childMenu).css("height",0);$(childMenu).css("bottom",24);var additionalPadding=0;if(!firstChildMenu){additionalPadding=3;};firstChildMenu=false;$(childMenu).css("left",$(menuItem).position().left-additionalPadding);var thisMenuWidth=$(menuItem).width()+parseInt($(childMenu).css("padding-right"),10);var childMenuWidth=$(childMenu).width()+parseInt($(childMenu).css("padding-right"),10);if(childMenuWidth>=thisMenuWidth){$(menuItem).css('width',childMenuWidth);$(childMenu).css('width',childMenuWidth+additionalPadding);}
else{if(ie7){if($(menuItem).children("a").html()=="News &amp; Events"){minMenuWidth=minMenuWidth+20;};}
$(childMenu).css("width",minMenuWidth-parseInt((childMenu).css("padding-right"),10)+additionalPadding);$(menuItem).css("width",minMenuWidth);}}
else{$(menuItem).addClass("noSubMenu");}



return true;};return this.each(function(){if(ie7){$("#mainMenuHolder").css("bottom",22);$("#mainMenu").children("li").children("a").css({"position":"absolute","bottom":-5,"font-size":"0.75em","line-height":"1.1em"});}
if(ie9){$("#mainMenu").children("li").children("a").addClass("ie9");};var noItems=$(this).children('li').length;$(this).children('li').each(function(){$(this).data("menuCount",menuCount);$(this).children("ul").appendTo($(menuHolder)).addClass('subMenu').data("menuCount",menuCount);if($(this).width()<minMenuWidth){$(this).css("width",minMenuWidth);};if(menuCount!=noItems){$("<div></div>").html("|").appendTo(this);}
menuCount++;});mainMenuHeight=$(this).height()+parseInt($(this).css("padding-bottom")+parseInt($(this).css("padding-top"),10),10);$(this).children('li').each(function(){setupMenuOptions(this);});$(menuHolder).mouseleave(function(){hideSubMenuSlide();});$(menuHolder).css({"height":23,"left":-2});});return false;};﻿(function($){var slideSpeed=400;$.fn.textContent=function(){return this.each(function(){var availableHeight=0;var hasRelatedLinks=false;var hasPrimaryContent=false;var hasSecondaryContent=false;var hasSocialMedia=false;var hasCountdown=false;if($('#countdown').length>0){hasCountdown=true;};if($('.relatedLinks').length>0){hasRelatedLinks=true;};if($("#socialMedia").length>0){hasSocialMedia=true;if(hasRelatedLinks){var existingBottom=0;existingBottom=parseInt($('.relatedLinks').css("bottom"),10);existingBottom=(existingBottom+$("#socialMedia").height()+12);$('.relatedLinks').css("bottom",existingBottom);}};if($('.sectorList',this).length>0){hasSecondaryContent=true;}


if($('.primarySection',this).length>0){hasPrimaryContent=true;};if($('.secondarySection').length>0){hasSecondaryContent=true;}
if(!$("#accord").hasClass("ui-accordion")){var autoOpen=false;if($("#accord").find("h3").length==1){autoOpen=0;};$("#accord").accordion({active:autoOpen,autoHeight:false,collapsible:true,change:function(event,ui){$(".secondarySection").find(".scrollContent").css("height","");$('#contentBar .mainContent').textContent();if(ui.oldContent.find("ul").length>0){ui.oldContent.find("ul").unbind("hover");}
ui.newContent.find("ul").unbind("hover");$("#accord").parent().css("top",0);$(".secondarySection").find(".scrollContent").css("height","");return false;}});$("#regionSelect").find("li").click(function(){$.fn.textContent.filterProjects(this);});};availableHeight=$(this).height()-$("#footer").outerHeight()-$("#mainMenuHolder").outerHeight()-parseInt($("#contentBar .mainContent").css("padding-top"),10)-$(".pageHeader").outerHeight()-20;var singleLineHeight=19;if($(".primarySection").find("h2").height()>singleLineHeight){availableHeight=availableHeight-($(".primarySection").find("h2").height()-singleLineHeight);}
if(hasCountdown){availableHeight=availableHeight-$('#countdown').outerHeight();};if(hasRelatedLinks){availableHeight=availableHeight-$('.relatedLinks').outerHeight()-25;}
if(hasSocialMedia){availableHeight=availableHeight-$('#socialMedia').outerHeight()-12;}
var actualTextDiv=$(".scrollContent",$(".textContent",this));var tContent=$(".textContent",this);var textHeight=((tContent.height())<(availableHeight/2))?(tContent.height()):(availableHeight/2);var minTextSize=188;if(!hasPrimaryContent){minTextSize=0;};textHeight=(textHeight<minTextSize)?minTextSize:textHeight;if(hasSecondaryContent){if(pageType=="GeneralPage"){tContent.css("height",textHeight);}else{tContent.css("height",textHeight);};}
else{if(pageType=="GeneralPage"){var limitedSize=(availableHeight-$('.relatedLinks').outerHeight());if((availableHeight-$('.relatedLinks').outerHeight())>(availableHeight*0.75)){limitedSize=limitedSize*0.75;};tContent.css("height",limitedSize);}
else{tContent.css("height",availableHeight-IsNull($('.relatedLinks').outerHeight(),0)-IsNull($('#socialMedia').outerHeight(),0));};};availableHeight=availableHeight-textHeight;var actualSecondaryDiv=$(".scrollContent",$(".sectorList",this));if(actualSecondaryDiv.length==0){actualSecondaryDiv=$(".scrollContent",$(".subSectorList",this));};var actualSecondaryHeight=((actualSecondaryDiv.outerHeight()+2)<((availableHeight)-$(".secondarySection",this).find(".subhead").outerHeight()))?(actualSecondaryDiv.outerHeight()+2):((availableHeight)-$(".secondarySection",this).find(".subhead").outerHeight());$(".sectorList",this).css("height",actualSecondaryHeight);$(".subSectorList",this).css("height",availableHeight-10);$(".sectorList").find("li").unbind();$(".sectorList").find("li").click(function(){window.location=$(this).find("a:first").attr("href");return false;});$(".slider-wrap").each(function(){$(this).remove();});$(".subSectorList",this).aedasVerticalScroll();$(".textContent",this).aedasVerticalScroll();$(".sectorList",this).aedasVerticalScroll();if(!$("#imgThumbnails").hasClass("IsCarousel")){$("#imgThumbnails").thumbCarousel();};var showPreview=false;if(!$("#accord").find("li:last").attr("rel")){var tmp=0;}
else{if($("#accord").find("li:last").attr("rel")!=""||$("#accord").find("li:last").attr("rel")==null){showPreview=true;}}
if(showPreview){$("#accord").find("li").hover(function(){if($(this).attr("rel")=="none"){return true;}
else{tContent.css("visibility",'hidden');$("#previewHolder").show();$.fn.textContent.showPreview($(this));}},function(){$("#previewHolder").hide();tContent.css("visibility","visible");});};});};$.fn.thumbCarousel=function(){return this.each(function(){var outerContainer=$(this);var innerContainer=outerContainer.children(".hscrollContent");outerContainer.addClass("IsCarousel");var count=1;innerContainer.children("img").each(function(){$(this).data("imgCount",count);count++;});if(innerContainer.children("img").length>2){var firstImageCopy=innerContainer.children("img:first").clone().removeClass("selectedImg").addClass("notReal right").data("imgCount",innerContainer.children("img:first").data("imgCount"));var secondImageCopy=innerContainer.children("img:first").next().clone().removeClass("selectedImg").addClass("notReal right").data("imgCount",innerContainer.children("img:first").next().data("imgCount"));var lastImageCopy=innerContainer.children("img:last").clone().removeClass("selectedImg").addClass("notReal left").data("imgCount",innerContainer.children("img:last").data("imgCount"));var secondLastCopy=innerContainer.children("img:last").prev().clone().removeClass("selectedImg").addClass("notReal left").data("imgCount",innerContainer.children("img:last").prev().data("imgCount"));firstImageCopy.appendTo(innerContainer);secondImageCopy.appendTo(innerContainer);lastImageCopy.prependTo(innerContainer);secondLastCopy.prependTo(innerContainer);var imageWidth=innerContainer.find("img:first").outerWidth();var innerContainerWidth=imageWidth*innerContainer.find("img").length;innerContainer.css("width",innerContainerWidth);var currentImage=innerContainer.children(".selectedImg");var imagePadding=(outerContainer.width()-imageWidth)/2;outerContainer.scrollLeft(currentImage.position().left-imagePadding);};});};$.fn.textContent.filterProjects=function(item){$(item).parent().find("li").removeClass("selected");$(item).addClass("selected");if($(item).hasClass("AllCountries")){$("#accord").find(".projectList").each(function(){var list=$(this);var items=list.find("li");items.show();list.parent().prev().find("tt").text("("+items.length+")");});}
else{var region=$(item).text().rtrim();$("#accord").find(".projectList").each(function(){var list=$(this);list.find("li").each(function(){if($(this).find(".region").text().toLowerCase()!=region.toLowerCase()&&$(this).find(".region").text().toLowerCase()!="all"){$(this).hide().addClass("notregion");}
else{$(this).show().removeClass("notregion");}});var count=list.find("li").length-list.find(".notregion").length;list.parent().prev().find("tt").text("("+count+")");});}};$.fn.textContent.showPreview=function(link){var newImgTag=$(".previewimage","#previewHolder");if($(".previewimage","#previewHolder").length<1){newImgTag=$("<img></img>").addClass('previewimage').appendTo($('#previewHolder'));}
newImgTag.hide();newImgTag.load(function(){newImgTag.show();}).attr('src',"/Content/images/pageimagesSmall/"+link.attr("rel"));debug(link.attr("href"));};$.fn.textContent.slideInContent=function(panel){if(!$(panel).hasClass("panelOpening")&&!$(panel).hasClass("panelOpen")&&!$(panel).hasClass("panelClosing")){$(panel).removeClass("panelClosed");$(panel).addClass("panelOpening");$(panel).animate({"left":0},slideSpeed,function(){$(panel).removeClass("panelOpening");$(panel).addClass("panelOpen");});};};$.fn.textContent.slideOutContent=function(panel){panel=$(panel);if(!panel.hasClass("showingVideo")){panel.removeClass("firstLoad");if(mouseX>PanelWidthRollOff){if(!panel.hasClass("panelClosing")&&!panel.hasClass("panelClosed")&&!panel.hasClass("panelOpening")){panel.removeClass("panelOpen");panel.addClass("panelClosing");panel.animate({"left":(-1*$(panel).width())},slideSpeed,function(){panel.removeClass("panelClosing");panel.addClass("panelClosed");});};};};};})(jQuery);(function($){var globals={'id':$(this).attr('id'),'imgCount':0,'imgLeft':0,'imgTop':0,'imgNewWidth':0,'imgNewHeight':0,'multiImage':false,'currentActiveSlide':1,'transition':null};var settings={'slideshow':false,'imgWidth':1600,'imgHeight':1200,'imageFadeTime':1500,'slideShowSpeed':8000,'preloadDelay':2000,'hasLegend':false,'showcase':false,'onfirstImageShown':function(){return false;},'onBackGroundChange':function(){return false;}};$.fn.aedasBgImage=function(options){var fadeOut=function(img){$(img).fadeOut();};var fadeIn=function(img){$(img).fadeIn();};var imageResize=function(){calculateDimensions();$('.backgroundImage').each(function(){$.fn.aedasBgImage.setImgProperties($(this),false,null);});};var calculateDimensions=function(){var browserwidth=$("#siteContainer").width();var browserheight=$("#siteContainer").height();var ratio=settings.imgHeight/settings.imgWidth;var newheight=0;var newwidth=0;if((browserheight/browserwidth)>ratio){globals.imgNewHeight=browserheight;globals.imgNewWidth=Math.round(browserheight/ratio);}else{globals.imgNewHeight=Math.round(browserwidth*ratio);globals.imgNewWidth=browserwidth;}
globals.imgLeft=Math.round((browserwidth-globals.imgNewWidth)/2);globals.imgTop=Math.round((browserheight-globals.imgNewHeight)/2);var tmp="Display Port Width="+$("#siteContainer").width()+"<br>Display Port Height="+$("#siteContainer").height()+"<br>Top="+globals.imgTop+"<br>Left="+globals.imgLeft+"<br>Height="+globals.imgNewHeight+"<br>Width="+globals.imgNewWidth+"<br>Ratio="+globals.imgNewHeight/globals.imgNewWidth;return true;};return this.each(function(){if(options){$.extend(settings,options);}
globals.imgCount=$("a",this).length;if(globals.imgCount<2){options.slideshow=false;};if(globals.imgCount>1){globals.multiImage=true;};var count=1;$("a",this).each(function(){$(this).attr("id","pageImageLink"+count);$(this).data("imgCount",count);count++;});count=1;if($(".hscrollContent","#imgThumbnails").find("img").length>0){$(".hscrollContent","#imgThumbnails").find("img").each(function(){$(this).click(function(){var img=$(this);if(img.hasClass("parentLoaded")){$(".hscrollContent","#imgThumbnails").find("img").removeClass("selectedImg");img.addClass("selectedImg");var imgCount=img.data("imgCount");if(!img.hasClass("video")){$('.currentBackground').fadeOut(settings.imageFadeTime);var nextImage=$(".backgroundImage:data(imgCount="+imgCount+")");$(nextImage).fadeIn(settings.imageFadeTime).addClass("currentBackground");$.fn.hideVideo();}
else{$.fn.showVideo(this);};var outerContainer=img.closest("#imgThumbnails");var imagePadding=(outerContainer.width()-img.outerWidth())/2;var thumbScrollLeft=img.position().left-imagePadding;if(img.hasClass("notReal")){img.parent().children("img:data(imgCount="+imgCount+")").each(function(){if(!$(this).hasClass("notReal")){var oldImg=img;img=$(this);img.removeClass("selectedImg");var scrollLeft=0;if(oldImg.hasClass("right")){scrollLeft=img.position().left-imagePadding-img.outerWidth();}
else{scrollLeft=img.position().left-imagePadding+img.outerWidth();};img.addClass("selectedImg");outerContainer.scrollLeft(scrollLeft);};});};imagePadding=(outerContainer.width()-img.outerWidth())/2;thumbScrollLeft=img.position().left-imagePadding;outerContainer.animate({"scrollLeft":thumbScrollLeft});}});count++;});}
if(settings.hasLegend){var contain=$("<div></div>").attr("id","showcaseLegendContainer").appendTo($("#siteContainer"));var readMoreBtn=$("<span></span>");var readMoreLink=$("<a></a>").text("["+$("#MultiLanguageInterfaceText").children("li.readmore").text()+"]").appendTo(readMoreBtn);var show=$("<div></div").attr("id","showcaseLegend").html("<h4></h4>").append(readMoreBtn).appendTo(contain).fadeOut(10);if(ie9){show.addClass("ie9");};$("<div></div>").addClass("background").appendTo(contain);}
$.fn.aedasBgImage.preLoadImage($("a:first",this).attr("id"),true,1);calculateDimensions();$(window).smartresize(function(){imageResize();});if(options.slideshow){if(options.Showcase){var numberOfImages=$("#pageImages").children().length;var btnNext=$("<div></div>").attr("id","goNext").attr("title",$("#MultiLanguageInterfaceText").children(".show").text()+" "+1+" / "+numberOfImages).appendTo($('#siteContainer')).click(function(){clearInterval(globals.transition);if(!$(this).hasClass("disabled")){$.fn.showcase(true);};});var btnPrev=$("<div></div>").attr("id","goPrev").attr("title",$("#MultiLanguageInterfaceText").children(".show").text()+" "+numberOfImages+" / "+numberOfImages).appendTo($('#siteContainer')).click(function(){clearInterval(globals.transition);if(!$(this).hasClass("disabled")){$.fn.showcase(false);};});;globals.transition=setInterval("$.fn.showcase(true)",settings.slideShowSpeed);}
else{setInterval("$.fn.slideshow(this)",settings.slideShowSpeed);}};});};$.fn.showVideo=function(btn){var contentBar=$("#contentBar");var tContent=$(".textContent",contentBar);tContent=$(tContent);contentBar.data("origWidth",contentBar.css("width"))
contentBar.addClass("showingVideo");tContent.css("visibility",'hidden');$(".slider-wrap",contentBar).css("visibility",'hidden');$(".secondarySection",contentBar).css("visibility",'hidden');$("<div></div>").text($("#MultiLanguageInterfaceText").children(".close").text()).addClass("videoClose").appendTo(tContent.parent()).click(function(){$.fn.closeVideo(this,contentBar);});$("#previewHolder").show();contentBar.animate({"width":698},500,function(){var playerWindow=$("<div></div>").attr("id","videoDiv").css({"top":0,"left":0,"position":"absolute","z-index":700,"width":626,"height":380}).appendTo(tContent.parent());var iframe=$('<iframe></iframe>').attr('id','videoIFrame').attr("frameborder",0).attr('name','videoIFrame').attr('src','/VideoPlayer/'+$(btn).attr("rel"));iframe.load(function(){});playerWindow.append(iframe);});};$.fn.closeVideo=function(btn,contentBar){var tContent=$(".textContent",contentBar);tContent=$(tContent);$("#videoDiv").fadeOut(200,function(){$("#videoDiv",contentBar).remove();$(btn).fadeOut(200,function(){$(btn).remove();});contentBar.animate({"width":contentBar.data("origWidth")},500,function(){$(".slider-wrap",contentBar).css("visibility",'visible');tContent.css("visibility",'visible');$(".secondarySection",contentBar).css("visibility",'visible');})});};$.fn.hideVideo=function(){$("#contentBar").removeClass("showingVideo");return true;};$.fn.slideshow=function(){var nextImageNo=parseInt(globals.currentActiveSlide,10)+1;if(globals.currentActiveSlide==globals.imgCount){nextImageNo=1;};$('#showcaseLegend').fadeOut(100,function(){if($(nextImage).data("imgLink")=="/"||$(nextImage).data("imgLink")==""){$('#showcaseLegend').find("a").hide();}
else{$('#showcaseLegend').find("a").show();};$('#showcaseLegend').find("a").attr("href",$(nextImage).data("imgLink"));$('#showcaseLegend h4').text($(nextImage).attr("alt"));$('#showcaseLegend').fadeIn(1000);$('#showcaseLegend').css("width",$('#showcaseLegend h4').outerWidth()+$('#showcaseLegend span').outerWidth());});$('.currentBackground').fadeOut(settings.imageFadeTime,function(){});var nextImage=$(".backgroundImage:data(imgCount="+nextImageNo+")");$(nextImage).fadeIn(settings.imageFadeTime,function(){}).addClass("currentBackground");globals.currentActiveSlide=nextImageNo;};$.fn.showcase=function(forward){var nextImageNo;var outDirection;var inDirection;if(forward){outDirection="left";inDirection="right";nextImageNo=parseInt(globals.currentActiveSlide,10)+1;if(globals.currentActiveSlide==globals.imgCount){nextImageNo=1;};}
else{outDirection="right";inDirection="left";nextImageNo=parseInt(globals.currentActiveSlide,10)-1;if(globals.currentActiveSlide==1){nextImageNo=globals.imgCount;};};var nextImage=$(".backgroundImage:data(imgCount="+nextImageNo+")");if(nextImage.length>0){$("#goNext").addClass("disabled");$("#goPrev").addClass("disabled");$("body").css("cursor","wait");$('#showcaseLegend').fadeOut(100,function(){if($(nextImage).data("imgLink")=="/"||$(nextImage).data("imgLink")==""){$('#showcaseLegend').find("a").hide();}
else{$('#showcaseLegend').find("a").show();};$('#showcaseLegend').find("a").attr("href",$(nextImage).data("imgLink"));$('#showcaseLegend h4').text($(nextImage).attr("alt"));$('#showcaseLegend').fadeIn(1000);$('#showcaseLegend').css("width",$('#showcaseLegend h4').outerWidth()+$('#showcaseLegend span').outerWidth());});$('.currentBackground').hide("slide",{direction:outDirection},1000,function(){$(this).removeClass("currentBackground");});nextImage.show("slide",{direction:inDirection},1000,function(){var currImg=$(this);$("body").css("cursor","default");var numberOfImages=$("#pageImages").children().length;var nextNumber,prevNumber;nextNumber=(currImg.data("imgCount")==numberOfImages)?1:currImg.data("imgCount")+1;prevNumber=(currImg.data("imgCount")==1)?numberOfImages:currImg.data("imgCount")-1;$("#goNext:first").attr("title",$("#MultiLanguageInterfaceText").children(".show").text()+" "+nextNumber+" / "+numberOfImages).removeClass("disabled");$("#goPrev:first").attr("title",$("#MultiLanguageInterfaceText").children(".show").text()+" "+prevNumber+" / "+numberOfImages).removeClass("disabled");}).addClass("currentBackground");globals.currentActiveSlide=nextImageNo;};};var randString=function(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=8;var randomstring='';for(i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1);};return randomstring;};$.fn.aedasBgImage.preLoadImage=function(imgLink,isFirst,imgNum){imgLink=$("#"+imgLink);$(imgLink).attr("rel");var src;if(settings.slideshow){src=$(imgLink).attr("rel");}
else{src=$(imgLink).attr("href");};if($.browser.msie){src=src+"?"+randString();};var img=new Image();$(img).data("imgCount",imgNum).attr("alt",$(imgLink).attr("title"));$(img).data("imgLink",$(imgLink).attr("href"));$(img).load(function(){$.fn.aedasBgImage.setImgProperties(this,isFirst,imgLink);if($("#imgThumbnails").find("img:data(imgCount="+$(this).data("imgCount")+")").length>0){$("#imgThumbnails").find("img:data(imgCount="+$(this).data("imgCount")+")").addClass("parentLoaded");};var nextImgNo=$(this).data("imgCount")+1;if($("#pageImages a:data(imgCount="+nextImgNo+")").length>0){var nextImage=$("#pageImages a:data(imgCount="+nextImgNo+")");if(isFirst){setTimeout("$.fn.aedasBgImage.preLoadImage('"+$(nextImage).attr("id")+"', false, "+nextImgNo+")",settings.preloadDelay);}
else{$.fn.aedasBgImage.preLoadImage($(nextImage).attr("id"),false,nextImgNo);};};}).attr('src',src).addClass("backgroundImage").hide().appendTo($('#siteContainer'));};$.fn.aedasBgImage.setImgProperties=function(img,isFirst,link){$(img).css({'top':globals.imgTop,'left':globals.imgLeft,'width':globals.imgNewWidth,'height':globals.imgNewHeight});if(isFirst){$('#showcaseLegend').find("a").attr("href",$(link).attr("href"));if($(link).attr("href")=="/"||$(link).attr("href")==""){$('#showcaseLegend').find("a").hide();}
else{$('#showcaseLegend').find("a").show();};$('#showcaseLegend h4').text($(img).attr("alt"));$('#showcaseLegend').fadeIn(1000);$('#showcaseLegend').css("width",$('#showcaseLegend h4').outerWidth()+$('#showcaseLegend span').outerWidth())
$(img).addClass("currentBackground");if(typeof settings.onfirstImageShown=='function'){settings.onfirstImageShown.call();}
$(img).css("display","block");};};})(jQuery);﻿$.fn.aedasVerticalScrollRemove=function(){return this.each(function(){$(".ui-slider-handle",$(this).parent()).remove();});};$.fn.aedasVerticalScroll=function(){var positionBar=function(content,scrollbar){scrollbar.css({"position":"absolute","top":$(content).position().top,"left":$(content).width()+5});};return this.each(function(){var scrollPane=this;var panelHeight=parseInt($(this).css('height'),10);var scrollContent=$(scrollPane).children('div:first');var difference=$(scrollContent).height()-$(scrollPane).height();if(difference>0){var sliderWrap;if($(scrollPane).next().hasClass("slider-wrap-vertical")){sliderWrap=$(scrollPane).next();sliderWrap.attr("style","");sliderWrap.html("");}
else{sliderWrap=$("<div></div>").addClass('slider-wrap').addClass('slider-wrap-vertical').insertAfter($(scrollPane));};positionBar(this,sliderWrap);var sliderVertical=$("<div></div>").addClass('slider-vertical').appendTo(sliderWrap);var sliderHandle=".ui-slider-handle";var uiSlider=".ui-slider";$(sliderWrap).css('height',$(this).css('height'));$(scrollPane).css('overflow','hidden');var proportion=difference/$(scrollContent).height();var handleHeight=Math.round((1-proportion)*$(scrollPane).height());$(sliderVertical).slider({orientation:"vertical",range:"max",min:0,max:100,value:100,slide:function(event,ui){var topValue=-((100-ui.value)*difference/100);$(scrollContent).css({top:topValue});}});sliderHandle=sliderVertical.children('.ui-slider-handle');uiSlider=sliderWrap.children('.ui-slider');sliderVertical.parent().click(function(e){var delta=0;var speed=15;if(e.pageY>$(this).find(".ui-slider-range").offset().top){delta=-1;speed=e.pageY-$(this).find(".ui-slider-range").offset().top;}
else{delta=1;speed=$(this).find(".ui-slider-range").offset().top-e.pageY;speed=speed*2;};var sliderVal=$(sliderVertical).slider("value");sliderVal+=(delta*speed);$(sliderVertical).slider("value",sliderVal);var topValue=-((100-sliderVal)*difference/100);if(topValue>0){topValue=0;};if(Math.abs(topValue)>difference){topValue=(-1)*difference;};$(scrollContent).css({top:topValue});return false;});$(sliderHandle).css({height:handleHeight,'margin-bottom':-0.5*handleHeight,'right':-2});var origSliderHeight=$(sliderVertical).height();var sliderHeight=origSliderHeight-handleHeight;var sliderMargin=(origSliderHeight-sliderHeight)*0.5;$(uiSlider).css({height:sliderHeight,'margin-top':sliderMargin});if(!isiPad()){$(scrollPane).unbind("mousewheel.verticalScroll");$(scrollPane).bind("mousewheel.verticalScroll",function(event,delta){var speed=5;var sliderVal=$(sliderVertical).slider("value");sliderVal+=(delta*speed);$(sliderVertical).slider("value",sliderVal);var topValue=-((100-sliderVal)*difference/100);if(topValue>0){topValue=0;};if(Math.abs(topValue)>difference){topValue=(-1)*difference;};$(scrollContent).css({top:topValue});event.preventDefault();});};if(isiPad()){var tDiv=$(scrollPane).Touchable();tDiv.unbind('touchablemove.verticalScroll');tDiv.bind('touchablemove.verticalScroll',function(e,touch){var speed=5;var sliderVal=$(sliderVertical).slider("value");var direction;if(touch.currentStartDelta.y>0){direction=1;}
else{direction=-1;};sliderVal+=(direction*speed);$(sliderVertical).slider("value",sliderVal);var topValue=-((100-sliderVal)*difference/100);if(topValue>0){topValue=0;};if(Math.abs(topValue)>difference){topValue=(-1)*difference;};$(scrollContent).css({top:topValue,height:$(scrollContent).height()});e.preventDefault();});};}
else{$(scrollPane).unbind('touchablemove.verticalScroll');$(scrollPane).unbind("mousewheel.verticalScroll");if($(scrollPane).next().hasClass("slider-wrap-vertical")){$(scrollPane).next().remove();};}});return false;};$.fn.aedasHorizontalScroll=function(){var thisScrollPane;var hasScrollBars=false;var addScrollBar=function(scrollPane){hasScrollBars=true;var scrollContent=$('.hscrollContent',scrollPane);var scrollBarWrap=$("<div></div>").appendTo($(scrollPane)).addClass("hscrollBarWrap");var scrollBar=$("<div></div>").appendTo($(scrollBarWrap)).addClass("hscrollBar");$(scrollBar).slider({slide:function(e,ui){if(scrollContent.width()>scrollPane.width()){scrollContent.css('margin-left',Math.round(ui.value/100*(scrollPane.width()-scrollContent.width()))+'px');}
else{scrollContent.css('margin-left',0);};},stop:function(e,ui){checkLeftRightControls();}});var handleHelper=scrollBar.find('.ui-slider-handle').mousedown(function(){scrollBar.width(handleHelper.width());}).mouseup(function(){scrollBar.width('100%');}).append('<span class="ui-icon ui-icon-grip-dotted-vertical"></span>').wrap('<div class="ui-handle-helper-parent"></div>').parent();scrollPane.css('overflow','hidden');addLeftRight(scrollPane.parent(),scrollBar,scrollContent,scrollPane);function sizeScrollbar(){if(hasScrollBars){var remainder=scrollContent.width()-scrollPane.width();var proportion=remainder/scrollContent.width();var handleSize=scrollPane.width()-(proportion*scrollPane.width());scrollBar.find('.ui-slider-handle').css({width:handleSize,'margin-left':-handleSize/2});handleHelper.width('').width(scrollBar.width()-handleSize);}};function resetValue(){if(hasScrollBars){var remainder=scrollPane.width()-scrollContent.width();var leftVal=scrollContent.css('margin-left')=='auto'?0:parseInt(scrollContent.css('margin-left'),10);var percentage=Math.round(leftVal/remainder*100);scrollBar.slider("value",percentage);}};function reflowContent(){if(hasScrollBars){var showing=scrollContent.width()+parseInt(scrollContent.css('margin-left'),10);var gap=scrollPane.width()-showing;if(gap>0){scrollContent.css('margin-left',parseInt(scrollContent.css('margin-left'),10)+gap);}}};checkLeftRightControls=function(){var scroll=parseInt($(".ui-slider-handle").css("left"),10);if(scroll==0){$(".goLeft").hide();}
else{$(".goLeft").show();};if(scroll==100){$(".goRight").hide();}
else{$(".goRight").show();};};$(window).bind("resize.horizScroll",function(){resetValue();sizeScrollbar();reflowContent();});setTimeout(sizeScrollbar,10);};var addNonScrollBar=function(scrollPane){hasScrollBars=false;scrollPane.css('overflow','hidden');var scrollBarWrap=$("<div></div>").appendTo($(scrollPane)).addClass("hscrollBarWrapDummy");$(window).bind('resize',function(){});$(".goLeft").hide();$(".goRight").hide();};var removeScrollBars=function(scrollPane){$(".hscrollBar",$(scrollPane).children(".hscrollBarWrap")).slider("destroy");$(scrollPane).children(".hscrollBarWrap").remove();$(window).unbind("resize.horizScroll");$(".goLeft").remove();$(".goRight").remove();};var removeNonScrollBars=function(scrollPane){$(scrollPane).children(".hscrollBarWrapDummy").remove();};var addLeftRight=function(browser,scrollBar,scrollContent,scrollPane){var goLeft=$("<div></div>").addClass("goLeft").hide();var goRight=$("<div></div>").addClass("goRight");if($(".searchResults").length>0){$(goLeft).css("left",35);};$(goLeft).appendTo($(browser).parent());$(goRight).appendTo($(browser).parent());goLeft.hover(function(){$(this).toggleClass("goLeft_MO");});goLeft.click(function(){var scrollDistance=scrollContent.width()-scrollPane.width();var oneSectionWidth=$(".browserSector:first",scrollContent).width();var scrollPercent=(100/scrollDistance)*oneSectionWidth;var newVal=parseInt(scrollBar.slider("value"),10)-scrollPercent;newVal=newVal<0?0:newVal;newVal=newVal>100?100:newVal;scrollBar.slider("value",newVal);if(scrollContent.width()>scrollPane.width()){var val=Math.round(parseInt(scrollBar.slider("value"),10)/100*(scrollPane.width()-scrollContent.width()));scrollContent.animate({'margin-left':val},500);}
checkLeftRightControls();});goRight.hover(function(){$(this).toggleClass("goRight_MO");});goRight.click(function(){var scrollDistance=scrollContent.width()-scrollPane.width();var oneSectionWidth=$(".browserSector:first",scrollContent).width();var scrollPercent=(100/scrollDistance)*oneSectionWidth;var newVal=parseInt(scrollBar.slider("value"),10)+scrollPercent;newVal=newVal>100?100:newVal;scrollBar.slider("value",newVal);if(scrollContent.width()>scrollPane.width()){var val=Math.round(parseInt(scrollBar.slider("value"),10)/100*(scrollPane.width()-scrollContent.width()));scrollBar.slider("value",newVal);scrollContent.animate({'margin-left':val},500);}
checkLeftRightControls();});};return this.each(function(){thisScrollPane=$(this);var scrollContent=$('.hscrollContent',this);if(scrollContent.width()>thisScrollPane.width()+16){addScrollBar(thisScrollPane);}
else{addNonScrollBar(thisScrollPane);}
$(window).resize(function(){var scrollContent=$('.hscrollContent',thisScrollPane);if(scrollContent.width()>thisScrollPane.width()+16){if(!hasScrollBars){removeNonScrollBars(thisScrollPane);addScrollBar(thisScrollPane);}}
else{if(hasScrollBars){removeScrollBars(thisScrollPane);addNonScrollBar(thisScrollPane);};}});});return false;};﻿$.fn.aedasSearch=function(){return this.each(function(){var animateSpeed=200;var searchOpen=false;$(this).children("input").focus(function(){if(($(this).val()=="")&&(searchOpen==false)){searchOpen=true;$(this).parent().animate({'width':247},animateSpeed);$(this).animate({'width':230},animateSpeed,function(){$(this).animate({'width':parseInt($(this).width(),10)-parseInt($(this).parent().children(".searchBtn").outerWidth(),10)},animateSpeed,function(){$(this).parent().children(".searchBtn").fadeIn(animateSpeed);});});};});$(this).children("input").focusout(function(){if(($(this).val()=="")&&(searchOpen==true)){searchOpen=false;$(this).parent().children(".searchBtn").fadeOut(animateSpeed,function(){$(this).parent().children("input").animate({'width':parseInt($(this).parent().children("input").width(),10)+parseInt($(this).outerWidth(),10)},animateSpeed,function(){$(this).parent().animate({'width':142},animateSpeed);$(this).parent().children("input").animate({'width':125},animateSpeed);});});}});$(this).children("input").keydown(function(){if(event.keyCode==13){window.location="/Search?searchTerm="+escape($(this).val());}});$(this).children(".searchBtn").click(function(){window.location="/Search?searchTerm="+escape($(this).parent().children("input").val());});});};(function($){$.widget("ui.accordion",{options:{active:0,animated:'slide',autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase();}},_create:function(){var o=this.options,self=this;this.running=0;this.element.addClass("ui-accordion ui-widget ui-helper-reset");this.element.children("li").addClass("ui-accordion-li-fix");this.headers=this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){$(this).addClass('ui-state-hover');}).bind("mouseleave.accordion",function(){$(this).removeClass('ui-state-hover');}).bind("focus.accordion",function(){$(this).addClass('ui-state-focus');}).bind("blur.accordion",function(){$(this).removeClass('ui-state-focus');});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(o.navigation){var current=this.element.find("a").filter(o.navigationFilter);if(current.length){var header=current.closest(".ui-accordion-header");if(header.length){this.active=header;}else{this.active=current.closest(".ui-accordion-content").prev();}}}
this.active=this._findActive(this.active||o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass('ui-accordion-content-active');this._createIcons();this.resize();this.element.attr('role','tablist');this.headers.attr('role','tab').bind('keydown',function(event){return self._keydown(event);}).next().attr('role','tabpanel');this.headers.not(this.active||"").attr('aria-expanded','false').attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr('tabIndex','0');}else{this.active.attr('aria-expanded','true').attr('tabIndex','0');}
if(!$.browser.safari)
this.headers.find('a').attr('tabIndex','-1');if(o.event){this.headers.bind((o.event)+".accordion",function(event){self._clickHandler.call(self,event,this);event.preventDefault();});}},_createIcons:function(){var o=this.options;if(o.icons){$("<span/>").addClass("ui-icon "+o.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);this.element.addClass("ui-accordion-icons");}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons");},destroy:function(){var o=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind('.accordion').removeData('accordion');this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex");this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var contents=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(o.autoHeight||o.fillHeight){contents.css("height","");}
return this;},_setOption:function(key,value){$.Widget.prototype._setOption.apply(this,arguments);if(key=="active"){this.activate(value);}
if(key=="icons"){this._destroyIcons();if(value){this._createIcons();}}},_keydown:function(event){var o=this.options,keyCode=$.ui.keyCode;if(o.disabled||event.altKey||event.ctrlKey)
return;var length=this.headers.length;var currentIndex=this.headers.index(event.target);var toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._clickHandler({target:event.target},event.target);event.preventDefault();}
if(toFocus){$(event.target).attr('tabIndex','-1');$(toFocus).attr('tabIndex','0');toFocus.focus();return false;}
return true;},resize:function(){var o=this.options,maxHeight;if(o.fillSpace){if($.browser.msie){var defOverflow=this.element.parent().css('overflow');this.element.parent().css('overflow','hidden');}
maxHeight=this.element.parent().height();if($.browser.msie){this.element.parent().css('overflow',defOverflow);}
this.headers.each(function(){maxHeight-=$(this).outerHeight(true);});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()));}).css('overflow','auto');}else if(o.autoHeight){maxHeight=0;this.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).height());}).height(maxHeight);}
return this;},activate:function(index){this.options.active=index;var active=this._findActive(index)[0];this._clickHandler({target:active},active);return this;},_findActive:function(selector){return selector?typeof selector=="number"?this.headers.filter(":eq("+selector+")"):this.headers.not(this.headers.not(selector)):selector===false?$([]):this.headers.filter(":eq(0)");},_clickHandler:function(event,target){var o=this.options;if(o.disabled)
return;if(!event.target){if(!o.collapsible)
return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);this.active.next().addClass('ui-accordion-content-active');var toHide=this.active.next(),data={options:o,newHeader:$([]),oldHeader:o.active,newContent:$([]),oldContent:toHide},toShow=(this.active=$([]));this._toggle(toShow,toHide,data);return;}
var clicked=$(event.currentTarget||target);var clickedIsActive=clicked[0]==this.active[0];o.active=o.collapsible&&clickedIsActive?false:$('.ui-accordion-header',this.element).index(clicked);if(this.running||(!o.collapsible&&clickedIsActive)){return;}
this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);if(!clickedIsActive){clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);clicked.next().addClass('ui-accordion-content-active');}
var toShow=clicked.next(),toHide=this.active.next(),data={options:o,newHeader:clickedIsActive&&o.collapsible?$([]):clicked,oldHeader:this.active,newContent:clickedIsActive&&o.collapsible?$([]):toShow,oldContent:toHide},down=this.headers.index(this.active[0])>this.headers.index(clicked[0]);this.active=clickedIsActive?$([]):clicked;this._toggle(toShow,toHide,data,clickedIsActive,down);return;},_toggle:function(toShow,toHide,data,clickedIsActive,down){var o=this.options,self=this;this.toShow=toShow;this.toHide=toHide;this.data=data;var complete=function(){if(!self)return;return self._completed.apply(self,arguments);};this._trigger("changestart",null,this.data);this.running=toHide.size()===0?toShow.size():toHide.size();if(o.animated){var animOptions={};if(o.collapsible&&clickedIsActive){animOptions={toShow:$([]),toHide:toHide,complete:complete,down:down,autoHeight:o.autoHeight||o.fillSpace};}else{animOptions={toShow:toShow,toHide:toHide,complete:complete,down:down,autoHeight:o.autoHeight||o.fillSpace};}
if(!o.proxied){o.proxied=o.animated;}
if(!o.proxiedDuration){o.proxiedDuration=o.duration;}
o.animated=$.isFunction(o.proxied)?o.proxied(animOptions):o.proxied;o.duration=$.isFunction(o.proxiedDuration)?o.proxiedDuration(animOptions):o.proxiedDuration;var animations=$.ui.accordion.animations,duration=o.duration,easing=o.animated;if(easing&&!animations[easing]&&!$.easing[easing]){easing='slide';}
if(!animations[easing]){animations[easing]=function(options){this.slide(options,{easing:easing,duration:duration||700});};}
animations[easing](animOptions);}else{if(o.collapsible&&clickedIsActive){toShow.toggle();}else{toHide.hide();toShow.show();}
complete(true);}
toHide.prev().attr('aria-expanded','false').attr("tabIndex","-1").blur();toShow.prev().attr('aria-expanded','true').attr("tabIndex","0").focus();},_completed:function(cancel){var o=this.options;this.running=cancel?0:--this.running;if(this.running)return;if(o.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""});}
this.toHide.removeClass("ui-accordion-content-active");this._trigger('change',null,this.data);}});$.extend($.ui.accordion,{version:"1.8.2",animations:{slide:function(options,additions){options=$.extend({easing:"swing",duration:300},options,additions);if(!options.toHide.size()){options.toShow.animate({height:"show"},options);return;}
if(!options.toShow.size()){options.toHide.animate({height:"hide"},options);return;}
var overflow=options.toShow.css('overflow'),percentDone=0,showProps={},hideProps={},fxAttrs=["height","paddingTop","paddingBottom"],originalWidth;var s=options.toShow;originalWidth=s[0].style.width;s.width(parseInt(s.parent().width(),10)-parseInt(s.css("paddingLeft"),10)-parseInt(s.css("paddingRight"),10)-(parseInt(s.css("borderLeftWidth"),10)||0)-(parseInt(s.css("borderRightWidth"),10)||0));$.each(fxAttrs,function(i,prop){hideProps[prop]='hide';var parts=(''+$.css(options.toShow[0],prop)).match(/^([\d+-.]+)(.*)$/);showProps[prop]={value:parts[1],unit:parts[2]||'px'};});options.toShow.css({height:0,overflow:'hidden'}).show();options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{step:function(now,settings){if(settings.prop=='height'){percentDone=(settings.end-settings.start===0)?0:(settings.now-settings.start)/(settings.end-settings.start);}
options.toShow[0].style[settings.prop]=(percentDone*showProps[settings.prop].value)+showProps[settings.prop].unit;},duration:options.duration,easing:options.easing,complete:function(){if(!options.autoHeight){options.toShow.css("height","");}
options.toShow.css("width",originalWidth);options.toShow.css({overflow:overflow});options.complete();}});},bounceslide:function(options){this.slide(options,{easing:options.down?"easeOutBounce":"swing",duration:options.down?1000:200});}}});})(jQuery);﻿
(function($){$.fn.aedasCountDownClock=function(options){var opts=$.extend({},$.fn.aedasCountDownClock.defaults,options);return this.each(function(){var clockHolder=$(this);clockHolder.find("a").attr("href",opts.linkURL);clockHolder.click(function(){window.location=opts.linkURL;});clockHolder.find(".label").text(opts.countDownText);opts.CountStepper=Math.ceil(opts.CountStepper);if(opts.CountStepper==0){opts.CountActive=false;};opts.SetTimeOutPeriod=(Math.abs(opts.CountStepper)-1)*1000+990;var dthen=new Date(opts.countDownToDate);var dnow=new Date();var ddiff;if(opts.CountStepper>0){ddiff=new Date(dnow-dthen);}
else{ddiff=new Date(dthen-dnow);}
gsecs=Math.floor(ddiff.valueOf()/1000);$.fn.aedasCountDownClock.CountBack(gsecs,JSON.stringify(opts),clockHolder.attr("id"));clockHolder.hover(function(){clockHolder.find(".label").toggleClass("mouseOver");});});};$.fn.aedasCountDownClock.defaults={countDownText:"The Event",countDownToDate:"12/31/2011 5:00 AM",CountStepper:-1,LeadingZero:true,CountActive:true,SetTimeOutPeriod:0,linkURL:"http://www.aedas.com"};$.fn.aedasCountDownClock.CountBack=function(secs,sOpts,container){var clockHolder=$("#"+container);var opts;if(sOpts.SetTimeOutPeriod){opts=sOpts;}
else{opts=JSON.parse(sOpts);};if(secs<0){return;}
var days=$.fn.aedasCountDownClock.calcage(secs,86400,100000,opts);var hours=$.fn.aedasCountDownClock.calcage(secs,3600,24,opts);var mins=$.fn.aedasCountDownClock.calcage(secs,60,60,opts);var seconds=$.fn.aedasCountDownClock.calcage(secs,1,60,opts);clockHolder.find(".days").text(days);clockHolder.find(".hours").text(hours);clockHolder.find(".mins").text(mins);clockHolder.find(".secs").text(seconds);if(opts.CountActive){var obStr=JSON.stringify(opts);setTimeout("$.fn.aedasCountDownClock.CountBack("+(secs+opts.CountStepper)+", "+obStr+", '"+clockHolder.attr("id")+"')",opts.SetTimeOutPeriod);};};$.fn.aedasCountDownClock.calcage=function(secs,num1,num2,opts){var s=((Math.floor(secs/num1))%num2).toString();if(opts.LeadingZero&&s.length<2){s="0"+s;};return s;};})(jQuery);(function($){$.fn.Touchable=function(conf){return this.each(function(){var t=$(this).data['Touchable']=new Touchable(this,conf);return t;});}
$.fn.newHover=function(fn1,fn2,disableHover){return this.each(function(){$(this).bind('newHoverIn',fn1).bind('newHoverOut',fn2);});}
$.fn.newHover2=function(fn1,fn2){return this.each(function(){$(this).bind('newHoverIn2',fn1).bind('newHoverOut2',fn2);});}
$.Touchable=Touchable;function Touchable(elem,conf)
{this.logging=false;var log=function(a){if(self.logging){console.log(arguments);}};this.elem=elem;this.$elem=$(elem);this.is_doubleTap=false;this.is_currentlyTouching=false;this.isOneFingerGesture=false;this.startTouch={x:0,y:0};this.currentTouch={x:0,y:0};this.previousTouch={x:0,y:0};this.currentDelta={x:0,y:0};this.currentStartDelta={x:0,y:0};this.currentPosition={x:0,y:0};this.doubleTapTimer=null,this.longTapTimer=null;var self=this;if(typeof conf!=='undefined'){if(typeof conf.logging!=='undefined'){this.logging=conf.logging;}}
var addEventListener=elem.addEventListener||elem.attachEvent
var removeEventListener=elem.removeEventListener||elem.detachEvent
addEventListener.call(elem,'touchstart',function(){self.$elem.trigger('touchstart')},false);addEventListener.call(elem,'touchend',function(){self.$elem.trigger('touchend')},false);addEventListener.call(elem,'touchmove',function(){self.$elem.trigger('touchmove')},false);addEventListener.call(elem,'touchstart',touchstart,false);this.$elem.mousedown(touchstart);function touchstart(e){if(typeof e.touches!=="undefined")
{log('Touchable Touchstart touches length '+e.touches.length);if(e.touches.length!==1&&e.touches.length!==2){return false;}
if(self.isCurrentlyTouching){return false;}
self.isCurrentlyTouching=true;if(e.touches.length==1){self.isOneFingerGesture=true;self.startTouch.x=self.previousTouch.x=e.touches[0].clientX;self.startTouch.y=self.previousTouch.y=e.touches[0].clientY;}else if(e.touches.length==2){self.isOneFingerGesture=false;if(e.touches[0].clientY>e.touches[1].clientY){self.startTouch.x=self.previousTouch.x=e.touches[0].clientX;self.startTouch.y=self.previousTouch.y=e.touches[0].clientY;}else{self.startTouch.x=self.previousTouch.x=self.touches[1].clientX;self.startTouch.y=self.previousTouch.y=self.touches[1].clientY;}}
addEventListener.call(document,'touchmove',touchmove,false);addEventListener.call(document,'touchend',touchend,false);}else{log('Touchable Touchstart touches length '+e.pageX+' '+e.pageY);self.startTouch.x=self.previousTouch.x=e.pageX;self.startTouch.y=self.previousTouch.y=e.pageY;$(document).mousemove(touchmove);$(document).mouseup(touchend);}
if(!(e.currentTarget===self.$elem.get(0)))e.preventDefault()
if(!self.inDoubleTap){self.inDoubleTap=true;self.doubleTapTimer=setTimeout(function(){self.inDoubleTap=false;},500);}else{log('Touchable doubleTap');self.$elem.trigger('doubleTap',self);clearTimeout(self.doubleTapTimer);self.inDoubleTap=false;}
self.longTapTimer=setTimeout(function(){log('Touchable longTap');$(self.elem).trigger('longTap',self);},1000);log('Touchable Tap');$(self.elem).trigger('tap',self);$(self.elem).trigger('touchablestart',self);}
function touchmove(e){if(typeof e.touches!=='undefined'){log('Touchable Touchsmove touches length '+e.touches.length);if(e.touches.length!==1&&e.touches.length!==2)
return false;if(e.touches.length==1||self.isOneFingerGesture){self.currentTouch.x=e.touches[0].clientX;self.currentTouch.y=e.touches[0].clientY;}else if(self.touches.length==2&&!self.isOneFingerGesture){if(e.touches[0].clientY>e.touches[1].clientY){self.currentTouch.x=e.touches[0].clientX;self.currentTouch.y=e.touches[0].clientY;}else{self.currentTouch.x=e.touches[1].clientX;self.currentTouch.y=e.touches[1].clientY;}}}else{self.currentTouch.x=e.pageX;self.currentTouch.y=e.pageY;}
$(self.elem).removeClass('webkitAnimate');self.currentDelta.x=(self.currentTouch.x-self.previousTouch.x);self.currentDelta.y=(self.currentTouch.y-self.previousTouch.y);self.currentStartDelta.x=(self.currentTouch.x-self.startTouch.x);self.currentStartDelta.y=(self.currentTouch.y-self.startTouch.y);self.currentPosition.x=self.currentPosition.x+self.currentDelta.x;self.currentPosition.y=self.currentPosition.y+self.currentDelta.y;self.previousTouch.x=self.currentTouch.x;self.previousTouch.y=self.currentTouch.y;log('Touchable Touchablemove self e.target'+e.target+'e.currentTarget '+e.currentTarget+' x:'+self.currentStartDelta.x);self.target=e.target;self.currentTarget=e.currentTarget;$(self.elem).trigger('touchablemove',self);if(self.longTapTimer)clearTimeout(self.longTapTimer);}
function touchend(e){if(typeof e.touches!=='undefined'){if(e.targetTouches.length>0)
return false;removeEventListener.call(self.elem,'touchmove',touchmove,true);removeEventListener.call(self.elem,'touchend',touchend,true);}else{$(document).unbind('mousemove',touchmove);$(document).unbind('mouseup',touchend);}
self.isCurrentlyTouching=false;if(self.longTapTimer)clearTimeout(self.longTapTimer);log('Touchable Touchend self '+self.currentStartDelta.x);$(self.elem).trigger('touchableend',self);log('Touchable: touchableend');}}})(jQuery);
