﻿// UpdateControls.js
// Copyright (c) Nikhil Kothari, 2007. All Rights Reserved.
// http://www.nikhilk.net
//
// This product's copyrights are licensed under the Creative
// Commons Attribution-ShareAlike (version 2.5).B
// http://creativecommons.org/licenses/by-sa/2.5/
//
// You are free to:
// - copy, distribute, display, and perform the work 
// - make derivative works 
// - make commercial use of the work 
// as long as the work is itself not a server control offering of
// any sort, under the following conditions:
// Attribution. You must attribute the original work in your
//              product or release.
// Share Alike. If you alter, transform, or build upon this work,
//              you may distribute the resulting work only under
//              a license identical to this one.
//

Type.registerNamespace('nStuff');nStuff.AnimationType=function(){};nStuff.AnimationType.prototype = {crossFade:0,highlight:1,slideUp:2,slideDown:3,wipeLeft:4,wipeRight:5}
nStuff.AnimationType.registerEnum('nStuff.AnimationType',false);nStuff.$create_AnimatedUpdatePanelOptions=function(){return {};}
nStuff.$create_UpdateIndicatorOptions=function(){return {};}
nStuff.$create_UpdateActionOptions=function(){return {};}
nStuff.ScrollOffset=function(){};nStuff.ScrollOffset.prototype = {top:0,bottom:1,middle:2}
nStuff.ScrollOffset.registerEnum('nStuff.ScrollOffset',false);nStuff.$create_UpdateHistoryOptions=function(){return {};}
nStuff.AnimatedUpdatePanel=function(element){nStuff.AnimatedUpdatePanel.initializeBase(this,[element]);}
nStuff.AnimatedUpdatePanel.prototype={$2_0:null,$2_1:null,$2_2:null,$2_3:null,$2_4:null,get_animation:function(){return null;},set_animation:function(value){this.$2_0=value;return value;},dispose:function(){if(this.$2_1){var $0=Sys.WebForms.PageRequestManager.getInstance();$0.remove_pageLoaded(this.$2_1);$0.remove_pageLoading(this.$2_2);this.$2_1=null;this.$2_2=null;}nStuff.AnimatedUpdatePanel.callBaseMethod(this, 'dispose');},initialize:function(){nStuff.AnimatedUpdatePanel.callBaseMethod(this, 'initialize');this.$2_1=Function.createDelegate(this,this.$2_5);this.$2_2=Function.createDelegate(this,this.$2_6);var $0=Sys.WebForms.PageRequestManager.getInstance();$0.add_pageLoaded(this.$2_1);$0.add_pageLoading(this.$2_2);var $1=this.get_element();var $2=$1.childNodes;for(var $3=$2.length-1;$3>=0;$3--){if($2[$3].nodeType===1){this.$2_3=$2[$3];$1.style.width=this.$2_3.offsetWidth+'px';$1.style.height=this.$2_3.offsetHeight+'px';var $4=this.$2_3.style;$4.position='absolute';$4.left='0px';$4.top='0px';break;}}},$2_5:function($p0,$p1){if(!Array.contains($p1.get_panelsUpdated(),this.$2_3)){return;}var $0=this.get_element();$0.style.width=this.$2_3.offsetWidth+'px';$0.style.height=this.$2_3.offsetHeight+'px';if(this.$2_0.type===1){var $1=document.createElement('div');$1.className=this.$2_0.highlightCssClass;var $2=$1.style;$2.display='none';$2.position='absolute';$2.top='0px';$2.left='0px';$2.width=$0.offsetWidth+'px';$2.height=$0.offsetHeight+'px';$0.appendChild($1);var $3=new nStuff._HighlightOverlayEffect($1,this.$2_0.duration);$3.play(null);}else{this.$2_4.style.width=this.$2_3.offsetWidth+'px';this.$2_4.style.height=this.$2_3.offsetHeight+'px';var $4=this.$2_3.style;$4.position='absolute';$4.left='0px';$4.top='0px';if(!this.$2_0.type){var $5=new nStuff._CrossFadeEffect($0,this.$2_0.duration);$5.$1_2(this.$2_4,this.$2_3);}else{var $6=new nStuff._SlideOrWipeEffect($0,this.$2_0.duration);$6.$1_5(this.$2_0.type,this.$2_4,this.$2_3);}}},$2_6:function($p0,$p1){if(!Array.contains($p1.get_panelsUpdating(),this.$2_3)){return;}if(this.$2_0.type!==1){this.$2_4=this.$2_3;this.$2_3=document.createElement(this.$2_4.tagName);this.$2_3.className=this.$2_4.className;this.$2_3.id=this.$2_4.id;this.$2_3.style.visibility='hidden';this.$2_4.id='';this.$2_4.style.overflow='hidden';var $0=this.$2_4.innerHTML;$p0._destroyTree(this.$2_4);this.$2_4.innerHTML=$0;this.get_element().appendChild(this.$2_3);}}}
nStuff.UpdateIndicator=function(element){nStuff.UpdateIndicator.initializeBase(this,[element]);}
nStuff.UpdateIndicator.prototype={$2_0:null,get_options:function(){return this.$2_0;},set_options:function(value){this.$2_0=value;return value;},dispose:function(){nStuff.UpdateIndicator.callBaseMethod(this, 'dispose');},initialize:function(){nStuff.UpdateIndicator.callBaseMethod(this, 'initialize');var $0=this.get_element();var $1=Sys.UI.DomElement.getLocation($0);var $2=0;if(this.$2_0.scrollOffset===1){$2=$0.offsetHeight;}else if(this.$2_0.scrollOffset===2){$2=Math.floor($0.offsetHeight/2);}var $3=new nStuff._ScrollEffect(document.body,this.$2_0.scrollDuration);$3.$1_4($1.x,$1.y+$2,Function.createDelegate(this,this.$2_2));},$2_1:function(){this.dispose();},$2_2:function(){if(this.$2_0.highlightDuration){var $0=this.get_element();var $1=document.createElement('div');$1.className=this.$2_0.highlightCssClass;var $2=$1.style;$2.display='none';$2.position='absolute';$2.top='0px';$2.left='0px';$2.width=$0.offsetWidth+'px';$2.height=$0.offsetHeight+'px';$0.appendChild($1);var $3=new nStuff._HighlightOverlayEffect($1,this.$2_0.highlightDuration);$3.play(Function.createDelegate(this,this.$2_1));}else{this.dispose();}}}
nStuff._ScrollEffect=function(domElement,duration){nStuff._ScrollEffect.initializeBase(this,[domElement,duration]);this.set_easingFunction(Function.createDelegate(null,nStuff.Glitz.TimedAnimation.easeInOut));}
nStuff._ScrollEffect.prototype={$1_0:0,$1_1:0,$1_2:0,$1_3:0,performTweening:function($p0){var $0=Math.ceil($p0*this.$1_2)+this.$1_0;var $1=Math.ceil($p0*this.$1_3)+this.$1_1;window.scrollTo($0,$1);},$1_4:function($p0,$p1,$p2){this.$1_0=document.body.scrollLeft;this.$1_1=document.body.scrollTop;this.$1_2=$p0-this.$1_0;this.$1_3=$p1-this.$1_1;this.play($p2);}}
nStuff.UpdateAction=function(){nStuff.UpdateAction.initializeBase(this);}
nStuff.UpdateAction.prototype={$1_0:null,$1_1:null,$1_2:null,$1_3:null,$1_4:null,$1_5:0,$1_6:0,get_options:function(){return this.$1_3;},set_options:function(value){this.$1_3=value;return value;},dispose:function(){if(this.$1_2){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this.$1_2);this.$1_2=null;}if(this.$1_1){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this.$1_1);this.$1_1=null;}nStuff.UpdateAction.callBaseMethod(this, 'dispose');},initialize:function(){nStuff.UpdateAction.callBaseMethod(this, 'initialize');this.$1_0=Function.createDelegate(this,this.$1_7);Sys.Application.add_load(this.$1_0);},$1_7:function($p0,$p1){Sys.Application.remove_load(this.$1_0);this.$1_0=null;this.$1_2=Function.createDelegate(this,this.$1_9);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this.$1_2);this.$1_1=Function.createDelegate(this,this.$1_8);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this.$1_1);this.$1_B(this.$1_3,false);},$1_8:function($p0,$p1){Sys.WebForms.PageRequestManager.getInstance()._scrollPosition = null;Sys.WebForms.PageRequestManager.getInstance()._controlIDToFocus = null;if(this.$1_3.maintainScrollPosition){this.$1_5=document.body.scrollLeft;this.$1_6=document.body.scrollTop;}},$1_9:function($p0,$p1){this.$1_4=$p1.get_dataItems()[this.$1_3.dataID];if(this.$1_4){window.setTimeout(Function.createDelegate(this,this.$1_A),100);}},$1_A:function(){this.$1_B(this.$1_4,true);},$1_B:function($p0,$p1){if($p1){if($p0.scrollToID){var $0=$get($p0.scrollToID);if($0){var $1=Sys.UI.DomElement.getLocation($0);var $2=0;if($p0.scrollOffset===1){$2=$0.offsetHeight;}else if($p0.scrollOffset===2){$2=Math.floor($0.offsetHeight/2);}var $3=new nStuff._ScrollEffect(document.body,1000);$3.$1_4($1.x,$1.y+$2,null);}}else if($p0.maintainScrollPosition){window.scrollTo(this.$1_5,this.$1_6);}}if($p0.message){alert($p0.message);}if($p0.focusID){window.WebForm_AutoFocus($p0.focusID);}}}
nStuff._SlideOrWipeEffect=function(domElement,duration){nStuff._SlideOrWipeEffect.initializeBase(this,[domElement,duration]);this.set_easingFunction(Function.createDelegate(null,nStuff.Glitz.TimedAnimation.easeInOut));}
nStuff._SlideOrWipeEffect.prototype={$1_0:0,$1_1:null,$1_2:null,$1_3:0,$1_4:0,performCleanup:function(){this.$1_1.parentNode.removeChild(this.$1_1);this.$1_2.style.top='0px';this.$1_2.style.left='0px';this.$1_2.style.height=this.$1_3+'px';this.$1_2.style.overflow='visible';this.$1_2.style.clip='rect(auto auto auto auto)';},performSetup:function(){this.$1_3=this.get_domElement().offsetHeight;this.$1_4=this.get_domElement().offsetWidth;this.$1_2.style.visibility='visible';this.$1_2.style.overflow='hidden';switch(this.$1_0){case 2:this.$1_2.style.top=this.$1_3+'px';this.$1_2.style.height='0px';break;case 3:this.$1_2.style.height=this.$1_3+'px';this.$1_2.style.clip='rect(auto auto 0px auto)';break;case 4:this.$1_2.style.height=this.$1_3+'px';this.$1_2.style.clip=String.format('rect(auto auto auto {0}px)',this.$1_4);break;case 5:this.$1_2.style.height=this.$1_3+'px';this.$1_2.style.clip='rect(auto 0px auto auto)';break;}},performTweening:function($p0){switch(this.$1_0){case 2:var $0=Math.floor(this.$1_3*(1-$p0));this.$1_2.style.top=$0+'px';this.$1_2.style.height=(this.$1_3-$0)+'px';break;case 3:this.$1_2.style.clip=String.format('rect(auto auto {0}px auto)',Math.floor(this.$1_3*$p0));break;case 4:var $1=Math.floor(this.$1_4*(1-$p0));break;case 5:this.$1_2.style.clip=String.format('rect(auto {0}px auto auto)',Math.floor(this.$1_4*$p0));break;}},$1_5:function($p0,$p1,$p2){this.$1_0=$p0;this.$1_1=$p1;this.$1_2=$p2;this.play(null);}}
nStuff._CrossFadeEffect=function(domElement,duration){nStuff._CrossFadeEffect.initializeBase(this,[domElement,duration]);this.set_easingFunction(Function.createDelegate(null,nStuff.Glitz.TimedAnimation.easeInOut));}
nStuff._CrossFadeEffect.prototype={$1_0:null,$1_1:null,performCleanup:function(){this.$1_0.parentNode.removeChild(this.$1_0);},performSetup:function(){this.$1_3(this.$1_1,0);this.$1_1.style.visibility='visible';this.$1_1.style.filter='';},performTweening:function($p0){this.$1_3(this.$1_1,$p0);this.$1_3(this.$1_0,1-$p0);},$1_2:function($p0,$p1){this.$1_0=$p0;this.$1_1=$p1;this.play(null);},$1_3:function($p0,$p1){if(window.navigator.userAgent.indexOf('MSIE')>=0){$p0.style.filter='alpha(opacity='+($p1*100)+')';}else{$p0.style.opacity=$p1.toString();}}}
nStuff._HighlightOverlayEffect=function(domElement,duration){nStuff._HighlightOverlayEffect.initializeBase(this,[domElement,duration]);}
nStuff._HighlightOverlayEffect.prototype={performCleanup:function(){this.get_domElement().parentNode.removeChild(this.get_domElement());},performSetup:function(){this.$1_1(0);this.get_domElement().style.display='';},performTweening:function($p0){this.$1_1(Math.sin($p0*Math.PI)*0.75);},$1_0:function(){this.play(null);},$1_1:function($p0){if(window.navigator.userAgent.indexOf('MSIE')>=0){this.get_domElement().style.filter='alpha(opacity='+($p0*100)+')';}else{this.get_domElement().style.opacity=$p0.toString();}}}
nStuff.UpdateHistory=function(){nStuff.UpdateHistory.initializeBase(this);}
nStuff.UpdateHistory.prototype={$1_0:0,$1_1:null,$1_2:null,$1_3:null,$1_4:null,$1_5:false,$1_6:false,$1_7:null,$1_8:null,$1_9:null,$1_A:null,$1_B:null,get_options:function(){return null;},set_options:function(value){this.$1_B=(value.initialEntry)?value.initialEntry:'';this.$1_9=value.dataID;this.$1_A=value.postbackID;return value;},$1_C:function($p0){this.$1_6=true;if(this.$1_7){this.$1_5=true;this.$1_7.src=this.$1_8+$p0;}else{this.$1_13($p0);}},dispose:function(){if(this.$1_7){this.$1_7.detachEvent('onload',this.$1_2);this.$1_7=null;}if(this.$1_0){window.clearTimeout(this.$1_0);this.$1_0=0;}if(this.$1_4){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this.$1_4);this.$1_4=null;}nStuff.UpdateHistory.callBaseMethod(this, 'dispose');},$1_D:function(){var $0=window.location.hash;if(($0.length>=1)&&($0.charAt(0)==='#')){$0=$0.substr(1);}return $0;},initialize:function(){nStuff.UpdateHistory.callBaseMethod(this, 'initialize');this.$1_3=Function.createDelegate(this,this.$1_F);Sys.Application.add_load(this.$1_3);},$1_E:function($p0){__doPostBack(this.$1_A,$p0);},$1_F:function($p0,$p1){Sys.Application.remove_load(this.$1_3);this.$1_3=null;this.$1_4=Function.createDelegate(this,this.$1_11);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this.$1_4);if(window.navigator.userAgent.indexOf('MSIE')>=0){this.$1_7=$get('__historyFrame');this.$1_8=this.$1_7.src+'?';this.$1_2=Function.createDelegate(this,this.$1_10);this.$1_7.attachEvent('onload',this.$1_2);}this.$1_1=Function.createDelegate(this,this.$1_12);this.$1_0=window.setTimeout(this.$1_1,100);var $0=this.$1_D();if($0!==this.$1_B){this.$1_B=$0;this.$1_E($0);}},$1_10:function(){var $0=this.$1_7.contentWindow.location.search;if(($0.length>=1)&&($0.charAt(0)==='?')){$0=$0.substr(1);}this.$1_13($0);if(this.$1_5){this.$1_5=false;return;}this.$1_E($0);},$1_11:function($p0,$p1){var $0=$p1.get_dataItems()[this.$1_9];if($0){this.$1_C($0);}},$1_12:function(){this.$1_0=0;var $0=this.$1_D();if($0!==this.$1_B){if(!this.$1_6){this.$1_B=$0;this.$1_E($0);}}else{this.$1_6=false;}this.$1_0=window.setTimeout(this.$1_1,100);},$1_13:function($p0){this.$1_B=$p0;window.location.hash=$p0;}}
Type.registerNamespace('nStuff.Glitz');nStuff.Glitz.AnimationStopState=function(){};nStuff.Glitz.AnimationStopState.prototype = {complete:0,abort:1,revert:2}
nStuff.Glitz.AnimationStopState.registerEnum('nStuff.Glitz.AnimationStopState',false);nStuff.Glitz.Animation=function(domElement){if(!domElement){domElement=document.documentElement;}this.$0=domElement;Sys.Application.registerDisposableObject(this);}
nStuff.Glitz.Animation.prototype={$0:null,$1:false,$2:false,$3:null,get_completed:function(){return this.$1;},get_domElement:function(){return this.$0;},get_isPlaying:function(){return this.$2;},dispose:function(){if(this.$2){this.stop(1);}if(this.$0){this.$0=null;Sys.Application.unregisterDisposableObject(this);}},$4:function($p0){this.performSetup();this.$2=true;this.playCore();},$5:function($p0,$p1){this.stopCore($p0,$p1);this.$1=$p0;this.$2=false;this.performCleanup();if($p0&&(this.$3)){this.$3();}},$6:function($p0){return this.progressCore($p0);},performCleanup:function(){},performSetup:function(){},play:function(completedCallback){Sys.Debug.assert(!this.get_isPlaying());this.$1=false;this.$3=completedCallback;nStuff.Glitz.AnimationManager.$4(this,this.$0);},stop:function(stopState){Sys.Debug.assert(this.get_isPlaying());nStuff.Glitz.AnimationManager.$5(this,stopState);}}
nStuff.Glitz.AnimationManager=function(){}
nStuff.Glitz.AnimationManager.get_FPS=function(){return nStuff.Glitz.AnimationManager.$0;}
nStuff.Glitz.AnimationManager.set_FPS=function(value){Sys.Debug.assert((value>0)&&(value<=100));nStuff.Glitz.AnimationManager.$0=value;return value;}
nStuff.Glitz.AnimationManager.$3=function(){nStuff.Glitz.AnimationManager.$2=0;if(!nStuff.Glitz.AnimationManager.$1.length){return;}var $0=(new Date()).getTime();var $1=nStuff.Glitz.AnimationManager.$1;var $2=[];nStuff.Glitz.AnimationManager.$1=null;for(var $3=0;$3<$1.length;$3++){var $4=$1[$3];var $5=$4.$6($0);if($5){$4.$5(true,0);}else{Array.add($2,$4);}}if($2.length){nStuff.Glitz.AnimationManager.$1=$2;if(!nStuff.Glitz.AnimationManager.$2){nStuff.Glitz.AnimationManager.$2=window.setTimeout(Function.createDelegate(null,nStuff.Glitz.AnimationManager.$3),1000/nStuff.Glitz.AnimationManager.$0);}}}
nStuff.Glitz.AnimationManager.$4=function($p0,$p1){if(!nStuff.Glitz.AnimationManager.$1){nStuff.Glitz.AnimationManager.$1=[];}Array.add(nStuff.Glitz.AnimationManager.$1,$p0);$p0.$4(false);if(!nStuff.Glitz.AnimationManager.$2){nStuff.Glitz.AnimationManager.$2=window.setTimeout(Function.createDelegate(null,nStuff.Glitz.AnimationManager.$3),1000/nStuff.Glitz.AnimationManager.$0);}}
nStuff.Glitz.AnimationManager.$5=function($p0,$p1){Sys.Debug.assert(nStuff.Glitz.AnimationManager.$1);$p0.$5(false,$p1);Array.remove(nStuff.Glitz.AnimationManager.$1,$p0);}
nStuff.Glitz.TimedAnimation=function(domElement,duration){nStuff.Glitz.TimedAnimation.initializeBase(this,[domElement]);Sys.Debug.assert(duration>0);this.$7=duration;}
nStuff.Glitz.TimedAnimation.easeIn=function(t){return t*t;}
nStuff.Glitz.TimedAnimation.easeInOut=function(t){t=t*2;if(t<1){return t*t/2;}return -((--t)*(t-2)-1)/2;}
nStuff.Glitz.TimedAnimation.easeOut=function(t){return -t*(t-2);}
nStuff.Glitz.TimedAnimation.prototype={$7:0,$8:null,$9:0,get_duration:function(){return this.$7;},set_duration:function(value){Sys.Debug.assert(!this.get_isPlaying());Sys.Debug.assert(this.$7>=0);this.$7=value;return value;},get_easingFunction:function(){return this.$8;},set_easingFunction:function(value){Sys.Debug.assert(!this.get_isPlaying());this.$8=value;return value;},playCore:function(){this.$9=(new Date()).getTime();this.progressCore(this.$9);},progressCore:function(timeStamp){var $0=0;var $1=false;$0=(timeStamp-this.$9)/this.$7;$1=($0>=1);$0=Math.min(1,$0);if((!$1)&&(this.$8)){$0=this.$8($0);}this.performTweening($0);return $1;},stopCore:function(completed,stopState){if(!completed){if(!stopState){this.performTweening(1);}else if(stopState===2){this.performTweening(0);}}}}
nStuff.AnimatedUpdatePanel.registerClass('nStuff.AnimatedUpdatePanel',Sys.UI.Control);nStuff.UpdateIndicator.registerClass('nStuff.UpdateIndicator',Sys.UI.Behavior);nStuff.Glitz.Animation.registerClass('nStuff.Glitz.Animation',null,Sys.IDisposable);nStuff.Glitz.TimedAnimation.registerClass('nStuff.Glitz.TimedAnimation',nStuff.Glitz.Animation);nStuff._ScrollEffect.registerClass('nStuff._ScrollEffect',nStuff.Glitz.TimedAnimation);nStuff.UpdateAction.registerClass('nStuff.UpdateAction',Sys.Component);nStuff._SlideOrWipeEffect.registerClass('nStuff._SlideOrWipeEffect',nStuff.Glitz.TimedAnimation);nStuff._CrossFadeEffect.registerClass('nStuff._CrossFadeEffect',nStuff.Glitz.TimedAnimation);nStuff._HighlightOverlayEffect.registerClass('nStuff._HighlightOverlayEffect',nStuff.Glitz.TimedAnimation);nStuff.UpdateHistory.registerClass('nStuff.UpdateHistory',Sys.Component);nStuff.Glitz.AnimationManager.registerClass('nStuff.Glitz.AnimationManager');nStuff.Glitz.AnimationManager.$0=100;nStuff.Glitz.AnimationManager.$1=null;nStuff.Glitz.AnimationManager.$2=0;
// ---- Do not remove this footer ----
// Generated using Script# v0.3.0.0 (http://projects.nikhilk.net)
// -----------------------------------
