jQuery.registerClass("jQuery");Type.registerNamespace("Panorama");Type.registerNamespace("Panorama.Items");D=Function.createDelegate;function setZoomLevelTo100(){typeof InternetExplorer==="undefined"&&document.body.insertAdjacentHTML("beforeEnd",'<OBJECT ID="InternetExplorer" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');InternetExplorer.ExecWB(63,1,100,null)}var origStyle=origStyle||jQuery.style;jQuery.style=function(a,c,b){if(jQuery.support.opacity||c!=="opacity"||b===undefined)return origStyle(a,c,b);var d=a.currentStyle.backgroundImage||a.style.backgroundImage;if(d=d.match(/url[("']+(.*\.png[^\)"']*)[\)"']/i)){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+d[1]+",sizingMethod='crop'), ";a.style.backgroundImage=""}a.style.zoom=1;var e=a.style.filter.indexOf("alpha(opacity=");a.style.filter=(e!=-1?a.style.filter.substr(0,e):a.style.filter)+(b!=1?"alpha(opacity="+b*100+")":"");if(a.style.filter.endsWith(", "))a.style.filter=a.style.filter.substr(0,a.style.filter.length-2);return origStyle(a,c,undefined)};var origCur=origCur||jQuery.fx.prototype.cur;jQuery.fx.prototype.cur=function(){return origCur.call(this,false)};jQuery.fn.hasEvent=function(b){var a=this.data("events");return a&&a[b]};jQuery.easing.endSlow=function(c,d,a,b){return Math.cos((1-c)*Math.PI/2)*b+a};Panorama.ItemBase=function(b){this._beginStyle={};this._parentFrame=b;var a=this._parentFrame._domElement;this._domElement=$("<DIV id='"+a[0].id+"$Item"+a.children().length+"' />");a.append(this._domElement)};Panorama.ItemBase.prototype={_domElement:null,_parentFrame:null,_name:null,_beginStyle:null,_navigateUrl:null,get_parentFrame:function(){return this._parentFrame},get_name:function(){return this._name},get_beginStyle:function(){return this._beginStyle},get_navigateUrl:function(){return this._navigateUrl},get_attribute:function(a){return this._domElement.attr(a)},set_name:function(a){this._name=a},set_beginStyle:function(a){this._beginStyle=a},set_attribute:function(b,a){this._domElement.attr(b,a)},set_navigateUrl:function(a){this._navigateUrl=a},setConfiguration:function(a){a.name&&this.set_name(a.name);a.beginStyle&&this.set_beginStyle(a.beginStyle);a.navigateUrl&&this.set_navigateUrl(a.navigateUrl);a.attributes&&this._domElement.attr(a.attributes)},loadItem:function(){this._navigateUrl&&!this._domElement.hasEvent("click")&&this._domElement.click(D(this,this._navigateTo))},resetItem:function(){this._domElement.attr("style","position:absolute;display:block");this._domElement.hasEvent("click")&&this._domElement.css("cursor","pointer");this._beginStyle&&this._domElement.css(this._beginStyle)},_navigateTo:function(){if(this._navigateUrl.toLowerCase().startsWith("javascript:"))D(window,new Function(this._navigateUrl.substr(11)))();else window.location="/Panorama/NavigateTo/?url="+this._navigateUrl},_isOutsideFrame:function(){var a=this._domElement,b=this._parentFrame._domElement,j=a.width(),f=a.height(),d=b.width(),c=b.height(),g=parseInt(a.css("left"),10),h=parseInt(a.css("right"),10),i=parseInt(a.css("top"),10),e=parseInt(a.css("bottom"),10);return g<0||g+j>d||h<0||h+j>d||i<0||i+f>c||e<0||e+f>c}};Panorama.ItemBase.registerClass("Panorama.ItemBase");Panorama.LayerBase=function(a,b){this._zIndex=b;this._operations={};this._domElement=$("<DIV id='"+a[0].id+"$"+Object.getTypeName(this)+"' />");this._domElement.attr("style","position:absolute;overflow:hidden;z-index:"+this._zIndex);this._domElement.width(a.width());this._domElement.height(a.height());a.append(this._domElement);this._frameReel=new Panorama.FrameReel(this._domElement);$.extend(this._operations,Panorama.LayerBase._operationScripts)};Panorama.LayerBase.prototype={_domElement:null,_zIndex:0,_frameReel:null,_operations:null,_defaultAction:null,get_zIndex:function(){return this._zIndex},get_defaultAction:function(){return this._defaultAction},get_isReadyForAction:function(){return this._frameReel._isReadyForAction},set_defaultAction:function(a){this._defaultAction=a},setConfiguration:function(a){if(a.defaultAnimation){var b=new Panorama.Animation(a.defaultAnimation);this._frameReel.set_defaultAnimation(b)}a.defaultAction&&this.set_defaultAction(a.defaultAction);this._frameReel.set_frames(a.frames,a.defaultItemType);this._frameReel.set_currentFrameIndex(a.startIndex||0,false)},execOperation:function(a,b,c){if(!this._operations[a])throw Error.create("This operation is unknown");this._operations[a].call(this,b,c)}};Panorama.LayerBase.registerClass("Panorama.LayerBase");Panorama.LayerBase._operationScripts={moveToFrame:function(d,a){var c=a.direction||d,b=a.animation?new Panorama.Animation(a.animation):null;this._frameReel.moveToFrame(a.frameName,c,b)},jumpToFrame:function(c,b){var a=parseInt(b.frameName,10);if(!a&&a!==0)a=this._frameReel.getFrameIndexByName(b.frameName);if(a==-1)throw Error.argument("frameName","This frame is not found");this._frameReel.set_currentFrameIndex(a,true)}};Panorama.Animation=function(a){a&&this.setConfiguration(a)};Panorama.Animation.prototype={_type:null,_options:null,_style:null,_delegate:null,get_type:function(){return this._type},get_options:function(){return this._options},get_style:function(){return this._style},set_type:function(a){this._type=a;this._delegate=Panorama.Animation._animationScripts[a];if(!this._delegate)throw Error.argumentOutOfRange("type",a,"Invalid animation type");},set_options:function(a){this._options=a},set_style:function(a){this._style=a},setConfiguration:function(a){this.set_type(a.type);a.options&&this.set_options(a.options);a.style&&this.set_style(a.style)},execAnimation:function(b,a){if(!this._delegate)throw Error.argumentOutOfRange("type",type,"Animation type not set");this._delegate(this._options,this._style,b,a||jQuery.noop)}};Panorama.Animation.registerClass("Panorama.Animation");Panorama.Animation._animationScripts={fadeAndMove:function(a,e,c,d){var b=c.add(c.find("DIV")),a=jQuery.extend(true,{sleepTime:0,fadeOutSpeed:500,fadeTo:.3,moveSpeed:1e3,animation:"linear",fadeInSpeed:500},a);Panorama.AsyncScript.execute([function(b){window.setTimeout(D(b,b.execAction),a.sleepTime)},function(c){b.fadeTo(a.fadeOutSpeed,a.fadeTo,c.whenFinishedWith(b))},function(b){c.animate(e,a.moveSpeed,a.animation,b.whenFinishedWith(c))},function(c){b.fadeTo(a.fadeInSpeed,1,c.whenFinishedWith(b))}],d)},fadeAndStyle:function(a,e,c,d){var b=c.add(c.find("DIV")),a=jQuery.extend(true,{sleepTime:0,fadeOutSpeed:500,fadeTo:0,fadeInSpeed:500},a);Panorama.AsyncScript.execute([function(b){window.setTimeout(D(b,b.execAction),a.sleepTime)},function(c){b.fadeTo(a.fadeOutSpeed,a.fadeTo,c.whenFinishedWith(b))},function(a){c.css(e);a.execAction()},function(c){b.fadeTo(a.fadeInSpeed,1,c.whenFinishedWith(b))}],d)},move:function(a,d,b,c){var a=jQuery.extend(true,{sleepTime:0,moveSpeed:3e3,animation:"swing"},a);Panorama.AsyncScript.execute([function(b){window.setTimeout(D(b,b.execAction),a.sleepTime)},function(c){b.animate(d,a.moveSpeed,a.animation,c.whenFinishedWith(b))}],c)},moveDownAndUp:function(a,d,b,c){var a=jQuery.extend(true,{sleepTime:0,moveDownSpeed:1e3,moveSpeed:1e3,moveUpSpeed:1e3,animation:"swing"},a);Panorama.AsyncScript.execute([function(b){window.setTimeout(D(b,b.execAction),a.sleepTime)},function(c){b.animate({top:"+="+b.height()+"px"},a.moveDownSpeed,a.animation,c.whenFinishedWith(b))},function(c){b.animate(d,a.moveSpeed,a.animation,c.whenFinishedWith(b))},function(c){b.animate({top:"-="+b.height()+"px"},a.moveUpSpeed,a.animation,c.whenFinishedWith(b))}],c)},fade:function(a,e,c,d){var b=c.add(c.find("DIV")),a=jQuery.extend(true,{sleepTime:0,fadeSpeed:200,fadeTo:.5},a);Panorama.AsyncScript.execute([function(b){window.setTimeout(D(b,b.execAction),a.sleepTime)},function(c){b.fadeTo(a.fadeSpeed,a.fadeTo,c.whenFinishedWith(b))}],d)},curlyMove:function(a,f,b,e){for(var a=jQuery.extend(true,{sleepTime:0,moveHorizontal:100,moveHorizontalSpeed:1e3,moveVertical:-500,moveVerticalSpeed:5e3,animation:"swing"},a),c=[function(b){window.setTimeout(D(b,b.execAction),a.sleepTime)}],d=0;d<Math.ceil(a.moveVerticalSpeed/a.moveHorizontalSpeed);d++){c.push(function(c){b.animate({left:"+="+a.moveHorizontal+"px"},a.moveHorizontalSpeed,a.animation,c.whenFinishedWith(b))});c.push(function(c){b.animate({left:"-="+a.moveHorizontal+"px"},a.moveHorizontalSpeed,a.animation,c.whenFinishedWith(b))})}Panorama.AsyncScript.execute(c,jQuery.noop);Panorama.AsyncScript.execute([function(b){window.setTimeout(D(b,b.execAction),a.sleepTime)},function(c){b.animate({top:"+="+a.moveVertical+"px"},{duration:a.moveVerticalSpeed,animation:"linear",queue:false,callback:c.whenFinishedWith(b)})}],e)}};Panorama.AsyncScript=function(a){this._executeOnInstance=this;if(a)this._onFinished=a;this._actions=[]};Panorama.AsyncScript.prototype={_actions:null,_onFinished:null,_executeInstance:null,_cancellationPending:false,get_actions:function(){return this._actions},get_onFinished:function(){return this._onFinished},get_executeOnInstance:function(){return this._executeInstance},get_cancellationPending:function(){return this._cancellationPending},set_actions:function(b){for(var c=[],a=0;a<b.length;a++)b[a]&&c.push(b[a]);this._actions=c},set_onFinished:function(a){this._onFinished=a},set_executeOnInstance:function(a){this._executeInstance=a},addAction:function(a){this._actions.push(a)},cancelAsync:function(){this._cancellationPending=true},_cancelChain:function(){this._onfinished&&this._onfinished.call(this._instance);this._cancellactionPending=false},execScript:function(c){c&&this.set_executeOnInstance(c);for(var a=this._onFinished?(a=new Panorama.AsyncScriptAction(this,this._onFinished)):null,b=this._actions.length-1;b>=0;b--)a=new Panorama.AsyncScriptAction(this,this._actions[b],a);a.execAction()}};Panorama.AsyncScript.registerClass("Panorama.AsyncScript");Panorama.AsyncScript.execute=function(c,b){var a=new Panorama.AsyncScript(b);a.set_actions(c);a.execScript()};Panorama.AsyncScriptAction=function(c,b,a){this._asyncScript=c;if(b)this._delegate=b;if(a)this._nextAction=a};Panorama.AsyncScriptAction.prototype={_asyncScript:null,_delegate:null,_nextAction:null,get_asyncScript:function(){return this._asyncScript},get_delegate:function(){return this._delegate},get_nextAction:function(){return this._nextAction},set_delegate:function(a){this._delegate=a},set_nextAction:function(a){this._nextAction=a},execAction:function(){if(!this._delegate)throw Error.argumentNull("this._delegate","please set delegate first");if(this._asyncScript._cancellationPending)this._asyncScript.cancelChain();else{var a=this._asyncScript.get_executeOnInstance();if(!this._nextAction)this._delegate.call(a);else this._delegate.call(a,this._nextAction)}},whenFinishedWith:function(){if(arguments.length!=1)throw Error.argument("You can only use one argument, and it must be a number, array or jQuery");var a=D(this,this.execAction),b=arguments[0]&&arguments[0].length||arguments[0]||1;return function(){return--b||a()}}};Panorama.AsyncScriptAction.registerClass("Panorama.AsyncScriptAction");Panorama.BackLayer=function(a){Panorama.BackLayer.initializeBase(this,[a,1e3])};Panorama.BackLayer.prototype={setConfiguration:function(a){Panorama.BackLayer.callBaseMethod(this,"setConfiguration",[a])}};Panorama.BackLayer.registerClass("Panorama.BackLayer",Panorama.LayerBase);Panorama.BrainnetLayer=function(a){Panorama.BrainnetLayer.initializeBase(this,[a,9e3]);this._domElement.css("display","none");this._panoramaHack=a};Panorama.BrainnetLayer.prototype={_panoramaHack:null,_showBalloons:false,get_showBalloons:function(){return this._showBalloons},set_showBalloons:function(a){this._showBalloons=a},setConfiguration:function(c){c=$.extend(true,{},Panorama.BrainnetLayer._staticConfiguration,c);this._showBalloons&&this.createBalloons(c);Panorama.BrainnetLayer.callBaseMethod(this,"setConfiguration",[c]);this._frameReel.set_currentFrameIndex(c.startIndex||0,true);this._panoramaHack.css("backgroundImage",this._frameReel._frames[0]._domElement.css("backgroundImage"));for(var b=this._frameReel._frames[0]._items,a=0;a<b.length;a++){if(!b[a]._beginStyle.zIndex)b[a]._beginStyle.zIndex=this._zIndex;this._panoramaHack.append(b[a]._domElement)}for(var b=this._frameReel._frames[0]._items,a=0;a<b.length;a++){if(!b[a]._beginStyle.zIndex)b[a]._beginStyle.zIndex=this._zIndex;this._panoramaHack.append(b[a]._domElement)}},createBalloons:function(d){for(var a=[this.createBalloon(2,"Balloon2",100,70,500,3e3),this.createBalloon(1,"Balloon1",200,100,1e3,5e3),this.createBalloon(2,"Balloon1",500,70,500,3e3),this.createBalloon(2,"Balloon2",800,100,1e3,5e3)],c=d.frames.frame[0].items.item,b=0;b<a.length;b++)c.push(a[b]);return a.length},createBalloon:function(f,c,e,d,a,b){return{name:"Balloon_"+f,type:"AnimatedItem",beginStyle:{left:e+"px",top:"360px",width:"98px",height:"120px",background:"url('/Content/Panorama/"+c+".png') no-repeat 0px 0px"},handlers:{handler:[{respondsTo:"movingIn",animations:{animation:[{type:"curlyMove",options:{moveHorizontal:d,moveHorizontalSpeed:a,moveVerticalSpeed:b}}]}},{respondsTo:"click",animations:{animation:[{type:"fade",options:{fadeTo:0,fadeSpeed:1}}]}}]}}}};Panorama.BrainnetLayer.registerClass("Panorama.BrainnetLayer",Panorama.LayerBase);Panorama.BrainnetLayer._staticConfiguration={frames:{frame:[{items:{item:[{beginStyle:{left:"0px",top:"0px",width:"1000px",height:"360px",zIndex:1100,background:"url('/Content/Panorama/Swoosh.png') no-repeat 0px 0px"}},{navigateUrl:"/",beginStyle:{left:"50px",top:"5px",width:"220px",height:"115px"}},{navigateUrl:"/Portal/Login/",beginStyle:{left:"729px",top:"78px",width:"68px",height:"21px",background:"url('/Content/Panorama/Buttons.png') no-repeat -89px -24px"},hoverStyle:{left:"729px",top:"78px",width:"68px",height:"21px",background:"url('/Content/Panorama/Buttons.png') no-repeat -89px -1px"}},{navigateUrl:"/Contact/",beginStyle:{left:"820px",top:"75px",width:"82px",height:"15px",background:"url('/Content/Panorama/Buttons.png') no-repeat -3px -24px"},hoverStyle:{left:"820px",top:"75px",width:"82px",height:"15px",background:"url('/Content/Panorama/Buttons.png') no-repeat -3px -1px"}},{navigateUrl:"http://twitter.com/BrainnetBV",beginStyle:{left:"927px",top:"79px",width:"27px",height:"19px",background:"url('/Content/Panorama/Buttons.png') no-repeat -160px -24px"},hoverStyle:{left:"927px",top:"79px",width:"27px",height:"19px",background:"url('/Content/Panorama/Buttons.png') no-repeat -160px -1px"}},{navigateUrl:"javascript:TopPanorama.navigateLeft()",beginStyle:{left:"20px",top:"237px",width:"21px",height:"33px",background:"url('/Content/Panorama/Buttons.png') no-repeat -3px -51px"},hoverStyle:{left:"20px",top:"237px",width:"21px",height:"33px",background:"url('/Content/Panorama/Buttons.png') no-repeat -24px -51px"}},{navigateUrl:"javascript:TopPanorama.navigateRight()",beginStyle:{right:"20px",top:"237px",width:"21px",height:"33px",background:"url('/Content/Panorama/Buttons.png') no-repeat -48px -51px"},hoverStyle:{right:"20px",top:"237px",width:"21px",height:"33px",background:"url('/Content/Panorama/Buttons.png') no-repeat -69px -51px"}}]}}]}};Panorama.Frame=function(a,c,b){this._items=[];this._events=new Sys.EventHandlerList;this._domElement=$("<DIV id='"+a[0].id+"$Frame"+a.children().length+"' />");this._domElement.attr("style","position:relative;float:left;width:"+c+"px;height:"+b+"px;");a.append(this._domElement)};Panorama.Frame.prototype={_domElement:null,_name:null,_events:null,_backgroundImageUrl:null,_backgroundImageLoaded:false,_items:null,_isLoaded:false,_defaultItemType:"Panorama.Items.HoverItem",get_name:function(){return this._name},get_backgroundImageUrl:function(){return this._backgroundImageUrl},get_defaultItemType:function(){return this._defaultItemType},get_items:function(){return this._items},get_isLoaded:function(){return this._isLoaded&&(!this._backgroundImageUrl||this._backgroundImageLoaded)},set_name:function(a){this._name=a},set_backgroundImageUrl:function(a){this._backgroundImageUrl=a},set_items:function(a){if(!a)return;a=$.makeArray(a.item);if(!a)return;for(var b=0;b<a.length;b++){var d=Panorama.Utils.getType(Panorama.ItemBase,a[b].type||this._defaultItemType,Panorama.Items),c=new d(this);c.setConfiguration(a[b]);this._items.push(c)}},set_defaultItemType:function(a){this._defaultItemType=a},_movingIn:function(){this.resetFrame();var a=this._events.getHandler("movingIn");a&&a(this,Sys.EventArgs.Empty)},add_movingIn:function(a){this._events.addHandler("movingIn",a)},remove_movingIn:function(a){this._events.removeHandler("movingIn",a)},_movedIn:function(){var a=this._events.getHandler("movedIn");a&&a(this,Sys.EventArgs.Empty)},add_movedIn:function(a){this._events.addHandler("movedIn",a)},remove_movedIn:function(a){this._events.removeHandler("movedIn",a)},_movingOut:function(){var a=this._events.getHandler("movingOut");a&&a(this,Sys.EventArgs.Empty)},add_movingOut:function(a){this._events.addHandler("movingOut",a)},remove_movingOut:function(a){this._events.removeHandler("movingOut",a)},_movedOut:function(){var a=this._events.getHandler("movedOut");a&&a(this,Sys.EventArgs.Empty)},add_movedOut:function(a){this._events.addHandler("movedOut",a)},remove_movedOut:function(a){this._events.removeHandler("movedOut",a)},setConfiguration:function(a){a.name&&this.set_name(a.name);a.defaultItemType&&this.set_defaultItemType(a.defaultItemType);a.backgroundImageUrl&&this.set_backgroundImageUrl(a.backgroundImageUrl);this.set_items(a.items)},getItemIndexByName:function(b){for(var c=b.toLowerCase(),a=0;a<this._items.length;a++){var b=this._items[a].get_name();if(b&&b.toLowerCase()==c)return a}return-1},getItemByName:function(b){var a=this.getItemIndexByName(b);if(a==-1)throw Error.argument("name","This item is unknown or not in this frame: "+b);return this._items[a]},loadFrame:function(){if(!this._isLoaded){if(this._backgroundImageUrl){this._domElement.css("backgroundImage","url('"+this._backgroundImageUrl+"')");Panorama.Utils.loadImage(this._backgroundImageUrl,D(this,function(){this._backgroundImageLoaded=true}))}for(var a=0;a<this._items.length;a++)this._items[a].loadItem();this._isLoaded=true}},resetFrame:function(){for(var a=0;a<this._items.length;a++)this._items[a].resetItem()}};Panorama.Frame.registerClass("Panorama.Frame");Panorama.FrameReel=function(a){this._frames=[];this._frameWidth=a.width();this._frameHeight=a.height();this._domElement=$("<DIV id='"+a[0].id+"$FrameReel' />");this._domElement.attr("style","position:relative;left:"+this._frameWidth);this._domElement.height(this._frameHeight);a.append(this._domElement)};Panorama.FrameReel.prototype={_domElement:null,_frameWidth:null,_frameHeight:null,_frames:null,_currentFrameIndex:0,_isReadyForAction:true,_defaultAnimation:new Panorama.Animation({type:"fadeAndMove"}),get_frames:function(){return this._frames},get_currentFrameIndex:function(){return this._currentFrameIndex},get_isReadyForAction:function(){return this._isReadyForAction},get_defaultAnimation:function(){return this._defaultAnimation},set_frames:function(a,d){a=$.makeArray(a.frame);this._domElement.width((a.length+1)*this._frameWidth);for(var c=0;c<a.length;c++){var b=new Panorama.Frame(this._domElement,this._frameWidth,this._frameHeight);d&&b.set_defaultItemType(d);b.setConfiguration(a[c]);this._frames.push(b)}},set_currentFrameIndex:function(a,d){this._set_isNotReadyForAction();var c=this._frames[this._currentFrameIndex],b=this._frames.getItem(a);b.loadFrame();this._currentFrameIndex=a;this._frames.getItem(a-1).loadFrame();this._frames.getItem(a+1).loadFrame();this._domElement.css("left",a*-this._frameWidth);Panorama.Utils.waitFor(D(b,b.get_isLoaded),D(this,function(){if(d){this._currentFrameIndex!=a&&c._movingOut();b._movingIn();this._currentFrameIndex!=a&&c._movedOut();b._movedIn()}this._set_isReadyForAction()}))},_set_isReadyForAction:function(){this._isReadyForAction=true},_set_isNotReadyForAction:function(){this._isReadyForAction=false},set_defaultAnimation:function(a){this._defaultAnimation=a},getFrameIndexByName:function(b){for(var c=b.toLowerCase(),a=0;a<this._frames.length;a++){var b=this._frames[a].get_name();if(b&&b.toLowerCase()==c)return a}return-1},moveToFrame:function(f,a,d){this._set_isNotReadyForAction();if(a)a=a.toLowerCase();if(!d)d=this._defaultAnimation;var c=parseInt(f,10),l=this._currentFrameIndex;if(c!=f){c=this.getFrameIndexByName(f);if(c==-1)throw Error.argumentOutOfRange("name of the frame is unknown");}if(c<0||c>=this._frames.length)throw Error.argumentOutOfRange("This frameindex is out of bounds");if(a!="left"&&a!="right"){var j=!a||a=="shortest"||a=="default",g=Math.abs(this._currentFrameIndex-c)-this._frames.length/2;if(!g)throw Error.argument("direction","Neither route is the shortest/longest, you must specify left or right");a=j==g>0?"right":"left"}if(!d._style)d._style={};d._style.left=(a=="right"?"-=":"+=")+this._frameWidth+"px";var i=[],b=new Panorama.AsyncScript;while(this._currentFrameIndex!=c){var h=this._frames[this._currentFrameIndex],l=this._currentFrameIndex;this._currentFrameIndex=this._frames.trimIndex(this._currentFrameIndex+(a=="right"?1:-1));var e=this._frames[this._currentFrameIndex];e.loadFrame();i.push(D(e,e.get_isLoaded));b.addAction(function(a){h._movingOut();e._movingIn();a.execAction()});if(this._currentFrameIndex==(a=="right"?0:this._frames.length-1)){a=="left"&&b.addAction(function(a){this._domElement.css("left",this._frames.length*-this._frameWidth);a.execAction()});b.addAction(function(a){this._frames[0]._domElement.css("left",this._frames.length*this._frameWidth);a.execAction()})}b.addAction(function(a){d.execAnimation(this._domElement,a.whenFinishedWith(this._domElement))});if(this._currentFrameIndex==(a=="right"?0:this._frames.length-1)){a=="right"&&b.addAction(function(a){this._domElement.css("left",0);a.execAction()});b.addAction(function(a){this._frames[0]._domElement.css("left",0);a.execAction()})}b.addAction(function(a){h._movedOut();e._movedIn();a.execAction()})}b.set_onFinished(this._set_isReadyForAction);var k=function(){b.execScript(this);this._frames.getItem(this._currentFrameIndex-1).loadFrame();this._frames.getItem(this._currentFrameIndex+1).loadFrame()};Panorama.Utils.waitFor(i,D(this,k))}};Panorama.FrameReel.registerClass("Panorama.FrameReel");Panorama.FrontLayer=function(a){Panorama.FrontLayer.initializeBase(this,[a,3e3])};Panorama.FrontLayer.prototype={setConfiguration:function(a){Panorama.FrontLayer.callBaseMethod(this,"setConfiguration",[a])}};Panorama.FrontLayer.registerClass("Panorama.FrontLayer",Panorama.LayerBase);Panorama.MiddleLayer=function(a){Panorama.MiddleLayer.initializeBase(this,[a,2e3])};Panorama.MiddleLayer.prototype={setConfiguration:function(a){Panorama.MiddleLayer.callBaseMethod(this,"setConfiguration",[a])}};Panorama.MiddleLayer.registerClass("Panorama.MiddleLayer",Panorama.LayerBase);Panorama.Panorama=function(a,b){this._layers=[];this._scenes=[];if(!Panorama._configurations){Panorama._configurations={};window.onerror=Panorama.Utils.errorHandling;$.ajaxSetup({error:Panorama.Utils.errorHandling})}this._domElement=$("<DIV id='"+a[0].id+"$Panorama' style='position:relative;overflow:hidden' />");this._domElement.width(a.width());this._domElement.height(a.height());a.append(this._domElement);b&&this.setConfiguration(b)};Panorama.Panorama.prototype={_domElement:null,_configuration:null,_layers:null,_scenes:null,_currentSceneIndex:0,get_configuration:function(){return this._configuration},get_layers:function(){return this._layers},get_scenes:function(){return this._scenes},get_currentScene:function(){return this._scenes.getItem(this._currentSceneIndex)},get_isReadyForAction:function(){for(var a=0;a<this._layers.length;a++)if(!this._layers[a].get_isReadyForAction())return false;return true},set_layers:function(a){a=$.makeArray(a.layer);for(var b=0;b<a.length;b++){var d=Panorama.Utils.getType(Panorama.LayerBase,a[b].type),c=new d(this._domElement);c.setConfiguration(a[b]);this._layers.push(c)}},set_scenes:function(a,d){a=$.makeArray(a.scene);for(var c=0;c<a.length;c++){var b=new Panorama.Scene;d&&b.set_defaultAction(d);b.setConfiguration(a[c]);this._scenes.push(b)}},set_currentSceneIndex:function(e){this._currentSceneIndex=e;for(var c=this._scenes.getItem(e-1),b=c.get_rightOperations(),a=0;a<b.length;a++){var d=this.getLayerByTypeName(b[a]._layer);(b[a].get_action()||c.get_defaultAction()||d.get_defaultAction())=="moveToFrame"&&d.execOperation("jumpToFrame","startScene",{frameName:b[a].get_arguments().frameName})}},setConfiguration:function(a){if(this._configuration)throw Error.create("Configuration cannot be changed, please create new Panorama object");var b=D(this,function(){var b=Panorama._configurations[a.loadConfig];if(!b)throw Error.argument("loadConfig","De configuratie kon niet geladen worden, valideer de xml file tegen de xsd file");this._setConfiguration($.extend(true,{},b.config,a))});!a.loadConfig&&this._setConfiguration(a);if(Panorama._configurations[a.loadConfig])b();else Panorama.Utils.loadScript("/Panorama/Configuration/"+a.loadConfig+".js",b)},_setConfiguration:function(b){this._configuration=b;this.set_scenes(this._configuration.scenes,this._configuration.defaultAction);this.set_layers(this._configuration.layers);if(this._configuration.startScene){var a=parseInt(this._configuration.startScene,10)||this.getSceneIndexByTitle(this._configuration.startScene);if(a==-1)throw Error.argumentOutOfRange("startScene",this._configuration.startScene,"The given start scene is unknown, use the title or an index");this.set_currentSceneIndex(a)}},navigateLeft:function(){if(!this.get_isReadyForAction())return false;this._execOperations("left",this.get_currentScene().get_leftOperations());this._currentSceneIndex--},navigateRight:function(){if(!this.get_isReadyForAction())return false;this._execOperations("right",this.get_currentScene().get_rightOperations());this._currentSceneIndex++},_execOperations:function(e,b){for(var a=0;a<b.length;a++){var d=this.getLayerByTypeName(b[a].get_layer()),c=b[a].get_action()||this.get_currentScene().get_defaultAction()||d.get_defaultAction();if(c==null)throw Error.argumentNull("Method is not defined for an operation, nor is there a default specified for the scene or the layer");d.execOperation(c,e,b[a].get_arguments())}},getLayerByTypeName:function(b){for(var c=Panorama.Utils.getType(Panorama.LayerBase,b),a=0;a<this._layers.length;a++)if(Object.getType(this._layers[a])==c)return this._layers[a];throw Error.argumentOutOfRange("layerName",layerName,"The layer defined in the action is unknown");},getSceneIndexByTitle:function(b){for(var c=b.toLowerCase(),a=0;a<this._scenes.length;a++){var b=this._scenes[a].get_title();if(b&&b.toLowerCase()==c)return a}return-1}};Panorama.Panorama.registerClass("Panorama.Panorama");Panorama.Scene=function(){this._leftOperations=[];this._rightOperations=[]};Panorama.Scene.prototype={_title:null,_defaultAction:null,_leftOperations:null,_rightOperations:null,get_title:function(){return this._title},get_defaultAction:function(){return this._defaultAction},get_leftOperations:function(){return this._leftOperations},get_rightOperations:function(){return this._rightOperations},set_title:function(a){this._title=a},set_defaultAction:function(a){this._defaultAction=a},_set_operations:function(a,f){a=$.makeArray(a.operation);for(var d=[],c=0;c<a.length;c++){var b=new Panorama.SceneOperation;b.setConfiguration(a[c]);f.push(b);var e=Panorama.Utils.getType(Panorama.LayerBase,b.get_layer());if(Array.contains(d,e))throw Error.argumentOutOfRange("Only one operation per layer possible in this scene");d.push(e)}},setConfiguration:function(a){a.title&&this.set_title(a.title);a.defaultAction&&this.set_defaultAction(a.defaultAction);a.leftOperations&&this._set_operations(a.leftOperations,this._leftOperations);a.rightOperations&&this._set_operations(a.rightOperations,this._rightOperations)}};Panorama.Scene.registerClass("Panorama.Scene");Panorama.SceneOperation=function(){this._arguments={}};Panorama.SceneOperation.prototype={_layer:null,_action:null,_arguments:null,get_layer:function(){return this._layer},get_action:function(){return this._action},get_arguments:function(){return this._arguments},set_layer:function(a){this._layer=a},set_action:function(a){this._action=a},setConfiguration:function(b){for(var a in b)if(a=="layer")this.set_layer(b[a]);else if(a=="action")this.set_action(b[a]);else this._arguments[a]=b[a];if(!this._layer)throw Error.argumentNull("layer","Layer of this operation must be specified");}};Panorama.SceneOperation.registerClass("Panorama.SceneOperation");Panorama.Utils=function(){throw Error.notImplemented();};Panorama.Utils.registerClass("Panorama.Utils");Panorama.Utils.loadImage=function(c,a){var b=new Image;if(a)b.onload=function(){a()};b.src=c};Panorama.Utils.loadScript=function(d,e){var b=false,c=document.getElementsByTagName("head")[0]||document.documentElement,a=document.createElement("script");a.src=d;a.onload=a.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")if(!b){b=true;e()}};c.insertBefore(a,c.firstChild)};Panorama.Utils.waitFor=function(a,d,c){a=$.makeArray(a);var b=function(){for(var f=true,e=0;e<a.length;e++)if(a[e]!==null&&!a[e].apply(c||this)){f=false;break}if(f)d.apply(c||this);else window.setTimeout(b,100)};window.setTimeout(b,100)};Panorama.Utils.getType=function(d,a,b){if(!b)b=Panorama;if(a.indexOf(".")==-1)a=b.getName()+"."+a;var c=Sys.__upperCaseTypes[a.toUpperCase()];if(!c)throw Error.argumentOutOfRange("className",a,"This type is unknown");else if(!c.inheritsFrom(d))throw Error.argumentOutOfRange("className",a,"This type is does not extend from "+d.getName());return c};Panorama.Utils.errorHandling=function(){};Panorama.Utils.getArrayItem=function(a,b){return a[a.trimIndex(b)]};Panorama.Utils.trimIndex=function(b,a){while(a>=b.length)a-=b.length;while(a<0)a+=b.length;return a};if(Array.prototype.getItem&&Array.prototype.getItem.toString().indexOf("Panorama.Utils.getArrayItem")==-1)throw Error.create("Array.prototype.getItem was already implented by another framework");Array.prototype.getItem=function(a){return Panorama.Utils.getArrayItem(this,a)};if(Array.prototype.trimIndex&&Array.prototype.trimIndex.toString().indexOf("Panorama.Utils.trimIndex")==-1)throw Error.create("Array.prototype.trimIndex was already implented by another framework");Array.prototype.trimIndex=function(a){return Panorama.Utils.trimIndex(this,a)};Panorama.Items.AnimatedItem=function(a){Panorama.Items.AnimatedItem.initializeBase(this,[a]);this._handlers=[]};Panorama.Items.AnimatedItem.prototype={_handlers:null,get_handlers:function(){return this._handlers},set_handlers:function(a){a=$.makeArray(a.handler);for(var b=0;b<a.length;b++){var c=new Panorama.Items.AnimationHandler(this);c.setConfiguration(a[b]);this._handlers.push(c)}},setConfiguration:function(c){Panorama.Items.AnimatedItem.callBaseMethod(this,"setConfiguration",[c]);this.set_handlers(c.handlers);var b=$(this._handlers).filter(function(){return this._respondsToEventName=="movingIn"}).length>0,a=$(this._handlers).filter(function(){return this._respondsToEventName=="movingOut"}).length>0;b&&this._parentFrame.add_movingIn(D(this,function(){this.startItem()}));!b&&this._parentFrame.add_movedIn(D(this,function(){this.startItem()}));!a&&this._parentFrame.add_movingOut(D(this,function(){this.stopItem()}));a&&this._parentFrame.add_movedOut(D(this,function(){this.stopItem()}))},loadItem:function(){Panorama.Items.AnimatedItem.callBaseMethod(this,"loadItem");this._domElement.css("visibility","hidden");for(var b=this.get_parentFrame(),a=0;a<this._handlers.length;a++)this._handlers[a].loadStyles();this._domElement.css("visibility","visible")},resetItem:function(){Panorama.Items.AnimatedItem.callBaseMethod(this,"resetItem");for(var c=this.get_parentFrame(),a=0;a<this._handlers.length;a++){var b=this._handlers[a].get_respondsToItemName(),d=b=="this"?this:c.getItemByName(b);this._handlers[a].bindEvent(d._domElement);this._handlers[a].resetAnimation()}if(this._isOutsideFrame())this._domElement.css("display")=="block"&&this._domElement.css("display","none")},startItem:function(){if(this._isOutsideFrame())this._domElement.css("display")=="none"&&this._domElement.css("display","block")},stopItem:function(){for(var a=0;a<this._handlers.length;a++)this._handlers[a].stopAnimation();if(this._isOutsideFrame())this._domElement.css("display")=="block"&&this._domElement.css("display","none")}};Panorama.Items.AnimatedItem.registerClass("Panorama.Items.AnimatedItem",Panorama.ItemBase);Panorama.Items.AnimationHandler=function(a){this._animatedItem=a;this._animations=[];this._respondsToDelegate=D(this,this.execNextAnimation)};Panorama.Items.AnimationHandler.prototype={_animatedItem:null,_respondsToItemName:"this",_respondsToEventName:"click",_respondsToElement:null,_respondsToDelegate:null,_animations:[],_currentAnimationIndex:0,_animationsPerEvent:1,_animationsLeft:null,_cancellationPending:false,_removeHandlerAfterEventNumber:0,_currentEventIndex:0,get_respondsToItemName:function(){return this._respondsToItemName},get_respondsToEventName:function(){return this._respondsToEventName},get_animations:function(){return this._animations},get_animationsPerEvent:function(){return this._animationsPerEvent},get_currentAnimation:function(){return this._animations.getItem(this._currentAnimationIndex)},get_removeHandlerAfterEventNumber:function(){return this._removeHandlerAfterEventNumber},set_respondsTo:function(a){if(typeof a=="string")a=a.split(".");if(a.length==2){this.set_respondsToItemName(a[0]);this.set_respondsToEventName(a[1])}else if(a.length==1)this.set_respondsToEventName(a[0]);else throw Error.argument("respondsTo","Must be in format [ItemName.]EventName");},set_respondsToItemName:function(a){this._respondsToItemName=a},set_respondsToEventName:function(a){if(a=="click"||a=="hover")this._respondsToEventName=a.toLowerCase();else if(a=="movingIn"||a=="movedIn"||a=="movingOut"||a=="movedOut")this._respondsToEventName=a;else throw Error.argumentOutOfRange("value",a,"This event is not allowed");},set_animations:function(a){a=$.makeArray(a.animation);for(var b=0;b<a.length;b++){var c=new Panorama.Animation;c.setConfiguration(a[b]);this._animations.push(c)}},set_animationsPerEvent:function(a){if(a=="all")a=this._animations.length;this._animationsPerEvent=a},set_removeHandlerAfterEventNumber:function(a){if(a=="all")a=this._animations.length;this._removeHandlerAfterEventNumber=a},setConfiguration:function(a){this.set_respondsTo(a.respondsTo);this.set_animations(a.animations);a.animationsPerEvent&&this.set_animationsPerEvent(a.animationsPerEvent);a.removeHandlerAfterEventNumber&&this.set_removeHandlerAfterEventNumber(a.removeHandlerAfterEventNumber);this.resetAnimation()},loadStyles:function(){for(var a=0;a<this._animations.length;a++){var b=this._animations[a].style;b&&this._animatedItem._domElement.css(b)}},execNextAnimation:function(){if(this._cancellationPending){this._cancellationPending=false;return}if(this._animationsLeft==this._animationsPerEvent)this._currentEventIndex++;this._removeHandlerAfterEventNumber&&this._removeHandlerAfterEventNumber==this._currentEventIndex&&this.unbindEvent();if(this._animationsLeft==1)this.get_currentAnimation().execAnimation(this._animatedItem._domElement);else this.get_currentAnimation().execAnimation(this._animatedItem._domElement,D(this,this.execNextAnimation));this._currentAnimationIndex++;this._animationsLeft=this._animationsLeft-1||this._animationsPerEvent},bindEvent:function(a){if(this._respondsToElement)return;else this._respondsToElement=a;if(this._respondsToEventName=="movingIn"||this._respondsToEventName=="movedIn"||this._respondsToEventName=="movingOut"||this._respondsToEventName=="movedOut"){var b="add_"+this._respondsToEventName;this._animatedItem._parentFrame[b](this._respondsToDelegate)}else{if(this._respondsToEventName=="click"&&!a._clickDetached)a._clickDetached=true;a.bind(this._respondsToEventName,this._respondsToDelegate);this._respondsToEventName=="click"&&a.css("cursor","pointer")}},unbindEvent:function(){var a=this._respondsToElement;this._respondsToElement=null;if(this._respondsToEventName=="movingIn"||this._respondsToEventName=="movedIn"||this._respondsToEventName=="movingOut"||this._respondsToEventName=="movedOut"){var b="remove_"+this._respondsToEventName;this._animatedItem._parentFrame[b](this._respondsToDelegate)}else{a.unbind(this._respondsToEventName,this._respondsToDelegate);!a.hasEvent("click")&&a.css("cursor","default")}},resetAnimation:function(){this._cancellationPending=false;this._currentEventIndex=0;this._currentAnimationIndex=0;this._animationsLeft=this._animationsPerEvent},stopAnimation:function(){if(this._animationsLeft>1){this._cancellationPending=true;this._animatedItem._domElement.stop()}}};Panorama.Items.AnimationHandler.registerClass("Panorama.Items.AnimationHandler");Panorama.Items.HoverItem=function(a){Panorama.Items.HoverItem.initializeBase(this,[a])};Panorama.Items.HoverItem.prototype={_hoverStyle:null,get_hoverStyle:function(){return this._hoverStyle},set_hoverStyle:function(a){this._hoverStyle=a},setConfiguration:function(a){Panorama.Items.HoverItem.callBaseMethod(this,"setConfiguration",[a]);a.hoverStyle&&this.set_hoverStyle(a.hoverStyle)},loadItem:function(){Panorama.Items.HoverItem.callBaseMethod(this,"loadItem");if(this._hoverStyle){this._domElement.css(this._hoverStyle);this._domElement.hover(D(this,this._mouseOver),D(this,this._mouseOut))}},resetItem:function(){Panorama.Items.HoverItem.callBaseMethod(this,"resetItem")},_mouseOver:function(){this._domElement.css(this._hoverStyle)},_mouseOut:function(){this._domElement.css(this._beginStyle)}};Panorama.Items.HoverItem.registerClass("Panorama.Items.HoverItem",Panorama.ItemBase)
