/*
 MIT
 @url http://livepipe.net/core
 @require prototype.js
*/
typeof Control=="undefined"&&(Control={});var $proc=function(a){return typeof a=="function"?a:function(){return a}},$value=function(a){return typeof a=="function"?a():a};
Object.Event={extend:function(a){a._objectEventSetup=function(b){this._observers=this._observers||{};this._observers[b]=this._observers[b]||[]};a.observe=function(b,a){if(typeof b=="string"&&typeof a!="undefined")this._objectEventSetup(b),this._observers[b].include(a)||this._observers[b].push(a);else for(var e in b)this.observe(e,b[e])};a.stopObserving=function(b,a){this._objectEventSetup(b);b&&a?this._observers[b]=this._observers[b].without(a):b?this._observers[b]=[]:this._observers={}};a.observeOnce=
function(a,c){var e=function(){c.apply(this,arguments);this.stopObserving(a,e)}.bind(this);this._objectEventSetup(a);this._observers[a].push(e)};a.notify=function(a){this._objectEventSetup(a);var c=[],e=$A(arguments).slice(1);try{for(var f=0;f<this._observers[a].length;++f)c.push(this._observers[a][f].apply(this._observers[a][f],e)||null)}catch(i){if(i==$break)return!1;else throw i;}return c};if(a.prototype)a.prototype._objectEventSetup=a._objectEventSetup,a.prototype.observe=a.observe,a.prototype.stopObserving=
a.stopObserving,a.prototype.observeOnce=a.observeOnce,a.prototype.notify=function(b){if(a.notify){var c=$A(arguments).slice(1);c.unshift(this);c.unshift(b);a.notify.apply(a,c)}this._objectEventSetup(b);var c=$A(arguments).slice(1),e=[];try{this.options&&this.options[b]&&typeof this.options[b]=="function"&&e.push(this.options[b].apply(this,c)||null);for(var f=0;f<this._observers[b].length;++f)e.push(this._observers[b][f].apply(this._observers[b][f],c)||null)}catch(i){if(i==$break)return!1;else throw i;
}return e}}};Element.addMethods({observeOnce:function(a,b,c){var e=function(){c.apply(this,arguments);Element.stopObserving(a,b,e)};Element.observe(a,b,e)}});
Object.extend(Event,function(){function a(a){if(a._prototypeEventID)return a._prototypeEventID[0];arguments.callee.id=arguments.callee.id||1;return a._prototypeEventID=[++arguments.callee.id]}function b(a){if(a&&a.include(":"))return"dataavailable";Prototype.Browser.IE||(a={mouseenter:"mouseover",mouseleave:"mouseout"}[a]||a);return a}function c(a,b){var c=h[a]=h[a]||{};return c[b]=c[b]||[]}function e(b,j,e){var d=a(b),d=c(d,j);if(d.pluck("handler").include(e))return!1;var f=function(a){if(!Event||
!Event.extend||a.eventName&&a.eventName!=j)return!1;Event.extend(a);e.call(b,a)};!Prototype.Browser.IE&&["mouseenter","mouseleave"].include(j)&&(f=f.wrap(function(a,b){var g=b.relatedTarget,d=b.currentTarget;if(g&&g.nodeType==Node.TEXT_NODE)g=g.parentNode;if(g&&g!=d&&!g.descendantOf(d))return a(b)}));f.handler=e;d.push(f);return f}function f(a,b,e){return c(a,b).find(function(a){return a.handler==e})}function i(a,b,c){var d=h[a]=h[a]||{};if(!d[b])return!1;d[b]=d[b].without(f(a,b,c))}function n(){for(var a in h)for(var b in h[a])h[a][b]=
null}var h=Event.cache;window.attachEvent&&window.attachEvent("onunload",n);return{observe:function(a,c,f){var a=$(a),d=b(c),c=e(a,c,f);if(!c)return a;a.addEventListener?a.addEventListener(d,c,!1):a.attachEvent("on"+d,c);return a},stopObserving:function(g,e,k){var g=$(g),d=a(g),m=b(e);if(!k&&e)return c(d,e).each(function(a){g.stopObserving(e,a.handler)}),g;else if(!e)return Object.keys(h[d]=h[d]||{}).each(function(a){g.stopObserving(a)}),g;var l=f(d,e,k);if(!l)return g;g.removeEventListener?g.removeEventListener(m,
l,!1):g.detachEvent("on"+m,l);i(d,e,k);return g},fire:function(a,b,c){a=$(a);if(a==document&&document.createEvent&&!a.dispatchEvent)a=document.documentElement;var d;document.createEvent?(d=document.createEvent("HTMLEvents"),d.initEvent("dataavailable",!0,!0)):(d=document.createEventObject(),d.eventType="ondataavailable");d.eventName=b;d.memo=c||{};document.createEvent?a.dispatchEvent(d):a.fireEvent(d.eventType,d);return Event.extend(d)}}}());Object.extend(Event,Event.Methods);
Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize()});(function(){function a(a){var c;a.wheelDelta?c=a.wheelDelta/120:a.detail&&(c=-a.detail/3);if(c&&a.element().fire("mouse:wheel",{delta:c}).stopped)return a.stop(),!1}document.observe("mousewheel",a);document.observe("DOMMouseScroll",a)})();
var IframeShim=Class.create({initialize:function(){this.element=new Element("iframe",{style:"position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);display:none",src:"javascript:void(0);",frameborder:0});$(document.body).insert(this.element)},hide:function(){this.element.hide();return this},show:function(){this.element.show();return this},positionUnder:function(a){var a=$(a),b=a.cumulativeOffset(),c=a.getDimensions();this.element.setStyle({left:b[0]+"px",top:b[1]+"px",width:c.width+
"px",height:c.height+"px",zIndex:a.getStyle("zIndex")-1}).show();return this},setBounds:function(a){for(prop in a)a[prop]+="px";this.element.setStyle(a);return this},destroy:function(){this.element&&this.element.remove();return this}});

