onHistoryChange=function(){};(function(A){if(typeof console==="undefined"){console=typeof window.console!=="undefined"?window.console:{}}console.log=console.log||function(){};console.debug=console.debug||console.log;console.warn=console.warn||console.log;console.error=console.error||function(){var B=[];for(var C=0;C<arguments.length;C++){B.push(arguments[C])}alert(B.join("\n"))};console.trace=console.trace||console.log;console.group=console.group||console.log;console.groupEnd=console.groupEnd||console.log;console.profile=console.profile||console.log;console.profileEnd=console.profileEnd||console.log;A.History={options:{debug:false},state:"",$window:null,$iframe:null,handlers:{generic:[],specific:{}},format:function(B){B=B.replace(/^.+?#/g,"").replace(/^#?\/?|\/?$/g,"");return B},getState:function(){var B=A.History;return B.state},setState:function(C){var B=A.History;C=B.format(C);B.state=C;return B.state},getHash:function(){var B=A.History;var C=window.location.hash||location.hash;C=B.format(C);return C},setHash:function(C){var B=A.History;C=A.History.format(C);C=C.replace(/^\/?|\/?(\?)|\/?$/g,"/$1");if(typeof window.location.hash!=="undefined"){window.location.hash=C}else{location.hash=C}if(A.browser.msie&&parseInt(A.browser.version,10)<8){A.History.$iframe.contentWindow.document.open();A.History.$iframe.contentWindow.document.close();A.History.$iframe.contentWindow.document.location.hash=C}},go:function(C){var B=A.History;C=B.format(C);var D=B.getHash();if(D!==C){B.setHash(C)}else{B.setState(C);B.trigger()}return true},hashchange:function(E){var B=A.History;if(B.options.debug){console.debug("History.hashchange",this,arguments)}var D=B.getHash();var C=B.getState();if((!B.$iframe&&C===D)||(B.$iframe&&B.hash===B.$iframe.contentWindow.document.location.hash)){return false}if(C===D){return false}B.setState(D);B.trigger();return true},bind:function(D,B){var C=A.History;if(B){if(typeof C.handlers.specific[D]==="undefined"){C.handlers.specific[D]=[]}C.handlers.specific[D].push(B)}else{B=D;C.handlers.generic.push(B)}return true},trigger:function(F){var D=A.History;if(typeof F==="undefined"){F=D.getState()}var B,G,C,E;if(typeof D.handlers.specific[F]!=="undefined"){E=D.handlers.specific[F];for(B=0,G=E.length;B<G;++B){C=E[B];C(F)}}E=D.handlers.generic;for(B=0,G=E.length;B<G;++B){C=E[B];C(F)}return true},construct:function(){var B=A.History;A(document).ready(function(){B.domReady()});return true},configure:function(B){var C=A.History;C.options=A.extend(C.options,B);return true},domReadied:false,domReady:function(){var B=A.History;if(B.domRedied){return }B.domRedied=true;B.$window=A(window);B.$window.bind("hashchange",this.hashchange);setTimeout(B.hashchangeLoader,200);return true},hashchangeLoader:function(){var C=A.History;if(!(A.browser.msie&&parseInt(A.browser.version)>=8)){var B;if(A.browser.msie){C.$iframe=A('<iframe id="jquery-history-iframe" style="display: none;"></$iframe>').prependTo(document.body)[0];try{C.$iframe.contentWindow.document.open();C.$iframe.contentWindow.document.close()}catch(E){}var D=C.getHash();if(D){C.$iframe.contentWindow.document.location.hash=D}B=function(){var F=C.format(C.$iframe.contentWindow.document.location.hash);if(C.getState()!==F){C.setHash(C.$iframe.contentWindow.document.location.hash)}var G=C.getHash();if(C.getState()!==G){C.go(G)}}}else{B=function(){var F=C.getHash();if(C.getState()!==F){C.go(F)}}}setInterval(B,200)}else{var D=C.getHash();if(D){C.$window.trigger("hashchange")}}return true}};A.History.construct()})(jQuery);(function(A,B){A.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var C=this;this.element.bind("mousedown."+this.widgetName,function(D){return C._mouseDown(D)}).bind("click."+this.widgetName,function(D){if(true===A.data(D.target,C.widgetName+".preventClickEvent")){A.removeData(D.target,C.widgetName+".preventClickEvent");D.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(E){E.originalEvent=E.originalEvent||{};if(E.originalEvent.mouseHandled){return }(this._mouseStarted&&this._mouseUp(E));this._mouseDownEvent=E;var D=this,F=(E.which==1),C=(typeof this.options.cancel=="string"?A(E.target).parents().add(E.target).filter(this.options.cancel).length:false);if(!F||C||!this._mouseCapture(E)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){D.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(E)&&this._mouseDelayMet(E)){this._mouseStarted=(this._mouseStart(E)!==false);if(!this._mouseStarted){E.preventDefault();return true}}if(true===A.data(E.target,this.widgetName+".preventClickEvent")){A.removeData(E.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(G){return D._mouseMove(G)};this._mouseUpDelegate=function(G){return D._mouseUp(G)};A(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);E.preventDefault();E.originalEvent.mouseHandled=true;return true},_mouseMove:function(C){if(A.browser.msie&&!(document.documentMode>=9)&&!C.button){return this._mouseUp(C)}if(this._mouseStarted){this._mouseDrag(C);return C.preventDefault()}if(this._mouseDistanceMet(C)&&this._mouseDelayMet(C)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,C)!==false);(this._mouseStarted?this._mouseDrag(C):this._mouseUp(C))}return !this._mouseStarted},_mouseUp:function(C){A(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(C.target==this._mouseDownEvent.target){A.data(C.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(C)}return false},_mouseDistanceMet:function(C){return(Math.max(Math.abs(this._mouseDownEvent.pageX-C.pageX),Math.abs(this._mouseDownEvent.pageY-C.pageY))>=this.options.distance)},_mouseDelayMet:function(C){return this.mouseDelayMet},_mouseStart:function(C){},_mouseDrag:function(C){},_mouseStop:function(C){},_mouseCapture:function(C){return true}})})(jQuery);(function(A,B){A.widget("ui.draggable",A.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this},_mouseCapture:function(C){var D=this.options;if(this.helper||D.disabled||A(C.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(C);if(!this.handle){return false}return true},_mouseStart:function(C){var D=this.options;this.helper=this._createHelper(C);this._cacheHelperProportions();if(A.ui.ddmanager){A.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};A.extend(this.offset,{click:{left:C.pageX-this.offset.left,top:C.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(C);this.originalPageX=C.pageX;this.originalPageY=C.pageY;(D.cursorAt&&this._adjustOffsetFromHelper(D.cursorAt));if(D.containment){this._setContainment()}if(this._trigger("start",C)===false){this._clear();return false}this._cacheHelperProportions();if(A.ui.ddmanager&&!D.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,C)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(C,true);return true},_mouseDrag:function(C,E){this.position=this._generatePosition(C);this.positionAbs=this._convertPositionTo("absolute");if(!E){var D=this._uiHash();if(this._trigger("drag",C,D)===false){this._mouseUp({});return false}this.position=D.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,C)}return false},_mouseStop:function(D){var E=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){E=A.ui.ddmanager.drop(this,D)}if(this.dropped){E=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original"){return false}if((this.options.revert=="invalid"&&!E)||(this.options.revert=="valid"&&E)||this.options.revert===true||(A.isFunction(this.options.revert)&&this.options.revert.call(this.element,E))){var C=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(C._trigger("stop",D)!==false){C._clear()}})}else{if(this._trigger("stop",D)!==false){this._clear()}}return false},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(C){var D=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==C.target){D=true}});return D},_createHelper:function(D){var E=this.options;var C=A.isFunction(E.helper)?A(E.helper.apply(this.element[0],[D])):(E.helper=="clone"?this.element.clone():this.element);if(!C.parents("body").length){C.appendTo((E.appendTo=="parent"?this.element[0].parentNode:E.appendTo))}if(C[0]!=this.element[0]&&!(/(fixed|absolute)/).test(C.css("position"))){C.css("position","absolute")}return C},_adjustOffsetFromHelper:function(C){if(typeof C=="string"){C=C.split(" ")}if(A.isArray(C)){C={left:+C[0],top:+C[1]||0}}if("left" in C){this.offset.click.left=C.left+this.margins.left}if("right" in C){this.offset.click.left=this.helperProportions.width-C.right+this.margins.left}if("top" in C){this.offset.click.top=C.top+this.margins.top}if("bottom" in C){this.offset.click.top=this.helperProportions.height-C.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var C=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0])){C.left+=this.scrollParent.scrollLeft();C.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){C={top:0,left:0}}return{top:C.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:C.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var C=this.element.position();return{top:C.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:C.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var F=this.options;if(F.containment=="parent"){F.containment=this.helper[0].parentNode}if(F.containment=="document"||F.containment=="window"){this.containment=[(F.containment=="document"?0:A(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(F.containment=="document"?0:A(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(F.containment=="document"?0:A(window).scrollLeft())+A(F.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(F.containment=="document"?0:A(window).scrollTop())+(A(F.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(F.containment)&&F.containment.constructor!=Array){var D=A(F.containment)[0];if(!D){return }var E=A(F.containment).offset();var C=(A(D).css("overflow")!="hidden");this.containment=[E.left+(parseInt(A(D).css("borderLeftWidth"),10)||0)+(parseInt(A(D).css("paddingLeft"),10)||0),E.top+(parseInt(A(D).css("borderTopWidth"),10)||0)+(parseInt(A(D).css("paddingTop"),10)||0),E.left+(C?Math.max(D.scrollWidth,D.offsetWidth):D.offsetWidth)-(parseInt(A(D).css("borderLeftWidth"),10)||0)-(parseInt(A(D).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,E.top+(C?Math.max(D.scrollHeight,D.offsetHeight):D.offsetHeight)-(parseInt(A(D).css("borderTopWidth"),10)||0)-(parseInt(A(D).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}else{if(F.containment.constructor==Array){this.containment=F.containment}}},_convertPositionTo:function(F,H){if(!H){H=this.position}var D=F=="absolute"?1:-1;var E=this.options,C=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,G=(/(html|body)/i).test(C[0].tagName);return{top:(H.top+this.offset.relative.top*D+this.offset.parent.top*D-(A.browser.safari&&A.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(G?0:C.scrollTop()))*D)),left:(H.left+this.offset.relative.left*D+this.offset.parent.left*D-(A.browser.safari&&A.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():G?0:C.scrollLeft())*D))}},_generatePosition:function(F){var I=this.options,C=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&A.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,J=(/(html|body)/i).test(C[0].tagName);var E=F.pageX;var D=F.pageY;if(this.originalPosition){if(this.containment){if(F.pageX-this.offset.click.left<this.containment[0]){E=this.containment[0]+this.offset.click.left}if(F.pageY-this.offset.click.top<this.containment[1]){D=this.containment[1]+this.offset.click.top}if(F.pageX-this.offset.click.left>this.containment[2]){E=this.containment[2]+this.offset.click.left}if(F.pageY-this.offset.click.top>this.containment[3]){D=this.containment[3]+this.offset.click.top}}if(I.grid){var H=this.originalPageY+Math.round((D-this.originalPageY)/I.grid[1])*I.grid[1];D=this.containment?(!(H-this.offset.click.top<this.containment[1]||H-this.offset.click.top>this.containment[3])?H:(!(H-this.offset.click.top<this.containment[1])?H-I.grid[1]:H+I.grid[1])):H;var G=this.originalPageX+Math.round((E-this.originalPageX)/I.grid[0])*I.grid[0];E=this.containment?(!(G-this.offset.click.left<this.containment[0]||G-this.offset.click.left>this.containment[2])?G:(!(G-this.offset.click.left<this.containment[0])?G-I.grid[0]:G+I.grid[0])):G}}return{top:(D-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(A.browser.safari&&A.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(J?0:C.scrollTop())))),left:(E-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(A.browser.safari&&A.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():J?0:C.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(C,D,E){E=E||this._uiHash();A.ui.plugin.call(this,C,[D,E]);if(C=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return A.Widget.prototype._trigger.call(this,C,D,E)},plugins:{},_uiHash:function(C){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});A.extend(A.ui.draggable,{version:"1.8.11"});A.ui.plugin.add("draggable","connectToSortable",{start:function(D,F){var E=A(this).data("draggable"),G=E.options,C=A.extend({},F,{item:E.element});E.sortables=[];A(G.connectToSortable).each(function(){var H=A.data(this,"sortable");if(H&&!H.options.disabled){E.sortables.push({instance:H,shouldRevert:H.options.revert});H.refreshPositions();H._trigger("activate",D,C)}})},stop:function(D,F){var E=A(this).data("draggable"),C=A.extend({},F,{item:E.element});A.each(E.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;E.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(D);this.instance.options.helper=this.instance.options._helper;if(E.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",D,C)}})},drag:function(D,G){var F=A(this).data("draggable"),C=this;var E=function(J){var O=this.offset.click.top,N=this.offset.click.left;var H=this.positionAbs.top,L=this.positionAbs.left;var K=J.height,M=J.width;var P=J.top,I=J.left;return A.ui.isOver(H+O,L+N,P,I,K,M)};A.each(F.sortables,function(H){this.instance.positionAbs=F.positionAbs;this.instance.helperProportions=F.helperProportions;this.instance.offset.click=F.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(C).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return G.helper[0]};D.target=this.instance.currentItem[0];this.instance._mouseCapture(D,true);this.instance._mouseStart(D,true,true);this.instance.offset.click.top=F.offset.click.top;this.instance.offset.click.left=F.offset.click.left;this.instance.offset.parent.left-=F.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=F.offset.parent.top-this.instance.offset.parent.top;F._trigger("toSortable",D);F.dropped=this.instance.element;F.currentItem=F.element;this.instance.fromOutside=F}if(this.instance.currentItem){this.instance._mouseDrag(D)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",D,this.instance._uiHash(this.instance));this.instance._mouseStop(D,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}F._trigger("fromSortable",D);F.dropped=false}}})}});A.ui.plugin.add("draggable","cursor",{start:function(D,E){var C=A("body"),F=A(this).data("draggable").options;if(C.css("cursor")){F._cursor=C.css("cursor")}C.css("cursor",F.cursor)},stop:function(C,D){var E=A(this).data("draggable").options;if(E._cursor){A("body").css("cursor",E._cursor)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(C,D){var E=A(this).data("draggable").options;A(E.iframeFix===true?"iframe":E.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(C,D){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","opacity",{start:function(D,E){var C=A(E.helper),F=A(this).data("draggable").options;if(C.css("opacity")){F._opacity=C.css("opacity")}C.css("opacity",F.opacity)},stop:function(C,D){var E=A(this).data("draggable").options;if(E._opacity){A(D.helper).css("opacity",E._opacity)}}});A.ui.plugin.add("draggable","scroll",{start:function(D,E){var C=A(this).data("draggable");if(C.scrollParent[0]!=document&&C.scrollParent[0].tagName!="HTML"){C.overflowOffset=C.scrollParent.offset()}},drag:function(E,F){var D=A(this).data("draggable"),G=D.options,C=false;if(D.scrollParent[0]!=document&&D.scrollParent[0].tagName!="HTML"){if(!G.axis||G.axis!="x"){if((D.overflowOffset.top+D.scrollParent[0].offsetHeight)-E.pageY<G.scrollSensitivity){D.scrollParent[0].scrollTop=C=D.scrollParent[0].scrollTop+G.scrollSpeed}else{if(E.pageY-D.overflowOffset.top<G.scrollSensitivity){D.scrollParent[0].scrollTop=C=D.scrollParent[0].scrollTop-G.scrollSpeed}}}if(!G.axis||G.axis!="y"){if((D.overflowOffset.left+D.scrollParent[0].offsetWidth)-E.pageX<G.scrollSensitivity){D.scrollParent[0].scrollLeft=C=D.scrollParent[0].scrollLeft+G.scrollSpeed}else{if(E.pageX-D.overflowOffset.left<G.scrollSensitivity){D.scrollParent[0].scrollLeft=C=D.scrollParent[0].scrollLeft-G.scrollSpeed}}}}else{if(!G.axis||G.axis!="x"){if(E.pageY-A(document).scrollTop()<G.scrollSensitivity){C=A(document).scrollTop(A(document).scrollTop()-G.scrollSpeed)}else{if(A(window).height()-(E.pageY-A(document).scrollTop())<G.scrollSensitivity){C=A(document).scrollTop(A(document).scrollTop()+G.scrollSpeed)}}}if(!G.axis||G.axis!="y"){if(E.pageX-A(document).scrollLeft()<G.scrollSensitivity){C=A(document).scrollLeft(A(document).scrollLeft()-G.scrollSpeed)}else{if(A(window).width()-(E.pageX-A(document).scrollLeft())<G.scrollSensitivity){C=A(document).scrollLeft(A(document).scrollLeft()+G.scrollSpeed)}}}}if(C!==false&&A.ui.ddmanager&&!G.dropBehaviour){A.ui.ddmanager.prepareOffsets(D,E)}}});A.ui.plugin.add("draggable","snap",{start:function(D,E){var C=A(this).data("draggable"),F=C.options;C.snapElements=[];A(F.snap.constructor!=String?(F.snap.items||":data(draggable)"):F.snap).each(function(){var H=A(this);var G=H.offset();if(this!=C.element[0]){C.snapElements.push({item:this,width:H.outerWidth(),height:H.outerHeight(),top:G.top,left:G.left})}})},drag:function(O,L){var F=A(this).data("draggable"),M=F.options;var S=M.snapTolerance;var R=L.offset.left,Q=R+F.helperProportions.width,E=L.offset.top,D=E+F.helperProportions.height;for(var P=F.snapElements.length-1;P>=0;P--){var N=F.snapElements[P].left,K=N+F.snapElements[P].width,J=F.snapElements[P].top,U=J+F.snapElements[P].height;if(!((N-S<R&&R<K+S&&J-S<E&&E<U+S)||(N-S<R&&R<K+S&&J-S<D&&D<U+S)||(N-S<Q&&Q<K+S&&J-S<E&&E<U+S)||(N-S<Q&&Q<K+S&&J-S<D&&D<U+S))){if(F.snapElements[P].snapping){(F.options.snap.release&&F.options.snap.release.call(F.element,O,A.extend(F._uiHash(),{snapItem:F.snapElements[P].item})))}F.snapElements[P].snapping=false;continue}if(M.snapMode!="inner"){var C=Math.abs(J-D)<=S;var T=Math.abs(U-E)<=S;var H=Math.abs(N-Q)<=S;var I=Math.abs(K-R)<=S;if(C){L.position.top=F._convertPositionTo("relative",{top:J-F.helperProportions.height,left:0}).top-F.margins.top}if(T){L.position.top=F._convertPositionTo("relative",{top:U,left:0}).top-F.margins.top}if(H){L.position.left=F._convertPositionTo("relative",{top:0,left:N-F.helperProportions.width}).left-F.margins.left}if(I){L.position.left=F._convertPositionTo("relative",{top:0,left:K}).left-F.margins.left}}var G=(C||T||H||I);if(M.snapMode!="outer"){var C=Math.abs(J-E)<=S;var T=Math.abs(U-D)<=S;var H=Math.abs(N-R)<=S;var I=Math.abs(K-Q)<=S;if(C){L.position.top=F._convertPositionTo("relative",{top:J,left:0}).top-F.margins.top}if(T){L.position.top=F._convertPositionTo("relative",{top:U-F.helperProportions.height,left:0}).top-F.margins.top}if(H){L.position.left=F._convertPositionTo("relative",{top:0,left:N}).left-F.margins.left}if(I){L.position.left=F._convertPositionTo("relative",{top:0,left:K-F.helperProportions.width}).left-F.margins.left}}if(!F.snapElements[P].snapping&&(C||T||H||I||G)){(F.options.snap.snap&&F.options.snap.snap.call(F.element,O,A.extend(F._uiHash(),{snapItem:F.snapElements[P].item})))}F.snapElements[P].snapping=(C||T||H||I||G)}}});A.ui.plugin.add("draggable","stack",{start:function(D,E){var G=A(this).data("draggable").options;var F=A.makeArray(A(G.stack)).sort(function(I,H){return(parseInt(A(I).css("zIndex"),10)||0)-(parseInt(A(H).css("zIndex"),10)||0)});if(!F.length){return }var C=parseInt(F[0].style.zIndex)||0;A(F).each(function(H){this.style.zIndex=C+H});this[0].style.zIndex=C+F.length}});A.ui.plugin.add("draggable","zIndex",{start:function(D,E){var C=A(E.helper),F=A(this).data("draggable").options;if(C.css("zIndex")){F._zIndex=C.css("zIndex")}C.css("zIndex",F.zIndex)},stop:function(C,D){var E=A(this).data("draggable").options;if(E._zIndex){A(D.helper).css("zIndex",E._zIndex)}}})})(jQuery);var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){var A;var B;var C;try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");A=B.GetVariable("$version")}catch(C){}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");A="WIN 6,0,21,0";B.AllowScriptAccess="always";A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A=B.GetVariable("$version")}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");A="WIN 3,0,18,0"}catch(C){}}if(!A){try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");A="WIN 2,0,0,11"}catch(C){A=-1}}return A}function GetSwfVer(){var G=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var F=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var A=navigator.plugins["Shockwave Flash"+F].description;var E=A.split(" ");var C=E[2].split(".");var H=C[0];var B=C[1];var D=E[3];if(D==""){D=E[4]}if(D[0]=="d"){D=D.substring(1)}else{if(D[0]=="r"){D=D.substring(1);if(D.indexOf("d")>0){D=D.substring(0,D.indexOf("d"))}}}var G=H+"."+B+"."+D}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){G=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){G=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){G=2}else{if(isIE&&isWin&&!isOpera){G=ControlVersion()}}}}}return G}function DetectFlashVer(F,D,C){versionStr=GetSwfVer();if(versionStr==-1){return false}else{if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",")}else{versionArray=versionStr.split(".")}var E=versionArray[0];var A=versionArray[1];var B=versionArray[2];if(E>parseFloat(F)){return true}else{if(E==parseFloat(F)){if(A>parseFloat(D)){return true}else{if(A==parseFloat(D)){if(B>=parseFloat(C)){return true}}}}}return false}}}function AC_AddExtension(B,A){if(B.indexOf("?")!=-1){return B.replace(/\?/,A+"?")}else{return B+A}}function AC_Generateobj(E,D,A){var C="";if(isIE&&isWin&&!isOpera){C+="<object ";for(var B in E){C+=B+'="'+E[B]+'" '}for(var B in D){C+='><param name="'+B+'" value="'+D[B]+'" /> '}C+="></object>"}else{C+="<embed ";for(var B in A){C+=B+'="'+A[B]+'" '}C+="> </embed>"}document.write(C)}function AC_FL_RunContent(){var A=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(A.objAttrs,A.params,A.embedAttrs)}function AC_GetArgs(B,E,G,D,H){var A=new Object();A.embedAttrs=new Object();A.params=new Object();A.objAttrs=new Object();for(var C=0;C<B.length;C=C+2){var F=B[C].toLowerCase();switch(F){case"classid":break;case"pluginspage":A.embedAttrs[B[C]]=B[C+1];break;case"src":case"movie":B[C+1]=AC_AddExtension(B[C+1],E);A.embedAttrs["src"]=B[C+1];A.params[G]=B[C+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblClick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":A.objAttrs[B[C]]=B[C+1];break;case"id":case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":A.embedAttrs[B[C]]=A.objAttrs[B[C]]=B[C+1];break;default:A.embedAttrs[B[C]]=A.params[B[C]]=B[C+1]}}A.objAttrs["classid"]=D;if(H){A.embedAttrs["type"]=H}return A}(function(A){A.widget("ui.customFile",{_init:function(){if(navigator.userAgent.indexOf("MSIE 6")>=0){return }var E=this.element,F=this.options;E.addClass("ui-custom-input-file").attr("size",1);var G=A("<div />").addClass("ui-custom-file-container").insertBefore(E).append(E);var D=A("<div />").addClass("ui-custom-file-filename");var C=A("<div />").addClass("custom-input-holder input");C.append(A("<div />").addClass("left-side"));C.append(A("<div />").addClass("text-holder").append(D));C.append(A("<div />").addClass("right-side"));C.appendTo(G);var B=A("<div />").addClass("ui-custom-file-button").appendTo(G);E.val("").hover(function(H){B.addClass("ui-custom-file-button-active")},function(H){B.removeClass("ui-custom-file-button-active")}).change(function(H){var J=E.val();var I=J.replace(/.*\\(.*)/,"$1");I=I.replace(/.*\/(.*)/,"$1");D.html(I);if(typeof (F.onChange)=="function"){F.onChange.call(E,H)}})}});A.extend(A.ui.customFile.prototype,{options:{onChange:null}})})(jQuery);var _foto_comments=null;var CommentForm=(function(){return{save:function(A,B,C){new JSONRequest({method:C,params:[A],success:B})},updateComment:function(C,B){var A=$(B).hide();$("#response_comments").show();C.find("div.comments").append(A).end();$("#add_comment").find(".first-comment").hide().end().find(".new-comment").show();A.slideDown();C.show();$(A).find("a.delete_comment").each(function(){$(this).click(function(){remove_comment($(this),$(this).attr("comment_id"));return false})})}}})();function initializeCommentForm(A,G){var D=$("#add_comment"),E=D.find("#foto_comment_referer"),H=D.find("#foto_comment_token");var C=A.tokens[G]!==undefined?A.tokens[G]:null;var F=A.referer,B=(A.methods instanceof Array)?(A.methods[G]?A.methods[G]:"postHotelFotoComment"):(A.methods);D.attr("referer_index",G).attr("method",B);if(!(C&&F)){return false}E.val(F);H.val(C);return true}$(function(){$(document).click(function(A){var B=$(A.target);if(B.filter("#scroll-to-add-comment, #scroll-to-add-comment i").length){A.preventDefault();A.stopPropagation();$(document).scrollTo($("#add_comment"),700)}else{if(B.filter("#add_comment .foto_comment_submit, #add_comment .foto_comment_submit span").length){A.preventDefault();A.stopPropagation();$.authJacket(function(){var D=$("#add_comment");var G=D.find("textarea"),I=D.find(".comment_token"),F=D.find(".comment_referer");var H=D.attr("referer_index"),E=_foto_comments.eq(H),C=E.attr("pic_id");if(!G.val()){return false}D.sleep();CommentForm.save({text:G.val(),token:I.val(),referer:F.val(),pic_id:C},function(J){CommentForm.updateComment(E,J);D.wakeup()},D.attr("method"));G.val("")},undefined,"Чтобы добавить комментарий, войдите на сайт. ")}}})});var init_uploader=function(A,B){if(!typeof (A)=="Object"){throw"Invalid type of initial object in swfUpload constructor method"}var C={flash_url:"/js/swfupload/swfupload.swf",upload_url:"/",post_params:{"PHPSESSID":""},file_size_limit:"10 MB",file_post_name:"file",file_types:"*.jpg;*.jpeg;*.png;*.gif;*.JPG;*.JPEG;*.PNG;*.GIF;*.Jpg;*.Jpeg;*.Png;*.Gif",file_upload_limit:B?50:1,file_queue_limit:0,custom_settings:{progressTarget:"fsUploadProgress",cancelButtonId:"btnCancel"},debug:false,button_placeholder_id:"btn-edit-avatar",button_image_url:"/i/fresh/new_photo.png",button_width:124,button_height:33,buttonText:"Добавить фото",button_cursor:SWFUpload.CURSOR.HAND,button_window_mode:"opaque",http_success:[200,302],file_queued_handler:fileQueued,file_queue_error_handler:fileQueueError,file_dialog_complete_handler:fileDialogComplete,upload_start_handler:uploadStart,upload_progress_handler:uploadProgress,upload_error_handler:uploadError,upload_success_handler:uploadSuccess,upload_complete_handler:uploadComplete,queue_complete_handler:queueComplete};C=$.extend(C,A);var D=new SWFUpload(C);return D};function fileQueueError(B,D,C){try{switch(D){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:console.log("Error Code: File too big, File name: "+B.name+", File size: "+B.size+", Message: "+C);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:console.log("Error Code: Zero byte file, File name: "+B.name+", File size: "+B.size+", Message: "+C);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:console.log("Error Code: Invalid File Type, File name: "+B.name+", File size: "+B.size+", Message: "+C);break;default:if(B!==null){progress.setStatus("Unhandled Error")}console.log("Error Code: "+D+", File name: "+B.name+", File size: "+B.size+", Message: "+C);break}}catch(A){this.debug(A)}}function uploadError(B,D,C){try{switch(D){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:console.log("Error Code: HTTP Error, File name: "+B.name+", Message: "+C);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:console.log("Error Code: Upload Failed, File name: "+B.name+", File size: "+B.size+", Message: "+C);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:console.log("Error Code: IO Error, File name: "+B.name+", Message: "+C);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:console.log("Error Code: Security Error, File name: "+B.name+", Message: "+C);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:console.log("Error Code: Upload Limit Exceeded, File name: "+B.name+", File size: "+B.size+", Message: "+C);break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:console.log("Error Code: File Validation Failed, File name: "+B.name+", File size: "+B.size+", Message: "+C);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:console.log("Cancelled");break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:console.log("Stopped");break;default:console.log("Error Code: "+D+", File name: "+B.name+", File size: "+B.size+", Message: "+C);break}}catch(A){this.debug(A)}}(function(A){A.extend({progressBar:new function(){this.defaults={increment:2,speed:15,showText:true,width:120,boxImage:"images/progressbar.gif",barImage:"images/progressbg_green.gif",height:12};this.construct=function(D,C){var B=null;var E=null;if(D!=null){if(!isNaN(D)){B=D;if(C!=null){E=C}}else{E=D}}return this.each(function(F){var L=this;if(B!=null&&this.bar!=null&&this.config!=null){this.config.tpercentage=B;if(E!=null){L.config=A.extend(this.config,E)}}else{var J=A(this);var H=A.extend({},A.progressBar.defaults,E);var O=B;if(B==null){var O=J.html().replace("%","")}J.html("");var I=document.createElement("img");var M=document.createElement("span");I.id=this.id+"_percentImage";M.id=this.id+"_percentText";I.src=H.boxImage;I.width=H.width;var G=A(I);var K=A(M);this.bar=G;this.ntext=K;this.config=H;this.config.cpercentage=0;this.config.tpercentage=O;G.css("width",H.width+"px");G.css("height",H.height+"px");G.css("background-image","url("+H.barImage+")");G.css("padding","0");G.css("margin","0");J.append(G);J.append(K);I.alt=this.tpercentage;I.title=this.tpercentage}var N=setInterval(function(){var S=L.config;var Q=parseInt(S.cpercentage);var R=parseInt(S.tpercentage);var P=parseInt(S.increment);var T=L.bar;var U=L.ntext;var V=S.width/100;T.css("background-position",(((S.width*-1))+(Q*V))+"px 50%");if(S.showText){U.html(" "+Math.round(Q)+"%")}if(Q>R){if(Q-P<R){L.config.cpercentage=0+R}else{L.config.cpercentage-=P}}else{if(L.config.cpercentage<L.config.tpercentage){if(Q+P>R){L.config.cpercentage=R}else{L.config.cpercentage+=P}}else{clearInterval(N)}}},L.config.speed)})}}});A.fn.extend({progressBar:A.progressBar.construct})})(jQuery);function bind_video_uploader(A,C){if(C!==undefined){var B=C}A.fileDialogComplete=function(D){if(D){if(B){B.sleep()}$.authJacket(function(){new JSONRequest({method:"getFarmSlot",success:function(E){if(B){B.wakeup()}if(E==undefined){return }if(E.error){alert(E.error);return }try{A.addPostParam("video[server_id]",E.result["server_id"]);A.addPostParam("video[user_id]",E.result["user_id"]);A.setUploadURL("http://"+E.result["upload_url"]+"/upload?X-Progress-ID="+E.result["slot_id"])}catch(F){modal_error("Ошибка во время инициализации загрузки. Повторите попытку позже.");return }A.startUpload();$(document).modalbox();$(document).modalbox("setCallback",{preClose:function(){return modal_success("Видео успешно загружено. После обработки оно появится на сайте.")}});$(document).modalbox("open",{content:'<div class="substance"><h2>Загрузка видео</h2><br /><div id="uploadprogressbar-container" class="progress tiny-long" style="display: none;margin-left:20px;"><div id="uploadprogressbar"></div></div></div>'});_progressbar=$("#uploadprogressbar");_progressbar.progressBar({boxImage:"/images/progressbar/progressbx.gif",barImage:"/images/progressbar/progressbg_green.gif",width:240,height:12,showText:false});$("#uploadprogressbar-container").show()}})},undefined,"Чтобы добавить видео,<br /> войдите на сайт.")}};A.uploadProgress=function(G,F,D){var E=D?Math.round(100*F/D):0;if(_progressbar){_progressbar.progressBar(E)}};A.uploadError=function(E,D){modal_error("Во время загрузки произошла ошибка.");if(B instanceof jQuery){B.wakeup()}};return A}if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(K,B,L,D,H,I,F,E,C,J){if(!document.getElementById){return }this.DETECT_KEY=J?J:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(K){this.setAttribute("swf",K)}if(B){this.setAttribute("id",B)}if(L){this.setAttribute("width",L)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(I){this.addParam("bgcolor",I)}var A=F?F:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var G=(E)?E:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(C){this.setAttribute("redirectUrl",C)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C[C.length]=B+"="+A[B]}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var F=this.getParams();for(var E in F){B+=[E]+'="'+F[E]+'" '}var D=this.getVariablePairs().join("&");if(D.length>0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'}var A=this.getVariablePairs().join("&");if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'}B+="</object>"}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){E=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=1;var C=3;while(B){try{C++;B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);E=new deconcept.PlayerVersion([C,0,0])}catch(D){B=null}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");E=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(D){if(E.major==6){return E}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}}return E};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;if(C==null){return D}if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;(function(A){A.widget("ui.review_markable",{_init:function(){var H=this.element,B=this.options,M=this,G=A("input:text",H.parent()).eq(0),L=A("a.save_review",H),K=A("p",H).eq(0),F=A("input.marks-review-input",H),E=A("input.marks-field-input",H),J=A("a",H),D=0,C="";var I=A(this).parent().find("a.hover span").text();if(I!=""){D=parseInt(I)}J.hover(function(N){C=A(H).attr("class");var O=A(this).find("i").text();if(O!=""){D=parseInt(O)}A(H).attr("class","give_rating select"+D)},function(N){A(H).attr("class",C)});J.click(function(N){var O=A(this).find("i").text();if(O!=""){D=parseInt(O)}C="give_rating select"+D;A(H).attr("class",C);A(".marks-mark-input:input",A(H).parent()).val(D);A(".help").hide();A(".bag_rait").hide();A("div",A(H).parent()).show();if(typeof (B.onUpdate)=="function"){B.onUpdate()}})}})})(jQuery);(function(A){A.widget("ui.cardManager",{_removeCard:function(B){if(typeof (this.options.onCardRemove)=="function"){this.options.onCardRemove.call(B,function(){B.remove()})}else{B.remove()}},_editTitle:function(D){var B=this.options,C=this;D.find(B.img).hide().end().find(B.editTitle).hide().end().find(B.editTitleDiv).show().end().find(B.editTags).hide();var E=D.find(B.editTitle),F=D.find(B.editTitleDiv).find("textarea");if(E.html()==B.defaultEditTitleLabel){F.val("")}else{F.val(E.text().replace(/[\t\n]+/gm,""))}},_saveTitle:function(D,B){var C=this.options,F=D.find(C.editTitleDiv).find("textarea").val(),E=D.find(C.editTitle);if(F){F=F.replace("<","&lt;").replace(">","&gt;");E.html(F)}else{E.html(C.defaultEditTitleLabel)}if(typeof (C.onTitleSave)=="function"){C.onTitleSave.call(D,F,B)}else{B()}return true},_editTags:function(D){var B=this.options,C=this;D.find(B.img).hide().end().find(B.editTitle).hide().end().find(B.editTagsDiv).show().end().find(B.editTags).hide();D.find(B.editTitle).closest("table").hide()},_saveTags:function(F,C){var E=this.options,B=this.element,D=A(E.editTagsDiv,F).find("input:checkbox").filter(":checked"),H=[],G=[];D.each(function(J,K){K=A(K);H.push(K.val());G.push(K.closest("label").text())});if(G.length){var I=G.join(", ");A(E.editTags,F).html(I)}else{A(E.editTags,F).html(E.defaultEditTagsLabel)}if(typeof (E.onTagsSave)=="function"){E.onTagsSave.call(F,H,C)}else{C()}F.find(E.editTitle).closest("table").show()},_viewState:function(C){var B=this.options;C.find(B.img).show().end().find(B.editTitle).show().end().find(B.editTitleDiv).hide().end().find(B.editTags).show().end().find(B.editTagsDiv).hide()},_init:function(){var B=this.element,C=this.options,D=this;A(C.remove,B).live("click",function(){var E=A(this).closest(C.card);D._removeCard(E)});A(C.editTitle,B).live("click",function(){var E=A(this).closest(C.card);D._editTitle(E)});A(C.editTitleSave,B).live("click",function(){var E=A(this).closest(C.card);D._saveTitle(E,function(){D._viewState(E)})});A(C.editTags,B).live("click",function(){var E=A(this).closest(C.card);D._editTags(E)});A(C.editTagsSave,B).live("click",function(){var E=A(this).closest(C.card);D._saveTags(E,function(){D._viewState(E)})})}})})(jQuery);$.extend($.ui.cardManager.prototype,{options:{}});var TourToolbox={getHashVariable:function(D,C){var A=new RegExp(D+"=([^&$]*)");if(C===undefined){C=$.hash()}var B=C.match(A);if(B!==null&&B[1]!==undefined){return B[1]}else{return null}},setHashVariable:function(C,I,G,B){var A,D;if(B===undefined){A=$.hash()}else{A=B}var H=A.split(";");switch(G){case"tsf":D=H[0].replace("tsf=","");break;case"tsr":D=H[1].replace("tsr=","");break}var E=new RegExp(C+"=([^&$]*)");if(D.match(E)){D=D.replace(E,C+"="+I)}else{var F=D.split("&");F.push(C+"="+I);D=F.join("&")}switch(G){case"tsf":H[0]="tsf="+D;break;case"tsr":H[1]="tsr="+D;break}A=H.join(";");if(B===undefined){$.hash(A)}return A},setHashDataVariable:function(C,A,B){return this.setHashVariable(C,A,"tsf",B)},setHashParamVariable:function(C,A,B){return this.setHashVariable(C,A,"tsr",B)},clearHashParamVariables:function(B){var A;if(B===undefined){A=$.hash()}else{A=B}A=A.replace(/tsr=.+/,"tsr=");if(B===undefined){$.hash(A)}return A},loadTours:function(B,A){$.ajax({url:"/ajax/loadTours/?"+B,dataType:"json",success:function(C){A(C)},error:function(C,E,D){A(null)}})}};(function(A){A.widget("ui.scrollbar",{_getValue:function(C){var D=this._getSlider();var B=parseInt(D.css("left"));return C?(B/C):undefined},_slideTrayOnClick:function(D){var G=this.element,E=this._getSlider(),I=parseInt(G.offset().left),F=parseInt(D.pageX),B=parseInt(E.outerWidth()),J=F-I-parseInt(B/2),H=G.innerWidth()-B;J=J>0?J:0;H=H>0?H:1;var C=J/H;C=C<=1?C:1;this._updatePos(C,J>0?1:-1)},_init:function(){var C=this.element,I=this._getSlider(),D=this.options,F=this,E=I.outerWidth(),H=C.innerWidth()-E;C.addClass("ui-scrollbar-container").click(function(J){F._slideTrayOnClick.call(F,J)});var G=0;I.addClass("ui-scrollbar-slider").draggable({axis:"x",containment:"parent",start:function(){G=F._getValue(H)},drag:function(J,K){var L=F._getValue(H);if(typeof (D.onSlide)=="function"){D.onSlide.call(J,L)}},stop:function(J,K){var L=F._getValue(H);F._updatePos(L,(G-L)<0?1:-1);if(typeof (D.onStopSlide)=="function"){D.onStopSlide.call(J,L)}}}).click(function(J){J.stopPropagation()});var B=D.startStep*D.discreteStep;if(B){this._updatePos(B,1)}},_updatePos:function(C,J){var G=this.element,E=G.children().eq(0),D=this.options,M=this,I=E.outerWidth(),H=G.innerWidth()-I;C=C<0?0:C>1?1:C;var F=this._getValue(H);var L=null;if(D.discreteStep!==undefined&&D.discreteStep){var L=parseInt(C/D.discreteStep);var K=parseInt(F/D.discreteStep);var B=C/D.discreteStep-L;if(B>0.999){L++}L=L<0?0:L;C=D.discreteStep*L}var N=parseInt(C*H);E.animate({"left":N},D.animationSpeed);if(typeof (D.onUpdate)=="function"){D.onUpdate.call(G,C,L)}},getValue:function(){return this._getValue(_range)},slide:function(B,C){this._updatePos(B,C)},_getNewPosByDispose:function(C){var E=this._getRange();var D=this._getValue(E);var B=C/E,F=B+D;return F},_getRange:function(){var B=this.element,F=this._getSlider(),D=this,C=F.outerWidth(),E=B.innerWidth()-C;return E},_getSlider:function(){return this.element.children().eq(0)},slideForDispose:function(B){if(B==0){return }this._updatePos(this._getNewPosByDispose(B),B>0?1:-1)},update:function(B,C){var G=B,F=this._getRange(),D=this;if(window.ui_scrollbar===undefined){window.ui_scrollbar={}}else{if(window.ui_scrollbar.expecting_timeout!==undefined&&window.ui_scrollbar.expecting_timeout){window.clearTimeout(window.ui_scrollbar.expecting_timeout)}}window.ui_scrollbar.expecting_timeout=window.setTimeout(function(){D._updatePos(G,C)},250);G=G<0?0:G>1?1:G;var E=parseInt(G*F);this._getSlider().css("left",E)},updateDiscreteStep:function(B){this.options.discreteStep=B}})})(jQuery);$.extend($.ui.scrollbar.prototype,{options:{onSlide:null,onStopSlide:null,onUpdate:null,animationSpeed:300,discreteStep:null,startStep:0},getter:"getValue"});(function(A){A.widget("ui.fotoslider",{_onScrollbarSlideStop:function(B,D,C){},_onNextArrowClick:function(C,F){var G=this.element.find("div.sliderback"),E=G.children("a").filter(":visible");var B=E.filter(".ui-slider-li-active").prevAll("a").filter(":visible").length;var D=(B+1)>(E.length-1)?0:B+1;this._onThumbnailClick(C,E.eq(D));if(typeof (this.options.onNextClick)=="function"){this.options.onNextClick.call(this,D)}},_onPrevArrowClick:function(C,F){var G=this.element.find("div.sliderback"),D=G.children("a").filter(":visible");var B=D.filter(".ui-slider-li-active").prevAll("a").filter(":visible").length;var E=(B-1)<0?D.length-1:B-1;this._onThumbnailClick(C,D.eq(E));if(typeof (this.options.onPrevClick)=="function"){this.options.onPrevClick.call(this,E)}},_updateScroller:function(B){this._showThumbnail(B)},_showThumbnail:function(D){var H=this.element,B=this.options,F=H,C=H.find("div.sliderback"),G=C.children("a").filter(":visible"),E=G.eq(D),I=E.prevAll("a").length;if(D<0||D>G.length-1){return }G.removeClass("ui-slider-li-active");E.addClass("ui-slider-li-active");if(B.frame!==undefined){F=(B.frame instanceof jQuery)?B.frame:A(B.frame)}var J=parseInt(A(E).find("img").position().left,10),K=(-1)*J+360;if(typeof (B.onSelect)=="function"){B.onSelect.call(E,I)}this._updatePos(C,K);this._updateThumbs(D)},_updatePosNoAnimate:function(C,B){C.css("left",B)},_updatePos:function(C,B){C.animate({left:B},this.options.animationSpeed)},_updateThumbs:function(F){var B=this.element,C=this,H=B.find("div.sliderback"),D=H.children("a").filter(":visible"),G=D.eq(F),E=[-3,-2,-1,0,1,2,3];A.each(E,function(J,I){C._loadThumb(D.eq(C._getOffset(D,F+parseInt(I,10))))})},_getOffset:function(D,B){var E=D.length;var C=B;if(B>E){C=B-E-1}else{if(B<0){C=E+B+1}}return C},_loadThumb:function(B){var C=B.find("img");if(C.attr("src")!=""){return }var D=C.attr("hidden_src");C.attr("src",D)},_onThumbnailClick:function(C,G){var B=G.closest("div").find(".ui-slider-li-active").prevAll("a:visible").length,E=this.options,I=G.prevAll("a:visible").length,D=G.closest("div").children("a:visible").length;D=(D-1)>0?(D-1):1;if(E.scrollbar!==undefined){var F=E.scrollbar instanceof jQuery?E.scrollbar:A(E.scrollbar);var H=(B-I)>0?-1:1;F.scrollbar("slide",I/D,H)}},_init:function(){var L=this.element,C=this.options,O=this,H=L.parent(),K=L,I=null,F=null,B=null,E=L.find("div.sliderback"),J=E.children("a");H.addClass("ui-slider-container");L.addClass("ui-slider-scroller");if(C.frame!==undefined&&C.frame){K=C.frame instanceof jQuery?C.frame:A(C.frame)}var N=Math.round((K.outerWidth()-K.innerWidth())/2);E.children("a:last").css("margin-right",0);var M=E.innerWidth()-parseInt(E.children("a:last").outerWidth(),10)-N;var G=-parseInt(E.children("a:last").outerWidth(),10)-N;var D=(K.position()!==undefined)?parseInt(K.position().left,10):0;if(C.scrollbar!==undefined&&C.scrollbar){I=C.scrollbar instanceof jQuery?C.scrollbar:A(C.scrollbar);I.scrollbar({onSlide:function(Q){var P=E.children("a").filter(":visible");var R=(P.length*120)-120;var S=(-1)*Q*R;O._updatePosNoAnimate(E,Math.round(S))},onStopSlide:function(P){O._onScrollbarSlideStop(P,I,K)},animationSpeed:C.animationSpeed,discreteStep:(J.length-1)?1/(J.length-1):null,onUpdate:function(P,Q){O._updateScroller(Q)},startStep:C.startStep})}if(C.nextArrow!==undefined&&C.nextArrow){F=C.nextArrow instanceof jQuery?C.nextArrow:A(C.nextArrow);F.click(function(P){P.preventDefault();P.stopPropagation();O._onNextArrowClick(P,A(this))});A(document).bind("keydown",function(P){if(P.ctrlKey&&P.keyCode==39){F.trigger("click")}})}if(C.prevArrow!==undefined&&C.prevArrow){B=C.prevArrow instanceof jQuery?C.prevArrow:A(C.prevArrow);B.click(function(P){P.preventDefault();P.stopPropagation();O._onPrevArrowClick(P,A(this))});A(document).bind("keydown",function(P){if(P.ctrlKey&&P.keyCode==37){B.trigger("click")}})}A.each(J,function(Q,P){P=A(P);P.click(function(R){R.stopPropagation();R.preventDefault();this.blur();O._onThumbnailClick(R,A(this))}).attr("href","#ui-slider-thumbnail-"+parseInt(Q))});this._updateThumbs(C.startStep)},show:function(B){this._showThumbnail(B)}})})(jQuery);$.extend($.ui.fotoslider.prototype,{options:{scrollbar:null,frame:null,step:1,onSelect:null,onNextClick:null,onPrevClick:null,nextArrow:null,prevArrow:null,onThumbnailOver:null,onThumbnailOut:null,onScroll:null,owner:null,animationSpeed:170,wheelSpeed:30,startStep:0}});(function(A){A.widget("ui.simple_map",{map:undefined,markers:{},data:{},day:1,info_holder:{},_init:function(){var C=this.options;this.map=new google.maps.Map(this.element.context,{mapTypeId:C.map_type_id,scrollwheel:false});this.map.fitBounds(C.bounds);if(this.options.data!=undefined){this.replaceMarkers(this.options.data)}B.prototype=new google.maps.OverlayView();B.prototype.onAdd=function(){};B.prototype.onRemove=function(){};B.prototype.draw=function(){};function B(D){this.setMap(D)}this.overlay=new B(this.map);this.popup=A(C.popup_selector);this._setupEvents()},_setupEvents:function(){var B=this;google.maps.event.addListener(this.map,"dragend",function(){B._handleReloadEvent.call(B)});google.maps.event.addListener(this.map,"tilesloaded",function(){if(B.options.data==undefined){B._handleReloadEvent.call(B)}});google.maps.event.addListener(this.map,"dragstart",function(){B.hidePopup.call(B)});A(document).click(function(){B.hidePopup.call(B)});this.popup.click(function(C){C.stopPropagation()})},_handleReloadEvent:function(){var C=this;var D=this.map.getBounds().getNorthEast();var B=this.map.getBounds().getSouthWest();if(C.markerRequest!=undefined){C.markerRequest.abort()}A("#map_spinner").show();C.markerRequest=A.ajax({url:this.options.ajax_url,dataType:"json",type:"GET",data:{lat_from:B.lat(),lng_from:B.lng(),lat_to:D.lat(),lng_to:D.lng(),size_y:this.element.height(),size_x:this.element.width(),zoom:this.map.getZoom()},success:function(E){C.replaceMarkers.call(C,E)},complete:function(){C.markerRequest=undefined;A("#map_spinner").hide()}})},replaceMarkers:function(D,C){var B=this;this.data=D;if(C==undefined){C=this.day}A.each(this.markers,function(F,E){E.setMap(null)});if(D){A.each(D,function(H,E){var I=E.weather;if(I){var F=new google.maps.MarkerImage(B.options.image_url+parseInt(I[C]["temp"])+"_"+parseInt(I[C]["weather_type"])+".png",new google.maps.Size(70,43,"px","px"),new google.maps.Point(0,0),new google.maps.Point(25,36));var G=new google.maps.Marker({position:new google.maps.LatLng(E.lat,E.lng),title:E.title,map:B.map,icon:F});google.maps.event.addListener(G,"click",function(J){B.showPopup.call(B,E,J.currentTarget);J.stopPropagation()});B.markers[E.slug]=G}})}},switchDay:function(B){var C=B.day;this.replaceMarkers(this.data,C);this.day=C},showPopup:function(B,C){var D=this.overlay.getProjection(),C=A(C);_pos=C.position();_parent_pos=C.parent().offset();_popup=this.popup;_popup.attr("href",B.link);_popup.find(".region").html(B.title);_popup.find(".xz").each(function(E,F){if(B.weather[E+1]!=undefined){A(F).find("strong").html((B.weather[E+1].temp>0?"+":"")+B.weather[E+1].temp);A(F).find("span>i").attr("class","w"+B.weather[E+1].weather_type);A(F).find(".w_desc").html(B.weather[E+1].weather_desc)}else{F.hide()}});_popup.show();_popup.css("top",_parent_pos.top+_pos.top-59);_popup.css("left",_parent_pos.left+_pos.left+1)},hidePopup:function(){this.popup.hide()}})})(jQuery);jQuery.extend(jQuery.ui.simple_map.prototype,{options:{bounds:undefined,map_type_id:undefined,map_constructor:undefined,ajax_url:undefined,ajax_info_url:undefined,image_url:undefined,popup_selector:"#weather_popup"}});var SWFUpload;if(SWFUpload==undefined){SWFUpload=function(A){this.initSWFUpload(A)}}SWFUpload.prototype.initSWFUpload=function(B){try{this.customSettings={};this.settings=B;this.eventQueue=[];this.movieName="SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(A){delete SWFUpload.instances[this.movieName];throw A}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(A){if(typeof (A)!=="string"||A.match(/^https?:\/\//i)||A.match(/^\//)){return A}var C=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"");var B=window.location.pathname.lastIndexOf("/");if(B<=0){path="/"}else{path=window.location.pathname.substr(0,B)+"/"}return path+A};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(B,A){this.settings[B]=(this.settings[B]==undefined)?A:this.settings[B]};this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});this.customSettings=this.settings.custom_settings;if(!!this.settings.prevent_swf_caching){this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+new Date().getTime()}if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var A,B;if(document.getElementById(this.movieName)!==null){throw"ID "+this.movieName+" is already in use. The Flash Object could not be added"}A=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(A==undefined){throw"Could not find the placeholder element: "+this.settings.button_placeholder_id}B=document.createElement("div");B.innerHTML=this.getFlashHTML();A.parentNode.replaceChild(B.firstChild,A);if(window[this.movieName]==undefined){window[this.movieName]=this.getMovieElement()}};SWFUpload.prototype.getFlashHTML=function(){return['<object id="',this.movieName,'" type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload">','<param name="wmode" value="',this.settings.button_window_mode,'" />','<param name="movie" value="',this.settings.flash_url,'" />','<param name="quality" value="high" />','<param name="menu" value="false" />','<param name="allowScriptAccess" value="always" />','<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var B=this.buildParamString();var A=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(A),"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(B),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined){this.movieElement=document.getElementById(this.movieName)}if(this.movieElement===null){throw"Could not find Flash element"}return this.movieElement};SWFUpload.prototype.buildParamString=function(){var C=this.settings.post_params;var B=[];if(typeof (C)==="object"){for(var A in C){if(C.hasOwnProperty(A)){B.push(encodeURIComponent(A.toString())+"="+encodeURIComponent(C[A].toString()))}}}return B.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var A=null;A=this.getMovieElement();if(A&&typeof (A.CallFunction)==="unknown"){for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(E){}}try{A.parentNode.removeChild(A)}catch(B){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieElement=null;this.settings=null;this.customSettings=null;this.eventQueue=null;this.movieName=null;return true}catch(D){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\n","Version: ",SWFUpload.version,"\n","Movie Name: ",this.movieName,"\n","Settings:\n","\t","upload_url:               ",this.settings.upload_url,"\n","\t","flash_url:                ",this.settings.flash_url,"\n","\t","use_query_string:         ",this.settings.use_query_string.toString(),"\n","\t","requeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n","\t","http_success:             ",this.settings.http_success.join(", "),"\n","\t","assume_success_timeout:   ",this.settings.assume_success_timeout,"\n","\t","file_post_name:           ",this.settings.file_post_name,"\n","\t","post_params:              ",this.settings.post_params.toString(),"\n","\t","file_types:               ",this.settings.file_types,"\n","\t","file_types_description:   ",this.settings.file_types_description,"\n","\t","file_size_limit:          ",this.settings.file_size_limit,"\n","\t","file_upload_limit:        ",this.settings.file_upload_limit,"\n","\t","file_queue_limit:         ",this.settings.file_queue_limit,"\n","\t","debug:                    ",this.settings.debug.toString(),"\n","\t","prevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n","\t","button_placeholder_id:    ",this.settings.button_placeholder_id.toString(),"\n","\t","button_placeholder:       ",(this.settings.button_placeholder?"Set":"Not Set"),"\n","\t","button_image_url:         ",this.settings.button_image_url.toString(),"\n","\t","button_width:             ",this.settings.button_width.toString(),"\n","\t","button_height:            ",this.settings.button_height.toString(),"\n","\t","button_text:              ",this.settings.button_text.toString(),"\n","\t","button_text_style:        ",this.settings.button_text_style.toString(),"\n","\t","button_text_top_padding:  ",this.settings.button_text_top_padding.toString(),"\n","\t","button_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n","\t","button_action:            ",this.settings.button_action.toString(),"\n","\t","button_disabled:          ",this.settings.button_disabled.toString(),"\n","\t","custom_settings:          ",this.settings.custom_settings.toString(),"\n","Event Handlers:\n","\t","swfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n","\t","file_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler==="function").toString(),"\n","\t","file_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n","\t","file_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n","\t","upload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n","\t","upload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n","\t","upload_error_handler assigned:      ",(typeof this.settings.upload_error_handler==="function").toString(),"\n","\t","upload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n","\t","upload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n","\t","debug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(B,C,A){if(C==undefined){return(this.settings[B]=A)}else{return(this.settings[B]=C)}};SWFUpload.prototype.getSetting=function(A){if(this.settings[A]!=undefined){return this.settings[A]}return""};SWFUpload.prototype.callFlash=function(functionName,argumentArray){argumentArray=argumentArray||[];var movieElement=this.getMovieElement();var returnValue,returnString;try{returnString=movieElement.CallFunction('<invoke name="'+functionName+'" returntype="javascript">'+__flash__argumentsToXML(argumentArray,0)+"</invoke>");returnValue=eval(returnString)}catch(ex){throw"Call to "+functionName+" failed"}if(returnValue!=undefined&&typeof returnValue.post==="object"){returnValue=this.unescapeFilePostParams(returnValue)}return returnValue};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(A){this.callFlash("StartUpload",[A])};SWFUpload.prototype.cancelUpload=function(A,B){if(B!==false){B=true}this.callFlash("CancelUpload",[A,B])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(A){this.callFlash("SetStats",[A])};SWFUpload.prototype.getFile=function(A){if(typeof (A)==="number"){return this.callFlash("GetFileByIndex",[A])}else{return this.callFlash("GetFile",[A])}};SWFUpload.prototype.addFileParam=function(A,B,C){return this.callFlash("AddFileParam",[A,B,C])};SWFUpload.prototype.removeFileParam=function(A,B){this.callFlash("RemoveFileParam",[A,B])};SWFUpload.prototype.setUploadURL=function(A){this.settings.upload_url=A.toString();this.callFlash("SetUploadURL",[A])};SWFUpload.prototype.setPostParams=function(A){this.settings.post_params=A;this.callFlash("SetPostParams",[A])};SWFUpload.prototype.addPostParam=function(A,B){this.settings.post_params[A]=B;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(A){delete this.settings.post_params[A];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(A,B){this.settings.file_types=A;this.settings.file_types_description=B;this.callFlash("SetFileTypes",[A,B])};SWFUpload.prototype.setFileSizeLimit=function(A){this.settings.file_size_limit=A;this.callFlash("SetFileSizeLimit",[A])};SWFUpload.prototype.setFileUploadLimit=function(A){this.settings.file_upload_limit=A;this.callFlash("SetFileUploadLimit",[A])};SWFUpload.prototype.setFileQueueLimit=function(A){this.settings.file_queue_limit=A;this.callFlash("SetFileQueueLimit",[A])};SWFUpload.prototype.setFilePostName=function(A){this.settings.file_post_name=A;this.callFlash("SetFilePostName",[A])};SWFUpload.prototype.setUseQueryString=function(A){this.settings.use_query_string=A;this.callFlash("SetUseQueryString",[A])};SWFUpload.prototype.setRequeueOnError=function(A){this.settings.requeue_on_error=A;this.callFlash("SetRequeueOnError",[A])};SWFUpload.prototype.setHTTPSuccess=function(A){if(typeof A==="string"){A=A.replace(" ","").split(",")}this.settings.http_success=A;this.callFlash("SetHTTPSuccess",[A])};SWFUpload.prototype.setAssumeSuccessTimeout=function(A){this.settings.assume_success_timeout=A;this.callFlash("SetAssumeSuccessTimeout",[A])};SWFUpload.prototype.setDebugEnabled=function(A){this.settings.debug_enabled=A;this.callFlash("SetDebugEnabled",[A])};SWFUpload.prototype.setButtonImageURL=function(A){if(A==undefined){A=""}this.settings.button_image_url=A;this.callFlash("SetButtonImageURL",[A])};SWFUpload.prototype.setButtonDimensions=function(C,A){this.settings.button_width=C;this.settings.button_height=A;var B=this.getMovieElement();if(B!=undefined){B.style.width=C+"px";B.style.height=A+"px"}this.callFlash("SetButtonDimensions",[C,A])};SWFUpload.prototype.setButtonText=function(A){this.settings.button_text=A;this.callFlash("SetButtonText",[A])};SWFUpload.prototype.setButtonTextPadding=function(B,A){this.settings.button_text_top_padding=A;this.settings.button_text_left_padding=B;this.callFlash("SetButtonTextPadding",[B,A])};SWFUpload.prototype.setButtonTextStyle=function(A){this.settings.button_text_style=A;this.callFlash("SetButtonTextStyle",[A])};SWFUpload.prototype.setButtonDisabled=function(A){this.settings.button_disabled=A;this.callFlash("SetButtonDisabled",[A])};SWFUpload.prototype.setButtonAction=function(A){this.settings.button_action=A;this.callFlash("SetButtonAction",[A])};SWFUpload.prototype.setButtonCursor=function(A){this.settings.button_cursor=A;this.callFlash("SetButtonCursor",[A])};SWFUpload.prototype.queueEvent=function(B,C){if(C==undefined){C=[]}else{if(!(C instanceof Array)){C=[C]}}var A=this;if(typeof this.settings[B]==="function"){this.eventQueue.push(function(){this.settings[B].apply(this,C)});setTimeout(function(){A.executeNextEvent()},0)}else{if(this.settings[B]!==null){throw"Event handler "+B+" is unknown or is not a function"}}};SWFUpload.prototype.executeNextEvent=function(){var A=this.eventQueue?this.eventQueue.shift():null;if(typeof (A)==="function"){A.apply(this)}};SWFUpload.prototype.unescapeFilePostParams=function(C){var E=/[$]([0-9a-f]{4})/i;var F={};var D;if(C!=undefined){for(var A in C.post){if(C.post.hasOwnProperty(A)){D=A;var B;while((B=E.exec(D))!==null){D=D.replace(B[0],String.fromCharCode(parseInt("0x"+B[1],16)))}F[D]=C.post[A]}}C.post=F}return C};SWFUpload.prototype.testExternalInterface=function(){try{return this.callFlash("TestExternalInterface")}catch(A){return false}};SWFUpload.prototype.flashReady=function(){var A=this.getMovieElement();if(!A){this.debug("Flash called back ready but the flash movie can't be found.");return }this.cleanUp(A);this.queueEvent("swfupload_loaded_handler")};SWFUpload.prototype.cleanUp=function(A){try{if(this.movieElement&&typeof (A.CallFunction)==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");for(var C in A){try{if(typeof (A[C])==="function"){A[C]=null}}catch(B){}}}}catch(D){}window["__flash__removeCallback"]=function(E,F){try{if(E){E[F]=null}}catch(G){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("file_queued_handler",A)};SWFUpload.prototype.fileQueueError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("file_queue_error_handler",[A,C,B])};SWFUpload.prototype.fileDialogComplete=function(B,C,A){this.queueEvent("file_dialog_complete_handler",[B,C,A])};SWFUpload.prototype.uploadStart=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("return_upload_start_handler",A)};SWFUpload.prototype.returnUploadStart=function(A){var B;if(typeof this.settings.upload_start_handler==="function"){A=this.unescapeFilePostParams(A);B=this.settings.upload_start_handler.call(this,A)}else{if(this.settings.upload_start_handler!=undefined){throw"upload_start_handler must be a function"}}if(B===undefined){B=true}B=!!B;this.callFlash("ReturnUploadStart",[B])};SWFUpload.prototype.uploadProgress=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_progress_handler",[A,C,B])};SWFUpload.prototype.uploadError=function(A,C,B){A=this.unescapeFilePostParams(A);this.queueEvent("upload_error_handler",[A,C,B])};SWFUpload.prototype.uploadSuccess=function(B,A,C){B=this.unescapeFilePostParams(B);this.queueEvent("upload_success_handler",[B,A,C])};SWFUpload.prototype.uploadComplete=function(A){A=this.unescapeFilePostParams(A);this.queueEvent("upload_complete_handler",A)};SWFUpload.prototype.debug=function(A){this.queueEvent("debug_handler",A)};SWFUpload.prototype.debugMessage=function(C){if(this.settings.debug){var A,D=[];if(typeof C==="object"&&typeof C.name==="string"&&typeof C.message==="string"){for(var B in C){if(C.hasOwnProperty(B)){D.push(B+": "+C[B])}}A=D.join("\n")||"";D=A.split("\n");A="EXCEPTION: "+D.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(A)}else{SWFUpload.Console.writeLine(C)}}};SWFUpload.Console={};SWFUpload.Console.writeLine=function(D){var B,A;try{B=document.getElementById("SWFUpload_Console");if(!B){A=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(A);B=document.createElement("textarea");B.id="SWFUpload_Console";B.style.fontFamily="monospace";B.setAttribute("wrap","off");B.wrap="off";B.style.overflow="auto";B.style.width="700px";B.style.height="350px";B.style.margin="5px";A.appendChild(B)}B.value+=D+"\n";B.scrollTop=B.scrollHeight-B.clientHeight}catch(C){alert("Exception: "+C.name+" Message: "+C.message)}};var SWFUpload;if(typeof (SWFUpload)==="function"){SWFUpload.prototype.initSettings=function(A){return function(){if(typeof (A)==="function"){A.call(this)}this.refreshCookies(false)}}(SWFUpload.prototype.initSettings);SWFUpload.prototype.refreshCookies=function(I){if(I===undefined){I=true}I=!!I;var E=this.settings.post_params;var C,H=document.cookie.split(";"),B=H.length,D,G,A,F;for(C=0;C<B;C++){D=H[C];while(D.charAt(0)===" "){D=D.substring(1,D.length)}G=D.indexOf("=");if(G>0){A=D.substring(0,G);F=D.substring(G+1);E[A]=F}}if(I){this.setPostParams(E)}}}var SWFUpload;if(typeof (SWFUpload)==="function"){SWFUpload.queue={};SWFUpload.prototype.initSettings=(function(A){return function(){if(typeof (A)==="function"){A.call(this)}this.queueSettings={};this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0;this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler;this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler;this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler;this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler;this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}})(SWFUpload.prototype.initSettings);SWFUpload.prototype.startUpload=function(A){this.queueSettings.queue_cancelled_flag=false;this.callFlash("StartUpload",[A])};SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=true;this.stopUpload();var A=this.getStats();while(A.files_queued>0){this.cancelUpload();A=this.getStats()}};SWFUpload.queue.uploadStartHandler=function(A){var B;if(typeof (this.queueSettings.user_upload_start_handler)==="function"){B=this.queueSettings.user_upload_start_handler.call(this,A)}B=(B===false)?false:true;this.queueSettings.queue_cancelled_flag=!B;return B};SWFUpload.queue.uploadCompleteHandler=function(B){var C=this.queueSettings.user_upload_complete_handler;var D;if(B.filestatus===SWFUpload.FILE_STATUS.COMPLETE){this.queueSettings.queue_upload_count++}if(typeof (C)==="function"){D=(C.call(this,B)===false)?false:true}else{if(B.filestatus===SWFUpload.FILE_STATUS.QUEUED){D=false}else{D=true}}if(D){var A=this.getStats();if(A.files_queued>0&&this.queueSettings.queue_cancelled_flag===false){this.startUpload()}else{if(this.queueSettings.queue_cancelled_flag===false){this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]);this.queueSettings.queue_upload_count=0}else{this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0}}}}}function FileProgress(C,A){this.fileProgressID=C.id;this.opacity=100;this.height=0;this.fileProgressWrapper=document.getElementById(this.fileProgressID);if(!this.fileProgressWrapper){this.fileProgressWrapper=document.createElement("div");this.fileProgressWrapper.className="progressWrapper";this.fileProgressWrapper.id=this.fileProgressID;this.fileProgressElement=document.createElement("div");this.fileProgressElement.className="progressContainer";var F=document.createElement("a");F.className="progressCancel";F.href="#";F.style.visibility="hidden";F.appendChild(document.createTextNode(" "));var B=document.createElement("div");B.className="progressName";B.appendChild(document.createTextNode(C.name));var E=document.createElement("div");E.className="progressBarInProgress";var D=document.createElement("div");D.className="progressBarStatus";D.innerHTML="&nbsp;";this.fileProgressElement.appendChild(F);this.fileProgressElement.appendChild(B);this.fileProgressElement.appendChild(D);this.fileProgressElement.appendChild(E);this.fileProgressWrapper.appendChild(this.fileProgressElement);document.getElementById(A).appendChild(this.fileProgressWrapper)}else{this.fileProgressElement=this.fileProgressWrapper.firstChild}this.height=this.fileProgressWrapper.offsetHeight}FileProgress.prototype.setProgress=function(A){this.fileProgressElement.className="progressContainer green";this.fileProgressElement.childNodes[3].className="progressBarInProgress";this.fileProgressElement.childNodes[3].style.width=A+"%"};FileProgress.prototype.setComplete=function(){this.appear();this.fileProgressElement.className="progressContainer blue";this.fileProgressElement.childNodes[3].className="progressBarComplete";this.fileProgressElement.childNodes[3].style.width="";var A=this;setTimeout(function(){A.disappear()},10000)};FileProgress.prototype.setError=function(){this.appear();this.fileProgressElement.className="progressContainer red";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var A=this;setTimeout(function(){A.disappear()},5000)};FileProgress.prototype.setCancelled=function(){this.appear();this.fileProgressElement.className="progressContainer";this.fileProgressElement.childNodes[3].className="progressBarError";this.fileProgressElement.childNodes[3].style.width="";var A=this;setTimeout(function(){A.disappear()},2000)};FileProgress.prototype.setStatus=function(A){this.fileProgressElement.childNodes[2].innerHTML=A};FileProgress.prototype.toggleCancel=function(B,C){this.fileProgressElement.childNodes[0].style.visibility=B?"visible":"hidden";if(C){var A=this.fileProgressID;this.fileProgressElement.childNodes[0].onclick=function(){C.cancelUpload(A);return false}}};FileProgress.prototype.appear=function(){if(this.fileProgressWrapper.filters){try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=100}catch(A){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=100)"}}else{this.fileProgressWrapper.style.opacity=1}this.fileProgressWrapper.style.height="";this.height=this.fileProgressWrapper.offsetHeight;this.opacity=100;this.fileProgressWrapper.style.display=""};FileProgress.prototype.disappear=function(){var E=15;var C=4;var B=30;if(this.opacity>0){this.opacity-=E;if(this.opacity<0){this.opacity=0}if(this.fileProgressWrapper.filters){try{this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity=this.opacity}catch(D){this.fileProgressWrapper.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+this.opacity+")"}}else{this.fileProgressWrapper.style.opacity=this.opacity/100}}if(this.height>0){this.height-=C;if(this.height<0){this.height=0}this.fileProgressWrapper.style.height=this.height+"px"}if(this.height>0||this.opacity>0){var A=this;setTimeout(function(){A.disappear()},B)}else{this.fileProgressWrapper.style.display="none"}};function swfUploadPreLoad(){var A=this;var B=function(){document.getElementById("divLoadingContent").style.display="";var C=function(){document.getElementById("divLoadingContent").style.display="none";document.getElementById("divLongLoading").style.display=""};this.customSettings.loadingTimeout=setTimeout(function(){C.call(A)},15*1000)};this.customSettings.loadingTimeout=setTimeout(function(){B.call(A)},1*1000)}function swfUploadLoaded(){var A=this;clearTimeout(this.customSettings.loadingTimeout);document.getElementById("divLoadingContent").style.display="none";document.getElementById("divLongLoading").style.display="none";document.getElementById("divAlternateContent").style.display="none";document.getElementById("btnCancel").onclick=function(){A.cancelQueue()}}function swfUploadLoadFailed(){clearTimeout(this.customSettings.loadingTimeout);document.getElementById("divLoadingContent").style.display="none";document.getElementById("divLongLoading").style.display="none";document.getElementById("divAlternateContent").style.display=""}function fileQueued(C){try{var A=new FileProgress(C,this.customSettings.progressTarget);A.setStatus("Pending...");A.toggleCancel(true,this)}catch(B){this.debug(B)}}function fileQueueError(C,E,D){try{if(E===SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED){alert("You have attempted to queue too many files.\n"+(D===0?"You have reached the upload limit.":"You may select "+(D>1?"up to "+D+" files.":"one file.")));return }var A=new FileProgress(C,this.customSettings.progressTarget);A.setError();A.toggleCancel(false);switch(E){case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:A.setStatus("File is too big.");this.debug("Error Code: File too big, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:A.setStatus("Cannot upload Zero Byte files.");this.debug("Error Code: Zero byte file, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:A.setStatus("Invalid File Type.");this.debug("Error Code: Invalid File Type, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;default:if(C!==null){A.setStatus("Unhandled Error")}this.debug("Error Code: "+E+", File name: "+C.name+", File size: "+C.size+", Message: "+D);break}}catch(B){this.debug(B)}}function fileDialogComplete(A,C){try{if(A>0){document.getElementById(this.customSettings.cancelButtonId).disabled=false}this.startUpload()}catch(B){this.debug(B)}}function uploadStart(C){try{var A=new FileProgress(C,this.customSettings.progressTarget);A.setStatus("Uploading...");A.toggleCancel(true,this)}catch(B){}return true}function uploadProgress(C,F,E){try{var D=Math.ceil((F/E)*100);var A=new FileProgress(C,this.customSettings.progressTarget);A.setProgress(D);A.setStatus("Uploading...")}catch(B){this.debug(B)}}function uploadSuccess(D,B){try{var A=new FileProgress(D,this.customSettings.progressTarget);A.setComplete();A.setStatus("Complete.");A.toggleCancel(false)}catch(C){this.debug(C)}}function uploadError(C,E,D){try{var A=new FileProgress(C,this.customSettings.progressTarget);A.setError();A.toggleCancel(false);switch(E){case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:A.setStatus("Upload Error: "+D);this.debug("Error Code: HTTP Error, File name: "+C.name+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:A.setStatus("Upload Failed.");this.debug("Error Code: Upload Failed, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.IO_ERROR:A.setStatus("Server (IO) Error");this.debug("Error Code: IO Error, File name: "+C.name+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:A.setStatus("Security Error");this.debug("Error Code: Security Error, File name: "+C.name+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:A.setStatus("Upload limit exceeded.");this.debug("Error Code: Upload Limit Exceeded, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:A.setStatus("Failed Validation.  Upload skipped.");this.debug("Error Code: File Validation Failed, File name: "+C.name+", File size: "+C.size+", Message: "+D);break;case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:if(this.getStats().files_queued===0){document.getElementById(this.customSettings.cancelButtonId).disabled=true}A.setStatus("Cancelled");A.setCancelled();break;case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:A.setStatus("Stopped");break;default:A.setStatus("Unhandled Error: "+E);this.debug("Error Code: "+E+", File name: "+C.name+", File size: "+C.size+", Message: "+D);break}}catch(B){this.debug(B)}}function uploadComplete(A){if(this.getStats().files_queued===0){document.getElementById(this.customSettings.cancelButtonId).disabled=true}}function queueComplete(B){var A=document.getElementById("divStatus");A.innerHTML=B+" file"+(B===1?"":"s")+" uploaded."}
