﻿
var D2L={GarbageCollection:{m_objects:[],Register:function(obj){this.m_objects.push(obj);},Dispose:function(){var length=this.m_objects.length;for(var i=0;i<length;i++){if(this.m_objects[i].Dispose){this.m_objects[i].Dispose();}}}},LP:{},LE:{},PT:{},LOR:{},EP:{}};D2L.InitTime=new Date();D2L.Class=function(){};D2L.Class.prototype.Construct=function(doRegisterForDisposal){if(doRegisterForDisposal===undefined){doRegisterForDisposal=false;}
if(doRegisterForDisposal){D2L.GarbageCollection.Register(this);}};D2L.Class.prototype.Dispose=function(){};D2L.Class.prototype.AttachObject=function(obj,attrName,val){if(obj!==undefined&&obj!==null){obj[attrName]=val;}};D2L.Class.extend=function(def){var classDef=function(){if(arguments[0]!==D2L.Class){this.Construct.apply(this,arguments);}};var proto=new this(D2L.Class);var superClass=this.prototype;for(var n in def){var item=def[n];if(item instanceof Function)item.$=superClass;proto[n]=item;}
classDef.prototype=proto;classDef.extend=this.extend;return classDef;};D2L.Files={};

function FindEventController(){if(window.EventController){return window.EventController;}else if(window.parent!=window){try{if(window.parent.window.EventController){return window.parent.window.EventController;}else if(window.parent.window.FindEventController){return window.parent.window.FindEventController();}}catch(e){}}else{try{if(window.opener&&!window.opener.closed){if(window.opener.window.EventController){return window.opener.window.EventController;}else if(window.opener.window.FindEventController){return window.opener.window.FindEventController();}}}catch(e){}}
return null;}
function RaiseEvent(evtName,args){Events.evtName.Raise(args);}
D2L.WindowEventManager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.Click=new D2L.EventHandler();this.KeyPress=new D2L.EventHandler();this.Resize=new D2L.EventHandler();this.Transform=new D2L.EventHandler();this.BC=this.BubbleChangeEvent;this.BE=this.BubbleExpandEvent;this.SelectIeHack=new D2L.EventHandler();this.HideContextMenus=new D2L.EventHandler();this.m_iframes=new Array();var me=this;var clickFunc=function(evt){WindowEventManager.Click.Trigger(new D2L.Event('click',evt));};var handleResize=function(evt){me.Resize.Trigger(new D2L.Event('resize',evt));};var onResizeTimer=function(evt){if(me.resizeTimer){clearTimeout(me.resizeTimer);}
me.resizeTimer=setTimeout(handleResize,100);};if(document.addEventListener){document.addEventListener('click',clickFunc,false);window.addEventListener('resize',handleResize,false);}else if(document.attachEvent){document.attachEvent('onclick',clickFunc);window.attachEvent('onresize',onResizeTimer);}
this.InstallKpel(document,function(obj,evt){return WindowEventManager.KeyPress.Trigger(evt);});UI.OnPageLoad().RegisterMethod(function(){me.Transform.Trigger();});},InstallKpel:function(obj,callback){if(obj===undefined||obj===null){return;}
if(obj.addEventListener){obj.addEventListener('keypress',function(evt){var key=0;var character='';if(evt.charCode&&evt.charCode!==0){key=parseInt(evt.charCode);character=String.fromCharCode(evt.charCode);}else if(evt.keyCode&&evt.keyCode!==0){key=parseInt(evt.keyCode);}
return callback.call(obj,obj,new D2L.KeyPressEvent(key,character,evt,null));},false);if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Safari){obj.addEventListener('keydown',function(evt){var key=parseInt(evt.keyCode);if(D2L.KeyPressEvent.IsCharacter(key)){key=0;}
if(key!==0){return callback.call(obj,obj,new D2L.KeyPressEvent(key,'',evt,null));}else{return false;}},false);}}else if(obj.attachEvent){var smush=0;obj.attachEvent('onkeydown',function(){if(window.event.keyCode==D2L.KeyPressEvent.Key.Backspace){return callback.call(obj,obj,new D2L.KeyPressEvent(window.event.keyCode,'',window.event,null));}else{smush=window.event.keyCode;}
return true;});obj.attachEvent('onkeypress',function(){if(window.event&&window.event.keyCode){if(window.event.keyCode==D2L.KeyPressEvent.Key.Enter||(window.event.keyCode>=32&&window.event.keyCode<=126)){smush=0;return callback.call(obj,obj,new D2L.KeyPressEvent(window.event.keyCode,String.fromCharCode(window.event.keyCode),window.event,null));}}
return true;});obj.attachEvent('onkeyup',function(){if(window.event&&window.event.keyCode==smush){return callback.call(obj,obj,new D2L.KeyPressEvent(window.event.keyCode,'',window.event,null));}
return true;});}},BubbleChangeEvent:function(source,eventObj){var event=new D2L.ChangeEvent(source,eventObj);event.Bubble();},BubbleExpandEvent:function(source,eventObj){var event=new D2L.ExpandEvent(source,eventObj);event.Bubble();},BubbleRemoveEvent:function(source){var e=new D2L.RemoveEvent(source);e.Bubble(false);}});D2L.Event=D2L.Class.extend({Construct:function(type,source,eventObj){arguments.callee.$.Construct.call(this);this.type=type;this.source=source;this.m_doBubble=true;this.eventObj=eventObj;},Bubble:function(doBubbleUp){if(doBubbleUp===undefined){doBubbleUp=true;}
var typeName='Default';for(var tn in D2L.Event.Type){if(D2L.Event.Type[tn]==this.type){typeName=tn;break;}}
var eventHandlerName='ID2LOn'+typeName;var me=this;var Up=function(node){if(node){if(node[eventHandlerName]){node[eventHandlerName].Trigger(me);}
if(node.parentNode&&me.DoBubble()){Up(node.parentNode);}}};var Down=function(node){if(node[eventHandlerName]!==undefined){node[eventHandlerName].Trigger(me);}
if(me.DoBubble()){if(node.cells!==undefined){for(var i=0;i<node.cells.length;i++){Down(node.cells[i]);}}
if(node.rows!==undefined){for(var i=0;i<node.rows.length;i++){Down(node.rows[i]);}}
for(var i=0;i<node.childNodes.length;i++){Down(node.childNodes[i]);}}};if(doBubbleUp){Up(this.source);}else{Down(this.source);}},GetDomEvent:function(){return this.eventObj;},CancelBubbling:function(){this.m_doBubble=false;},DoBubble:function(){return this.m_doBubble;},ResumeBubbling:function(){this.m_doBubble=true;}});D2L.Event.Type={Default:1,Change:2,KeyPress:3,Expand:4,Transform:5,SelectIeHack:6,Remove:7,Scroll:8};D2L.ChangeEvent=D2L.Event.extend({Construct:function(source,eventObj){arguments.callee.$.Construct.call(this,D2L.Event.Type.Change,source,eventObj);this.hasChangeBeenShown=false;}});D2L.KeyPressEvent=D2L.Event.extend({Construct:function(keyCode,character,evt,source){arguments.callee.$.Construct.call(this,D2L.Event.Type.KeyPress,source,evt);this.m_keyCode=keyCode;this.m_character=character;},IsNumber:function(){var key=this.GetKey();return((key>=48)&&(key<=57));},GetKey:function(){return this.m_keyCode;},GetCharacter:function(){return this.m_character;},Cancel:function(){if(this.eventObj.preventDefault){this.eventObj.preventDefault();}},StopPropagation:function(){if(this.eventObj.stopPropagation){this.eventObj.stopPropagation();}else if(this.eventObj.cancelBubble){this.eventObj.cancelBubble=true;}}});D2L.KeyPressEvent.Key={Backspace:8,Enter:13,Escape:27,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Delete:46};D2L.KeyPressEvent.IsCharacter=function(key){return key!=D2L.KeyPressEvent.Key.Backspace&&key!=D2L.KeyPressEvent.Key.Escape&&key!=D2L.KeyPressEvent.Key.ArrowLeft&&key!=D2L.KeyPressEvent.Key.ArrowUp&&key!=D2L.KeyPressEvent.Key.ArrowRight&&key!=D2L.KeyPressEvent.Key.ArrowDown&&key!=D2L.KeyPressEvent.Key.Delete;};D2L.ExpandEvent=D2L.Event.extend({Construct:function(source,eventObj){arguments.callee.$.Construct.call(this,D2L.Event.Type.Expand,source,eventObj);},Bubble:function(doBubbleUp){UI.GetDisplayGroupManager().Init();arguments.callee.$.Bubble.call(this,doBubbleUp);}});D2L.TransformEvent=D2L.Event.extend({Construct:function(source){arguments.callee.$.Construct.call(this,D2L.Event.Type.Transform,source);}});D2L.SelectIeHackEvent=D2L.Event.extend({Construct:function(doHide,source,eventObj){arguments.callee.$.Construct.call(this,D2L.Event.Type.SelectIeHack,source,eventObj);this.doHide=doHide;}});D2L.RemoveEvent=D2L.Event.extend({Construct:function(source){arguments.callee.$.Construct.call(this,D2L.Event.Type.Remove,source);}});D2L.EventHandler=function(){this.methodListeners=new Array();this.objectListeners=new Array();this.jsListeners=new Array();this.ignoreEvents=false;};D2L.EventHandler.prototype.RegisterJs=function(js){this.jsListeners.push(js);};D2L.EventHandler.prototype.RegisterMethod=function(method){var found=false;for(var i=0;i<this.methodListeners.length;i++){if(this.methodListeners[i]==method){found=true;break;}}
if(!found){this.methodListeners.push(method);}};D2L.EventHandler.prototype.Register=function(obj,method){var found=false;for(var i=0;i<this.objectListeners.length;i++){if(this.objectListeners[i].object==obj&&this.objectListeners[i].method==method){found=true;break;}}
if(!found){var pair=new Object();pair.object=obj;pair.method=method;this.objectListeners.push(pair);}};D2L.EventHandler.prototype.SetIgnoreEvents=function(bool){this.ignoreEvents=bool;};D2L.EventHandler.prototype.Trigger=function(){if(this.ignoreEvents){return false;}
var result=true;var i;for(i=0;i<this.methodListeners.length;i++){try{result=this.methodListeners[i].apply(this.methodListeners[i],arguments);if(result===false){return false;}}catch(e){if(D2L.Debug.IsEnabled()){throw e;}}}
var pair,object,method;for(i=0;i<this.objectListeners.length;i++){method=null;object=null;try{pair=this.objectListeners[i];object=pair.object;method=object[pair.method];}catch(e){}
if(method!==undefined&&method!==null&&object!==undefined&&object!==null){result=method.apply(object,arguments);if(result===false){return false;}}}
for(i=0;i<this.jsListeners.length;i++){eval(this.jsListeners[i]);}
return true;};

D2L.Control=D2L.Class.extend({Construct:function(type,doRegisterForDisposal){arguments.callee.$.Construct.call(this,doRegisterForDisposal);if(type===undefined){type=D2L.Control.Type.Unknown;}
this.IDomNode=null;this.IChildrenDomNode=null;this.isD2LControl=true;this.m_children=[];this.m_hasDomBeenBuilt=false;this.m_isIntegrated=false;this.m_nextSibling=null;this.m_previousSibling=null;this.m_parent=null;this.m_controlType=type;this.m_window=window;this.m_ignoreTransformEvent=false;this.m_mappedId='';this.m_controlId=new D2L.Control.Id();this.OnChildAdd=new D2L.EventHandler();this.OnChildRemove=new D2L.EventHandler();this.OnChildRemoveStructure=new D2L.EventHandler();this.OnDomInsertion=new D2L.EventHandler();this.m_parentChangeEvent=new D2L.EventHandler();},AppendChild:function(node,sourceDomNode){return this.InsertBefore(node,undefined,sourceDomNode);},AppendChildren:function(children,sourceDomNode){this.m_ignoreTransformEvent=true;for(var i=0;i<children.length;i++){if(i==children.length-1){this.m_ignoreTransformEvent=false;}
this.AppendChild(children[i],sourceDomNode);}
this.m_ignoreTransformEvent=false;},AppendTo:function(parentNode){if(parentNode){if(parentNode.d2l_win!==undefined){this.SetWindow(parentNode.d2l_win);}
if(!this.m_hasDomBeenBuilt){this.BuildDom();}
if(parentNode.isD2LControl){parentNode.AppendChild(this);}else if(parentNode.appendChild){parentNode.appendChild(this.IDomNode);this.OnDomInsertion.Trigger();}}},BuildDom:function(){this.m_hasDomBeenBuilt=true;},Children:function(){return this.m_children;},ChildrenDomNode:function(){return(this.IChildrenDomNode)?this.IChildrenDomNode:this.IDomNode;},CreateCell:function(row,index){if(index===undefined){index=-1;}
var cell=row.insertCell(index);this.AttachObject(cell,'d2l_win',this.GetWindow());return cell;},CreateElement:function(elementName){return this.GetUI().CreateElement(elementName);},CreateTextNode:function(text){return this.GetUI().CreateTextNode(text);},GetControlId:function(){return this.m_controlId;},GetControlType:function(){return this.m_controlType;},GetDomNode:function(){if(this.IDomNode===null&&this.m_mappedId.length>0){this.IDomNode=UI.GetById(this.GetMappedId());}
return this.IDomNode;},GetMappedId:function(){if(this.m_mappedId.length===0){if(this.IDomNode!==null&&this.IDomNode.id.length>0){this.m_mappedId=this.IDomNode.id;}else{this.m_mappedId=UI.GetUniqueHtmlId();}}
return this.m_mappedId;},GetUI:function(){return this.GetWindow()['UI'];},GetWindow:function(){if(this.Parent()){return this.Parent().GetWindow();}else{return this.m_window;}},IsRendered:function(){return this.m_hasDomBeenBuilt;},Integrate:function(parent,IDomNode){this.IntegrateChild(parent,IDomNode);},IntegrateChild:function(parent,IDomNode){if(parent){this.m_parent=parent;this.ParentChangeEvent().Trigger(parent);if(parent.m_children.length>0){parent.m_children[parent.m_children.length-1].m_nextSibling=this;this.m_previousSibling=parent.m_children[parent.m_children.length-1];}
parent.m_children.push(this);}
if(IDomNode){this.IDomNode=IDomNode;this.AttachObject(this.IDomNode,'ID2L',this);this.m_hasDomBeenBuilt=true;}},IntegrateControlInfo:function(controlInfo,isRendered){if(this.IsIntegrated()){return;}
this.m_isIntegrated=true;if(isRendered===undefined){isRendered=true;}
this.m_hasDomBeenBuilt=isRendered;if(isRendered&&this.GetDomNode()!==null){this.AttachObject(this.GetDomNode(),'ID2L',this);}},IntegrateControl:function(controlInfo,isRendered){this.IntegrateControlInfo(controlInfo,isRendered);},IntegrateControlMin:function(controlInfo,isRendered){this.IntegrateControlInfo(controlInfo,isRendered);},InsertBefore:function(child,beforeChild,sourceDomNode){if(!child||child===undefined||child===null){return null;}
if(!child.isD2LControl){var control=new D2L.Control();control.IDomNode=child;control.m_hasDomBeenBuilt=true;child=control;}
if(child.Parent()==this){child=this.RemoveChildStructure(child);}
if(!this.m_hasDomBeenBuilt){this.BuildDom();}
if(sourceDomNode===undefined){sourceDomNode=this.ChildrenDomNode();}
if(beforeChild&&!beforeChild.m_hasDomBeenBuilt){beforeChild.BuildDom();}
var i;var beforePos=-1;if(beforeChild){for(i=0;i<this.m_children.length;i++){if(this.m_children[i]==beforeChild){beforePos=i;break;}}}
if(beforeChild&&(beforePos==-1||beforeChild.IDomNode.parentNode!=sourceDomNode)){beforeChild=null;beforePos=-1;}
child.m_parent=this;child.ParentChangeEvent().Trigger(this);if(beforePos>-1){if(this.m_children[beforePos].m_previousSibling){this.m_children[beforePos].m_previousSibling.m_nextSibling=child;child.m_previousSibling=this.m_children[beforePos].m_previousSibling;}
this.m_children[beforePos].m_previousSibling=child;child.m_nextSibling=this.m_children[beforePos];this.m_children.splice(beforePos,0,child);}else{if(this.m_children.length>0){this.m_children[this.m_children.length-1].m_nextSibling=child;child.m_previousSibling=this.m_children[this.m_children.length-1];}
this.m_children.push(child);}
if(!child.m_hasDomBeenBuilt){child.BuildDom();}
if(beforePos>-1){if(child.IDomNode.parentNode!=sourceDomNode){sourceDomNode.insertBefore(child.IDomNode,beforeChild.IDomNode);this.OnDomInsertion.Trigger();}}else{if(child.IDomNode&&(!child.IDomNode.parentNode||child.IDomNode.parentNode!=sourceDomNode)){try{if(child.IDomNode.tagName&&child.IDomNode.tagName.toLowerCase()!='tr'){sourceDomNode.appendChild(child.IDomNode);child.OnDomInsertion.Trigger();}}catch(e){}}}
this.OnChildAdd.Trigger(new D2L.Event('ChildAdd',this),child);if(!this.m_ignoreTransformEvent){var transformEvent=new D2L.TransformEvent(child.IDomNode);transformEvent.Bubble();}
return child;},InsertSorted:function(child,isGreaterThan){var beforeChild;for(var i=0;i<this.Children().length;i++){if(isGreaterThan(this.Children()[i],child)){beforeChild=this.Children()[i];break;}}
return this.InsertBefore(child,beforeChild);},IsFirstSibling:function(){return(this.PreviousSibling()===null);},IsIntegrated:function(){return this.m_isIntegrated;},IsLastSibling:function(){return(this.NextSibling()===null);},NextSibling:function(){return this.m_nextSibling;},Parent:function(){return this.m_parent;},ParentChangeEvent:function(){return this.m_parentChangeEvent;},PreviousSibling:function(){return this.m_previousSibling;},Remove:function(fadeOut){if(fadeOut===undefined){fadeOut=undefined;}
if(this.IDomNode){var me=this;var doRemoval=function(){if(me.m_parent&&me.m_parent.isD2LControl){return me.m_parent.RemoveChild(me);}else if(me.IDomNode.parentNode){if(me.IDomNode.parentNode.deleteRow){me.IDomNode.parentNode.deleteRow(me.IDomNode.rowIndex);}else{me.IDomNode=me.IDomNode.parentNode.removeChild(me.IDomNode);}
var transformEvent=new D2L.TransformEvent(me.IDomNode);transformEvent.Bubble();}};if(fadeOut){var myAnim=new YAHOO.util.Anim(this.IDomNode,{opacity:{to:0}},0.5);myAnim.onComplete.subscribe(function(){doRemoval();});myAnim.animate();}else{doRemoval();}
return me;}
return null;},RemoveChild:function(child){if(!child||child===undefined||child===null){return null;}
child=this.RemoveChildStructure(child);if(child){this.OnChildRemove.Trigger(new D2L.Event('ChildRemove',this),child);}
return child;},RemoveChildStructure:function(child){if(!child||child===undefined||child===null){return null;}
for(var i=0;i<this.m_children.length;i++){if(this.m_children[i]==child){break;}}
if(i>=this.m_children.length){return null;}
var domNode=child;if(child.NextSibling()){child.NextSibling().m_previousSibling=child.PreviousSibling();}
if(child.PreviousSibling()){child.PreviousSibling().m_nextSibling=child.NextSibling();}
child.m_parent=null;child.m_nextSibling=null;child.m_previousSibling=null;domNode=child.IDomNode;if(domNode&&domNode.parentNode){this.m_children.splice(i,1);if(domNode.parentNode.deleteRow){domNode.parentNode.deleteRow(domNode.rowIndex);}else{domNode=domNode.parentNode.removeChild(domNode);}
var transformEvent=new D2L.TransformEvent(domNode);transformEvent.Bubble();}
this.OnChildRemoveStructure.Trigger(new D2L.Event('ChildRemoveStructure',this),child);return child;},RequireControlId:function(){if(this.m_controlId.ID().length===0){this.SetControlId(UI.GetUniqueHtmlId());}},SetControlId:function(id,sid){UI.GetControlMap().UnregisterControl(this);this.m_controlId=new D2L.Control.Id(id,sid);UI.GetControlMap().RegisterControl(this);},SetDomNode:function(domNode){this.IDomNode=domNode;return this.IDomNode;},SetValidator:function(validator){this.RequireControlId();validator.RequireControlId();UI.GetValidationManager().SetControlValidator(this.GetControlId(),validator.GetControlId());},SetValidationGroup:function(group){this.RequireControlId();UI.GetValidationManager().SetControlValidationGroup(this.GetControlId(),group);},SetValidationSubject:function(subject){this.RequireControlId();UI.GetValidationManager().SetControlSubject(this.GetControlId(),subject);},SetWindow:function(w){this.m_window=w;}});D2L.Control.TextFormat={Normal:1,Bold:2};D2L.Control.Id=D2L.Class.extend({Construct:function(id,sid){arguments.callee.$.Construct.call(this);if(id===undefined){id='';}else if(!id.isString){id=id.toString();}
if(sid===undefined){sid='';}else if(!sid.isString){sid=sid.toString();}
this.m_id=id.toLowerCase();this.m_sid=sid.toLowerCase();},Deserialize:function(deserializer){this.m_id=deserializer.GetMember('ID');if(deserializer.HasMember('SID')){this.m_sid=deserializer.GetMember('SID');}},DeserializeMin:function(deserializer){this.m_id=deserializer.GetMember();if(deserializer.HasMember()){this.m_sid=deserializer.GetMember();}},Serialize:function(serializer){serializer.AddMember('ID',this.m_id);if(this.m_sid.length>0){serializer.AddMember('SID',this.m_sid);}},ID:function(){return this.m_id;},SID:function(){return this.m_sid;}});D2L.C=function(name,id,sid){if(name!==undefined&&name!==null&&name.length>0){window[name]=UI.GetControl(id,sid);}};

D2L.Control.Type={Unknown:0,DisplayGroup:1,Link:2,Edit:3,SelectList:4,SelectOption:5,TreeView2:6,TreeNode2:7,Checkbox:8,Rating:9,RatingAverage:10,FormulaEditor:11,CustomSelectorItem:12,ReorderItemGroup:13,ReorderItem:14,RichEdit:15,Button:16,Dialog:17,CustomSelector:18,CustomSelectorItemAction:19,CustomSelectorItemData:20,Toggle:21,ToggleItem:22,FileUpload:23,ProgressBar:24,ColourPicker:25,ActionBar:26,ActionBarItem:27,FileSelector:28,FileSelectorFile:29,Paging:30,FileLink:31,PathSelector:32,DateTimeSelector:33,HtmlEditor:34,TagInput:35,TagItem:36,List:37,ListItem:38,Calendar:39,Balloon:40,Image:41,DateRange:42,Slideshow:43,GraphBar:44,Thumbnail:45,Band:46};

D2L.Control.Behaviour={};D2L.Control.Behaviour.GetContainer=function(control){var container=control.CreateElement('div');container.className='dbvr';if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){container.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=50)';}else{container.style.opacity='0.5';}
container.style.left=FindPosX(control.IDomNode)+'px';container.style.top=FindPosY(control.IDomNode)+'px';container.style.width=control.IDomNode.offsetWidth+'px';container.style.height=control.IDomNode.offsetHeight+'px';container.style.zIndex=control.GetWindow()['UI'].GetZIndex();control.GetWindow()['UI'].GetById('d2l_body').appendChild(container);return container;};D2L.Control.Behaviour.Drag=function(evt,control){var theW=control.GetWindow();var theUI=theW['UI'];var cursorStartX=theUI.GetCursorX(theW,evt);var cursorStartY=theUI.GetCursorY(theW,evt);var nodeStartL=control.GetPosX();var nodeStartT=control.GetPosY();var newL=nodeStartL;var newT=nodeStartT;var minX=0;var maxX=Math.max(theUI.GetPageWidth(theW),theUI.GetWindowWidth(theW))-control.GetWidth()-10;var minY=0;var maxY=Math.max(theUI.GetPageHeight(theW),theUI.GetWindowHeight(theW))-control.GetHeight()-10;var container=D2L.Control.Behaviour.GetContainer(control);container.style.cursor='move';control.SetPos(control.GetWidth()*-1-100,control.GetHeight()*-1-100);var start=function(evt){var newX=theUI.GetCursorX(theW,evt);var newY=theUI.GetCursorY(theW,evt);newL=(nodeStartL+newX-cursorStartX);newT=(nodeStartT+newY-cursorStartY);if(newL<=minX){newL=minX;}
if(newL>maxX){newL=maxX;}
if(newT<=minY){newT=minY;}
if(newT>maxY){newT=maxY;}
container.style.left=newL+'px';container.style.top=newT+'px';if(theW.event){theW.event.cancelBubble=true;theW.event.returnValue=false;}else{evt.preventDefault();}};var stop=function(evt){D2L.Util.Purge(container);container.parentNode.removeChild(container);control.SetPos(newL,newT);if(theW.document.detachEvent){theW.document.detachEvent("onmousemove",start);theW.document.detachEvent("onmouseup",stop);}else if(theW.document.removeEventListener){theW.document.removeEventListener("mousemove",start,true);theW.document.removeEventListener("mouseup",stop,true);}};if(theW.document.attachEvent){theW.document.attachEvent("onmousemove",start);theW.document.attachEvent("onmouseup",stop);theW.event.cancelBubble=true;theW.event.returnValue=false;}else if(theW.document.addEventListener){theW.document.addEventListener("mousemove",start,true);theW.document.addEventListener("mouseup",stop,true);evt.preventDefault();}};D2L.Control.Behaviour.Drag.Install=function(control,domNode){control.AttachObject(domNode,'onmousedown',function(e){control.GetWindow()['D2L'].Control.Behaviour.Drag(e,control);});};D2L.Control.Behaviour.Resize=function(evt,control,minWidth,minHeight){var theW=control.GetWindow();var theUI=theW['UI'];var cursorStartX=theUI.GetCursorX(theW,evt);var cursorStartY=theUI.GetCursorY(theW,evt);var startW=control.GetWidth();var startH=control.GetHeight();var startX=control.GetPosX();var startY=control.GetPosY();var newW=startW;var newH=startH;var maxWidth=theUI.GetScrollLeft()+theUI.GetWindowWidth()-control.GetPosX();var maxHeight=theUI.GetScrollTop()+theUI.GetWindowHeight()-control.GetPosY();var container=D2L.Control.Behaviour.GetContainer(control);container.style.cursor='nw-resize';control.SetPos(control.GetWidth()*-1-100,control.GetHeight()*-1-100);var start=function(evt){var newX=theUI.GetCursorX(theW,evt);var newY=theUI.GetCursorY(theW,evt);newW=(startW+newX-cursorStartX);if(newW>maxWidth){newW=maxWidth;}
if(newW<minWidth){newW=minWidth;}
newH=(startH+(newY-cursorStartY));if(newH>maxHeight){newH=maxHeight;}
if(newH<minHeight){newH=minHeight;}
container.style.width=newW+'px';container.style.height=newH+'px';if(theW.event){theW.event.cancelBubble=true;theW.event.returnValue=false;}else{evt.preventDefault();}};var stop=function(evt){D2L.Util.Purge(container);container.parentNode.removeChild(container);control.SetSize(newW,newH);control.SetPos(startX,startY);if(theW.document.detachEvent){theW.document.detachEvent("onmousemove",start);theW.document.detachEvent("onmouseup",stop);}else if(theW.document.removeEventListener){theW.document.removeEventListener("mousemove",start,true);theW.document.removeEventListener("mouseup",stop,true);}};if(theW.document.attachEvent){theW.document.attachEvent("onmousemove",start);theW.document.attachEvent("onmouseup",stop);theW.event.cancelBubble=true;theW.event.returnValue=false;}else if(theW.document.addEventListener){theW.document.addEventListener("mousemove",start,true);theW.document.addEventListener("mouseup",stop,true);evt.preventDefault();}};D2L.Control.Behaviour.Resize.Install=function(control,domNode,minWidth,minHeight){control.AttachObject(domNode,'onmousedown',function(e){control.GetWindow()['D2L'].Control.Behaviour.Resize(e,control,minWidth,minHeight);});};

D2L.Util={};D2L.Util.MethodProxy=D2L.Class.extend({Construct:function(beginMethod,endMethod,isAsynchronous){arguments.callee.$.Construct.call(this);if(isAsynchronous===undefined){isAsynchronous=true;}
this.m_beginMethod=beginMethod;this.m_endMethod=endMethod;this.m_isAsynchronous=isAsynchronous;},Call:function(){var ret=undefined;if(this.m_isAsynchronous){var dr=new D2L.Util.DelayedReturn();ret=dr;if(this.m_endMethod){ret=dr.RegisterWithReturn(this.m_endMethod);}
if(this.m_beginMethod){dr.Trigger(this.m_beginMethod.apply(this.m_beginMethod,arguments));}}else{if(this.m_beginMethod){ret=this.m_beginMethod.apply(this.m_beginMethod,arguments);}
if(this.m_endMethod){ret=this.m_endMethod.apply(this.m_endMethod,[ret]);}}
return ret;}});D2L.Util.IsD2LControl=function(obj){if(obj!==undefined){return(obj.isD2LControl!==undefined);}
return false;};D2L.Util.GetViewFileUrl=function(file,stream){if(stream===undefined){stream=false;}
var fileId=D2L.Util.Base64.Encode(file.FileId).replace("=","").replace("/","+");var fileName=D2L.Util.Url.Encode(file.FileName.replace(/[#?\/\\%&+]/g,"_")).replace(/\.\.+/g,".").replace("+","%20");var url='/d2l/common/viewFile.d2lfile/';if(fileId.length>100){url+=file.FileSystemType+"/"+new Date().getTime()+"/"+
fileName+'?ou='+Global.OrgUnitId+'&fid='+fileId;}else{url+=file.FileSystemType+'/'+fileId+'/'+fileName+'?ou='+Global.OrgUnitId;}
if(stream){url+='&display=1';}
return url;};D2L.Util.GetViewImageFileUrl=function(file,size,fillColour){if(size===undefined){size=0;}
if(fillColour===undefined){fillColour='#ffffff';}
fillColour=D2L.Util.Url.Encode(fillColour);var fileId=D2L.Util.Base64.Encode(file.FileId).replace("=","").replace("/","+");var fileName=D2L.Util.Url.Encode(file.FileName.replace(/[#?\/\\%&+]/g,"_")).replace(/\.\.+/g,".").replace("+","%20");if(fileId.length>100){return"/d2l/common/viewImage.d2lfile/"+file.FileSystemType+"/"+new Date().getTime()+"/"+fileName+"?ou="+Global.OrgUnitId+"&fid="+fileId+'&s='+size+'&c='+fillColour;}else{return'/d2l/common/viewImage.d2lfile/'+file.FileSystemType+'/'+fileId+'/'+fileName+'?ou='+Global.OrgUnitId+'&s='+size+'&c='+fillColour;}};D2L.Util.GetViewImageUrl=function(imageTerm){return'/d2l/common/language/viewImage.d2l?ou='+Global.OrgUnitId+'&isi='+Global.ImageSetId+'&iv='+Global.ImageVersion+'&t='+imageTerm;};function CheckboxReorder(cbName,isUp){var cbs=eval('UI.form.'+cbName);var arrNewOrder=new Array(cbs.length);var i=0;if(isUp){i=0;for(;i<cbs.length;i++){if(!(cbs[i].checked)){break;}
arrNewOrder[i]=i;}
for(;i<cbs.length;i++){if(cbs[i].checked){arrNewOrder[i]=arrNewOrder[i-1];arrNewOrder[i-1]=i;}else{arrNewOrder[i]=i;}}}else{i=cbs.length-1;for(;i>=0;i--){if(!(cbs[i].checked)){break;}
arrNewOrder[i]=i;}
for(;i>=0;i--){if(cbs[i].checked){arrNewOrder[i]=arrNewOrder[i+1];arrNewOrder[i+1]=i;}else{arrNewOrder[i]=i;}}}
return arrNewOrder;}
function AdminHelp(pTitle,collectionName){var p=new d2l_Popup();p.height=800;p.width=800;p.title=pTitle;p.bodySource='/d2l/lp/Lang/admin/modify/language_instructions_edit.d2l';p.queryString='ou='+Global.OrgUnitId+'&cname='+collectionName;p.AddCloseButton();p.AddSaveButton();p.Open();}
function FindPosX(domNode){var x=0;var xy=YAHOO.util.Dom.getXY(domNode);if(xy){x=xy[0];}
return x;}
function FindPosY(domNode){var y=0;var xy=YAHOO.util.Dom.getXY(domNode);if(xy){y=xy[1];}
return y;}
function FindPosXY(domNode){var xy=YAHOO.util.Dom.getXY(domNode);if(!xy){xy=[];xy[0]=0;xy[1]=0;}
return xy;}
function ScrollToDomNode(node,doMiddle,doScrollToBottom){if(!node||!node.offsetLeft||!node.offsetWidth){return;}
if(doMiddle===undefined){doMiddle=false;}
if(doScrollToBottom===undefined){doScrollToBottom=false;}
var posX=FindPosX(node);var posY=FindPosY(node);var width=node.offsetWidth;var scrollLeft=UI.GetScrollLeft();var scrollTop=UI.GetScrollTop();var clientWidth=UI.GetWindowWidth();var clientHeight=UI.GetWindowHeight();var isBottom=false;if(doScrollToBottom&&(node.offsetHeight&&(node.offsetHeight+posY)>=scrollTop+clientHeight)&&(posY>scrollTop)){posY=posY+node.offsetHeight;isBottom=true;}
var scrollAmtX=0;var scrollAmtY=0;var diff=0;if(!isBottom){diff=clientHeight;}
if(doMiddle){diff=clientHeight/2;}
if(posY<scrollTop){scrollAmtY=(posY-scrollTop-diff);}else if(posY>(scrollTop+clientHeight)){scrollAmtY=(posY-(scrollTop+clientHeight)+diff);}
if(posX<scrollLeft){scrollAmtX=(posX-scrollLeft);}else if((posX+width)>(scrollLeft+clientWidth)){scrollAmtX=((posX+width)-(scrollLeft+clientWidth));}
if(scrollAmtX!=0||scrollAmtY!=0){window.scrollBy(scrollAmtX,scrollAmtY);}}
function isFunction(obj){return typeof obj=='function';}
function isObject(obj){return(obj&&(typeof obj=='object'))||isFunction(obj);}
function isArray(obj){if(obj&&obj.pop&&obj.push){return true;}
return false;}
function addLeading(str,ch,len){if(!str){str='';}
var ret=str.toString();while(ret.length<len){ret=ch+ret;}
return ret;}
function extractFileNameFromPath(fullPath){var fileName=String(fullPath);var iBSlash,iColon,iFSlash,iSlice;iBSlash=fileName.lastIndexOf("\\")+1;iColon=fileName.lastIndexOf(":")+1;iFSlash=fileName.lastIndexOf("/")+1;if(iBSlash>=iColon){if(iBSlash>=iFSlash){iSlice=iBSlash;}else{iSlice=iFSlash;}}else{if(iColon>=iFSlash){iSlice=iColon;}else{iSlice=iFSlash;}}
fileName=fileName.slice(iSlice);return fileName;}
function extractDirectoryFromPath(fullPath){return fullPath.slice(0,String(fullPath.lastIndexOf("/")));}
function SetPngSrc(img,src,width,height){img.width=width;img.height=height;if(img.runtimeStyle){img.src='/d2l/tools/img/pixel.gif';img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";}else{img.src=src;}}
window.oldAlert=window.alert;window.alert=function(obj){if(obj){if(obj.isString){obj=obj.replace(/<br[\s]*[\/]?[\s]*>/gi,'\n');obj=obj.stripHtml();obj=obj.decodeHtml();}}
this.oldAlert(obj);};window.oldConfirm=window.confirm;window.confirm=function(obj){if(obj){if(obj.isString){obj=obj.replace(/<br[\s]*[\/]?[\s]*>/gi,'\n');obj=obj.stripHtml();obj=obj.decodeHtml();}}
return this.oldConfirm(obj);};window.oldSetTimeout=window.setTimeout;window.setTimeout=function(method,time){if(time===undefined){time=0;}
return window.oldSetTimeout(method,time);};function GetOrderedObjectMembers(obj){var ret=new Array();for(var i in obj){ret[ret.length]=i;}
ret.sort();return ret;}
function IsKeyEnter(e){var evt=e||window.event;if(evt===undefined||evt===null){return false;}
if(evt.keyCode==13||evt.charCode==13||evt.which==13){return true;}else{return false;}}
D2L.Util.Purge=function(d){var a=d.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){if(a[i]){n=a[i].name;if(typeof d[n]==='function'){d[n]=null;}}}}
a=d.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){D2L.Util.Purge(d.childNodes[i]);}}};

D2L.Control.Balloon=D2L.Control.extend({Construct:function(name,title,tailPosition){arguments.callee.$.Construct.call(this,D2L.Control.Type.Balloon);if(tailPosition===undefined){tailPosition=D2L.Control.Balloon.TAIL_POSITION_AUTO;}
if(title===undefined){title='';}
this.isShown=false;this.title=title;this.posX=-1;this.posY=-1;this.offsetX=0;this.offsetY=0;this.tailPosition=tailPosition;this.autoCalculateTailPosition=(tailPosition==D2L.Control.Balloon.TAIL_POSITION_AUTO);this.m_cont=null;this.m_dummyContainer=null;this.m_contents=null;this.m_titleWrapper=null;this.m_title=null;this.m_x=null;this.m_tail=null;this.m_ctb=null;this.m_clr=null;this.m_tl=null;this.m_tr=null;this.m_br=null;this.m_bl=null;this.m_doIgnoreHide=false;},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(document.createElement('div'));this.m_contents=document.createElement('div');this.contents=document.createElement('span');this.m_contents.appendChild(this.contents);this.GetDomNode().appendChild(this.m_contents);this.BuildDomIntegrateHelper();}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.title=deserializer.GetMember();this.tailPosition=deserializer.GetMember();this.autoCalculateTailPosition=(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_AUTO);this.m_contents=this.GetDomNode().firstChild;this.contents=this.GetDomNode().firstChild.firstChild;this.BuildDomIntegrateHelper();},Build:function(){if(!this.IsRendered()){this.SetDomNode(document.createElement('div'));this.m_contents=document.createElement('div');this.contents=document.createElement('span');this.m_contents.appendChild(this.contents);this.GetDomNode().appendChild(this.m_contents);if(UI){var body=UI.GetById('d2l_body');if(body){body.appendChild(this.GetDomNode());}}
this.BuildDomIntegrateHelper();if(UI){var body=UI.GetById('d2l_body');if(body){body.appendChild(this.m_cont);body.appendChild(this.m_titleWrapper);body.appendChild(this.m_contents);body.appendChild(this.m_x);body.appendChild(this.m_tail);body.appendChild(this.m_dummyContainer);}}
this.m_hasDomBeenBuilt=true;}},BuildDomIntegrateHelper:function(){if(!this.m_contents||!this.contents||!this.GetDomNode()){D2L.Debug.Warn("Error building D2L.Control.Balloon \""+this.m_name+"\".");return;}
this.m_cont=document.createElement('div');this.m_cont.className='d_BL';this.m_dummyContainer=document.createElement('div');this.m_dummyContainer.style.position='absolute';this.m_dummyContainer.style.display='none';var me=this;var clickFunc=function(event){if(event){event.cancelBubble=true;}};this.m_contents.className='d_BL_contents';this.AttachObject(this.m_contents,'onclick',clickFunc);this.contents.id=this.m_name+'_contentsId';this.m_titleWrapper=document.createElement('div');this.m_titleWrapper.className='d_BL_title';this.AttachObject(this.m_titleWrapper,'onclick',clickFunc);this.m_title=document.createElement('span');this.m_titleWrapper.appendChild(this.m_title);this.m_x=document.createElement('img');this.m_x.className='d_BL_x';this.m_x.src='/d2l/img/LP/balloon/x.gif';this.m_x.title='Close';this.m_x.width=11;this.m_x.height=11;this.AttachObject(this.m_x,'onclick',function(e){if(e===undefined){e=window.event;}
e.cancelBubble=true;me.Hide(e);});this.m_tail=document.createElement('img');this.m_tail.className='d_BL_tail';this.AttachObject(this.m_tail,'onclick',clickFunc);this.GetDomNode().insertBefore(this.m_cont,this.m_contents);this.GetDomNode().insertBefore(this.m_titleWrapper,this.m_contents);this.GetDomNode().insertBefore(this.m_dummyContainer,this.m_contents.nextSibling);this.GetDomNode().insertBefore(this.m_tail,this.m_contents.nextSibling);this.GetDomNode().insertBefore(this.m_dummyContainer,this.m_contents.nextSibling);this.m_ctb=document.createElement('div');this.m_ctb.className='d_BL_ctb';this.AttachObject(this.m_ctb,'onclick',clickFunc);this.m_clr=document.createElement('div');this.m_clr.className='d_BL_clr';this.AttachObject(this.m_clr,'onclick',clickFunc);this.m_tl=document.createElement('img');this.m_tl.className='d_BL_crn';this.m_tr=document.createElement('img');this.m_tr.className='d_BL_crn';this.m_br=document.createElement('img');this.m_br.className='d_BL_crn';this.m_bl=document.createElement('img');this.m_bl.className='d_BL_crn';this.m_cont.appendChild(this.m_ctb);this.m_cont.appendChild(this.m_clr);this.m_cont.appendChild(this.m_tl);this.m_cont.appendChild(this.m_tr);this.m_cont.appendChild(this.m_br);this.m_cont.appendChild(this.m_bl);SetPngSrc(this.m_tl,'/d2l/img/LP/balloon/tl.png',8,8);SetPngSrc(this.m_tr,'/d2l/img/LP/balloon/tr.png',8,8);SetPngSrc(this.m_br,'/d2l/img/LP/balloon/br.png',8,8);SetPngSrc(this.m_bl,'/d2l/img/LP/balloon/bl.png',8,8);WindowEventManager.Click.Register(this,'Hide');WindowEventManager.Resize.Register(this,'Hide');WindowEventManager.KeyPress.Register(this,'Hide');},CalculateTailCoordinates:function(elemX,elemY,elemWidth,elemHeight,balloonWidth,balloonHeight){if(this.autoCalculateTailPosition){var scrollLeft=UI.GetScrollLeft();var scrollTop=UI.GetScrollTop();var clientWidth=UI.GetWindowWidth();var clientHeight=UI.GetWindowHeight();var scrollHeight=UI.GetPageHeight();var height=Math.min((elemY+elemHeight/2)-scrollTop,(scrollTop+clientHeight-(elemY+elemHeight/2)))*2;var width=Math.min((elemX+elemWidth/2)-scrollLeft,(scrollLeft+clientWidth)-(elemX+elemWidth/2))*2;var rectRight=new D2L.Control.Balloon.Rectangle(D2L.Control.Balloon.TAIL_POSITION_LM,(clientWidth+scrollLeft)-(elemX+elemWidth),height,25,0);var rectTop=new D2L.Control.Balloon.Rectangle(D2L.Control.Balloon.TAIL_POSITION_BM,width,elemY-scrollTop,0,25);var rectBottom=new D2L.Control.Balloon.Rectangle(D2L.Control.Balloon.TAIL_POSITION_TM,width,(clientHeight+scrollTop)-(elemY+elemHeight),0,25);var rectLeft=new D2L.Control.Balloon.Rectangle(D2L.Control.Balloon.TAIL_POSITION_RM,(elemX-scrollLeft),height,25,0);var rectBottomTotal=new D2L.Control.Balloon.Rectangle(D2L.Control.Balloon.TAIL_POSITION_TM,width,scrollHeight-(elemY+elemHeight),0,25);var rectTopTotal=new D2L.Control.Balloon.Rectangle(D2L.Control.Balloon.TAIL_POSITION_BM,width,elemY,0,25);var rectangles=new Array(rectRight,rectTop,rectBottom,rectLeft,rectBottomTotal,rectTopTotal);this.tailPosition=D2L.Control.Balloon.TAIL_POSITION_TM;for(var i=0;i<rectangles.length;i++){var rect=rectangles[i];if(rect.width>=balloonWidth+rect.tailWidth&&rect.height>=balloonHeight+rect.tailHeight){this.tailPosition=rect.position;break;}}}
if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_TL){this.posX=elemX+Math.round(elemWidth*3/4);this.posY=elemY+elemHeight+3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_TM){this.posX=elemX+Math.round(elemWidth/2);this.posY=elemY+elemHeight+3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_TR){this.posX=elemX+Math.round(elemWidth*1/4);this.posY=elemY+elemHeight+3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_RT){this.posX=elemX-3;this.posY=elemY+elemHeight;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_RM){this.posX=elemX-3;this.posY=elemY+Math.round(elemHeight/2);}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_RB){this.posX=elemX-3;this.posY=elemY;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_BR){this.posX=elemX+Math.round(elemWidth*1/4);this.posY=elemY-3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_BM){this.posX=elemX+Math.round(elemWidth*1/2);this.posY=elemY-3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_BL){this.posX=elemX+Math.round(elemWidth*3/4);this.posY=elemY-3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_LB){this.posX=elemX+elemWidth+3;this.posY=elemY;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_LM){this.posX=elemX+elemWidth+3;this.posY=elemY+Math.round(elemHeight/2);}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_LT){this.posX=elemX+elemWidth+3;this.posY=elemY+elemHeight;}},ScrollTo:function(){this.Build();if(this.m_ctb){ScrollToDomNode(this.m_ctb,true);}},SetContent:function(html){this.Build();UI.GetById(this.m_name+'_contentsId').innerHTML=html;},Hide:function(event){this.Build();if(this.isShown&&!this.m_doIgnoreHide){if(event){this.m_dummyContainer.style.display='block';this.SetContainer();WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(false,this.m_dummyContainer,event.eventObj));this.m_dummyContainer.style.display='none';WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(false,this.m_tail,event.eventObj));}
this.m_cont.style.display='none';this.m_titleWrapper.style.display='none';this.m_x.style.display='none';this.m_tail.style.display='none';this.m_contents.style.display='none';this.isShown=false;}},Show:function(event,elem){this.Build();if(event===undefined||event===null){event=new Object();}
if(elem&&elem.IDomNode){elem=elem.IDomNode;}
this.m_cont.style.display='block';if(this.title.length>0){this.m_titleWrapper.style.display='block';}
this.m_x.style.display='block';this.m_tail.style.display='block';this.m_contents.style.display='block';this.Render(event,elem);this.m_dummyContainer.style.display='block';this.SetContainer();WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(true,this.m_dummyContainer,event));this.m_dummyContainer.style.display='none';WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(true,this.m_tail,event));this.m_doIgnoreHide=true;var balloon=this;setTimeout(function(){balloon.m_doIgnoreHide=false;},0);this.isShown=true;},SetContainer:function(){this.Build();var left=FindPosX(this.m_tl);var top=FindPosY(this.m_tl);var width=(FindPosX(this.m_br)+this.m_br.offsetWidth-left);var height=(FindPosY(this.m_br)+this.m_br.offsetHeight-top);this.m_dummyContainer.style.left=left+'px';this.m_dummyContainer.style.top=top+'px';this.m_dummyContainer.style.width=width+'px';this.m_dummyContainer.style.height=height+'px';},Render:function(event,elem){if(this.title.length>0){this.m_title.innerHTML=this.title;}
var size=this.Resize();size=this.Resize();if(elem){this.CalculateTailCoordinates(FindPosX(elem),FindPosY(elem),elem.offsetWidth,elem.offsetHeight,size.width,size.height);}else if(event.clientX){this.posX=event.clientX+UI.GetScrollLeft();this.posY=event.clientY+UI.GetScrollTop();}
this.RenderTail();this.RenderBalloon();},Resize:function(){var size=new Object();size.width=0;size.height=0;var width;if(this.title.length>0){width=(this.contents.offsetWidth>this.m_title.offsetWidth)?this.contents.offsetWidth:this.m_title.offsetWidth;}else{width=this.contents.offsetWidth;}
if(width<100){width=100;}else if(width>200){width=200;}
this.m_contents.style.width=width+'px';this.m_titleWrapper.style.width=width+'px';this.m_ctb.style.width=(width+17)+'px';this.m_clr.style.width=(width+31)+'px';SetPngSrc(this.m_tail,'/d2l/img/LP/balloon/t_10.png',25,11);var height=this.m_contents.offsetHeight;if(this.title.length>0){height+=this.m_titleWrapper.offsetHeight;}
this.m_ctb.style.height=(height+11)+'px';this.m_clr.style.height=(height-3)+'px';size.width=width+33;size.height=height+21;return size;},RenderBalloon:function(){var titleHeight=0;if(this.title.length>0){titleHeight=this.m_titleWrapper.offsetHeight;}
this.m_cont.style.left=(this.posX+this.offsetX)+'px';this.m_cont.style.top=(this.posY+this.offsetY)+'px';this.m_titleWrapper.style.left=(this.posX+this.offsetX+5)+'px';this.m_titleWrapper.style.top=(this.posY+this.offsetY+5)+'px';this.m_x.style.left=(this.posX+this.offsetX+this.m_contents.offsetWidth+7)+'px';this.m_x.style.top=(this.posY+this.offsetY+5)+'px';this.m_ctb.style.left='8px';this.m_ctb.style.top='0px';this.m_clr.style.left='0px';this.m_clr.style.top='8px';this.m_tl.style.left='0px';this.m_tl.style.top='0px';this.m_tr.style.left=(this.m_contents.offsetWidth+15)+'px';this.m_tr.style.top='0px';this.m_br.style.left=(this.m_contents.offsetWidth+15)+'px';this.m_br.style.top=(this.m_contents.offsetHeight+titleHeight+5)+'px';this.m_bl.style.left='0px';this.m_bl.style.top=(this.m_contents.offsetHeight+titleHeight+5)+'px';this.m_contents.style.left=(this.posX+this.offsetX+5)+'px';this.m_contents.style.top=(this.posY+this.offsetY+titleHeight+5)+'px';},RenderTail:function(){var width=this.m_contents.offsetWidth+23;var height=this.m_contents.offsetHeight+13;if(this.title.length>0){height+=this.m_titleWrapper.offsetHeight;}
SetPngSrc(this.m_tail,'/d2l/img/LP/balloon/t_'+this.tailPosition+'.png',25,11);if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_TL){this.m_tail.style.left=this.posX+'px';this.m_tail.style.top=this.posY+'px';this.offsetX=(Math.round(width/4)-Math.round(this.m_tail.width/2)-3)*-1;this.offsetY=this.m_tail.height-3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_TM){this.m_tail.style.left=this.posX-Math.round(this.m_tail.width/2)+'px';this.m_tail.style.top=this.posY+'px';this.offsetX=Math.round(width/2)*-1;this.offsetY=this.m_tail.height-3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_TR){this.m_tail.style.left=this.posX-Math.round(this.m_tail.width)+'px';this.m_tail.style.top=this.posY+'px';this.offsetX=(Math.round(width*3/4)+Math.round(this.m_tail.width/2))*-1;this.offsetY=this.m_tail.height-3;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_RT){this.m_tail.style.left=(this.posX-this.m_tail.width)+'px';this.m_tail.style.top=(this.posY-this.m_tail.height/2)+'px';this.offsetX=(this.m_tail.width+width-3)*-1;this.offsetY=(Math.round(height/4)+4)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_RM){this.m_tail.style.left=(this.posX-this.m_tail.width)+'px';this.m_tail.style.top=(this.posY-this.m_tail.height/2)+'px';this.offsetX=(this.m_tail.width+width-3)*-1;this.offsetY=Math.round(height/2)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_RB){this.m_tail.style.left=(this.posX-this.m_tail.width)+'px';this.m_tail.style.top=(this.posY-this.m_tail.height/2)+'px';this.offsetX=(this.m_tail.width+width-3)*-1;this.offsetY=(Math.round(height*3/4)-4)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_BR){this.m_tail.style.left=(this.posX-this.m_tail.width)+'px';this.m_tail.style.top=(this.posY-this.m_tail.height)+'px';this.offsetX=(Math.round(width*3/4)+Math.round(this.m_tail.width/2))*-1;this.offsetY=(height+this.m_tail.height-3)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_BM){this.m_tail.style.left=this.posX-Math.round(this.m_tail.width/2)+'px';this.m_tail.style.top=(this.posY-this.m_tail.height)+'px';this.offsetX=Math.round(width/2)*-1;this.offsetY=(height+this.m_tail.height-3)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_BL){this.m_tail.style.left=this.posX+'px';this.m_tail.style.top=(this.posY-this.m_tail.height)+'px';this.offsetX=(Math.round(width/4)-Math.round(this.m_tail.width/2)-3)*-1;this.offsetY=(height+this.m_tail.height-3)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_LB){this.m_tail.style.left=this.posX+'px';this.m_tail.style.top=(this.posY-this.m_tail.height/2)+'px';this.offsetX=this.m_tail.width-3;this.offsetY=(Math.round(height*3/4)-4)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_LM){this.m_tail.style.left=this.posX+'px';this.m_tail.style.top=(this.posY-this.m_tail.height/2)+'px';this.offsetX=this.m_tail.width-3;this.offsetY=Math.round(height/2)*-1;}else if(this.tailPosition==D2L.Control.Balloon.TAIL_POSITION_LT){this.m_tail.style.left=this.posX+'px';this.m_tail.style.top=(this.posY-this.m_tail.height/2)+'px';this.offsetX=this.m_tail.width-3;this.offsetY=(Math.round(height/4)+4)*-1;}}});D2L.Control.Balloon.Rectangle=function(position,width,height,tailWidth,tailHeight){this.width=width;this.height=height;this.tailWidth=tailWidth;this.tailHeight=tailHeight;this.position=position;};D2L.Control.Balloon.TAIL_POSITION_TL=0;D2L.Control.Balloon.TAIL_POSITION_TM=1;D2L.Control.Balloon.TAIL_POSITION_TR=2;D2L.Control.Balloon.TAIL_POSITION_RT=3;D2L.Control.Balloon.TAIL_POSITION_RM=4;D2L.Control.Balloon.TAIL_POSITION_RB=5;D2L.Control.Balloon.TAIL_POSITION_BR=6;D2L.Control.Balloon.TAIL_POSITION_BM=7;D2L.Control.Balloon.TAIL_POSITION_BL=8;D2L.Control.Balloon.TAIL_POSITION_LB=9;D2L.Control.Balloon.TAIL_POSITION_LM=10;D2L.Control.Balloon.TAIL_POSITION_LT=11;D2L.Control.Balloon.TAIL_POSITION_AUTO=12;D2L.Control.Balloon.Validation=D2L.Control.Balloon.extend({Construct:function(control,message){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId());this.m_validationControl=control;this.m_msg=D2L.LP.Text.IText.Normalize(message,'D2L.Control.Balloon.Validation','Constructor','message');},Show:function(){var me=this;var show=arguments.callee.$.Show;this.m_msg.GetText().Register(function(val){me.SetContent('<span style="font-size:1em;font-weight:bold;color:red">'+
D2L.Util.Html.Encode(val)+'</span>');show.call(me,undefined,me.m_validationControl);me.ScrollTo();});}});D2L.Balloon=D2L.Control.Balloon;

function d2l_Collection(){this.Items=new Object();this.Keys=new Array();this.ItemArray=new Array();}
d2l_Collection.prototype.Add=function(key,obj){this.Items[key]=obj;this.Keys[this.Keys.length]=key;this.ItemArray[this.ItemArray.length]=obj;};d2l_Collection.prototype.Get=function(key){return this.Items[key];};d2l_Collection.prototype.Apply=function(func){var newArgs=new Array();for(var k=1;k<arguments.length;k++){newArgs[newArgs.length]=arguments[k];}
var results=new Array();for(var i=0;i<this.Keys.length;i++){results[results.length]=eval('func.apply( this.Items[this.Keys[i]], newArgs )');}
return results;};d2l_Collection.prototype.QueryProperty=function(prop){var results=new Array();for(var i=0;i<this.Keys.length;i++){results[results.length]=eval('this.Items[this.Keys[i]].'+prop);}
return results;};

function d2l_Encoder(valSep,valReplace,rowSep,rowReplace){this.ResetData();this.valSep=valSep;this.rowSep=rowSep;this.valReplace=this.escapeChar+valReplace;this.rowReplace=this.escapeChar+rowReplace;}
d2l_Encoder.prototype.escapeChar='\\';d2l_Encoder.prototype.escapeReplace='\\&';d2l_Encoder.prototype.ResetData=function(){this.rows=new Array();};d2l_Encoder.prototype.AddRow=function(){var data=new Array();if(arguments[0]!==undefined){if(arguments[0].join){data=arguments[0];}else{for(var i=0;i<arguments.length;i++){data[i]=arguments[i];}}}
this.rows[this.rows.length]=data;};d2l_Encoder.prototype.Encode=function(val){var ret=val;if(val.split){ret=val.split(this.escapeChar).join(this.escapeReplace);ret=ret.split(this.valSep).join(this.valReplace);ret=ret.split(this.rowSep).join(this.rowReplace);}
return ret;};d2l_Encoder.prototype.Decode=function(val){var ret=val.split(this.rowReplace).join(this.rowSep);ret=ret.split(this.valReplace).join(this.valSep);ret=ret.split(this.escapeReplace).join(this.escapeChar);return ret;};d2l_Encoder.prototype.Serialize=function(){var ret='';var currRow;var valReplace=this.escapeChar+this.valReplace;var rowReplace=this.escapeChar+this.rowReplace;var currVal,valSep;var currRowVals,rowSep;rowSep='';for(var i=0;i<this.rows.length;i++){currRow=this.rows[i];currRowVals='';valSep='';for(var x=0;x<currRow.length;x++){currVal=this.Encode(currRow[x]);currRowVals+=valSep+currVal;valSep=this.valSep;}
ret+=rowSep+currRowVals;rowSep=this.rowSep;}
return ret;};d2l_Encoder.prototype.Deserialize=function(data){this.ResetData();var rows=data.split(this.rowSep);var currData;var rowReplace=this.escapeChar+this.rowReplace;var valReplace=this.escapeChar+this.valReplace;for(var i=0;i<rows.length;i++){currData=rows[i].split(this.valSep);for(var x=0;x<currData.length;x++){currData[x]=this.Decode(currData[x]);}
this.rows[this.rows.length]=currData;}
return this.rows;};

D2L.UI=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.displayGroups=null;this.formName='d2l_form';this.form={};this.initialized=false;this.Form=D2L.UI.GetByName;this.ValidateArray=new Array();this.prefetchedImages=new Array();this.windowId='';this.hitCodeSeed=0;this.Callback=new Object();this.LanguageManager=new D2L.Language.LanguageManager();this.DisplayGroupsManager=null;this.qsParams=null;this.m_bodyType=D2L.UI.BodyType.Normal;this.m_controlMap=null;this.m_culture=null;this.m_d2lTextCacheManager=null;this.m_displayGroupManager=null;this.m_dragDropManager=null;this.m_formManager=null;this.m_helpDialogs={};this.m_hitCode='';this.m_hitCodeCount=0;this.m_isPageFullScreen=true;this.m_messageArea=null;this.m_messageAreaParentId='';this.m_messageAreaSiblingId='';this.m_multiEditManager=null;this.m_notifierManager=new D2L.Notifiers.Manager();this.m_onPageLoad=new D2L.EventHandler();this.m_onPageUnload=new D2L.EventHandler();this.m_pageLoadTime=0;this.m_parentDialog=null;this.m_parentDialogDr=new D2L.Util.DelayedReturn();this.m_relativeFontSizeManager=null;this.m_relativeZIndex=1000;this.m_reorderManager=null;this.m_shimController=null;this.m_stateManager=null;this.m_uniqueHtmlId=0;this.m_validationManager=null;this.m_warnings=[];this.m_windowEventManager=null;this.m_zIndex=1000;var me=this;this.OnPageLoad().RegisterMethod(function(){var now=new Date();me.m_pageLoadTime=(now.getTime()-D2L.InitTime);me.GetControlMap();me.GetReorderManager().Init();if(me.m_warnings.length>0){var ma=me.GetMessageArea();for(var i=0;i<me.m_warnings.length;i++){ma.AddWarningMessage(new D2L.LP.Text.SmlText(me.m_warnings[i]),false);}
setTimeout(function(){ma.RenderWarningLabel();ma.RenderHeight();});}
me.InitSessionTimeout();me.FixPNGs();me.GetNotifierManager().Start();});},DeserializeMin:function(deserializer){window['UI']=this;window['Nav']=new D2L.Nav();window['WindowEventManager']=this.GetWindowEventManager();window['Events']=FindEventController();window['RpcManager']=new D2L.Rpc.Manager();window['FormManager']=this.GetFormManager();this.windowId=deserializer.GetMember();this.pageId=deserializer.GetMember();this.hitCodeSeed=deserializer.GetMember();this.m_bodyType=deserializer.GetMember();this.m_relativeFontSizeManager=new D2L.Style.RelativeFontSizeManager(deserializer.GetDictionaryMin());this.m_displayGroupManager=deserializer.GetObjectMin(D2L.DisplayGroups.DisplayGroupManager);this.m_reorderManager=deserializer.GetObjectMin(D2L.Reorder.ReorderManager);this.m_validationManager=deserializer.GetObjectMin(D2L.Validation.Manager);this.m_multiEditManager=deserializer.GetObjectMin(D2L.MultiEdit.Manager);this.m_culture=deserializer.GetObjectMin(D2L.Culture);window['Culture']=this.m_culture;this.m_warnings=deserializer.GetMember();this.m_isPageFullScreen=deserializer.GetBoolean();this.m_notifierManager=deserializer.GetObject();D2L.Util.DateTime.LoadDateTime=deserializer.GetObject();var ariaController=new D2L.UI.AriaController(this);},CreateElement:function(elementName){var ele=document.createElement(elementName);this.AttachObject(ele,'d2l_win',window);;return ele;},CreateTextNode:function(text){var emptySpace='\ufeff';if(text===undefined||text===null){return document.createTextNode(emptySpace);}else if(text.isString){if(text.length===0){text=emptySpace;}
return document.createTextNode(text);}else{var textNode=document.createTextNode(emptySpace);text.AssignText(textNode,'data');return textNode;}},DisableRightClick:function(){document.oncontextmenu=function(){var term=new D2L.LP.Text.LangTerm('Standard.Messages.jsRightClickDisabled');term.GetText().Register(function(val){alert(val);});return false;};},DisablePrint:function(){document.oncontextmenu=function(){var term=new D2L.LP.Text.LangTerm('Standard.Messages.jsPrintDisabled');term.GetText().Register(function(val){alert(val);});return false;};if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){document.onselectstart=function(){return false;};}else{document.onmousedown=function(e){return(e.target.tagName!=null&&e.target.tagName.search('^(INPUT|TEXTAREA|BUTTON|SELECT)$')!=-1);};}
document.ondragstart=function(){return false;};},C:function(anchor,onClick){if(anchor.className!='dlk_d'&&anchor.className.indexOf('di_l_d')<0){var f=new Function(onClick);f.call(anchor);}},FixPNGs:function(){if(this.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&this.GetBrowserInfo().MajorVersion<7){var pngs=YAHOO.util.Dom.getElementsBy(function(elem){if(elem!==undefined&&elem!==null&&elem.src!==undefined&&elem.runtimeStyle!==undefined){return(elem.src.indexOf('.png')>-1);}
return false;},'img',undefined,function(elem){var src=elem.src;elem.src='/d2l/img/lp/pixel.gif';elem.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"')";});}},G:function(id){return this.GetById(id);},GenerateHitCode:function(){var now=new Date();this.m_hitCodeCount++;var count=(this.m_hitCodeCount%10).toString();this.m_hitCode=this.hitCodeSeed.toString()+((now.getTime()+100000000)%100000000)+count;if(this.form){var input=this.GetByName('d2l_hitCode');if(input){input.value=this.m_hitCode;}}
return this.m_hitCode;},GetBrowserInfo:function(){return BrowserInfo;},GetById:function(id){return document.getElementById(id);},GetByClassName:function(className){return YAHOO.util.Dom.getElementsByClassName(className);},GetControl:function(ID,SID){return this.GetControlMap().GetControl(ID,SID);},GetControls:function(ID){return this.GetControlMap().GetControls(ID);},GC:function(mappedId){return this.GetControlMap().GetControlByMappedId(mappedId);},GetControlMap:function(){if(this.m_controlMap===null){if(!this.GetForm()){return new D2L.ControlMap();}else{if(this.GetForm().d2l_controlMap!==undefined){this.m_controlMap=D2L.Serialization.JsonDeserializerMin.Deserialize(this.GetForm().d2l_controlMap.value,D2L.ControlMap);}else{this.m_controlMap=new D2L.ControlMap();}}}
return this.m_controlMap;},GetCulture:function(){return this.m_culture;},GetDisplayGroupManager:function(){return this.m_displayGroupManager;},GetLanguageManager:function(){return this.LanguageManager;},GetForm:function(){return document.forms[this.formName];},GetFormManager:function(){if(this.m_formManager===null){this.m_formManager=new D2L.FormManager();}
return this.m_formManager;},GetD2LTextCacheManager:function(){if(this.m_d2lTextCacheManager===null){this.m_d2lTextCacheManager=new D2L.LP.Text.Cache();}
return this.m_d2lTextCacheManager;},GetDragDropManager:function(){if(this.m_dragDropManager===null){this.m_dragDropManager=new D2L.DragDrop.Manager();}
return this.m_dragDropManager;},GetHitCode:function(){return this.m_hitCode;},GetMessageArea:function(){if(this.GetBodyType()==D2L.UI.BodyType.IFrame&&window.parent!==window&&window.parent['UI']!==undefined){return window.parent['UI'].GetMessageArea();}
if(this.m_messageArea===null){this.m_messageArea=UI.GetControl('ctl_messageArea');if(this.m_messageArea===null){this.m_messageArea=new D2L.Control.MessageArea();}}
return this.m_messageArea;},GetMultiEditManager:function(){return this.m_multiEditManager;},GetNotifierManager:function(){return this.m_notifierManager;},GetPageLoadTime:function(){return this.m_pageLoadTime;},GetParentDialog:function(){return this.m_parentDialog;},GetParentDialogDelayed:function(){return this.m_parentDialogDr;},GetRelativeFontSizeManager:function(){return this.m_relativeFontSizeManager;},GetReorderManager:function(){return this.m_reorderManager;},GetShimController:function(){if(this.m_shimController===null){this.m_shimController=new D2L.UI.ShimController(this);}
return this.m_shimController;},GetStateManager:function(){if(this.m_stateManager===null){if(!this.GetForm()){return new D2L.State.StateManager();}else{if(this.GetForm().d2l_state!==undefined){this.m_stateManager=D2L.Serialization.JsonDeserializerMin.Deserialize(this.GetForm().d2l_state.value,D2L.State.StateManager);}else{this.m_stateManager=new D2L.State.StateManager();}}}
return this.m_stateManager;},GetValidationManager:function(){if(this.m_validationManager===null){if(!this.GetForm()){return new D2L.Validation.Manager();}else{if(this.GetForm().d2l_validationManager!==undefined){this.m_validationManager=D2L.Serialization.JsonDeserializerMin.Deserialize(this.GetForm().d2l_validationManager.value,D2L.Validation.Manager);}else{this.m_validationManager=new D2L.Validation.Manager();}}}
return this.m_validationManager;},GetWindowEventManager:function(){if(this.m_windowEventManager===null){this.m_windowEventManager=new D2L.WindowEventManager();}
return this.m_windowEventManager;},HideNavBar:function(){var navBar=window.document.getElementById('d_navBar');if(navBar==null){return;}
var hasNavBar=false;var firstTime=true;var w=window;while(w&&!hasNavBar){try{if(!firstTime&&w.document.getElementById('d_navBar')!==null){hasNavBar=true;break;}}catch(e){break;}
firstTime=false;var frames=w.document.getElementsByTagName('frame');for(var i=0;i<frames.length;i++){if(frames[i].name=='nav'&&frames[i].contentWindow!=window){hasNavBar=true;break;}}
if(w==w.parent){break;}
w=w.parent;}
if(hasNavBar){YAHOO.util.Dom.addClass(this.GetBodyElement(),'dbd_noNav');}},DecodeUrl:function(str){return D2L.Util.Url.Decode(str);},EncodeUrl:function(str){return D2L.Util.Url.Encode(str);},SetQueryStringParam:function(name,value){if(this.qsParams===null){this.qsParams=new Object();}
this.qsParams[name]=value;},Init:function(){this.HideNavBar();if(document.forms){this.form=document.forms[this.formName];}
this.initialized=true;this.GenerateHitCode();var d=new Date();var me=this;var termCopyright=new D2L.LP.Text.LangTerm('Standard.Misc.txtCopyright',d.getFullYear());termCopyright.GetText().Register(function(val){window.defaultStatus=val;me.AttachObject(document,'onmouseout',function(){window.status=val;});});this.DisplayGroupsManager=this.GetDisplayGroupManager();this.displayGroups=this.DisplayGroupsManager;this.StateManager=this.GetStateManager();window['StateManager']=this.GetStateManager();window['ValidationManager']=this.GetValidationManager();},InitMessageArea:function(parentId,siblingId){this.m_messageAreaParentId=parentId;this.m_messageAreaSiblingId=siblingId;},IsPageFullScreen:function(){return this.m_isPageFullScreen;},IsValidJsVariableName:function(name){var validRegEx=/^([a-zA-Z])+([a-zA-Z0-9_])*$/;return validRegEx.test(name);},GetByName:function(name){var retVal=null;var form=this.form;if(!this.initialized){form=document.forms[this.formName];}
if(form[name]){retVal=form[name];}else if(window[name]){retVal=window[name];}
if(retVal){if(isArray(retVal)){for(var i=0;i<retVal.length;i++){if(retVal[i].ID2L){retVal[i]=retVal[i].ID2L;}}}else if(retVal.ID2L){retVal=retVal.ID2L;}}
return retVal;},GetBodyElement:function(){return document.getElementById('d2l_body');},GetBodyType:function(){return this.m_bodyType;},GoTo:function(url,qs,ou,win){for(var i=0;i<this.navigationHandlers.length;i++){var ret;ret=eval(this.navigationHandlers[i]+'( );');if(!ret){return;}}
var href;if(!ou){ou=Global.OrgUnitId;}
href=url+'?ou='+ou;if(qs){if(qs.length>0){href+='&'+qs;}}
if(win){win.location.href=href;}else{window.location.href=href;}},PrefetchImage:function(name,src,width,height,alt){if(!alt||alt===undefined){alt='';}
if(!this.prefetchedImages[name]||(this.prefetchedImages[name]&&this.prefetchedImages[name]===null)){var img=new Image(width,height);img.src=src;img.alt=alt;img.w=width;img.h=height;this.prefetchedImages[name]=img;}else if(this.prefetchedImages[name]&&this.prefetchedImages[name].src!=src){this.prefetchedImages[name].src=src;this.prefetchedImages[name].alt=alt;this.prefetchedImages[name].w=width;this.prefetchedImages[name].h=height;}},FetchImage:function(name){return this.prefetchedImages[name];},SwapImages:function(oldImage,prefetchedImageName,alt){if(this.prefetchedImages[prefetchedImageName]&&oldImage){var img=this.prefetchedImages[prefetchedImageName];var imgAlt=(alt!==undefined)?alt:((img.alt.length>0)?img.alt:'');oldImage.src=img.src;oldImage.width=img.w;oldImage.height=img.h;if(imgAlt.length>0){oldImage.alt=imgAlt;oldImage.title=imgAlt;}}},AddCallback:function(method,windowId){var success=false;var window=this.FindWindow(windowId);if(window!==null){if(eval('window.'+method)){success=true;eval('this.Callback.'+method+' = window.'+method+';');}}
if(!success){eval('this.Callback.'+method+' = function() { return null; }');}},FindWindow:function(windowId,searchUp){if(searchUp===undefined){searchUp=true;}
var retVal=null;var SearchWindow=function(w){if(w.UI&&w.UI.windowId==windowId){return w;}
var frames=w.document.getElementsByTagName('frame');for(var i=0;i<frames.length;i++){var fWin=frames[i].contentWindow;if(fWin['UI']){retVal=fWin.UI.FindWindow(windowId,false);if(retVal){return retVal;}}}
var iframes=w.document.getElementsByTagName('iframe');for(var i=0;i<iframes.length;i++){var fWin=iframes[i].contentWindow;if(fWin['UI']){retVal=fWin.UI.FindWindow(windowId,false);if(retVal){return retVal;}}}
if(w.opener&&w.opener.UI){retVal=w.opener.UI.FindWindow(windowId);if(retVal){return retVal;}}
return null;};var root=window;if(searchUp){while(root&&root.parent!=root&&root['UI']){root=root.parent;}}
return SearchWindow(root);},GetRootWindow:function(){var retVal=window;var keepGoing=true;while(keepGoing){var parent=retVal.parent;if(parent&&parent!=retVal){var frames=[];try{frames=parent.document.getElementsByTagName('frame');}catch(e){}
if(frames&&frames.length>0){keepGoing=false;}else{retVal=parent;}}else{keepGoing=false;}}
return retVal;},GetUniqueHtmlId:function(){this.m_uniqueHtmlId=this.m_uniqueHtmlId+1;return'd2l_cntl_'+this.windowId+'_'+this.m_uniqueHtmlId;},GetWindowWidth:function(w){if(w===undefined){w=window;}
if(w.innerWidth){return w.innerWidth;}else if(w.document.documentElement&&w.document.documentElement.clientWidth){return w.document.documentElement.clientWidth;}else if(w.document.body){return w.document.body.clientWidth;}
return 0;},GetWindowHeight:function(w){if(w===undefined){w=window;}
if(w.innerHeight){return w.innerHeight;}else if(w.document.documentElement&&w.document.documentElement.clientHeight){return w.document.documentElement.clientHeight;}else if(w.document.body){return w.document.body.clientHeight;}
return 0;},GetPageWidth:function(w){if(w===undefined){w=window;}
return Math.max(w.document.documentElement.scrollWidth,UI.GetWindowWidth(w));},GetPageHeight:function(w){if(w===undefined){w=window;}
var doc=undefined;try{doc=w.document;}catch(e){}
var dh=0;var sh=0
var oh=0;if(doc!==undefined){if(doc.height!==undefined){dh=doc.height;}
if(doc.body!==undefined){if(doc.body.scrollHeight!==undefined)sh=doc.body.scrollHeight;if(doc.body.offsetHeight!==undefined)oh=doc.body.offsetHeight;}}
return Math.max(Math.max(dh,sh),oh);},GetScrollLeft:function(w){if(w===undefined){w=window;}
if(w.document.documentElement&&w.document.documentElement.scrollLeft){return w.document.documentElement.scrollLeft;}else if(w.document.body){return w.document.body.scrollLeft;}
return 0;},GetScrollTop:function(w){if(w===undefined){w=window;}
if(w.document.documentElement&&w.document.documentElement.scrollTop){return w.document.documentElement.scrollTop;}else if(w.document.body){return w.document.body.scrollTop;}
return 0;},GetCursorX:function(w,evt){var x=0;if(w.event){x=w.event.clientX+w.document.documentElement.scrollLeft+w.document.body.scrollLeft;}else{x=evt.clientX+w.scrollX;}
return x;},GetCursorY:function(w,evt){var y=0;if(w.event){y=w.event.clientY+w.document.documentElement.scrollTop+w.document.body.scrollTop;}else{y=evt.clientY+w.scrollY;}
return y;},GetCursorPositionInEdit:function(w,textElement){if(w===undefined){w=window;}
if(textElement.selectionStart){return textElement.selectionStart;}else if(w.document.selection){var sOldText=textElement.value;var objRange=w.document.selection.createRange();var sOldRange=objRange.text;var sWeirdString='$5b6aaf4b8a6c6c498a74cc6d$';objRange.text=sOldRange+sWeirdString;objRange.moveStart('character',(0-sOldRange.length-sWeirdString.length));var sNewText=textElement.value;objRange.text=sOldRange;for(var i=0;i<=sNewText.length;i++){var sTemp=sNewText.substring(i,i+sWeirdString.length);if(sTemp==sWeirdString){var cursorPos=(i-sOldRange.length);return cursorPos;}}
return 0;}
return 0;},SetCursorPositionInEdit:function(w,textElement,cursorPosition){textElement.focus();if(textElement.selectionStart&&cursorPosition>=0){textElement.setSelectionRange(cursorPosition,cursorPosition);}else if(textElement.createTextRange){var range=textElement.createTextRange();range.collapse(true);range.moveEnd('character',cursorPosition);range.moveStart('character',cursorPosition);range.select();}},InitSessionTimeout:function(){var sessionManager=null;var FindSessionManager=function(win){try{if(win&&win['UI']!==undefined){sessionManager=win['UI'].GetNotifierManager();if(win.parent&&win.parent!=win){FindSessionManager(win.parent);}}}catch(e){}};FindSessionManager(window);if(sessionManager!==null){sessionManager.ResetTimeout();}},SetParentDialog:function(dialog){this.m_parentDialog=dialog;this.m_parentDialogDr.Trigger(this.m_parentDialog);},EnableLoadingPageShim:function(isShimEnabled){if(isShimEnabled){this.GetShimController().Shim(null,true);}else{this.GetShimController().ClearShims();}},Confirm:function(callback,primaryMessage,secondaryMessage,opener,positiveText,negativeText){if(opener!==undefined&&opener!==null&&(opener.isString!==undefined||opener.m_isLangTerm!==undefined)){negativeText=positiveText;positiveText=opener;opener=undefined;}
var d=new D2L.Dialog.Confirm(this.GetUniqueHtmlId(),callback,primaryMessage,secondaryMessage)
if(positiveText!==undefined){d.SetPositiveButtonText(positiveText);}
if(negativeText!==undefined){d.SetNegativeButtonText(negativeText);}
return d.Open(opener);},Error:function(primaryMessage,secondaryMessage,opener){var d=new D2L.Dialog.Error(this.GetUniqueHtmlId(),primaryMessage,secondaryMessage)
return d.Open(opener);},Info:function(primaryMessage,secondaryMessage,opener){var d=new D2L.Dialog.Info(this.GetUniqueHtmlId(),primaryMessage,secondaryMessage)
return d.Open(opener);},Warning:function(primaryMessage,secondaryMessage,opener){var d=new D2L.Dialog.Warning(this.GetUniqueHtmlId(),primaryMessage,secondaryMessage)
return d.Open(opener);},GetRelativeZIndex:function(){this.m_relativeZIndex--;return this.m_relativeZIndex;},GetZIndex:function(){this.m_zIndex++;return this.m_zIndex;},H:function(titleTerm,descTerm){var dialogName=titleTerm.toLowerCase().replace('.','_');var dialog=this.m_helpDialogs[dialogName];var me=this;if(dialog===undefined||dialog===null){dialog=new D2L.NonModalDialog('popupHelp_'+dialogName,function(){dialog.Close();me.m_helpDialogs[dialogName]=null;});dialog.SetSrc('/d2l/common/dialogs/popupHelp/popupHelp.d2l');dialog.AddButton(D2L.Control.Button.Type.Close);dialog.SetSize(600,400);this.m_helpDialogs[dialogName]=dialog;}
dialog.SetSrcParam('tt',titleTerm);dialog.SetSrcParam('dt',descTerm);dialog.Open();},HT:function(primary,secondary,source){var d=new D2L.Dialog.Info(this.GetUniqueHtmlId(),new D2L.LP.Text.HtmlText(primary,false),new D2L.LP.Text.HtmlText(secondary,false))
d.SetOpener(source);return d.Open();},OnPageLoad:function(){return this.m_onPageLoad;},OnPageUnload:function(){return this.m_onPageUnload;}});D2L.UI.BodyType={Normal:0,Frame:1,Dialog:2,IFrame:3};D2L.UI.BrowserType={Unknown:0,IE:1,Safari:4,Firefox:6};

D2L.Culture=D2L.Class.extend({Construct:function(){this.decimalRegex='';this.integerRegex='';this.Lang_MinuteShort='';this.Lang_Minute='';this.Lang_Minutes='';this.Lang_HourShort='';this.Lang_Hour='';this.Lang_Hours='';this.Lang_Day='';this.Lang_Days='';this.m_firstDayOfWeek=0;this.m_shortestDayOfWeekNames=[];this.m_shortDayOfWeekNames=[];this.m_longDayOfWeekNames=[];this.m_shortMonthNames=[];this.m_longMonthNames=[];},DeserializeMin:function(deserializer){this.m_firstDayOfWeek=deserializer.GetMember();this.m_shortestDayOfWeekNames=deserializer.GetMember();this.m_shortDayOfWeekNames=deserializer.GetMember();this.m_longDayOfWeekNames=deserializer.GetMember();this.m_shortMonthNames=deserializer.GetMember();this.m_longMonthNames=deserializer.GetMember();this.Lang_MinuteShort=deserializer.GetMember();this.Lang_Minute=deserializer.GetMember();this.Lang_Minutes=deserializer.GetMember();this.Lang_HourShort=deserializer.GetMember();this.Lang_Hour=deserializer.GetMember();this.Lang_Hours=deserializer.GetMember();this.Lang_Day=deserializer.GetMember();this.Lang_Days=deserializer.GetMember();this.decimalRegex=deserializer.GetMember();this.integerRegex=deserializer.GetMember();},FormatFileSize:function(size){var bytesPerKilo=1024;var bytesPerMega=bytesPerKilo*1024;var bytesPerGiga=bytesPerMega*1024;if(size>=bytesPerGiga){return''+(Math.round(size/bytesPerGiga*100)/100)+' GB';}else if(size>=bytesPerMega){return''+(Math.round(size/bytesPerMega*100)/100)+' MB';}else if(size>=bytesPerKilo){return''+(Math.round(size/bytesPerKilo*100)/100)+' KB';}else if(size==1){return size+' Byte';}
return size+' Bytes';},FormatDate:function(date){var d=date.GetDay();var m=date.GetMonth();m=this.m_shortMonthNames[m];var y=date.GetYear();return m+' '+d+', '+y;},FormatTime:function(date){var h=date.GetHour();var ampm;if(h<12){ampm='AM';}else{ampm='PM';}
if(h===0){h='12';}else if(h>12){h=h-12;}
h=h.toString();var m=date.GetMinute();if(m<10){m='0'+m.toString();}
m=m.toString();return h+':'+m+' '+ampm;},FormatTwoDates:function(start,end){if(start&&end){var sy=start.GetYear();var sm=start.GetMonth();var sd=start.GetDay();var sh=start.GetHour();var smin=start.GetMinute();var ey=end.GetYear();var em=end.GetMonth();var ed=end.GetDay();var eh=end.GetHour();var emin=end.GetMinute();if(sy==ey&&sm==em&&sd==ed&&sh==eh&&smin==emin){return this.FormatDate(start)+' at '+this.FormatTime(start);}else if(sy==ey&&sm==em&&sd==ed){return this.FormatDate(start)+' from '+this.FormatTime(start)+' to '+this.FormatTime(end);}else{return this.FormatDate(start)+' at '+this.FormatTime(start)+' - '+this.FormatDate(end)+' at '+this.FormatTime(end);}}else if(start&&!end){return'Starts '+this.FormatDate(start)+' at '+this.FormatTime(start);}else if(!start&&end){return'Ends '+this.FormatDate(end)+' at '+this.FormatTime(end);}else if(!start&&!end){return'Always available';}
return'';},FormatMinutesAsTimeSpan:function(minutes,shortFormat){var days=parseInt(minutes/1440,10);var hours=parseInt(minutes/60,10);var min=minutes;if(days>0){var remMinutes=minutes%1440;hours=parseInt(remMinutes/60,10);min=remMinutes%60;}else if(hours>0){min=minutes%60;}
var ts=new d2l_TimeSpan(days,hours,min,0);var time='';var minuteString;if(shortFormat){minuteString=this.Lang_MinuteShort;}else if(ts.Minutes==1){minuteString=this.Lang_Minute;}else{minuteString=this.Lang_Minutes;}
if(minutes===0){return'0 '+minuteString;}
if(ts.Minutes>0){time=ts.Minutes+' '+minuteString;}
var hourString;if(shortFormat){hourString=this.Lang_HourShort;}else if(ts.Hours==1){hourString=this.Lang_Hour;}else{hourString=this.Lang_Hours;}
if(ts.Hours>0){if(time.length===0){time=ts.Hours+' '+hourString;}else{if(shortFormat){time=ts.Hours+' '+hourString+' '+time;}else{time=ts.Hours+' '+hourString+', '+time;}}}
var dayString;if(ts.Days==1){dayString=this.Lang_Day;}else{dayString=this.Lang_Days;}
if(ts.Days>0){if(time.length===0){time=ts.Days+' '+dayString;}else{time=ts.Days+' '+dayString+', '+time;}}
return time;},PluralizeText:function(num,singular,plural){return(num==1)?singular:plural;},Pluralize:function(num,singular,plural){return num+" "+this.PluralizeText(num,singular,plural);},GetFirstDayOfWeek:function(){return this.m_firstDayOfWeek;},GetLongMonthNames:function(){return this.m_longMonthNames;},GetLongShortNames:function(){return this.m_shortMonthNames;},GetLongDayOfWeekNames:function(){return this.m_longDayOfWeekNames;},GetShortDayOfWeekNames:function(){return this.m_shortDayOfWeekNames;},GetShortestDayOfWeekNames:function(){return this.m_shortestDayOfWeekNames;},LimitChars:function(value,numChars){if(numChars<1||value.length<=numChars){return value;}
if(value.length>=3){value=value.substr(0,numChars-3)+'...';}
return value;}});function d2l_TimeSpan(days,hours,minutes,seconds){this.Days=days;this.Hours=hours;this.Minutes=minutes;this.Seconds=seconds;}

D2L.Control.Grid=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.nameOrMappedId='';this.type=D2L.Control.Grid.Type.Data;this.activatedKey='';this.pageNum=1;this.pageSize=20;this.sortField='';this.sortDir=1;this.sortFieldForState='';this.sortDirForState=1;this.isUsingDefaultSort=false;this.search=null;this.m_selectionAllowMultiple=true;this.m_treeType=null;this.m_slPgSz1=null;this.m_slPgSz2=null;this.m_slPgNm1=null;this.m_slPgNm2=null;this.m_treeRowsExpanded=true;this.m_treeRowExceptionKeys=[];this.m_isSelectedExceptionKeys=[];this.m_rowIndex=1;this.OnSelectRow=new D2L.EventHandler();this.OnDeleteRow=new D2L.EventHandler();this.OnRestoreRow=new D2L.EventHandler();WindowEventManager.Transform.Register(this,'RefreshItemRowTrees');Nav.OnBeforeNavigate.Register(this,'OnNav');},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.type=deserializer.GetMember();this.isUsingDefaultSort=deserializer.GetBoolean();this.pageNum=deserializer.GetMember();this.pageSize=deserializer.GetMember();this.m_treeType=deserializer.GetMember();this.m_selectionAllowMultiple=deserializer.GetBoolean();this.sortField=deserializer.GetMember();this.sortDir=deserializer.GetMember();this.m_treeRowsExpanded=deserializer.GetBoolean();this.m_treeRowExceptionKeys=deserializer.GetDictionaryMin();this.m_isSelectedExceptionKeys=deserializer.GetDictionaryMin();this.data=deserializer.GetMember();this.m_rowIndex=deserializer.GetMember();var activatedKey=deserializer.GetMember();this.nameOrMappedId=deserializer.GetMember();this.m_slPgSz1=UI.GetControl(this.GetMappedId()+'_sl_pgS1');this.m_slPgSz2=UI.GetControl(this.GetMappedId()+'_sl_pgS2');this.m_slPgNm1=UI.GetControl(this.GetMappedId()+'_sl_pg1');this.m_slPgNm2=UI.GetControl(this.GetMappedId()+'_sl_pg2');this.Init();if(activatedKey.length>0){this.Activate(activatedKey);}},GetTreeRowsExpanded:function(){return this.m_treeRowsExpanded;},GetTreeExceptionKeys:function(){return this.m_treeRowExceptionKeys;},GetTreeExceptionKeysForState:function(){var ret=new Array();var me=this;this.ForEachRow(function(currRow){if(currRow.type=='i'&&currRow.isTreeNode){var key=currRow.GetKey();var defExpanded=me.GetTreeRowsExpanded();if(me.GetTreeExceptionKeys()[key]){if(currRow.isExpanded==defExpanded){ret[ret.length]=key;}}else{if(currRow.isExpanded!=defExpanded){ret[ret.length]=key;}}}});return ret;},GetCollapsedKeys:function(){var ret=new Array();var me=this;this.ForEachRow(function(currRow){if(currRow.type=='i'&&currRow.isTreeNode){var key=currRow.GetKey();if(currRow.isExpanded==false){ret[ret.length]=key;}}});return ret;},GetExpandedKeys:function(){var ret=new Array();var me=this;this.ForEachRow(function(currRow){if(currRow.type=='i'&&currRow.isTreeNode){var key=currRow.GetKey();if(currRow.isExpanded==true){ret[ret.length]=key;}}});return ret;},GetIsSelectedExceptionKeys:function(){return this.m_isSelectedExceptionKeys;},GetIsSelectedExceptionKeysForState:function(){var ret=new Array();var me=this;this.ForEachRow(function(currRow){if(currRow.type=='i'){var isSelected=currRow.IsSelected();var key=currRow.GetKey();if(me.GetIsSelectedExceptionKeys()[key]){if(!isSelected){ret[ret.length]=key;}}else{if(isSelected){ret[ret.length]=key;}}}});return ret;},GetSelectedGroupKeys:function(){return this.GetSelectedKeysForType('g');},GetSelectedKeys:function(){return this.GetSelectedKeysForType('i');},RefreshItemRowTrees:function(){var currRow,currKey;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];}}},GetSelectedValues:function(){var ret=new Array();var currKey,currRow;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type=='i'&&currRow.IsSelected()){ret.push(currRow.val);}}}
return ret;},GetKeys:function(){var underScoreIndex=-1;var ret=new Array();var currKey,currRow;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type=='i'){underScoreIndex=currKey.indexOf('_');if(underScoreIndex>=0&&underScoreIndex<currKey.length){currKey=currKey.substr(underScoreIndex+1);}
ret.push(currKey);}}}
return ret;},GetState:function(serializer,stateType,key){if(stateType=='rowshowchanges'){var row=this.GetRow(key);if(row!==null){var changedCells='';for(var i=0;i<row.obj.cells.length;i++){changedCells+=(row.changedCells[i])?'1':'0';}
serializer.AddMember('HasChanged',row.hasChanged);serializer.AddMember('ChangedCells',changedCells);}}else if(stateType=='pagenum'){serializer.AddMember('PageNum',this.pageNum);}else if(stateType=='tree'){serializer.AddMember('ExceptionKeys',this.GetTreeExceptionKeysForState());}else if(stateType=='rows'){serializer.AddMember('ActivatedKey',this.GetActivatedKey());serializer.AddMember('ExceptionKeys',this.GetIsSelectedExceptionKeysForState());}else{serializer.AddMember('PageSize',this.pageSize);if(this.isUsingDefaultSort){serializer.AddMember('SortField',this.sortFieldForState);serializer.AddMember('SortDir',this.sortDirForState);}else{serializer.AddMember('SortField',this.sortField);serializer.AddMember('SortDir',this.sortDir);}
if(this.search){serializer.AddMember('IsSearchExpanded',this.search.GetIsExpanded());}}},GetValues:function(){var ret=new Array();var currKey,currRow;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type=='i'){ret.push(currRow.val);}}}
return ret;},GetGroupSelectedKeys:function(){return this.GetSelectedGroupKeys();},GetGroupKeys:function(){var underScoreIndex=-1;var ret=new Array();var currKey,currRow;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type=='g'){underScoreIndex=currKey.indexOf('_');if(underScoreIndex>=0&&underScoreIndex<currKey.length){currKey=currKey.substr(underScoreIndex+1);}
ret.push(currKey);}}}
return ret;},GetRowsByValue:function(value){var ret=new Array();var currKey,currRow;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type=='i'&&currRow.val==value){ret.push(currRow);}}}
return ret;},GetActivatedKey:function(){return this.activatedKey;},ForEachRow:function(actionFunc){var currKey,currRow;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];actionFunc(currRow);}}},ExpandAllTrees:function(){this.ForEachRow(function(currRow){if(currRow.type=='i'&&currRow.Expand){currRow.Expand();}});},CollapseAllTrees:function(){this.ForEachRow(function(currRow){if(currRow.type=='i'&&currRow.Collapse){currRow.Collapse();}});},Activate:function(key){if(key===undefined||key===null){key='';}
key=key.toString();var row=this.GetRow(key);if(row){this.DeActivate();this.activatedKey=key;row.UpdateRowClass();var parent=row.Parent();while(parent!==null){parent.Expand();parent=parent.Parent();}}},DeActivate:function(){var activatedRow=this.GetRow(this.activatedKey);if(activatedRow){this.activatedKey='';activatedRow.UpdateRowClass();}},RegisterSearch:function(s){this.search=s;},Enable:function(){this.SetIsEnabled(true);},Disable:function(){this.SetIsEnabled(false);},SetIsEnabled:function(isEnabled){this.isEnabled=isEnabled;if(!this.cb_sa1){this.cb_sa1=UI.GetById(this.GetMappedId()+'_cb_sa1');}
if(this.cb_sa1){this.cb_sa1.disabled=!isEnabled;}
if(!this.cb_sa2){this.cb_sa2=UI.GetById(this.GetMappedId()+'_cb_sa2');}
if(this.cb_sa2){this.cb_sa2.disabled=!isEnabled;}
this.ForEachRow(function(row){if(row.cbObj){row.cbObj.disabled=!isEnabled;}});},SetDisabledState:function(state){this.SetIsEnabled(!state);},GetSelectedKeysForType:function(type){var underScoreIndex=-1;var ret=new Array();var currKey,currRow;if(this.rowData&&this.rowData.allRows){for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type==type&&currRow.IsSelected()){underScoreIndex=currKey.indexOf('_');if(underScoreIndex>=0&&underScoreIndex<currKey.length){currKey=currKey.substr(underScoreIndex+1);}
ret.push(currKey);}}}
return ret;},g_getRow:function(key){if(this.rowData&&this.rowData.allRows&&this.rowData.allRows[key]){return this.rowData.allRows[key];}
return null;},GetRow:function(key){var row=this.GetRowByType(key,'i');if(row===null){row=this.GetRowByType(key,'g');}
return row;},GetRowByType:function(key,type){if(this.rowData){if(this.rowData.allRows){var currKey;var currRow;var underScoreIndex;for(currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type==type){underScoreIndex=currKey.indexOf('_');if(underScoreIndex>=0&&underScoreIndex<currKey.length){currKey=currKey.substr(underScoreIndex+1);}
if(key==currKey){return currRow;}}}}}
return null;},g_sr:function(key){var row=this.g_getRow(key);this.SelectRow(row,row.cbObj.checked);},g_sd:function(key){var startRow=this.g_getRow(key);startRow.Expand();var currKey;var allSelected=true;for(currKey in startRow.rows){var currRow=startRow.rows[currKey];if(currRow.doChildSelection){if(!currRow.AllDescendantsSelected(true)){this.SelectRow(currRow,true);allSelected=false;}}else{if(!currRow.IsSelected()){this.SelectRow(currRow,true);allSelected=false;}}}
if(allSelected){for(currKey in startRow.rows){var currRow=startRow.rows[currKey];this.SelectRow(currRow,false);}}},RemoveRow:function(key){var row=this.GetRow(key);if(row===null){return;}
var me=this;var myAnim=new YAHOO.util.Anim(row.obj,{opacity:{to:0}},0.5,YAHOO.util.Easing.easeOut);myAnim.onComplete.subscribe(function(){WindowEventManager.BubbleRemoveEvent(row.obj);var table=me.IDomNode;if(table){table.deleteRow(row.obj.rowIndex);if(row.dObj){table.deleteRow(row.dObj.rowIndex);}}
if(me.rowData){me.rowData.RemoveRow(row);}});myAnim.animate();},SelectAll:function(){this.g_sa(true);},UnSelectAll:function(){this.g_sa(false);},g_sa:function(doSelect){var cbArr=UI.GetByName(this.GetMappedId()+'_cb_sa');if(cbArr.checked!==undefined){cbArr.checked=doSelect;}else if(cbArr.length==2){cbArr[0].checked=doSelect;cbArr[1].checked=doSelect;}
var innerRow;var key;for(key in this.rowData.rows){innerRow=this.rowData.rows[key];this.SelectRow(innerRow,doSelect);}},g_te:function(key){var group=this.g_getRow(key);if(group.isExpanded){group.Collapse();}else{group.Expand();}},SelectRow:function(row,doSelect){var key;if(row.type=='i'){if(row.HasSelection()){if(!this.SelectionAllowMultiple()&&doSelect){var me=this;this.ForEachRow(function(eachRow){if(eachRow.IsSelected()){me.SelectRow(eachRow,false);}});}
row.cbObj.checked=doSelect;row.isSelected=doSelect;row.UpdateRowClass();if(!doSelect){var group=row.m_parentGroup;while(group){if(group.hasSelection&&group.m_linkDescendantSelection){group.isSelected=false;group.cbObj.checked=false;}
group=group.m_parentGroup;}}
if(!doSelect){var theRow=row.m_parent;while(theRow){if(theRow.HasSelection()&&theRow.LinkDescendantSelection()){theRow.isSelected=false;theRow.cbObj.checked=false;theRow.UpdateRowClass();}
theRow=theRow.m_parent;}}
this.OnSelectRow.Trigger(row);}
if(this.SelectionAllowMultiple()&&row.rows&&row.doChildSelection){for(key in row.rows){this.SelectRow(row.rows[key],doSelect);}}}else if(row.type=='g'){if(row.hasSelection){row.isSelected=doSelect;row.cbObj.checked=doSelect;}
for(key in row.rows){this.SelectRow(row.rows[key],doSelect);}}},Init:function(){if(!this.data){return;}
this.rowData=new D2L.GridRows(this);var count=this.data.length;var currElem;for(var i=0;i<count;i++){currElem=this.data[i];if(i+1<count){this.rowData.AddElem(currElem,this.data[i+1]);if(!isArray(currElem)&&currElem.charAt(0)==this.rowData.item){i++;}}else{this.rowData.AddElem(currElem);}
this.m_rowIndex++;}},Sort:function(fldName,isAsc,doReload){if(fldName!=this.sortField){this.pageNum=1;}
this.sortFieldForState=fldName;this.sortField=fldName;if(isAsc){this.sortDirForState=1;this.sortDir=1;}else{this.sortDirForState=2;this.sortDir=2;}
if(doReload){Nav.Go(new D2L.NavInfo());}},SetPageNum:function(pageNum,doReload){var origPageNum=this.pageNum;var me=this;var Set=function(){me.pageNum=pageNum;if(me.m_slPgNm1){me.m_slPgNm1.SelectOption(me.m_slPgNm1.GetOption(pageNum),false);}
if(me.m_slPgNm2){me.m_slPgNm2.SelectOption(me.m_slPgNm2.GetOption(pageNum),false);}};if(doReload){if(me.m_slPgNm1){me.m_slPgNm1.SelectOption(me.m_slPgNm1.GetOption(origPageNum),false);}
if(me.m_slPgNm2){me.m_slPgNm2.SelectOption(me.m_slPgNm2.GetOption(origPageNum),false);}
var ni=new D2L.NavInfo();ni.OnNavigate.RegisterMethod(function(){Set();});Nav.Go(ni);}else{Set();}},SetPageSize:function(pageSize,doReload){var origPageSize=this.pageSize;var me=this;var Set=function(){me.pageSize=pageSize;me.pageNum=1;if(me.m_slPgSz1){me.m_slPgSz1.SelectOption(me.m_slPgSz1.GetOption(pageSize),false);}
if(me.m_slPgSz2){me.m_slPgSz2.SelectOption(me.m_slPgSz2.GetOption(pageSize),false);}};if(doReload){if(me.m_slPgSz1){me.m_slPgSz1.SelectOption(me.m_slPgSz1.GetOption(origPageSize),false);}
if(me.m_slPgSz2){me.m_slPgSz2.SelectOption(me.m_slPgSz2.GetOption(origPageSize),false);}
var ni=new D2L.NavInfo();ni.OnNavigate.RegisterMethod(function(){Set();});Nav.Go(ni);}else{Set();}},GetSearch:function(){return this.search;},OnSearchChanged:function(sender){this.pageNum=1;},OnNav:function(navInfo){if(navInfo&&navInfo.IsAction()){var valNode=UI.GetById(this.GetMappedId()+'_values');while(valNode.hasChildNodes()){D2L.Util.Purge(valNode.childNodes[0]);valNode.removeChild(valNode.childNodes[0]);}
var currRow;if(this.rowData&&this.rowData.allRows){for(var currKey in this.rowData.allRows){currRow=this.rowData.allRows[currKey];if(currRow.type=='i'&&currRow.IsSelected()&&currRow.val!==''){var hdn=document.createElement('input');hdn.type='hidden';hdn.name=this.nameOrMappedId+'_vals';hdn.value=currRow.val;valNode.appendChild(hdn);}}}}
return true;},SelectionAllowMultiple:function(){return this.m_selectionAllowMultiple;},GetTreeType:function(){return this.m_treeType;}});D2L.Control.Grid.Type={Data:1,List:2,NoLines:3};D2L.Grid=D2L.Control.Grid;D2L.Grid.TreeType={StructureOnly:1,StructureHierarchy:2,StructureHierarchyLines:3};D2L.GridRows=D2L.Class.extend({Construct:function(g){arguments.callee.$.Construct.call(this);this.item='i';this.details='d';this.header='h';this.group='g';this.summary='s';this.grid=g;this.rows=new Array();this.allRows=new Array();this.treeNodePeekIndex=-1;this.openTreeNodes=new Array();this.groupPeekIndex=-1;this.openGroups=new Array();},PeekGroup:function(){if(this.groupPeekIndex<0){return null;}
else{return this.openGroups[this.groupPeekIndex];}},PushGroup:function(group){this.groupPeekIndex++;this.openGroups[this.groupPeekIndex]=group;},PopGroup:function(){this.groupPeekIndex--;},PeekItemTreeNode:function(){if(this.treeNodePeekIndex<0){return null;}
else{return this.openTreeNodes[this.treeNodePeekIndex];}},PushItemTreeNode:function(group){this.treeNodePeekIndex++;this.openTreeNodes[this.treeNodePeekIndex]=group;},PopItemTreeNode:function(){this.treeNodePeekIndex--;},AddRow:function(row){var currGroup=this.PeekGroup();if(currGroup){currGroup.AddRow(row);}else{this.rows[row.key]=row;}
if(row.type==this.item){var currTreeNode=this.PeekItemTreeNode();if(currTreeNode){currTreeNode.AddRow(row);}}
this.allRows[row.key]=row;},RemoveRow:function(row){var currKey,currRow;var newAllRows=new Array();for(currKey in this.allRows){currRow=this.allRows[currKey];if(currRow.key!=row.key){newAllRows[currKey]=currRow;}}
this.allRows=newAllRows;var newRows=new Array();for(currKey in this.rows){currRow=this.rows[currKey];if(currRow.type==this.group){currRow.RemoveRow(row);}else if(currRow!=row){newRows[currKey]=currRow;}}
this.rows=newRows;},AddElem:function(elem,extra){var type;if(isArray(elem)){type=elem[0].charAt(0);var groupElem=elem[0];groupElem=groupElem.substring(1,groupElem.length);var start=1;if(type==this.group){this.OpenGroup(groupElem);}else if(type==this.item){this.OpenItemTreeNode(groupElem,elem[1]);start++;}
var len=elem.length;for(var i=start;i<len;i++){this.grid.m_rowIndex++;if(i+1<len){this.AddElem(elem[i],elem[i+1]);if(!isArray(elem[i])&&elem[i].charAt(0)==this.item){i++;}}else{this.AddElem(elem[i]);}}
if(type==this.group){this.CloseGroup();}else if(type==this.item){this.CloseItemTreeNode();}}else{type=elem.charAt(0);var rest=elem.substring(1,elem.length);if(type==this.item){this.AddItem(rest,extra);}else if(type==this.header){this.AddHeader(rest);}else if(type==this.summary){this.AddSummary(rest);}}},AddHeader:function(elem){var row=new D2L.GridRow();var key=elem;row.grid=this.grid;row.type=this.header;row.key='h_'+key;row.obj=row.grid.GetDomNode().rows[row.grid.m_rowIndex];this.AddRow(row);},AddSummary:function(elem){var row=new D2L.GridRow();var key=elem;row.type=this.summary;row.key='s_'+key;row.obj=this.grid.IDomNode.rows[this.grid.m_rowIndex];this.AddRow(row);},OpenItemTreeNode:function(elem,extra){var row=this.AddItem(elem,extra);row.rows=new Array();row.isTreeNode=true;if(elem.charAt(2)=='0'){row.isExpanded=false;}else{row.isExpanded=true;}
if(elem.charAt(4)=='0'){row.isChild=false;}else{row.isChild=true;}
row.hasChildren=(elem.charAt(8)=='1');row.hasSiblings=(elem.charAt(9)=='1');row.isTopLevel=(elem.charAt(10)=='1');row.isFirstSibling=(elem.charAt(11)=='1');row.isLastSibling=(elem.charAt(1)=='1');row.ExpandHelper=GridExpandHelper;row.CollapseHelper=GridCollapseHelper;row.SetVisibleHelper=GridRowSetVisible;row.SetVisible=function(isVisible){row.SetVisibleHelper(isVisible);};row.Expand=function(){this.isExpanded=true;this.SetTreeNodeImage();this.ExpandHelper();if(navigator.userAgent.indexOf("MSIE")==-1){this.SetVisible(false);this.SetVisible(true);}};row.Collapse=function(){this.isExpanded=false;this.SetTreeNodeImage();this.CollapseHelper();};row.SetTreeNodeImage=function(){if(this.treObj){var oldImg=this.treObj.childNodes[0];var oldImgSrc=oldImg.src;var t=(this.isTopLevel&&!this.isFirstSibling)?'t':'';var r='r';var b='';var l=(!this.isTopLevel)?'l':'';var imageTerm='';var langTerm='';if(this.isExpanded){b=(this.hasChildren)?'b':'';imageTerm='Framework.Grid.actCollapse';langTerm='Framework.Grid.altCollapseRow';}else{b=(this.isTopLevel&&this.hasSiblings)?'b':'';imageTerm='Framework.Grid.actExpand';langTerm='Framework.Grid.altExpandRow';}
D2L.Images.ImageTerm.Assign(imageTerm,oldImg);var lang=new D2L.LP.Text.LangTerm(langTerm);lang.SetSubject(this.m_subject);lang.AssignText(oldImg,'title');lang.AssignText(oldImg,'alt');if(this.grid.GetTreeType()==D2L.Grid.TreeType.StructureHierarchyLines){var className='d_g_l_'+t+r+b+l;this.treObj.parentNode.parentNode.className=className;}}};row.AddRow=function(row){row.m_parent=this;this.rows[row.key]=row;};for(var i=0;i<row.obj.cells.length;i++){if(row.obj.cells[i].firstChild){if(row.obj.cells[i].firstChild.className=='d_gt'){row.treObj=row.obj.cells[i].firstChild.firstChild;break;}else if(row.obj.cells[i].firstChild.className=='d_gts'){row.treObj=row.obj.cells[i].firstChild;break;}}}
this.PushItemTreeNode(row);},CloseItemTreeNode:function(){this.PopItemTreeNode();},AddItem:function(elem,extra){var row=new D2L.GridRow();row.type=this.item;row.grid=this.grid;row.m_subject=extra[0];row.val=extra[1];if(elem.charAt(0)=='1'){row.hasSelection=true;}else{row.hasSelection=false;}
if(elem.charAt(1)=='1'){row.hasDetails=true;}else{row.hasDetails=false;}
if(elem.charAt(3)=='1'){row.isSelected=true;}else{row.isSelected=false;}
if(elem.charAt(5)=='1'){row.doChildSelection=true;}else{row.doChildSelection=false;}
if(elem.charAt(6)=='1'){row.isAlt=true;}else{row.isAlt=false;}
row.m_linkDescendantSelection=(elem.charAt(13)=='1');var index1=elem.indexOf('_');var index2=elem.lastIndexOf('_');var key=elem.substring(index1+1,index2);row.key=key;row.obj=row.grid.GetDomNode().rows[row.grid.m_rowIndex];this.AttachObject(row.obj,'rowObj',row);if(row.hasSelection){for(var i=0;i<row.obj.cells.length;i++){if(row.obj.cells[i].firstChild&&row.obj.cells[i].firstChild.name&&row.obj.cells[i].firstChild.name==(this.grid.nameOrMappedId+'_cb')){row.cbObj=row.obj.cells[i].firstChild;break;}}}
if(row.hasDetails){row.dObj=row.obj.nextSibling;row.grid.m_rowIndex++;}
var showChangesFlag=elem.charAt(7);if(showChangesFlag=='2'){row.HandleOnChange(new D2L.ChangeEvent(row.obj));}else if(showChangesFlag=='1'){this.AttachObject(row.obj,'ID2LOnChange',new D2L.EventHandler());row.obj.ID2LOnChange.Register(row,'HandleOnChange');}
for(var i=index2+1;i<elem.length;i+=2){var showChanges=elem.charAt(i);if(showChanges=='1'){var cellIndex=(i-(index2+1))/2;var hasChanged=elem.charAt(i+1);if(hasChanged=='1'){row.HandleCellOnChange(new D2L.ChangeEvent(row.obj.cells[cellIndex]));}else{this.AttachObject(row.obj.cells[cellIndex],'ID2LOnChange',new D2L.EventHandler());row.obj.cells[cellIndex].ID2LOnChange.Register(row,'HandleCellOnChange');}}}
if(row.IsSelected()){row.UpdateRowClass();}
this.AddRow(row);return row;},OpenGroup:function(elem){var row=new D2L.GridGroup();if(elem.charAt(0)=='1'){row.hasSelection=true;}
if(elem.charAt(1)=='0'){row.isExpanded=false;}
if(elem.charAt(2)=='1'){row.m_linkDescendantSelection=true;}
var key=elem.substring(3,elem.length);row.type=this.group;row.key=key;row.obj=this.grid.IDomNode.rows[this.grid.m_rowIndex];row.cbObj=UI.GetById(this.grid.GetMappedId()+'_cb'+key);row.exObj=UI.GetById(this.grid.GetMappedId()+'_ex'+key);this.AddRow(row);this.PushGroup(row);},CloseGroup:function(){this.PopGroup();}});D2L.GridRow=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isDeleted=false;this.grid=null;this.hasChanged=false;this.changedCells=[];this.m_hiddenChanged=null;this.m_hiddenDeleted=null;this.val='';this.m_parentGroup=null;this.m_parent=null;this.isSelected=false;this.m_initialClass=null;this.m_linkDescendantSelection=false;this.m_hasSpecifiedKey=false;this.m_subject='';FormManager.OnChangeReset.Register(this,'HandleOnChangeReset');},GetSubject:function(){return this.m_subject;},LinkDescendantSelection:function(){return this.m_linkDescendantSelection;},HasSelection:function(){return this.hasSelection;},UpdateRowClass:function(){if(this.m_initialClass===null){this.m_initialClass=this.obj.className;}
var isActivated=(this.grid.activatedKey.length>0&&this.GetKey().length>0&&this.grid.activatedKey==this.GetKey());var colourClass='';if(isActivated){colourClass=' d_ga';}else if(this.hasChanged){colourClass=' d_gc';}else if(this.IsSelected()){colourClass=' d_gs';}
var deletedClass='';if(this.IsDeleted()){deletedClass=' d_gdel';}
var newClass=(this.m_initialClass+colourClass+deletedClass);this.obj.className=newClass;if(this.hasDetails){this.dObj.className=newClass;}},SetTextFormat:function(format){var f=format.toLowerCase();if(f=='normal'){this.obj.style.fontWeight='normal';}else if(f=='bold'){this.obj.style.fontWeight='bold';}},HandleOnChange:function(event){if(!event.hasChangeBeenShown){if(!this.hasChanged){this.hasChanged=true;this.UpdateRowClass();}
event.hasChangeBeenShown=true;}
if(this.m_hiddenChanged===null){this.m_hiddenChanged=document.createElement('input');this.m_hiddenChanged.type='hidden';this.m_hiddenChanged.value=this.GetKey();this.obj.firstChild.appendChild(this.m_hiddenChanged);}
this.m_hiddenChanged.name=this.grid.nameOrMappedId+'_ckeys';},HandleCellOnChange:function(event){if(!event.hasChangeBeenShown){var node=event.source;var prevNode=null;while(node!=this.obj){prevNode=node;node=node.parentNode;}
this.hasChanged=true;this.changedCells[prevNode.cellIndex]=true;prevNode.className+=' d_gch';}},HandleOnChangeReset:function(){this.hasChanged=false;this.UpdateRowClass();},HasSpecifiedKey:function(){return this.m_hasSpecifiedKey;},GetKey:function(){var underScoreIndex=this.key.indexOf('_');if(underScoreIndex>=0&&underScoreIndex<this.key.length){return this.key.substr(underScoreIndex+1);}
return'';},GetValue:function(){return this.val;},SetVisible:GridRowSetVisible,Delete:function(){if(!this.IsDeleted()){if(this.m_hiddenDeleted===null){this.m_hiddenDeleted=document.createElement('input');this.m_hiddenDeleted.type='hidden';this.m_hiddenDeleted.value=this.GetKey();this.obj.firstChild.appendChild(this.m_hiddenDeleted);}
this.m_hiddenDeleted.name=this.grid.nameOrMappedId+'_dkeys';this.m_isDeleted=true;this.UpdateRowClass();WindowEventManager.BubbleChangeEvent(this.obj);this.grid.OnDeleteRow.Trigger(this);}},IsDeleted:function(){return this.m_isDeleted;},IsSelected:function(){return this.isSelected;},HasSelectedDescendant:function(considerRootNode){if(considerRootNode&&this.IsSelected()){return true;}
for(var currKey in this.rows){var currRow=this.rows[currKey];if(currRow.HasSelectedDescendant(true)){return true;}}
return false;},AllDescendantsSelected:function(considerRootNode){if(considerRootNode&&!this.IsSelected()){return false;}
for(var currKey in this.rows){var currRow=this.rows[currKey];if(!currRow.AllDescendantsSelected(true)){return false;}}
return true;},Restore:function(){if(this.IsDeleted()){this.m_hiddenDeleted.name='';this.m_isDeleted=false;this.UpdateRowClass();this.grid.OnRestoreRow.Trigger(this);}},SetIsDeleted:function(isDeleted){if(!this.IsDeleted()&&isDeleted){this.Delete();}else if(this.IsDeleted()&&!isDeleted){this.Restore();}},ToggleIsDeleted:function(){this.SetIsDeleted(!this.IsDeleted());},SetDoChildSelection:function(doChildSelection){this.doChildSelection=doChildSelection;},DoChildSelection:function(){return this.doChildSelection;},Parent:function(){return this.m_parent;},SetBackgroundColour:function(colour){var row=this.obj;row.style.backgroundColor=colour;},SetCellBackgroundColour:function(index,colour){var cell=this.obj.getElementsByTagName("td")[index];cell.style.backgroundColor=colour;},SetCellOnMouseOver:function(index,func){var cell=this.obj.getElementsByTagName("td")[index];cell.onmouseover=func;},SetCellOnMouseOut:function(index,func){var cell=this.obj.getElementsByTagName("td")[index];cell.onmouseout=func;},SetCellOnMouseClick:function(index,func){var cell=this.obj.getElementsByTagName("td")[index];cell.onclick=func;},SetCellProperty:function(index,propName,propValue){var cell=this.obj.getElementsByTagName("td")[index];cell[propName]=propValue;}});D2L.GridGroup=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.rows=new Array();this.doChildSelection=true;this.itemRows=new Array();this.m_linkDescendantSelection=false;this.m_parentGroup=null;this.isSelected=false;},SetVisible:GridRowSetVisible,ExpandHelper:GridExpandHelper,CollapseHelper:GridCollapseHelper,Expand:function(){if(this.exObj){this.exObj.innerHTML='<img style=\"border:none;\" src=\"/d2l/tools/img/up.gif\" width=\"6\" height=\"8\" alt=\"Collapse Group\" title=\"Collapse Group\" />';}
this.isExpanded=true;this.ExpandHelper();},Collapse:function(){if(this.exObj){this.exObj.innerHTML='<img style=\"border:none;\" src=\"/d2l/tools/img/down.gif\" width=\"6\" height=\"8\" alt=\"Expand Group\" title=\"Expand Group\" />';}
this.isExpanded=false;this.CollapseHelper();},AddRow:function(row){row.m_parentGroup=this;this.rows[row.key]=row;},IsSelected:function(){return this.isSelected;},RemoveRow:function(row){var newRows=new Array();for(currKey in this.rows){currRow=this.rows[currKey];if(currRow.type==this.group){currRow.RemoveRow(row);}else if(currRow!=row){newRows[currKey]=currRow;}}
this.rows=newRows;}});function GridExpandHelper(){for(var key in this.rows){var row=this.rows[key];row.SetVisible(true);if(row.type=='g'||(row.type=='i'&&row.rows)){if(row.isExpanded){row.ExpandHelper();}}}
WindowEventManager.Transform.Trigger();}
function GridCollapseHelper(){for(var key in this.rows){var row=this.rows[key];row.SetVisible(false);if(row.type=='g'||(row.type=='i'&&row.rows)){row.CollapseHelper();}}
WindowEventManager.Transform.Trigger();}
function GridRowSetVisible(isVisible){this.isVisible=isVisible;if(isVisible){if(navigator.userAgent.indexOf("MSIE")!=-1){this.obj.style.display='inline';}else{this.obj.style.display='table-row';}}else{this.obj.style.display='none';}}

D2L.Control.Field=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_fieldRow1=null;this.m_fieldRow2=null;this.m_hasChanged=false;this.m_showChanges=false;this.m_textLocation=D2L.Control.Field.TextLocation.Left;this.OnShowChange=new D2L.EventHandler();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_hasChanged=deserializer.GetBoolean();this.m_textLocation=deserializer.GetMember();this.m_showChanges=deserializer.GetBoolean();if(this.m_textLocation==D2L.Control.Field.TextLocation.Top){this.m_fieldRow1=this.GetDomNode().previousSibling;this.m_fieldRow2=this.GetDomNode();}else{this.m_fieldRow1=this.GetDomNode();}},GetState:function(serializer){serializer.AddMember('HasChanged',this.m_hasChanged);},HandleOnChange:function(event){if(!event.hasChangeBeenShown&&this.m_showChanges){if(!this.m_hasChanged){this.SetHasChanged(true);}
this.OnShowChange.Trigger();event.hasChangeBeenShown=true;}},HandleOnChangeReset:function(){if(this.m_showChanges){this.m_hasChanged=false;if(this.m_fieldRow1!==null){this.m_fieldRow1.style.backgroundColor='';}
if(this.m_fieldRow2!==null){this.m_fieldRow2.style.backgroundColor='';}}},HandleOnTransform:function(event){if(this.m_fieldRow1.cells.length==2){this.m_fieldRow1.cells[0].style.paddingTop='0.3em';}
var me=this;setTimeout(function(){D2L.Control.Field.DoAlignment(me.GetDomNode());},0);},HasChanged:function(){return this.m_hasChanged;},SetHasChanged:function(hasChanged){this.m_hasChanged=hasChanged;var colour=hasChanged?'#e8e8ff':'#ffffff';if(this.m_fieldRow1!==null){this.m_fieldRow1.style.backgroundColor=colour;}
if(this.m_fieldRow2!==null){this.m_fieldRow2.style.backgroundColor=colour;}},Hide:function(){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Field.Hide() is obsolete. Please use '+'SetIsDisplayed() instead.'),true);this.SetIsDisplayed(false);},SetIsDisplayed:function(isDisplayed){var display='none';if(isDisplayed){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){display='inline';}else{display='table-row';}}
if(this.m_fieldRow1!==null){this.m_fieldRow1.style.display=display;}
if(this.m_fieldRow2!==null){this.m_fieldRow2.style.display=display;}
var tEvent=new D2L.TransformEvent(this.GetDomNode());tEvent.Bubble();},SetText:function(text){text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Field','SetText','text');if(this.IsRendered()){var span=this.m_fieldRow1.cells[0].firstChild.lastChild;if(span.firstChild){D2L.Util.Purge(span.firstChild);span.removeChild(span.firstChild);}
var me=this;text.GetText().Register(function(val){span.appendChild(me.CreateTextNode(val+':'));});}},Show:function(){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Field.Show() is obsolete. Please use '+'SetIsDisplayed() instead.'),true);this.SetIsDisplayed(true);}});D2L.Control.Field.TextLocation={Left:0,Top:1,None:2};D2L.Control.Field.InstallEvents=function(domNode,GetControl){var me=null;if(domNode.ID2LOnChange===undefined){UI.AttachObject(domNode,'ID2LOnChange',new D2L.EventHandler());}
domNode.ID2LOnChange.RegisterMethod(function(evt){if(me===null){me=GetControl();}
me.HandleOnChange(evt);});if(domNode.ID2LOnTransform===undefined){UI.AttachObject(domNode,'ID2LOnTransform',new D2L.EventHandler());}
domNode.ID2LOnTransform.RegisterMethod(function(evt){if(me===null){me=GetControl();}
me.HandleOnTransform();});FormManager.OnChangeReset.RegisterMethod(function(){if(me===null){me=GetControl();}
me.HandleOnChangeReset();});D2L.Control.Field.DoAlignment(domNode);};D2L.Control.Field.DoAlignment=function(domNode){if(domNode.cells.length==2){var field,content,fieldY,contentY,fieldMid,contentMid;var field=domNode.cells[0];var content=domNode.cells[1];var FindElem=function(node){var className=(node.className!==undefined?node.className:'');var tagName=(node.tagName!==undefined?node.tagName.toLowerCase():'');var isDisplayed=((node.style&&node.style.display=='none')?false:true);if(node.nodeType==1){if((className=='fgskip')||!isDisplayed||(tagName=='input'&&node.type.toLowerCase()=='hidden')){return null;}else if(tagName=='select'||tagName=='applet'||tagName=='object'){return node;}}else if(node.nodeType==3){if(node.data.trim().length==0){return null;}else{return node;}}
if(tagName=='table'){for(var i=0;i<node.rows.length;i++){if(node.rows[i].style.display!='none'){for(var j=0;j<node.rows[i].cells.length;j++){for(var k=0;k<node.rows[i].cells[j].childNodes.length;k++){var elem=FindElem(node.rows[i].cells[j].childNodes[k]);if(elem!==null){return elem;}}}}}
return null;}else{for(var i=0;i<node.childNodes.length;i++){var elem=FindElem(node.childNodes[i]);if(elem!==null){return elem;}}
return node;}};var content=FindElem(content);if(content&&content.parentNode){var space=document.createElement('span');if(field.firstChild){space=field.insertBefore(space,field.firstChild);}else{space=field.appendChild(space);}
space.appendChild(document.createTextNode(' '));fieldY=FindPosY(space);fieldMid=Math.round((fieldY+(fieldY+space.offsetHeight))/2);var space2=document.createElement('span');space2=content.parentNode.insertBefore(space2,content);space2.appendChild(document.createTextNode(' '));contentY=FindPosY(space2);contentMid=Math.round((contentY+(contentY+space2.offsetHeight))/2);if(contentMid>fieldMid){field.style.paddingTop=((contentMid-fieldMid)/Global.Preferences.FontSize+0.3)+'em';}
D2L.Util.Purge(space);space.parentNode.removeChild(space);space=null;D2L.Util.Purge(space2);space2.parentNode.removeChild(space2);space2=null;}}};D2L.Control.Field.GetFieldParentText=function(control){var domNode=control.GetDomNode();if(domNode!==null&&domNode.parentNode&&domNode.parentNode.className){var span=null;if(domNode.parentNode.className=='fcl_n'||domNode.parentNode.className=='fcl_w'){span=domNode.parentNode.previousSibling.firstChild.lastChild;}else if(domNode.parentNode.className=='fct_n'||domNode.parentNode.className=='fct_w'){span=domNode.parentNode.parentNode.previousSibling.firstChild.firstChild.lastChild;}
if(span!==null){var text=span.innerHTML;if(text.endsWith(':')){text=text.substr(0,text.length-1);}
return new D2L.LP.Text.PlainText(text);}}
return null;};

D2L.Control.Search=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.stateGroup='Search';this.options=[];this.isExpanded=false;this.doSearch=false;this.onSearch='';this.m_host=null;this.m_isSuggestedSearch=false;this.primaryTextType=3;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.doSearch=deserializer.GetBoolean();this.isExpanded=deserializer.GetBoolean();this.onSearch=deserializer.GetMember();var hasPrimaryText=deserializer.GetMember();if(hasPrimaryText){this.primaryTextType=deserializer.GetMember();}
if(deserializer.HasMember()){var hostControlId=deserializer.GetObjectMin(D2L.Control.Id);this.m_host=UI.GetControl(hostControlId.ID(),hostControlId.SID());}else{this.m_host=this;}
if(this.m_host&&this.m_host.RegisterSearch){this.m_host.RegisterSearch(this);}
var primaryTextInput=UI.GetControl(this.GetMappedId()+'_primary_text');if(primaryTextInput){this.primaryTextOption=new D2L.Control.Search.SearchText(-1,'primary',primaryTextInput.GetMappedId(),this.GetMappedId()+'_primary_fields');var me=this;UI.GetWindowEventManager().InstallKpel(primaryTextInput.GetDomNode(),function(obj,evt){me.PrimaryKeyPress(evt);});}
if(!this.isExpanded){this.RemoveSearchOptionTitles();}
D2L.Util.Aria.SetRole(this.GetDomNode(),'search');},RemoveSearchOptionTitles:function(){var selects=this.GetDomNode().getElementsByTagName('select');var inputs=this.GetDomNode().getElementsByTagName('input');for(var i=0;i<selects.length;i++){var element=selects[i];if(element&&element.title&&element.title!=''){element['d2ltitle']=element.title;element.removeAttribute('title');}}
for(var i=0;i<inputs.length;i++){var element=inputs[i];if(element&&element.title&&element.title!=''){element['d2ltitle']=element.title;element.removeAttribute('title');}}},AddSearchOptionTitles:function(){var selects=this.GetDomNode().getElementsByTagName('select');var inputs=this.GetDomNode().getElementsByTagName('input');for(var i=0;i<selects.length;i++){var element=selects[i];if(element&&element.d2ltitle&&element.d2ltitle!=''&&element.title!==undefined){element.title=element.d2ltitle;element.d2ltitle='';}}
for(var i=0;i<inputs.length;i++){var element=inputs[i];if(element&&element.d2ltitle&&element.d2ltitle!=''&&element.title!==undefined){element.title=element.d2ltitle;element.d2ltitle='';}}},Search:function(overridePrimaryText){var me=this;var dRet=ValidationManager.Validate('Search');dRet.Register(function(pass){if(!pass){if(!me.isExpanded){me.ToggleSearch();}
return;}
if(me.onSearch.length>0){var func=new Function(me.onSearch);if(!func()){return;}}
if(me.primaryTextOption){var hasSelectedFields=me.primaryTextOption.HasSelectedFields();if(!hasSelectedFields){UI.Error(new D2L.LP.Text.LangTerm('Framework.Search.jsErrorSearchOptionSearch'));return;}}
me.doSearch=true;var sg=StateManager.GetStateGroup(me.stateGroup);if(sg){sg.SetIsActive(true);}
if(me.m_host){me.m_host.OnSearchChanged(me);}
if(overridePrimaryText){me.SetIsSuggestedSearch(true);me.SetSearchText(new D2L.LP.Text.PlainText(overridePrimaryText));}
Nav.Go(new D2L.NavInfo());});},OnSearchChanged:function(){},GetIsExpanded:function(){return this.isExpanded;},GetPrimaryText:function(){return this.primaryTextOption;},GetState:function(serializer,stateType){if(stateType=='expanded'){serializer.AddMember('IsExpanded',this.GetIsExpanded());}else{serializer.AddMember('DoSearch',this.doSearch);serializer.AddMember('IsSuggestedSearch',this.GetIsSuggestedSearch());if(this.doSearch){if(this.primaryTextOption){serializer.AddMember('PrimaryTextValue',this.primaryTextOption.GetValue());serializer.AddMember('PrimaryTextFields',this.primaryTextOption.GetSelectedFields());}
var optionData=[];for(var i=0;i<this.options.length;i++){optionData.push(new D2L.Control.Search.SearchOptionInfo(this.options[i].type,this.options[i].GetId(),D2L.Serialization.JsonSerializer.Serialize(this.options[i])));}
serializer.AddMember('OptionData',optionData);}}},PrimaryKeyPress:function(e){if(e.GetKey()==D2L.KeyPressEvent.Key.Enter){this.Search();return false;}else{return true;}},Clear:function(noNavigation){var me=this;var DoClear=function(){me.doSearch=false;me.isExpanded=false;var sg=StateManager.GetStateGroup(me.stateGroup);if(sg){sg.Clear();}
if(me.host&&me.host!==null){me.host.OnSearchChanged(me);me.host.isSearchExpanded=false;}};if(!noNavigation){var ni=new D2L.NavInfo();ni.OnNavigate.RegisterMethod(function(){DoClear();});Nav.Go(ni);}else{DoClear();}},SetIsSuggestedSearch:function(isSuggestedSearch){this.m_isSuggestedSearch=isSuggestedSearch;},GetIsSuggestedSearch:function(){return this.m_isSuggestedSearch;},ToggleSearch:function(showImg,hideImg){var searchOptions=UI.GetById(this.GetMappedId()+'_searchOptions');var searchLink=UI.GetControl(this.GetMappedId()+'_searchOptionsToggle');var img;if(this.isExpanded){if(this.primaryTextOption){var hasSelectedFields=this.primaryTextOption.HasSelectedFields();if(!hasSelectedFields){UI.Error(new D2L.LP.Text.LangTerm('Framework.Search.jsErrorSearchOptionHide'));return;}}
this.RemoveSearchOptionTitles();searchOptions.style.display='none';searchLink.SetText(new D2L.LP.Text.LangTerm('Framework.Search.lblShowSearchOptions'));if(showImg!==null){img=UI.GetControl(this.GetMappedId()+'_searchOptionsToggleImg');if(img){img.SetImage(new D2L.Images.ImageTerm('Framework.Search.actShowSearchOptions'));img.SetAlt(new D2L.LP.Text.LangTerm('Framework.Search.altShowSearchOptions'));}}}else{this.AddSearchOptionTitles();searchOptions.style.display='block';searchLink.SetText(new D2L.LP.Text.LangTerm('Framework.Search.lblHideSearchOptions'));if(hideImg!==null){img=UI.GetControl(this.GetMappedId()+'_searchOptionsToggleImg');if(img){img.SetImage(new D2L.Images.ImageTerm('Framework.Search.actHideSearchOptions'));img.SetAlt(new D2L.LP.Text.LangTerm('Framework.Search.altHideSearchOptions'));}}}
this.isExpanded=!(this.isExpanded);var tEvent=new D2L.TransformEvent(searchOptions);tEvent.Bubble();},AddOption:function(option){this.options[this.options.length]=option;},SetSearchText:function(text){var primaryTextInput=UI.GetControl(this.GetMappedId()+'_primary_text');if(primaryTextInput){primaryTextInput.SetText(text);}},SetPrimarySearchFieldIsChecked:function(fieldName,isChecked){if(this.primaryTextOption){this.primaryTextOption.SetPrimarySearchFieldIsChecked(fieldName,isChecked);}},SetPrimaryTagSearchFieldIsChecked:function(isChecked){if(this.primaryTextOption){this.primaryTextOption.SetPrimaryTagSearchFieldIsChecked(isChecked);}}});D2L.Control.Search.OptionType={Boolean:1,DateRange:2,DropDownList:3,Text:4,PrimaryText:5,Custom:6};D2L.Control.Search.SearchOptionInfo=D2L.Class.extend({Construct:function(type,id,serializedData){arguments.callee.$.Construct.call(this);this.m_type=type;this.m_id=id;this.m_serializedData=serializedData;},Serialize:function(serializer){serializer.AddMember('Type',this.m_type);serializer.AddMember('Id',this.m_id);serializer.AddMember('SerializedData',this.m_serializedData,undefined,true);}});D2L.Control.Search.SearchBoolean=D2L.Class.extend({Construct:function(index,field,bothRb,onRb,offRb){arguments.callee.$.Construct.call(this);this.index=index;this.type=D2L.Control.Search.OptionType.Boolean;this.field=field;this.bothRb=bothRb;this.onRb=onRb;this.offRb=offRb;},Serialize:function(serializer){serializer.AddMember('Field',this.field);var state=0;if(this.onRb.IsSelected()){state=0;}else if(this.offRb.IsSelected()){state=1;}else{state=2;}
serializer.AddMember('State',state);},GetId:function(){return this.field;}});D2L.Control.Search.SearchText=D2L.Class.extend({Construct:function(index,name,valueId,cbName){arguments.callee.$.Construct.call(this);this.index=index;this.type=D2L.Control.Search.OptionType.Text;this.name=name;this.cbName=cbName;this.valueId=valueId;},Serialize:function(serializer){serializer.AddMember('Name',this.name);serializer.AddMember('Value',this.GetValue());serializer.AddMember('SelectedFields',this.GetSelectedFields());},GetId:function(){return this.name;},GetValue:function(){return UI.GetById(this.valueId).value;},HasSelectedFields:function(){var cbs=UI.GetControls(this.cbName);for(var i=0;i<cbs.length;i++){if(cbs[i].IsChecked()){return true;}}
return false;},GetSelectedFields:function(){var ret=[];var cbs=UI.GetControls(this.cbName);for(var i=0;i<cbs.length;i++){if(cbs[i].IsChecked()){ret.push(cbs[i].GetValue());}}
return ret;},SetPrimarySearchFieldIsChecked:function(fieldName,isChecked){var cbs=UI.GetControls(this.cbName);for(var i=0;i<cbs.length;i++){if(cbs[i].GetValue()==fieldName){cbs[i].SetIsChecked(isChecked);}}},SetPrimaryTagSearchFieldIsChecked:function(isChecked){var cbs=UI.GetControls(this.cbName);for(var i=0;i<cbs.length;i++){if(cbs[i].GetValue().indexOf('__searchTagField')>=0){cbs[i].SetIsChecked(isChecked);}}}});D2L.Control.Search.SearchDropDownList=D2L.Class.extend({Construct:function(index,field,cbId,dlId){arguments.callee.$.Construct.call(this);this.index=index;this.type=D2L.Control.Search.OptionType.DropDownList;this.field=field;this.cbId=cbId;this.dlId=dlId;},Serialize:function(serializer){serializer.AddMember('Field',this.field);if(UI.GetControl(this.cbId).IsChecked()){serializer.AddMember('Value',UI.GetControl(this.dlId),'GetState');}},GetId:function(){return this.field;}});D2L.Control.Search.SearchDateRange=D2L.Class.extend({Construct:function(index,field,name){arguments.callee.$.Construct.call(this);this.index=index;this.type=D2L.Control.Search.OptionType.DateRange;this.field=field;this.name=name;},Serialize:function(serializer){serializer.AddMember('Field',this.field);serializer.AddMember('Value',UI.GetControl(this.name),'GetState');},GetId:function(){return this.field;}});

function d2l_MultiSelectManager(availMs,addedMs,container){this.availMs=availMs;this.addedMs=addedMs;this.IDomNode=addedMs.div;}
d2l_MultiSelectManager.prototype.Add=function(){if(this.availMs.CountChecked()>0){this.availMs.RemoveChecked(this.addedMs);this.availMs.Draw();this.addedMs.Draw();}};d2l_MultiSelectManager.prototype.Remove=function(){if(this.addedMs.CountChecked()>0){this.addedMs.RemoveChecked(this.availMs);this.availMs.Draw();this.addedMs.Draw();}};function d2l_MultiSelect(name,rowValues,rowData,rowChecked){this.name=name;this.div=UI.GetById('ms_'+name+'_id');this.rowValues=rowValues;this.rowData=rowData;this.rowChecked=rowChecked;this.OnChangedEvent=new D2L.EventHandler();this.OnChangedEvent.Register(this,'HandleChange');}
d2l_MultiSelect.prototype.HandleChange=function(){WindowEventManager.BubbleChangeEvent(this.div,null);};d2l_MultiSelect.prototype.Draw=function(){var html='';var checked='';var rowClass='';var cbId='';html+='<table style="width:100%;" cellspacing="0" cellpadding="0">';for(var i=0;i<this.rowValues.length;i++){if(this.rowChecked[i]){checked=' checked="checked" ';rowClass=' class="MultiSelectOptionRowHighlight" ';}else{checked="";rowClass="";}
cbId=this.name+'_c'+i;html+='<tr id="'+this.name+'_r'+i+'"'+rowClass+'><td style="vertical-align:top" class="MultiSelectOptionCell">';html+='<input type="hidden" name="'+this.name+'_order" value="'+this.rowValues[i]+'"/>';html+='<input onclick="ms_'+this.name+'.Check('+i+');"'+checked+' name="'+this.name+'" id="'+cbId+'" value="'+this.rowValues[i]+'" type="checkbox"/></td><td style="width:100%;text-align:left" class="MultiSelectOptionCell"><label for="'+cbId+'">'+this.rowData[i]+'</label></td></tr>';}
html+='</table>';this.div.innerHTML=html;};d2l_MultiSelect.prototype.Check=function(rowNum){var cb;if(this.rowData.length==1){cb=eval('UI.form.'+this.name);}else{cb=eval('UI.form.'+this.name+'['+rowNum+']');}
var row=eval('document.getElementById("'+this.name+'_r'+rowNum+'")');if(cb.checked){this.rowChecked[rowNum]=true;row.className='MultiSelectOptionRowHighlight';}else{this.rowChecked[rowNum]=false;row.className='';}};d2l_MultiSelect.prototype.Up=function(){this.Move(true);};d2l_MultiSelect.prototype.Down=function(){this.Move(false);};d2l_MultiSelect.prototype.Move=function(isUp){if(this.rowData.length<=1){return;}
var numChecked=this.SaveChecked();if(numChecked===0){return;}
var arrNewOrder=CheckboxReorder(this.name,isUp);var arrNewValues=new Array(this.rowValues.length);var arrNewData=new Array(this.rowData.length);var arrNewChecked=new Array(this.rowChecked.length);for(var i=0;i<arrNewOrder.length;i++){arrNewValues[i]=this.rowValues[arrNewOrder[i]];arrNewData[i]=this.rowData[arrNewOrder[i]];arrNewChecked[i]=this.rowChecked[arrNewOrder[i]];}
this.rowValues=arrNewValues;this.rowData=arrNewData;this.rowChecked=arrNewChecked;this.Draw();this.OnChangedEvent.Trigger();};d2l_MultiSelect.prototype.Add=function(data,value,isChecked){this.rowValues[this.rowValues.length]=value;this.rowData[this.rowData.length]=data;this.rowChecked[this.rowChecked.length]=isChecked;this.OnChangedEvent.Trigger();};d2l_MultiSelect.prototype.RemoveChecked=function(newMS){var arrNewValues=new Array();var arrNewData=new Array();var arrNewChecked=new Array();var cb;for(var i=0;i<this.rowData.length;i++){if(this.rowData.length==1){cb=eval('UI.form.'+this.name);}else{cb=eval('UI.form.'+this.name+'['+i+']');}
if(cb.checked){newMS.Add(this.rowData[i],this.rowValues[i],true);}else{arrNewValues[arrNewValues.length]=this.rowValues[i];arrNewData[arrNewData.length]=this.rowData[i];arrNewChecked[arrNewChecked.length]=false;}}
this.rowValues=arrNewValues;this.rowData=arrNewData;this.rowChecked=arrNewChecked;this.OnChangedEvent.Trigger();};d2l_MultiSelect.prototype.SaveChecked=function(){var cbs=eval('UI.form.'+this.name);var count=0;for(var x=0;x<cbs.length;x++){this.rowChecked[x]=cbs[x].checked;if(cbs[x].checked){count++;}}
return count;};d2l_MultiSelect.prototype.CountChecked=function(){var count=0;for(var x=0;x<this.rowChecked.length;x++){if(this.rowChecked[x]){count++;}}
return count;};d2l_MultiSelect.prototype.Count=function(){return this.rowValues.length;};

D2L.Control.DateRange=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.DateRange);this.m_isEnabled=true;this.sd=null;this.ed=null;this.cb_sd=null;this.cb_ed=null;this.cb_se=null;this.cb_ih=null;this.m_validationFailureSource=0;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.sd=UI.GetControl(this.GetMappedId()+'_dts_sd');this.ed=UI.GetControl(this.GetMappedId()+'_dts_ed');this.cb_sd=UI.GetControl(this.GetMappedId()+'_cb_sd');this.cb_ed=UI.GetControl(this.GetMappedId()+'_cb_ed');this.cb_se=UI.GetControl(this.GetMappedId()+'_cb_se');this.cb_ih=UI.GetControl(this.GetMappedId()+'_cb_ih');},HasTime:function(){return this.sd.HasTime();},Focus:function(){if(this.m_validationFailureSource==0||this.m_validationFailureSource==1){this.sd.Focus();}else if(this.m_validationFailureSource==2){this.ed.Focus();}},GetValidationBalloonDomNode:function(){if(this.m_validationFailureSource==0||this.m_validationFailureSource==1){return this.sd.GetDomNode();}else if(this.m_validationFailureSource==2){return this.ed.GetDomNode();}},GetStartDate:function(){if(this.HasStartDate()){return this.sd.GetDate();}else{return null;}},GetStartDateSelector:function(){return this.sd;},GetStartYear:function(){return this.sd.GetYear();},GetStartMonth:function(){return this.sd.GetMonth();},GetStartDay:function(){return this.sd.GetDay();},GetStartHour:function(){return this.sd.GetHour();},GetStartMinute:function(){return this.sd.GetMinute();},GetEndYear:function(){return this.ed.GetYear();},GetEndMonth:function(){return this.ed.GetMonth();},GetEndDay:function(){return this.ed.GetDay();},GetEndHour:function(){return this.ed.GetHour();},GetEndMinute:function(){return this.ed.GetMinute();},GetEndDate:function(){if(this.HasEndDate()){return this.ed.GetDate();}else{return null;}},GetEndDateSelector:function(){return this.ed;},HasStartDate:function(){if(this.cb_sd!==null){return this.cb_sd.IsChecked();}
return true;},HasEndDate:function(){if(this.cb_ed!==null){return this.cb_ed.IsChecked();}
return true;},IsScheduleEventCreated:function(){if(this.cb_se!=null){return this.cb_se.IsChecked();}else{return false;}},HasEvent:function(){return this.IsScheduleEventCreated();},IsHidden:function(){if(this.cb_ih){return this.cb_ih.IsChecked();}else{return false;}},GetState:function(serializer){serializer.AddMember('HasStartDate',this.HasStartDate());serializer.AddMember('HasEndDate',this.HasEndDate());serializer.AddMember('HasEvent',this.IsScheduleEventCreated());serializer.AddMember('IsHidden',this.IsHidden());serializer.AddMember('StartDate',this.GetStartDateSelector(),'GetState');serializer.AddMember('EndDate',this.GetEndDateSelector(),'GetState');},SetHasStartDate:function(hasStartDate){if(this.HasStartDate()!=hasStartDate&&this.cb_sd!==null){this.cb_sd.SetIsChecked(hasStartDate);this.cb_sd.GetDomNode().IEnabler.ResetState();}},SetHasEndDate:function(hasEndDate){if(this.HasEndDate()!=hasEndDate&&this.cb_ed!==null){this.cb_ed.SetIsChecked(hasEndDate);this.cb_ed.GetDomNode().IEnabler.ResetState();}}});D2L.DateRange=D2L.Control.DateRange;var d2l_DateRange=D2L.Control.DateRange;D2L.DateTime=D2L.Class.extend({Construct:function(dateString){arguments.callee.$.Construct.call(this);this.m_date=new Date();if(dateString){this.SetDateString(dateString);}},SetDateString:function(dateString){this.SetMonth(0);this.SetDay(1);this.SetYear(parseInt(substr(0,4)));this.SetMonth(parseInt(substr(4,2)));this.SetDay(parseInt(substr(6,2)));this.SetHour(parseInt(substr(8,2)));this.SetMinute(parseInt(substr(10,2)));},GetDateString:function(){var ret;ret=this.GetYear();ret+=this.PadInt(this.GetMonth(),2);ret+=this.PadInt(this.GetDay(),2);ret+=this.PadInt(this.GetHour(),2);ret+=this.PadInt(this.GetMinute(),2);return ret;},PadInt:function(val,digits){var ret=val.toString();while(ret.length<digits){ret='0'+ret;}
return ret;},GetYear:function(){return this.m_date.getFullYear();},SetYear:function(year){this.m_date.setFullYear(year);},GetMonth:function(){return this.m_date.getMonth();},SetMonth:function(month){this.m_date.setMonth(month);},GetDay:function(){return this.m_date.getDate();},SetDay:function(day){this.m_date.setDate(day);},GetHour:function(){return this.m_date.getHours();},SetHour:function(hour){this.m_date.setHours(hour);},GetMinute:function(){return this.m_date.getMinutes();},SetMinute:function(minute){this.m_date.setMinutes(minute);},GetTimestamp:function(){return this.m_date.getTime();}});

D2L.Control.HiddenPropertyGroup=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isModified=false;this.m_infoIsDisplayed=false;this.m_infoText=new D2L.LP.Text.PlainText('');this.m_isFieldGroup=false;this.m_isOpened=true;this.m_openedText=new D2L.LP.Text.PlainText('');this.m_text=new D2L.LP.Text.PlainText('');this.m_header=null;this.m_icon=null;this.m_infoBar=null;this.m_contents=null;this.m_fields=[];},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isOpened=deserializer.GetBoolean();this.m_isFieldGroup=deserializer.GetBoolean();this.m_text=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_openedText=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_infoText=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_infoIsDisplayed=deserializer.GetBoolean();this.m_isModified=deserializer.GetBoolean();this.m_fields=deserializer.GetMember();this.m_icon=UI.GetControl(this.GetMappedId()+'_icon');if(this.m_isFieldGroup){this.m_header=this.GetDomNode().cells[0].firstChild;}else{this.m_header=this.GetDomNode();this.m_contents=this.m_header.nextSibling;}
this.m_infoBar=this.m_header.childNodes[this.m_header.childNodes.length-1];var me=this;var Attach=function(container){me.AttachObject(container,'ID2LOnExpand',new D2L.EventHandler());container.ID2LOnExpand.Register(me,'Open');if(container.ID2LOnChange===undefined){me.AttachObject(container,'ID2LOnChange',new D2L.EventHandler());}
container.ID2LOnChange.RegisterMethod(function(){me.m_isModified=true;});};if(!this.m_isFieldGroup){Attach(this.m_contents);}else{var rowIndex=this.GetDomNode().rowIndex+1;var row=null;for(var i=0;i<this.m_fields.length;i++){Attach(this.GetDomNode().parentNode.rows[rowIndex]);rowIndex++;if(this.m_fields[i]==D2L.Control.Field.TextLocation.Top){Attach(this.GetDomNode().parentNode.rows[rowIndex]);rowIndex++;}}}},Close:function(){if(this.m_isFieldGroup){var rowIndex=this.GetDomNode().rowIndex+1;var row=null;for(var i=0;i<this.m_fields.length;i++){row=this.GetDomNode().parentNode.rows[rowIndex];row.style.display='none';rowIndex++;if(this.m_fields[i]==D2L.Control.Field.TextLocation.Top){row=this.GetDomNode().parentNode.rows[rowIndex];row.style.display='none';rowIndex++;}}}else{this.m_contents.style.display='none';}
this.m_icon.SetImage(new D2L.Images.ImageTerm('Shared.Main.actShow'));this.m_icon.SetText(this.m_text);if(this.m_isModified){this.m_header.className='D2LModified';}
if(this.m_infoIsDisplayed){this.ShowInfo();}
this.m_isOpened=false;var tEvent=new D2L.TransformEvent(this.m_header);tEvent.Bubble();},GetState:function(serializer,stateType){if(stateType=='showchanges'){serializer.AddMember('IsModified',this.m_isModified);}else{serializer.AddMember('IsOpened',this.m_isOpened);}},HideInfo:function(){this.m_infoBar.style.display='none';},IsOpen:function(){return this.m_isOpened;},Open:function(){if(this.m_isFieldGroup){var rowIndex=this.GetDomNode().rowIndex+1;var row=null;for(var i=0;i<this.m_fields.length;i++){row=this.GetDomNode().parentNode.rows[rowIndex];if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){row.style.display='inline';}else{row.style.display='table-row';}
rowIndex++;if(this.m_fields[i]==D2L.Control.Field.TextLocation.Top){row=this.GetDomNode().parentNode.rows[rowIndex];if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){row.style.display='inline';}else{row.style.display='table-row';}
rowIndex++;}}}else{this.m_contents.style.display='block';}
this.m_icon.SetImage(new D2L.Images.ImageTerm('Shared.Main.actHide'));this.m_icon.SetText(this.m_openedText);if(this.m_isModified){this.m_header.className='';}
if(this.m_infoIsDisplayed){this.HideInfo();}
this.m_isOpened=true;var tEvent=new D2L.TransformEvent(this.m_header);tEvent.Bubble();},ShowInfo:function(){this.m_infoBar.style.display='block';},SetInfoIsDisplayed:function(infoIsDisplayed){this.m_infoIsDisplayed=infoIsDisplayed;if(!this.m_isOpened){if(infoIsDisplayed){this.ShowInfo();}else{this.HideInfo();}}},Toggle:function(){if(this.IsOpen()){this.Close();}else{this.Open();}}});

D2L.MultiEdit={};D2L.MultiEdit.Manager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_controls=[];this.m_includeUnchanged=false;var me=this;UI.GetFormManager().OnChangeReset.RegisterMethod(function(){for(var i=0;i<me.m_controls.length;i++){me.m_controls[i].Reset();}});},DeserializeMin:function(deserializer){this.m_controls=deserializer.GetObjectArrayMin(D2L.MultiEdit.MultiEditControl);this.m_includeUnchanged=deserializer.GetBoolean();},Serialize:function(serializer){var controls=[];for(var i=0;i<this.m_controls.length;i++){if(this.m_controls[i].IsInDom()&&(this.m_controls[i].HasChanged()||this.m_includeUnchanged)){controls.push(this.m_controls[i]);}}
serializer.AddMember('Controls',controls);},AddMultiEditToForm:function(){var form=UI.GetForm();var hdn=UI.GetById('d2l_multiedit');if(!hdn){hdn=document.createElement('input');hdn.type='hidden';hdn.name='d2l_multiedit';hdn.id='d2l_multiedit';form.appendChild(hdn);}
hdn.value=D2L.Serialization.JsonSerializer.Serialize(this);},GetMultiEditObject:function(key,fieldName){fieldName=fieldName.toLowerCase();for(var i=0;i<this.m_controls.length;i++){if(this.m_controls[i].GetKey()==key&&this.m_controls[i].GetField().toLowerCase()==fieldName){return this.m_controls[i];}}
return null;},GetMultiEditObjectsByField:function(fieldName){fieldName=fieldName.toLowerCase();var ret={};for(var i=0;i<this.m_controls.length;i++){if(this.m_controls[i].GetField().toLowerCase()==fieldName){ret[this.m_controls[i].GetKey()]=this.m_controls[i];}}
return ret;},GetMultiEditObjectsByKey:function(key){var ret={};for(var i=0;i<this.m_controls.length;i++){if(this.m_controls[i].GetKey()==key){ret[this.m_controls[i].GetField()]=this.m_controls[i];}}
return ret;}});D2L.MultiEdit.MultiEditControl=D2L.Class.extend({Construct:function(obj){arguments.callee.$.Construct.call(this);this.m_controlId=null;this.m_key='';this.m_originalValue='';this.m_field='';this.m_includeWhenUnchanged=false;},DeserializeMin:function(deserializer){this.m_controlId=deserializer.GetObjectMin(D2L.Control.Id);this.m_key=deserializer.GetMember();this.m_originalValue=deserializer.GetMember();this.m_field=deserializer.GetMember();this.m_includeWhenUnchanged=deserializer.GetBoolean();},Serialize:function(serializer){serializer.AddMember('Key',this.GetKey());serializer.AddMember('Field',this.GetField());serializer.AddMember('Value',this.GetValue());},GetControl:function(){return UI.GetControl(this.m_controlId.ID(),this.m_controlId.SID());},GetField:function(){return this.m_field;},GetKey:function(){return this.m_key;},GetObject:function(){return this.GetControl();},GetValue:function(){return this.GetControl().GetMultiEditValue();},GetOriginalValue:function(){return this.m_originalValue;},HasChanged:function(){return(this.IncludeWhenUnchanged()||this.GetOriginalValue()!=this.GetValue());},IncludeWhenUnchanged:function(){return this.m_includeWhenUnchanged;},IsInDom:function(){var domNode=this.GetControl().GetDomNode();if(domNode!==null){while(domNode.parentNode!==null){domNode=domNode.parentNode;}
return(domNode==document);}
return false;},Reset:function(){this.m_originalValue=this.GetValue();},SetIncludeWhenUnchanged:function(includeWhenUnchanged){this.m_includeWhenUnchanged=includeWhenUnchanged;}});D2L.MultiEdit.GetManager=function(){return UI.GetMultiEditManager();};

D2L.Control.RichEdit=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.RichEdit);this.m_customButtons=[];this.m_isEnabled=true;this.m_isHtml=null;this.m_htmlEditorImage=null;this.m_div=null;this.m_table=null;this.m_editor=null;this.m_editorD=null;this.m_editorText=null;this.m_originalText='';this.m_originalIsHtml=false;this.m_hasChanged=null;this.m_allowImages=false;this.m_allowEquations=false;this.m_inEditMode=false;this.m_domReAnchor=null;this.m_domPvAnchor=null;this.m_hasSpellcheck=false;this.m_hasInsertObject=false;this.m_hasInsertQuicklink=false;this.m_allowHtmlSourceEditing=false;this.m_canUploadFile=false;this.m_defaultLangCode='en';this.m_domValue=null;this.m_subject='';this.m_turnOffEditor=false;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var me=this;this.m_hasChanged=this.GetDomNode().firstChild;this.m_domValue=this.GetDomNode().childNodes[1];this.m_turnOffEditor=deserializer.GetBoolean();this.m_isEnabled=deserializer.GetBoolean();if(this.m_turnOffEditor){this.m_originalText=this.m_domValue.value;var me=this;Nav.OnBeforeNavigate.RegisterMethod(function(){me.UpdateHasChanged();});}else{this.m_table=this.GetDomNode().childNodes[3];this.m_domReAnchor=this.m_table.rows[0].cells[0].firstChild.firstChild;this.m_htmlEditorImage=this.m_domReAnchor.firstChild;this.m_div=this.m_table.rows[0].cells[1].firstChild;this.m_div.tabIndex=-1;this.m_allowImages=deserializer.GetBoolean();this.m_allowEquations=deserializer.GetBoolean();this.m_hasSpellcheck=deserializer.GetBoolean();this.m_hasInsertObject=deserializer.GetBoolean();this.m_canUploadFile=deserializer.GetBoolean();var text=this.m_domValue.value;this.m_defaultLangCode=deserializer.GetMember();this.m_customButtons=deserializer.GetObjectArrayMin(D2L.Control.HtmlEditorButton);this.m_hasInsertQuicklink=deserializer.GetBoolean();this.m_allowHtmlSourceEditing=deserializer.GetBoolean();this.m_subject=deserializer.GetMember();this.m_originalText=text;this.SetText(text);this.AttachObject(this.m_div,'onclick',function(){if(!me.m_inEditMode&&me.IsEnabled()){me.LaunchEditor();return false;}
return true;});this.AttachObject(this.m_div,'onmouseover',function(){me.m_ignoreMouseOut=true;if(!me.m_inEditMode&&me.IsEnabled()&&me.m_div.className!='dre_ch'){me.m_div.className='dre_ch';me.FixIEHeightBug(true);return false;}
return true;});this.AttachObject(this.m_div,'onmouseout',function(){me.m_ignoreMouseOut=false;setTimeout(function(){if(!me.m_inEditMode&&me.IsEnabled()&&!me.m_ignoreMouseOut){me.m_div.className='dre_c';me.FixIEHeightBug(true);return false;}},0);return true;});this.AttachObject(this.m_domReAnchor,'onclick',function(){me.LaunchEditor();return false;});var OnFocusEdit=function(){if(UI.GetBrowserInfo().Type!=D2L.UI.BrowserType.Safari&&me.IsEnabled()){me.m_domReAnchor.className='dre_ieh';}
return false;};var OnBlurEdit=function(){if(UI.GetBrowserInfo().Type!=D2L.UI.BrowserType.Safari&&me.IsEnabled()){if(me.m_inEditMode){me.m_domReAnchor.className='dre_ieon';}else{me.m_domReAnchor.className='dre_ieoff';}}
return false;};this.AttachObject(this.m_domReAnchor,'onmouseover',function(){return OnFocusEdit();});this.AttachObject(this.m_domReAnchor,'onmouseout',function(){return OnBlurEdit();});this.AttachObject(this.m_domReAnchor,'onfocus',function(){return OnFocusEdit();});this.AttachObject(this.m_domReAnchor,'onblur',function(){return OnBlurEdit();});if(UI.GetBrowserInfo().Type!=D2L.UI.BrowserType.Safari&&this.IsEnabled()){this.m_domReAnchor.className='dre_ieoff';}
this.FixIEHeightBug();this.Init();}},Init:function(){if(UI.GetBrowserInfo().Type!=D2L.UI.BrowserType.Safari){var btnSpellcheck='';var plugins='';if(this.m_hasSpellcheck){btnSpellcheck+='spellchecker,';plugins+='spellchecker,';}}
var me=this;Nav.OnBeforeNavigate.RegisterMethod(function(){me.UpdateHasChanged();});},Disable:function(){if(this.IsEnabled()){if(this.m_turnOffEditor){this.m_domValue.disabled='disabled';this.m_isEnabled=false;}else{this.m_domReAnchor.removeAttribute('href');if(UI.GetBrowserInfo().Type!=D2L.UI.BrowserType.Safari&&!this.m_turnOffEditor){if(this.m_inEditMode&&this.m_editor!=null){this.LaunchEditor();}
this.m_domReAnchor.className='dre_id';}
if(this.m_turnOffEditor&&this.m_editorText!=null){this.m_editorText.Disable();}
this.m_isEnabled=false;this.Render_Image();}}},Enable:function(){if(!this.IsEnabled()){if(this.m_turnOffEditor){this.m_domValue.disabled='';this.m_isEnabled=true;}else{this.m_domReAnchor.href='javascript://';if(UI.GetBrowserInfo().Type!=D2L.UI.BrowserType.Safari&&this.m_inEditMode){this.m_domReAnchor.className='dre_ieon';}else if(UI.GetBrowserInfo().Type!=D2L.UI.BrowserType.Safari&&!this.m_inEditMode){this.m_domReAnchor.className='dre_ieoff';}
if(this.m_turnOffEditor&&this.m_editorText!=null){this.m_editorText.Enable();}
this.m_isEnabled=true;this.Render_Image();}}},Focus:function(){if(this.m_turnOffEditor){this.m_domValue.focus();}else{this.m_domReAnchor.focus();}},GetMultiEditValue:function(){return this.GetText();},GetState:function(serializer){serializer.AddMember('Text',this.GetText());serializer.AddMember('IsHtml',true);},GetText:function(){if(this.m_inEditMode&&this.m_editor!=null&&this.m_editor.IsLoaded()){return this.m_editor.GetHtml();}else{return this.m_domValue.value;}},GetValidationBalloonDomNode:function(){if(this.m_turnOffEditor){return this.m_domValue;}else{return this.m_table;}},HasValue:function(){return new D2L.Util.DelayedReturn(this.HasValueNoDelay());},HasValueNoDelay:function(){return(this.GetText().trim().length>0);},IsEmpty:function(){return(this.GetText().length===0);},IsEnabled:function(){return this.m_isEnabled;},IsHtml:function(){return true;},SetIsEnabled:function(isEnabled){if(isEnabled){this.Enable();}else{this.Disable();}},SetText:function(text){if(this.m_inEditMode&&this.m_editor!=null&&this.m_editor.IsLoaded()){this.m_editor.SetHtml(text);}else if(!this.m_turnOffEditor){D2L_MathML.AssignHtml(this.m_div,text.replace('{orgUnitId}',Global.OrgUnitId));}
this.m_domValue.value=text;this.UpdateHasChanged();},ToggleEnabled:function(){if(this.IsEnabled()){this.Disable();}else{this.Enable();}},LaunchEditor:function(){if(this.IsEnabled()&&!this.m_turnOffEditor){var firstLoad=false;if(this.m_editor===null){this.m_editor=new D2L.Control.HtmlEditor(this.m_domValue);this.m_editor.SetTheme(D2L.Control.HtmlEditor.Theme.Basic);this.m_editor.SetSize(this.m_div.offsetWidth,this.m_div.offsetHeight);this.m_editor.SetHasInsertImage(this.m_allowImages);this.m_editor.SetHasInsertQuicklink(this.m_hasInsertQuicklink);this.m_editor.SetHasInsertObject(this.m_hasInsertObject);this.m_editor.SetHasInsertEquations(this.m_allowEquations);this.m_editor.SetHasSpellChecker(this.m_hasSpellcheck);this.m_editor.SetHasEditHtmlSource(this.m_allowHtmlSourceEditing);this.m_editor.SetDefaultLanguage(this.m_defaultLangCode);this.m_editor.SetCanUploadFile(this.m_canUploadFile);this.m_editor.SetCustomButtons(this.m_customButtons);var divParent=this.m_div.parentNode;this.m_editor.AppendTo(divParent);firstLoad=true;}
if(this.m_editor.IsLoaded()||firstLoad){if(!this.m_inEditMode){this.m_div.style.display='none';this.m_table.style.tableLayout='auto';var hideEditorTerm=new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.altHideEditor',this.m_subject);hideEditorTerm.AssignText(this.m_htmlEditorImage,'title');hideEditorTerm.AssignText(this.m_htmlEditorImage,'alt');}
this.m_editor.ToggleEditor();if(this.m_inEditMode){this.m_table.style.tableLayout='fixed';this.m_div.style.display='block';D2L_MathML.AssignHtml(this.m_div,this.m_domValue.value.replace('{orgUnitId}',Global.OrgUnitId));var showEditorTerm=new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.altShowEditor',this.m_subject);showEditorTerm.AssignText(this.m_htmlEditorImage,'title');showEditorTerm.AssignText(this.m_htmlEditorImage,'alt');}else{this.m_editor.Focus();}
if(this.IsEnabled()){if(this.m_inEditMode){this.m_domReAnchor.className='dre_ieoff';}else{this.m_domReAnchor.className='dre_ieon';}}
this.m_div.className='dre_c';this.FixIEHeightBug();this.Render_Image();this.m_inEditMode=!this.m_inEditMode;}}},FixIEHeightBug:function(isEvent){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){var me=this;me.m_div.style.overflow='visible';if(isEvent){me.m_div.style.overflow='auto';}else{setTimeout(function(){me.m_div.style.overflow='auto';},0);}}},SpellCheck:function(){if(this.IsEnabled()&&!this.m_turnOffEditor){var spell_win=window.open("/d2l/tools/spellchecker/spellcheckFrameset.asp?ou="+Global.OrgUnitId+"&dataSource="+UI.EncodeUrl('UI.GetByName(\''+this.m_name+'\').GetText()'),"SpellChecker","width=400,height=450,toolbar=no,status=no,menubar=no,directories=no,resizable=yes");spell_win.focus();}},UpdateHasChanged:function(){this.m_hasChanged.value=(this.GetText()!=this.m_originalText)?'1':'0';},HasChanged:function(){return(this.GetText()!=this.m_originalText);},Render_Image:function(){var imgTerm='';if(this.IsEnabled()){imgTerm='Shared.Main.actEdit';}else{imgTerm='Shared.Main.actEditDisabled';}
D2L.Images.ImageTerm.Assign(imgTerm,this.m_htmlEditorImage);}});D2L.Control.HtmlEditorButton=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_alt=null;this.m_callback=null;this.m_imageTerm=null;this.m_isInBasic=false;this.m_name='HtmlButton'+UI.GetUniqueHtmlId();},GetAlt:function(){return this.m_alt;},GetCallback:function(){return this.m_callback;},GetImageTerm:function(){return this.m_imageTerm;},GetName:function(){return this.m_name;},IsInBasic:function(){return this.m_isInBasic;},SetAlt:function(alt){this.m_alt=alt;},SetCallback:function(callback){this.m_callback=callback;},SetImageTerm:function(imageTerm){this.m_imageTerm=imageTerm;},Serialize:function(serializer){serializer.AddMember('N',this.GetName());serializer.AddMember('ALT',this.GetAlt());serializer.AddMember('JS',this.GetCallback());serializer.AddMember('IMG',this.GetImageTerm());serializer.AddMember('IB',this.IsInBasic());},DeserializeMin:function(deserializer){this.m_name=deserializer.GetMember();this.m_alt=deserializer.GetMember();this.m_callback=deserializer.GetMember();this.m_imageTerm=deserializer.GetMember();this.m_isInBasic=deserializer.GetBoolean();}});D2L.Control.HtmlEditorCustomButtons=[];

D2L.Popup=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this,true);this.winName='';this.bodySource='';this.footerSource='footer.d2l';this.queryString='';this.footerMsg='';this.height=400;this.width=400;this.title=new D2L.LP.Text.PlainText('');this.hasStatusBar=false;this.hasAutoScroll=true;this.buttons=new Array();this.m_window=null;this.m_autoCloseWindow=true;this.m_name=UI.GetUniqueHtmlId();window[this.m_name]=this;this.m_isClone=false;},Dispose:function(){arguments.callee.$.Dispose.call(this);if(this.m_window&&!this.m_isClone&&this.m_autoCloseWindow&&UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<7&&!this.m_window.closed){this.m_window.close();}
this.m_window=null;},AddButton:function(text,jsFunctionName,location){var me=this;var doAddition=function(){if(text.isString){me.RemoveButton(text);}
me.buttons.push(new Array(text,jsFunctionName,location));};var pWindow=this.GetWindow();if(pWindow!==null&&pWindow.OnLoadComplete&&pWindow.isLoadComplete!==undefined){if(!pWindow.isLoadComplete){pWindow.OnLoadComplete.RegisterMethod(doAddition);}else{doAddition();}}else{doAddition();}},RemoveButton:function(text){var me=this;var doRemoval=function(){for(var i=0;i<me.buttons.length;i++){if(me.buttons[i][0].isString){if(me.buttons[i][0]==text){if(me.buttons[i]==me.buttons[me.buttons.length-1]){me.buttons.pop();}else{me.buttons[i]=me.buttons.pop();}}}}};var pWindow=this.GetWindow();if(pWindow!==null&&pWindow.OnLoadComplete&&pWindow.isLoadComplete!==undefined){if(!pWindow.isLoadComplete){pWindow.OnLoadComplete.RegisterMethod(doRemoval);}else{doRemoval();}}else{doRemoval();}},AddCancelButton:function(){this.AddButton("Cancel","Cancel","Left");},AddCloseButton:function(){this.AddButton("Close","Close","Left");},AddCreateButton:function(){this.AddButton("Create","Create","Right");},AddSaveButton:function(){this.AddButton("Save","Save","Right");},ClearButtons:function(){var me=this;var doRemoval=function(){me.buttons=new Array();};var pWindow=this.GetWindow();if(pWindow!==null&&pWindow.OnLoadComplete&&pWindow.isLoadComplete!==undefined){if(!pWindow.isLoadComplete){pWindow.OnLoadComplete.RegisterMethod(doRemoval);}else{doRemoval();}}else{doRemoval();}},Open:function(){if(this.m_window){if(this.m_window.closed){this.m_window=null;}}
if(!this.m_window){var statusBar,windowFeatures;if(this.hasStatusBar){statusBar='yes';}
windowFeatures="height="+this.height+",width="+this.width+",status="+statusBar;windowFeatures+=",location=0,menubar=0,toolbar=0,directories=0,resizable=1";this.m_window=window.open(this.GetUrl(),this.winName,windowFeatures);}
if(this.m_window){this.m_window.focus();}},Load:function(){var pWindow=this.GetWindow();if(pWindow!==null){pWindow.resizeTo(this.width,this.height);if(this.bodySource.length>0){if(this.queryString.length>0){pWindow.frames['Body'].location.href=this.bodySource+"?"+this.queryString;}else{pWindow.frames['Body'].location.href=this.bodySource;}}else{pWindow.frames['Body'].location.href="/d2l/common/popup/empty.html";}
this.LoadFooter();this.LoadHeader();}},LoadFooter:function(){var pWindow=this.GetWindow();if(pWindow!==null){var footer=pWindow.frames['Footer'];var me=this;var reloadFooter=function(){var buttons=me.GetButtonString().Register(function(buttonString){if(me.footerSource=="footer.d2l"){var ni=new footer['D2L'].NavInfo();ni.SetParam('footerMsg',me.footerMsg);ni.SetParam('buttons',buttonString);footer['Nav'].Go(ni);}else{footer.location.href=me.footerSource+"?"+me.queryString;}});};if(pWindow.OnLoadComplete&&pWindow.isLoadComplete!==undefined){if(!pWindow.isLoadComplete){pWindow.OnLoadComplete.RegisterMethod(reloadFooter);}else{reloadFooter();}}}},LoadHeader:function(){var win=this.GetWindow();if(win!==null&&win.SetTitle){this.GetTitle().GetText().Register(function(t){win.SetTitle(t);});}},GetButtonString:function(){var dr=new D2L.Util.DelayedReturn();var encoder=new d2l_Encoder('|',',','$','*');var me=this;var BuildButton=function(i){if(i==me.buttons.length){dr.Trigger(encoder.Serialize());}else{var data=new Array();var text=me.buttons[i][0];if(text.isString){text=new D2L.LP.Text.PlainText(me.buttons[i][0]);}
text.GetText().Register(function(text){data[0]=text;data[1]=me.buttons[i][1];data[2]=me.buttons[i][2];encoder.AddRow(data);BuildButton(++i);});}};BuildButton(0);return dr;},GetTitle:function(){if(this.title.isString){this.title=new D2L.LP.Text.PlainText(this.title);}
return this.title;},FetchTitle:function(Callback){this.GetTitle().GetText().Register(function(title){Callback.call(Callback,title);});},GetUrl:function(){var page='/d2l/common/popup/popup.d2l?ou='+Global.OrgUnitId;page+='&queryString='+UI.EncodeUrl(this.queryString);page+='&footerMsg='+UI.EncodeUrl(this.footerMsg.decodeHtml());page+='&popBodySrc='+UI.EncodeUrl(this.bodySource);page+='&popFooterSrc='+UI.EncodeUrl(this.footerSource);page+='&width='+this.width;page+='&height='+this.height;page+='&hasStatusBar='+this.hasStatusBar;page+='&hasAutoScroll='+this.hasAutoScroll;page+='&p='+D2L.Util.Url.Encode(this.m_name);return page;},GetWindow:function(){return this.m_window;},SetAutoCloseWindow:function(autoClose){this.m_autoCloseWindow=autoClose;},SetTitle:function(title){this.title=D2L.LP.Text.IText.Normalize(title,'D2L.Popup','SetTitle','title');this.LoadHeader();}});var d2l_Popup=D2L.Popup;D2L.Popup.InsertFile=D2L.Popup.extend({Construct:function(callback,type,allowCourse,allowUpload,allowUrl,storageLocation,maxFileSize){arguments.callee.$.Construct.call(this);this.bodySource='/d2l/common/insert/insert.d2l';this.queryString='ou='+Global.OrgUnitId+'&type='+type+'&aco='+(allowCourse?'1':'0')+'&aup='+(allowUpload?'1':'0')+'&aur='+(allowUrl?'1':'0')+'&sloc='+storageLocation+'&mfs='+maxFileSize+'&cb='+callback;this.height=350;this.width=550;this.AddCloseButton();}});D2L.Popup.HtmlEditor=D2L.Popup.extend({Construct:function(callbackGet,callbackSet){arguments.callee.$.Construct.call(this);this.bodySource='/d2l/common/htmlEditor/htmlEditor.d2l';this.queryString='ou='+Global.OrgUnitId+'&cbGet='+callbackGet+'&cbSet='+callbackSet+'&uiid=1';this.height=465;this.width=650;this.SetTitle(new D2L.LP.Text.LangTerm('FrameworkWebPages.HtmlEditorDialog.titHtmlEditor'));this.AddCancelButton();this.AddButton("Insert","insertData","Right");}});D2L.Popup.Email=D2L.Popup.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_body='';this.m_emails=[];this.m_groups=[];this.m_groupLocations=[];this.m_users=[];this.m_userLocations=[];this.m_subject='';this.SetAutoCloseWindow(false);var id=UI.GetUniqueHtmlId();window[id]=this;this.bodySource='/d2l/lms/email/frame_item_message_compose.d2l';this.queryString='ou='+Global.OrgUnitId+'&p=1&ext=1&cb='+id;this.SetTitle(new D2L.LP.Text.LangTerm('Email.frame_item_message_compose.titComposeNewMessage'));this.width=740;this.height=735;this.AddCancelButton();this.AddButton(new D2L.LP.Text.LangTerm('Standard.Buttons.btnSend'),'Send','Right');},AddEmails:function(emails,location){if(location===undefined){location=D2L.Popup.Email.Location.To;}
if(!isArray(emails)){emails=[emails];}
for(var i=0;i<emails.length;i++){var emailId=new String(emails[i]);if(this.m_emails[emailId]===undefined){this.m_emails[emailId]=[];}
this.m_emails[emailId].push(location);}},AddUsers:function(users,location){if(location===undefined){location=D2L.Popup.Email.Location.To;}
if(!isArray(users)){users=[users];}
for(var i=0;i<users.length;i++){var userId=new String('u'+users[i]);if(this.m_users[userId]===undefined){this.m_users[userId]=[];}
this.m_users[userId].push(location);}},AddGroups:function(groups,location){if(location===undefined){location=D2L.Popup.Email.Location.To;}
if(!isArray(groups)){groups=[groups];}
for(var i=0;i<groups.length;i++){var groupId=new String('g'+groups[i]);if(this.m_groups[groupId]===undefined){this.m_groups[groupId]=[];}
this.m_groups[groupId].push(location);}},GetBody:function(){return this.m_body;},GetEmails:function(){return this.m_emails;},GetGroupIds:function(){var groupIds=[];for(var groupId in this.m_groups){groupIds.push(groupId.substr(1));}
return groupIds;},GetGroups:function(){return this.m_groups;},GetSubject:function(){return this.m_subject;},GetUsers:function(){return this.m_users;},GetUserIds:function(){var userIds=[];for(var userId in this.m_users){userIds.push(userId.substr(1));}
return userIds;},SetBody:function(body){this.m_body=body;},SetSubject:function(subject){this.m_subject=subject;}});D2L.Popup.Email.Location={To:0,Cc:1,Bcc:2};

D2L.Enablers={};function d2l_EnablerManager(){this.enablerTargetLists=new Object();this.enablers=new Object();this.enablerTargetStack=new Array();this.enablerTargets=new Array();this.enablerTargetStackIndex=-1;this.radioGroups=new Object();this.OpenEnablerTarget=function(key,keyOp){var keyList=key.split(',');var et=new d2l_EnablerTarget(keyList,keyOp);for(var i=0;i<keyList.length;i++){var etList=this.enablerTargetLists[keyList[i]];if(etList){etList[etList.length]=et;}else{etList=new Array();etList[0]=et;this.enablerTargetLists[keyList[i]]=etList;}}
this.enablerTargetStackIndex++;this.enablerTargetStack[this.enablerTargetStackIndex]=et;this.enablerTargets[this.enablerTargets.length]=et;};this.CloseEnablerTarget=function(){this.enablerTargetStackIndex--;};this.AddEnabler=function(key,e){this.enablers[key]=e;};this.AddEnablerTargetItem=function(eti){this.enablerTargetStack[this.enablerTargetStackIndex].AddEnablerTargetItem(eti);};this.ResetState=function(key){for(var i=0;i<this.enablerTargets.length;i++){this.enablerTargets[i].ResetState();}};this.SetInitialState=function(){this.ResetState();var radioGroup;var currRb;var oldOnClick;for(radioGroup in this.radioGroups){currRb=UI.GetByName(radioGroup);if(currRb.length){for(var i=0;i<currRb.length;i++){this.AddRadioOnClick(currRb[i]);}}else{this.AddRadioOnClick(currRb);}}};this.AddRadioOnClick=function(rb){if(rb.onclick){rb.onclick=new Function('EnablerManager.ResetState();this.oldOnClick='+rb.onclick+';this.oldOnClick();');}else{rb.onclick=new Function('EnablerManager.ResetState();');}};this.AddRadioGroup=function(name){this.radioGroups[name]=0;};}
function d2l_EnablerTarget(keyList,keyOp){this.keyList=keyList;if(keyOp.toLowerCase()=='and'){this.useAndLogic=true;}else{this.useAndLogic=false;}
this.enablerTargetItems=new Array();this.AddEnablerTargetItem=function(eti){this.enablerTargetItems[this.enablerTargetItems.length]=eti;};this.ResetState=function(){var isStateEnabled=this.useAndLogic;var numEnablers=0;var currEnabler;for(var i=0;i<this.keyList.length;i++){currEnabler=EnablerManager.enablers[this.keyList[i]];if(currEnabler){numEnablers++;if(currEnabler.IEnabler.IsEnabled()!=this.useAndLogic){isStateEnabled=!this.useAndLogic;break;}}}
if(numEnablers===0){isStateEnabled=true;}
var currTargetItem;for(var x=0;x<this.enablerTargetItems.length;x++){currTargetItem=this.enablerTargetItems[x];if(isStateEnabled){currTargetItem.IEnablerTargetItem.Enable();}else{currTargetItem.IEnablerTargetItem.Disable();}}};}
var IEnablerTargetItem=D2L.Class.extend({Construct:function(obj){arguments.callee.$.Construct.call(this);this.obj=obj;},Dispose:function(){arguments.callee.$.Dispose.call(this);if(this.obj){this.obj.IEnablerTargetItem=null;}},Enable:function(){this.obj.disabled=false;},Disable:function(){this.obj.disabled=true;}});var IEnabler=D2L.Class.extend({Construct:function(key,obj){arguments.callee.$.Construct.call(this);this.key=key;this.obj=obj;},Dispose:function(){arguments.callee.$.Dispose.call(this);if(this.obj){this.obj.IEnabler=null;}},IsEnabled:function(){return(!this.obj.disabled&&this.obj.checked);},ResetState:function(){EnablerManager.ResetState();}});function Base_IEnablerTargetItem(obj){obj.IEnablerTargetItem=new IEnablerTargetItem(obj);}
function Base_IEnabler(key,obj){obj.IEnabler=new IEnabler(key,obj);}
function CreateEnablerCollection(obj){var enbColl=new Object();enbColl._collection=new Array();enbColl.Add=function(enabler){this._collection.push(enabler);};enbColl.ResetEnablers=function(){for(var index in this._collection){var enabler=this._collection[index];enabler.ResetState();}};obj.Enablers=enbColl;}
function d2l_SelectListEnabler(key,selectList,optKey){this.obj=selectList;this.key=key;this.optKey=optKey;this.IEnabler=this;this.IsEnabled=function(){var isEnabled=false;var selectedOption=this.obj.GetSelectedOption();if(selectedOption){isEnabled=this.obj.IsEnabled()&&selectedOption.key==this.optKey;}
return isEnabled;};this.ResetState=function(){EnablerManager.ResetState();};}
function SelectList_IEnabler(key,selectList,optKey){var enabler=new d2l_SelectListEnabler(key,selectList,optKey);if(!selectList.Enablers||(selectList.Enablers&&selectList.Enablers===null)){CreateEnablerCollection(selectList);}
selectList.Enablers.Add(enabler);return enabler;}
D2L.Control.Enabler=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isEnabled=true;var me=this;this.IEnabler={key:'',IsEnabled:function(){return me.IsEnabled();},ResetState:function(){EnablerManager.ResetState();}};this.IEnablerTargetItem={Enable:function(){me.Enable();},Disable:function(){me.Disable();}};},IntegrateControlMin:function(deserializer){this.m_isEnabled=deserializer.GetBoolean();this.IEnabler.key=deserializer.GetMember();},Enable:function(){this.SetIsEnabled(true);},Disable:function(){this.SetIsEnabled(false);},IsEnabled:function(){return this.m_isEnabled;},SetIsEnabled:function(isEnabled){if(isEnabled!=this.m_isEnabled){this.m_isEnabled=isEnabled;this.IEnabler.ResetState();}},ToggleEnabled:function(){this.SetIsEnabled(!this.IsEnabled());}});function Object_IEnablerTargetItem(c){c.IEnablerTargetItem=new Object();c.IEnablerTargetItem.Enable=function(){c.SetIsEnabled(true);};c.IEnablerTargetItem.Disable=function(){c.SetIsEnabled(false);};}

D2L.State={};D2L.State.StateScopeTypes={NoPersistence:0,OrgUnitSession:1,OrgUnitUser:2,User:3};D2L.State.StateManager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_stateScopes={};this.m_stateGroups=[];this.m_saveStateOnUnload=true;var me=this;UI.OnPageUnload().RegisterMethod(function(){me.SaveState();});UI.OnPageLoad().RegisterMethod(function(){var searchStateGroup=me.GetStateGroup('Search');if(searchStateGroup!==null){searchStateGroup.SetIsActive(false);}});},DeserializeMin:function(deserializer){this.m_stateScopes=deserializer.GetDictionaryMin();this.m_stateGroups=deserializer.GetObjectArrayMin(D2L.State.StateGroup);},AddStateToNavInfo:function(navInfo){if(!navInfo.IgnoreState()){var state=this.GenerateState(true,true);navInfo.SetParam('d2l_stateScopes',state.Scopes);navInfo.SetParam('d2l_stateGroups',state.Groups);navInfo.SetParam('d2l_statePageId',UI.pageId);for(var stateGroup in state.State){navInfo.SetParam('d2l_state_'+stateGroup,state.State[stateGroup]);}}},AddStateToForm:function(){var state=this.GenerateState(true,true);var form=UI.GetForm();var CreateHidden=function(name,value,parent){var hdn=UI.GetById(name);if(!hdn){hdn=document.createElement('input');hdn.type='hidden';hdn.name=name;hdn.id=name;parent.appendChild(hdn);}
hdn.value=value;};CreateHidden('d2l_stateScopes',state.Scopes,form);CreateHidden('d2l_stateGroups',state.Groups,form);CreateHidden('d2l_statePageId',UI.pageId,form);for(var i=0;i<form.childNodes.length;i++){if(form.childNodes[i].name!==undefined&&form.childNodes[i].name.indexOf('d2l_state_')==0){D2L.Util.Purge(form.childNodes[i]);form.removeChild(form.childNodes[i]);}}
for(var stateGroup in state.State){CreateHidden('d2l_state_'+stateGroup,state.State[stateGroup],form);}},CreateStateGroup:function(name){var stateGroup=this.GetStateGroup(name);if(stateGroup===null){stateGroup=new D2L.State.StateGroup(name);this.m_stateGroups.push(stateGroup);}
return stateGroup;},GetStateGroup:function(name){name=name.toLowerCase();for(var i=0;i<this.m_stateGroups.length;i++){if(this.m_stateGroups[i].GetName()==name){return this.m_stateGroups[i];}}
return null;},GenerateState:function(includeDbState,includePostState){var ret={Scopes:D2L.Serialization.JsonSerializer.Serialize(this.m_stateScopes),Groups:'',State:{}};var groups=[];for(var i=0;i<this.m_stateGroups.length;i++){var inDbScope=false;if(includeDbState){for(var scopeType in this.m_stateScopes){for(var j=0;j<this.m_stateScopes[scopeType].length;j++){if(this.m_stateScopes[scopeType][j]==this.m_stateGroups[i].GetName()){inDbScope=true;break;}}
if(inDbScope){break;}}}
if(includeDbState&&inDbScope||includePostState){groups.push(this.m_stateGroups[i].GetName());ret.State[this.m_stateGroups[i].GetName()]=D2L.Serialization.JsonSerializer.Serialize(this.m_stateGroups[i]);}}
if(groups.length>0){ret.Groups=D2L.Serialization.JsonSerializer.Serialize(groups);}
return ret;},SaveState:function(){if(this.m_saveStateOnUnload){var state=this.GenerateState(true,false);if(state.Groups.length>0){var rpc=D2L.Rpc.Create('Save',undefined,'/d2l/common/rpc/state/saveState.d2l');rpc.SetIncludeState(state);rpc.Call();}}},SetSaveStateOnUnload:function(saveStateOnUnload){this.m_saveStateOnUnload=saveStateOnUnload;}});D2L.State.StateGroup=D2L.Class.extend({Construct:function(name){arguments.callee.$.Construct.call(this);if(name===undefined){name='';}
this.m_controls=[];this.m_isActive=true;this.m_isCleared=false;this.m_inactiveState='';this.m_name=name.toLowerCase();},DeserializeMin:function(deserializer){this.m_name=deserializer.GetMember().toLowerCase();this.m_controls=deserializer.GetObjectArrayMin(D2L.State.StateControlInfo);},Serialize:function(serializer){serializer.AddMember('Name',this.GetName());if(!this.m_isCleared){if(!this.IsActive()){serializer.AddMember('Controls',this.m_inactiveState,undefined,true);}else{serializer.AddMember('Controls',this.m_controls);}}},Clear:function(){this.m_isCleared=true;},GetName:function(){return this.m_name;},IsActive:function(){return this.m_isActive;},SetIsActive:function(isActive){if(isActive!=this.m_isActive){if(isActive){this.m_inactiveState='';}else{this.m_inactiveState=D2L.Serialization.JsonSerializer.Serialize(this.m_controls);}
this.m_isActive=isActive;}}});D2L.State.StateControlInfo=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.ControlId=null;this.Name='';this.StateType='';this.Key='';},DeserializeMin:function(deserializer){this.ControlId=deserializer.GetObjectMin(D2L.Control.Id);this.StateType=deserializer.GetMember();this.Key=deserializer.GetMember();if(deserializer.HasMember()){this.Name=deserializer.GetMember();}},Serialize:function(serializer){serializer.AddMember('ControlId',this.ControlId);serializer.AddMember('StateType',this.StateType);serializer.AddMember('Key',this.Key);if(this.Name.length>0){serializer.AddMember('Name',this.Name);}
var control=UI.GetControl(this.ControlId.ID(),this.ControlId.SID());if(control!==undefined&&control!==null&&control.GetState){serializer.AddMember('State',control,'GetState',false,this.StateType,this.Key);}}});

D2L.DisplayGroups={};D2L.DisplayGroups.DisplayGroupManager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_groups={};},DeserializeMin:function(deserializer){this.m_groups=deserializer.GetDictionaryMin('string',D2L.DisplayGroups.DisplayGroupData);},GetGroup:function(groupName){groupName=groupName.toLowerCase();if(this.m_groups[groupName]){return UI.GetControl(this.m_groups[groupName].ControlId.ID(),this.m_groups[groupName].ControlId.SID());}else{return null;}},GetGroupControls:function(groupControlId){var controls=[];for(var name in this.m_groups){var data=this.m_groups[name];if(data.ControlId.ID()==groupControlId.ID()&&data.ControlId.SID()==groupControlId.SID()){return data.Controls;}}
return controls;},Init:function(){for(var name in this.m_groups){var group=this.GetGroup(name);if(group!==null){group.Init();}}},SetControlDisplayGroup:function(controlId,groupControlId){}});D2L.DisplayGroups.DisplayGroupData=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.ControlId=null;this.Controls=[];},DeserializeMin:function(deserializer){this.ControlId=deserializer.GetObjectMin(D2L.Control.Id);this.Controls=deserializer.GetObjectArrayMin(D2L.DisplayGroups.DisplayGroupControl);}});D2L.Control.DisplayGroup=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.isDisplayed=true;this.m_controls=[];},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.isDisplayed=deserializer.GetBoolean();this.m_controls=UI.GetDisplayGroupManager().GetGroupControls(this.GetControlId());},Init:function(){for(var i=0;i<this.m_controls.length;i++){this.m_controls[i].Init();}},GetState:function(serializer){serializer.AddMember('IsDisplayed',this.IsDisplayed());},IsDisplayed:function(){return this.isDisplayed;},Show:function(){this.SetIsDisplayed(true);},Hide:function(){this.SetIsDisplayed(false);},SetIsDisplayed:function(isDisplayed){UI.GetDisplayGroupManager();for(var i=0;i<this.m_controls.length;i++){this.m_controls[i].SetIsDisplayed(isDisplayed);}
this.isDisplayed=isDisplayed;}});D2L.DisplayGroups.DisplayGroup=D2L.Control.DisplayGroup;D2L.DisplayGroups.DisplayGroupType={Block:0,Inline:1,Object:2,TableRow:3};D2L.DisplayGroups.DisplayGroupControl=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_type=D2L.DisplayGroups.DisplayGroupType.Object;this.m_mappedId='';this.m_control=null;},DeserializeMin:function(deserializer){this.m_type=deserializer.GetMember();this.m_mappedId=deserializer.GetMember();},Init:function(){var me=this;var InstallExpand=function(domNode){if(domNode!==null){me.AttachObject(domNode,'ID2LOnExpand',new D2L.EventHandler());domNode.ID2LOnExpand.RegisterMethod(function(){me.SetIsDisplayed(true);});}};if(this.m_control===null){if(this.m_type==D2L.DisplayGroups.DisplayGroupType.Object){this.m_control=UI.GetControlMap().GetControlByMappedId(this.m_mappedId);InstallExpand(this.m_control.GetDomNode());}else{this.m_control=UI.GetById(this.m_mappedId);InstallExpand(this.m_control);}}},SetIsDisplayed:function(isDisplayed){this.Init();if(this.m_control!==null){if(this.m_type==D2L.DisplayGroups.DisplayGroupType.Object){this.m_control.SetIsDisplayed(isDisplayed);}else{if(isDisplayed){if(this.m_type==D2L.DisplayGroups.DisplayGroupType.Block){this.m_control.style.display='block';}else if(this.m_type==D2L.DisplayGroups.DisplayGroupType.Inline){this.m_control.style.display='inline';}else if(this.m_type==D2L.DisplayGroups.DisplayGroupType.TableRow){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){this.m_control.style.display='inline';}else{this.m_control.style.display='table-row';}}}else{this.m_control.style.display='none';}}
var tEvent=new D2L.TransformEvent(this.m_control);tEvent.Bubble();}}});D2L.DisplayGroup=D2L.DisplayGroups.DisplayGroup;

D2L.Nav=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_params=null;this.OnBeforeNavigate=new D2L.EventHandler();this.OnNavigate=new D2L.EventHandler();this.OnNavigationFailure=new D2L.EventHandler();},Go:function(navInfo,skipValidation,skipHandlers){var result=true;if(!skipHandlers&&(navInfo.target=='_self'||navInfo.target=='_parent'||navInfo.target===''||navInfo.action=='RPC')){result=this.OnBeforeNavigate.Trigger(navInfo);if(!result){this.OnNavigationFailure.Trigger(navInfo);}}
if(result){if(navInfo.IsAction()){this.GoAction(navInfo,skipValidation);}else{if(navInfo.target=='_self'||navInfo.target=='_parent'||navInfo.target===''||navInfo.action=='RPC'){result=this.OnNavigate.Trigger(navInfo);if(!result){this.OnNavigationFailure.Trigger(navInfo);}else{navInfo.OnNavigate.Trigger(navInfo);}}
if(result){if(navInfo.IsReload()){this.GoSelf(navInfo);}else{this.GoTo(navInfo);}}}}},GoRpc:function(rpc,rpcPage,ni){var PostCallback=function(rpcResponse){if(rpcResponse.GetResponseType()==D2L.Rpc.ResponseType.Success){if(ni){Nav.Go(ni);}}};D2L.Rpc.CreatePost(rpc,PostCallback,rpcPage).Call();},SetAnchor:function(anchor){if(window.location.hash==anchor||window.location.hash=='#'+anchor){window.location.hash='d2l';}
window.location.hash=anchor;},GetAnchor:function(){var ret=window.location.href.split('#')[1];if(!ret){ret='';}
return ret;},GetParam:function(name){if(!this.m_params){this.m_params=this.GetParamArray();}
if(this.m_params[name]){return this.m_params[name];}else{return null;}},Reload:function(navParams,skipHandlers){var n=new D2L.NavInfo();if(navParams){for(var paramName in navParams.m_params){n.SetParam(paramName,navParams.m_params[paramName]);}}
this.Go(n,true,skipHandlers);},SubmitAction:function(action,actionParam,navParams){var n=new D2L.NavInfo();if(!action){alert('action is required for the Nav.SubmitAction function');return;}
n.action=action;if(actionParam){n.actionParam=actionParam;}
if(navParams){for(var paramName in navParams.m_params){n.SetParam(paramName,navParams.m_params[paramName]);}}
this.Go(n);},GetWindow:function(target){try{if(!target||target===''||target=='_self'){return window;}else if(target=='_parent'){return window.parent;}else if(target=='_top'){return window.top;}else if(target=='_blank'){return null;}else{return D2L.Util.Html.FindFrame(target,window);}}catch(e){return null;}},GetParamArray:function(){var params=new Object();var qs=window.location.href.split('?')[1];if(qs){qs=qs.split('#')[0];}else{qs='';}
var currName,currVal;if(qs.length>0){var qsArr=qs.split('&');var len=qsArr.length;for(var x=0;x<len;x++){currName=qsArr[x].split('=')[0];currVal=qsArr[x].split('=')[1];if(currName){if(!currVal){currVal='';}
currName=UI.DecodeUrl(currName);currVal=UI.DecodeUrl(currVal);params[currName]=currVal;}}}
return params;},GoTo:function(navInfo){var href=navInfo.GetHref();this.GoHelper(href,navInfo.target);},GoSelf:function(navInfo){UI.GetStateManager().SetSaveStateOnUnload(false);UI.GetStateManager().AddStateToNavInfo(navInfo);var change=this.GetParam('d2l_change');var newChange='0';if(change){if(change=='0'){newChange='1';}else{newChange='0';}}else{newChange='0';}
navInfo.SetParam('d2l_change',newChange);var href=navInfo.GetHref();this.GoHelper(href,navInfo.target);},GoUrl:function(href){this.GoHelper(href,"_self");},LogOut:function(){var cookieList=document.cookie.split(";");var sessionKey="";for(var i=0;i<cookieList.length;i++){if(cookieList[i].length>0){var parts=cookieList[i].split("=");if(parts.length>1&&parts[0].trim()=="d2lSessionVal"){sessionKey=parts[1].trim();}}}
this.PostHelper('/d2l/lp/auth/logout/logout.d2l',{'d2l_session':sessionKey},'_top');},PostHelper:function(href,values,target){var body=document.body;var frm=document.createElement('form');var i;var hidden;for(i in values){hidden=document.createElement('input');hidden.type='hidden';hidden.name=i;hidden.value=values[i];frm.appendChild(hidden);}
if(target){frm.target=target;}
frm.action=href;frm.method='post';body.appendChild(frm);frm.submit();},GoHelper:function(href,target){if(href.length<2000){var win=this.GetWindow(target);if(win){win.location.href=href;}else{if(target=='_blank'){window.open(href);}else{window.open(href,target);}}}else{var body=document.getElementById('d2l_body');var frm=document.createElement('form');body.appendChild(frm);var url=href.split('?')[0].split('#')[0];var qs=href.split('?')[1];if(!qs)qs='';var anchor=href.split('#')[1];if(!anchor)anchor='';var pairs=qs.split('&');var i;var newUrl=url;var firstTime=true;for(i=0;i<pairs.length;i++){var currPair=pairs[i];if(!currPair)currPair='';var currName=currPair.split('=')[0];if(!currName)currName='';var currVal=currPair.split('=')[1];if(!currVal)currVal='';if(currName.substring(0,9)=='d2l_state'){var input=document.createElement('input');input.name=D2L.Util.Url.Decode(currName);input.value=D2L.Util.Url.Decode(currVal);input.type='hidden';frm.appendChild(input);}else{if(firstTime){newUrl+='?';firstTime=false;}else{newUrl+='&';}
newUrl=newUrl+currName+'='+currVal;}}
if(anchor.length>0){newUrl=newUrl+'#'+anchor;}
frm.method='post';frm.action=newUrl;frm.target=target;frm.submit();}},GoAction:function(navInfo,skipValidation,skipBeforeNavigateEvent){if(skipValidation===undefined){skipValidation=false;}
if(skipBeforeNavigateEvent===undefined){skipBeforeNavigateEvent=false;}
var me=this;var DoNavigation=function(){if(UI.form.target=='_self'||navInfo.target=='_parent'||UI.form.target===''||navInfo.action=='RPC'){if(!me.OnNavigate.Trigger(navInfo)){return;}}
UI.GetByName('d2l_action').value=navInfo.action;UI.GetByName('d2l_actionparam').value=navInfo.actionParam;if(navInfo.GetParam('d2l_rf')!==undefined){UI.GetByName('d2l_rf').value=navInfo.GetParam('d2l_rf');}
UI.form.action=navInfo.GetHref();if(navInfo.target&&navInfo.target.length>0){UI.form.target=navInfo.target;}
if(navInfo.IsAction()){UI.GetMultiEditManager().AddMultiEditToForm();}
if(!navInfo.IgnoreState()){UI.GetStateManager().SetSaveStateOnUnload(false);UI.GetStateManager().AddStateToForm();}
UI.GetControlMap().AddControlMapToForm();var goesToLegacyPage=(UI.form.action.indexOf('/d2l/tools/')>=0);if(goesToLegacyPage){var hasFileInput=false;var arrElements=UI.form.elements;var currElemLength=arrElements.length;var currElem;for(var i=0;i<currElemLength;i++){currElem=arrElements[i];if(currElem.name&&currElem.type&&currElem.name=='input'&&currElem.type=='file'){hasFileInput=true;break;}}
if(!hasFileInput&&!navInfo.doMultipartSubmission){UI.form.enctype='application/x-www-form-urlencoded';UI.form.encoding='application/x-www-form-urlencoded';}}
UI.form.method='post';if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Safari&&UI.GetBodyType()!=D2L.UI.BodyType.Normal){setTimeout(function(){UI.form.submit();});}else{UI.form.submit();}
if(!(UI.form.target=='_self'||UI.form.target==='')){UI.GenerateHitCode();}};if(!skipValidation){UI.GetValidationManager().Validate(['Action','Action'+navInfo.action]).Register(function(success){if(success){DoNavigation();}else{me.OnNavigationFailure.Trigger(navInfo);}});}else{DoNavigation();}},GetNavigation:function(){var ret=window.location.href.split('?')[0];if(!ret){ret='';}
ret=ret.split('#')[0];if(ret.indexOf('/d2l/')>=0){ret=ret.substring(ret.indexOf('/d2l/'),ret.length);}
return ret;},OpenWindow:function(name,navigation,width,height,hasMenubar,hasScrollbars,hasToolbar,hasLocation){if(width===undefined){width=640;}
if(height===undefined){height=480;}
if(hasMenubar===undefined){hasMenubar=true;}
if(hasScrollbars===undefined){hasScrollbars=true;}
if(hasToolbar===undefined){hasToolbar=true;}
if(hasLocation===undefined){hasLocation=true;}
name=name.replace('.','_');var features='width='+width+',height='+height+','+'location='+(hasLocation?'1':'0')+','+'menubar='+(hasMenubar?'1':'0')+','+'resizable=1,'+'scrollbars='+(hasScrollbars?'1':'0')+','+'status=0,'+'toolbar='+(hasToolbar?'1':'0');var w=window.open(navigation,name,features);w.focus();}});

D2L.NavInfo=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.action='none';this.actionParam='';this.anchor='';this.doSmartScroll=false;this.navigation=Nav.GetNavigation();this.target='_self';this.m_params={};this.m_ignoreState=false;this.m_ignoreCurrentQueryParamsOnReload=false;this.m_event='';this.m_eventParams='';this.m_statusIsSet=false;this.m_forceSaveConfirmation=false;this.m_isNavigationSet=false;this.m_onClick=null;this.OnNavigate=new D2L.EventHandler();},ForceSaveConfirmation:function(){this.m_forceSaveConfirmation=true;},GetAction:function(){return this.action;},GetActionParam:function(){return this.actionParam;},GetAnchor:function(){return this.anchor;},GetHref:function(){var isAction=this.IsAction();var newParams;var currName;var currVal;var navigation=this.navigation;var params=new Object();var anchor=this.anchor;for(var n in this.m_params){params[n]=this.m_params[n];}
if(!anchor||anchor.length===0){anchor=navigation.split('#')[1];if(!anchor){anchor='';}}
navigation=navigation.split('#')[0];if(navigation.indexOf('?')>0){var navQs=navigation.split('?')[1];navigation=navigation.split('?')[0];var navQsArr=navQs.split('&');for(var i=0;i<navQsArr.length;i++){var nameValArr=navQsArr[i].split('=');currName=D2L.Util.Url.Decode(nameValArr[0]);if(nameValArr.length==2){currVal=D2L.Util.Url.Decode(nameValArr[1]);}else{currVal=undefined;}
if(currName&&!params[currName]){params[currName]=currVal;}}}
if(this.IsReload()&&!this.m_ignoreCurrentQueryParamsOnReload){newParams=Nav.GetParamArray();for(currName in params){newParams[currName]=params[currName];}
var scrollx,scrolly;if(this.doSmartScroll){scrollx=UI.GetScrollLeft();scrolly=UI.GetScrollTop();}else{scrollx=null;scrolly=null;}
newParams['d2l_scrollx']=scrollx;newParams['d2l_scrolly']=scrolly;if(!this.m_statusIsSet){newParams['dst']=null;}}else{newParams=params;if(!this.IsExternal()&&this.GetTarget()!='_top'&&this.GetTarget()!='_blank'){var oldParams=Nav.GetParamArray();if(oldParams['d2l_body_type']){newParams['d2l_body_type']=oldParams['d2l_body_type'];}}}
if(!newParams['ou']&&!this.IsExternal()){if(Nav.GetParam('ou')){newParams['ou']=Nav.GetParam('ou');}else{newParams['ou']=Global.OrgUnitId;}}
var qs='';var amp='';for(currName in newParams){if(newParams[currName]!==null){if(isArray(newParams[currName])){for(var i=0;i<newParams[currName].length;i++){qs+=amp+D2L.Util.Url.Encode(currName)+'='+D2L.Util.Url.Encode(newParams[currName][i]);amp='&';}}else{qs+=amp+D2L.Util.Url.Encode(currName);if(newParams[currName]!==undefined){qs+='='+D2L.Util.Url.Encode(newParams[currName]);}
amp='&';}}}
var ret=navigation;if(qs.length>0){ret+='?'+qs;}
if(anchor.length>0){ret+='#'+D2L.Util.Url.Encode(anchor);}
return ret;},GetNavigation:function(){return this.navigation;},GetOnClick:function(){return this.m_onClick;},GetEventParams:function(){return this.m_eventParams;},GetEvent:function(){return this.m_event;},GetParam:function(name){return this.m_params[name];},GetTarget:function(){return this.target;},HasSmartScroll:function(){return this.doSmartScroll;},IgnoreState:function(){return this.m_ignoreState;},IsAction:function(){return(!(this.action.toString().toLowerCase()=='none'));},IsEvent:function(){return(this.m_event!=='');},IsExternal:function(){var hasProtocal=(this.navigation.search(new RegExp('^[a-zA-Z]+://','i'))>-1);return hasProtocal;},IsReload:function(){return(this.navigation.split('#')[0].split('?')[0].toLowerCase()==Nav.GetNavigation().split('#')[0].split('?')[0].toLowerCase());},SetAction:function(action){this.action=action;},SetActionParam:function(actionParam){this.actionParam=actionParam;},SetAnchor:function(anchor){this.anchor=anchor;},SetEventParams:function(eventParams){this.m_eventParams=eventParams;},SetEvent:function(event){this.m_event=event;},SetHasSmartScroll:function(doSmartScroll){this.doSmartScroll=doSmartScroll;},SetIgnoreCurrentQueryParamsOnReload:function(bool){this.m_ignoreCurrentQueryParamsOnReload=bool;},SetIgnoreState:function(ignoreState){this.m_ignoreState=ignoreState;},SetMessageAreaStatusType:function(statusType){this.SetParam('dst',statusType);this.m_statusIsSet=true;},SetNavigation:function(navigation){if(navigation&&navigation!=''){if(navigation.toLowerCase()!='self'){this.navigation=navigation;}
this.m_isNavigationSet=true;}},SetOnClick:function(onClick){this.m_onClick=onClick;},SetParam:function(name,value){if(!name){return;}
name=name.toString();if(name.length===0){return;}
if(value===null){value='';}
if(isArray(value)){this.m_params[name]=value;}else{this.m_params[name]=value.toString();}},SetTarget:function(target){this.target=target;},SetupHrefOnClick:function(control,hasHref){var result=[];var executeHref=false;if(hasHref===undefined){hasHref=true;}
result['Href']=null;result['OnClick']=null;result['Target']=null;if(hasHref&&!this.IsAction()&&this.m_isNavigationSet&&!this.IsReload()&&!this.IsEvent()){result['Href']=this.GetHref();if(this.GetTarget()!='_self'&&this.GetTarget()!=''&&this.GetTarget()!=null){result['Target']=this.GetTarget();}
if(result['Href'].length<2000){executeHref=true;}else{executeHref=false;result['Href']='javascript://';}}else{if(hasHref){result['Href']='javascript://';}}
var me=this;var onClickFunction=function(){if(me.IsEvent()){if(Events!==undefined){Events[me.GetEvent()].Raise(me.GetEventParams());}}
if(me.GetOnClick()!=null){me.GetOnClick().call(control);}
if(!hasHref||!executeHref){if(me.m_isNavigationSet||me.IsAction()){Nav.Go(me);}
return false;}else{return true;}};result['OnClick']=onClickFunction;return result;},Deserialize:function(deserializer){if(deserializer.HasMember('Action')){this.SetAction(deserializer.GetMember('Action'));}
if(deserializer.HasMember('ActionParam')){this.SetActionParam(deserializer.GetMember('ActionParam'));}
if(deserializer.HasMember('Anchor')){this.SetAnchor(deserializer.GetMember('Anchor'));}
if(deserializer.HasMember('Navigation')){this.SetNavigation(deserializer.GetMember('Navigation'));}
if(deserializer.HasMember('OnClick')){var onClick=deserializer.GetMember('OnClick');onClick=new Function(onClick);this.SetOnClick(onClick);}
this.SetTarget(deserializer.GetMember('Target','_self'));if(deserializer.HasMember('NavParams')){this.m_params=deserializer.GetDictionary('NavParams');}
if(deserializer.HasMember('Event')){this.SetEvent(deserializer.GetMember('Event'));}
if(deserializer.HasMember('EventParams')){this.SetEventParams(deserializer.GetMember('EventParams'));}},DeserializeMin:function(deserializer){this.SetAction(deserializer.GetMember());this.SetActionParam(deserializer.GetMember());this.SetAnchor(deserializer.GetMember());this.SetNavigation(deserializer.GetMember());var onClick=deserializer.GetMember();onClick=new Function(onClick);this.SetOnClick(onClick);this.SetTarget(deserializer.GetMember());this.m_params=deserializer.GetDictionaryMin();this.SetEvent(deserializer.GetMember());this.SetEventParams(deserializer.GetMember());},Serialize:function(serializer){serializer.AddMember('A',this.GetAction());serializer.AddMember('AP',this.GetActionParam());serializer.AddMember('AN',this.GetAnchor());if(this.m_isNavigationSet){serializer.AddMember('N',this.GetNavigation());}else{serializer.AddMember('N','');}
var onClick='';if(this.GetOnClick()){onClick=this.GetOnClick().toString();}
if(onClick.substr(0,8)=='function'){onClick=onClick.substring(onClick.indexOf('{')+1,onClick.lastIndexOf('}'));}
serializer.AddMember('O',onClick);serializer.AddMember('T',this.GetTarget());var data=new D2L.Util.Dictionary();for(i in this.m_params){if(this.m_params){data.Add(i.toString(),this.m_params[i].toString());}}
serializer.AddMember('NP',data);serializer.AddMember('E',this.GetEvent());serializer.AddMember('EP',this.GetEventParams());}});D2L.NavParams=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_params=new Object();},SetParam:function(name,value){if(!name){return;}
name=name.toString();if(name.length===0){return;}
if(value===null){value='';}
this.m_params[name]=value.toString();}});

D2L.Control.CustomSelector=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.CustomSelector);this.m_allowMultiple=true;this.m_addButton=null;this.m_addOnClick=null;this.m_reorderButton=null;this.m_isEnabled=true;this.m_numActiveItems=0;this.m_statusInputs=[];this.m_hasDeleteAll=false;this.m_integrationComplete=false;this.m_emptyText='';this.m_notEmptyText='';this.m_deleteAllSpan=null;this.m_deleteAllImg=null;this.m_emptyTextCell=null;this.m_reorderText='';this.m_restoreTermName='Framework.CustomSelector.altRestore';this.m_removeTermName='Framework.CustomSelector.altRemove';this.m_name='';this.m_isDisplayed=true;this.OnDeleteItem=new D2L.EventHandler();this.OnRestoreItem=new D2L.EventHandler();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var isEnabled=deserializer.GetBoolean();if(!isEnabled){this.SetIsEnabled(false);}
this.m_allowMultiple=deserializer.GetBoolean();this.m_hasDeleteAll=deserializer.GetBoolean();this.m_emptyText=deserializer.GetMember();this.m_notEmptyText=deserializer.GetMember();this.m_reorderText=deserializer.GetMember();this.m_restoreTermName=deserializer.GetMember();this.m_removeTermName=deserializer.GetMember();var items=deserializer.GetObjectArrayMin(D2L.Control.CustomSelectorItem);this.m_name=deserializer.GetMember();this.m_isDisplayed=deserializer.GetBoolean();if(this.m_name.length===0){this.m_name=this.GetMappedId();}
this.IChildrenDomNode=this.GetDomNode().firstChild;this.m_addButton=UI.GetControl(this.GetMappedId()+'_b');this.m_reorderButton=UI.GetControl(this.GetMappedId()+'_reo');if(this.m_hasDeleteAll){this.m_deleteAllSpan=UI.GetById(this.GetMappedId()+'_das');this.m_deleteAllImg=this.m_deleteAllSpan.childNodes[1].firstChild;}
var rowOffset=0;if(this.m_addButton||this.m_hasDeleteAll||this.m_reorderButton){rowOffset++;}
if(this.m_emptyText.length>0||this.m_notEmptyText.length>0){this.m_emptyTextCell=this.GetDomNode().rows[rowOffset].cells[0];rowOffset++;}
for(var i=0;i<items.length;i++){items[i].IntegrateChild(this,this.GetDomNode().rows[i+rowOffset]);if(!items[i].IsDeleted()){this.m_numActiveItems++;}}
if(!this.AllowMultiple()&&this.Children().length>0){this.m_addButton.Hide();}
this.ReorderItems();this.m_integrationComplete=true;},AppendChild:function(child){if(this.AllowMultiple()||this.m_numActiveItems===0){var existing=this.GetItem(child.GetKey());if(existing){if(child.IsDeleted()&&!existing.IsDeleted()){this.DeleteItem(existing);}else if(!child.IsDeleted()&&existing.IsDeleted()){this.RestoreItem(existing);}
return existing;}
child=arguments.callee.$.AppendChild.call(this,child);if(!child.IsDeleted()){this.m_numActiveItems++;}else{this.DeleteItem(child);}
if(!this.AllowMultiple()&&this.m_addButton&&this.m_numActiveItems>0){this.m_addButton.Hide();}
if(this.AllowMultiple()&&this.m_reorderButton&&this.m_numActiveItems>0){this.m_reorderButton.SetIsEnabled(true);}
if(this.m_hasDeleteAll&&this.m_deleteAllSpan){this.m_deleteAllSpan.style.display='inline';}
if(this.Children().length==1&&this.m_emptyTextCell){this.m_emptyTextCell.innerHTML=this.m_notEmptyText;}
this.SetItemOrder();if(this.m_integrationComplete){var e=new D2L.ChangeEvent(child.GetDomNode());e.hasChangeBeenShown=true;e.Bubble();}
return child;}
return null;},RemoveChild:function(child){if(child&&this.IsEnabled()){var p=child.GetDomNode().parentNode;if(!this.AllowMultiple()){if(!child.IsDeleted()){this.m_numActiveItems--;}
if(this.m_addButton){this.m_addButton.Show();}
if(child.IsNew()){this.SetItemStatus(child.GetKey(),'');}else{this.SetItemStatus(child.GetKey(),'existingDeleted');}
if(child.m_dataInput!==null){this.GetDomNode().parentNode.appendChild(child.m_dataInput.parentNode.removeChild(child.m_dataInput));}
var width=this.GetDomNode().offsetWidth;arguments.callee.$.RemoveChild.call(this,child);this.GetDomNode().style.width=width+'px';}else{child.Delete();this.OnDeleteItem.Trigger(child);}
if(this.AllowMultiple()&&this.m_reorderButton&&this.m_numActiveItems<1){this.m_reorderButton.SetIsDisabled(true);}
if(this.m_numActiveItems===0&&this.m_emptyTextCell){this.m_emptyTextCell.innerHTML=this.m_emptyText;}
this.SetItemOrder();var e=new D2L.ChangeEvent(p);e.hasChangeBeenShown=this.AllowMultiple();e.Bubble();}else{child=null;}
return child;},Add:function(key,contents){this.AppendChild(new D2L.Control.CustomSelectorItem(key,contents));},AddItem:function(item){return this.AppendChild(item);},AllowMultiple:function(){return this.m_allowMultiple;},DeleteAll:function(){for(var i=0;i<this.Children().length;i++){this.DeleteItem(this.Children()[i]);}},DeleteItem:function(item){return this.RemoveChild(item);},Disable:function(){this.m_isEnabled=false;if(this.GetDomNode()){this.GetDomNode().className='dcs dcs_d';}
if(this.m_addButton){this.m_addButton.SetIsEnabled(false);}
if(this.m_reorderButton){this.m_reorderButton.SetIsEnabled(false);}
if(this.m_hasDeleteAll&&this.m_deleteAllImg){D2L.Images.ImageTerm.Assign('Shared.Main.actDeleteDisabled',this.m_deleteAllImg);}
for(var i=0;i<this.Children().length;i++){this.Children()[i].Render_Delete();this.Children()[i].Render_Actions();this.Children()[i].Render_Info();}},Enable:function(){this.m_isEnabled=true;if(this.GetDomNode()){this.GetDomNode().className='dcs';}
if(this.m_addButton){this.m_addButton.SetIsEnabled(true);}
if(this.m_reorderButton&&this.m_numActiveItems>0&&this.AllowMultiple()){this.m_reorderButton.SetIsEnabled(true);}
if(this.m_hasDeleteAll&&this.m_deleteAllImg){D2L.Images.ImageTerm.Assign('Shared.Main.actDelete',this.m_deleteAllImg);}
for(var i=0;i<this.Children().length;i++){this.Children()[i].Render_Delete();this.Children()[i].Render_Actions();this.Children()[i].Render_Info();}},Focus:function(){if(!this.AllowMultiple()&&this.GetNumItems()>0){this.Children()[0].Focus();}else if(this.m_addButton){this.m_addButton.Focus();}},GetItem:function(key){for(var i=0;i<this.Children().length;i++){if(this.Children()[i].GetKey()==key){return this.Children()[i];}}
return null;},GetNumItems:function(){var count=0;if(this.AllowMultiple()){return this.Children().length;}else{count=this.m_numActiveItems;}
return count;},GetState:function(serializer){serializer.AddMember('IsEnabled',this.IsEnabled());serializer.AddMember('Items',this.Children());},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){return this.m_isEnabled;},ToggleDeleteItem:function(item){if(this.IsEnabled()){if(item.IsDeleted()){this.RestoreItem(item);}else{this.DeleteItem(item);}}},Reorder:function(){var d=new D2L.Dialog('reorderDialog');d.SetTitle(new D2L.LP.Text.LangTerm('FrameworkWebPages.ReorderDialog.ttlReorderOptions'));d.AddButton(D2L.Control.Button.Type.Cancel);d.AddCustomButton(new D2L.LP.Text.LangTerm('Conditions.Main.btnApply'),D2L.Dialog.ButtonPosition.Right,D2L.Dialog.ResponseType.Positive);d.SetIsResizable(false);d.SetSize(400,230);d.SetSrc('/d2l/common/dialogs/reorder/reorder.d2l','SrcCallback');var itemsToReorder=new Array();for(var i=0;i<this.Children().length;i++){itemsToReorder[i]=this.Children()[i];}
if(itemsToReorder.length>0){var sorter=function(item1,item2){return(item1.GetData('order')-item2.GetData('order'))};itemsToReorder.sort(sorter);var encoder=new d2l_Encoder('#','|',':','-');for(var i=0;i<itemsToReorder.length;i++){var data=new Array();data[0]=itemsToReorder[i].GetKey();data[1]=itemsToReorder[i].GetDomNode().firstChild.innerHTML;encoder.AddRow(data);}
d.SetSrcParam('reorderItems',encoder.Serialize());var me=this;var args=arguments;var ReorderCallback=function(response){if(response.GetType()==D2L.Dialog.ResponseType.Positive){var responseData=response.GetData('newOrder');var orders=encoder.Deserialize(responseData);for(var i=0;i<orders.length;i++){if(orders[i][0]&&orders[i][1]){var item=me.GetItem(orders[i][0]);if(item){item.SetData('order',orders[i][1],true);}}}
me.ReorderItems();}
response.GetDialog().Close();};d.SetCallback(ReorderCallback);d.Open();}},ReorderItems:function(){var reorderList=new Array();for(var j=0;j<this.Children().length;j++){if(this.Children()[j].GetData('order')){reorderList[j]=this.Children()[j];}}
var sorter=function(item1,item2){return(item1.GetData('order')-item2.GetData('order'))};reorderList.sort(sorter);var toPosition=0;for(i in reorderList){reorderList[i].m_parent.GetDomNode().firstChild.appendChild(reorderList[i].GetDomNode());}
this.SetItemOrder();},SetAddOnClick:function(onClick){if(onClick){this.m_addOnClick=onClick;if(this.m_addButton){var me=this;this.AttachObject(this.m_addButton.GetDomNode(),'onclick',function(){if(me.m_isEnabled){return me.m_addOnClick.call(me);}else{return false;}});}}},SetIsDisplayed:function(isDisplayed){this.m_isDisplayed=isDisplayed;if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'block':'none';}},SetIsEnabled:function(isEnabled){if(isEnabled){this.Enable();}else{this.Disable();}},SetItemOrder:function(){for(var j=0;j<this.Children().length;j++){this.Children()[j].SetData('order',this.Children()[j].GetDomNode().rowIndex-1,false);}},RestoreItem:function(item){if(this.IsEnabled()){if(item.IsDeleted()){this.m_numActiveItems++;this.OnRestoreItem.Trigger(item);}
if(!this.AllowMultiple()){if(item.GetDomNode()){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){item.GetDomNode().style.display='inline';}else{item.GetDomNode().style.display='table-row';}}
if(this.m_addButton){this.m_addButton.style.display='none';}}
item.Restore();}},SetAllowMultiple:function(allowMultiple){this.m_allowMultiple=allowMultiple;if(!allowMultiple&&this.Children().length>0){this.m_addButton.Hide();}else if(allowMultiple){this.m_addButton.Show();}},SetIsEnabled:function(isEnabled){if(isEnabled){this.Enable();}else{this.Disable();}},SetItemStatus:function(key,status){if(!this.m_statusInputs[key]&&status.length>0){this.m_statusInputs[key]=document.createElement('input');this.m_statusInputs[key].type='hidden';this.m_statusInputs[key].value=key;this.m_statusInputs[key].name=this.m_name+'_'+status;this.GetDomNode().parentNode.appendChild(this.m_statusInputs[key]);}else if(this.m_statusInputs[key]&&status.length===0){D2L.Util.Purge(this.m_statusInputs[key]);this.m_statusInputs[key].parentNode.removeChild(this.m_statusInputs[key]);this.m_statusInputs[key]=null;}else{this.m_statusInputs[key].name=this.m_name+'_'+status;}}});D2L.CustomSelector=D2L.Control.CustomSelector;D2L.Control.CustomSelectorItem=D2L.Control.extend({Construct:function(key,contents){if(key===undefined){key='';}
if(contents===undefined){contents='';}
arguments.callee.$.Construct.call(this,D2L.Control.Type.CustomSelectorItem);this.m_actions=[];this.m_actionsCell=null;this.m_deleteIsEnabled=true;this.m_infoText='';this.m_isDeleted=false;this.m_isModified=false;this.m_isNew=true;this.m_key=key;this.m_canDelete=true;this.m_originalIsDeleted=false;this.m_data=new D2L.Util.Dictionary();this.m_dataInput=null;this.m_contents=contents;this.m_deleteAnchor=null;this.m_deleteCell=null;this.m_deleteCellVAlign=null;this.m_deleteIcon=null;this.m_infoAnchor=null;this.m_infoCell=null;this.m_infoIcon=null;this.m_subject='';this.m_order=0;var me=this;Nav.OnNavigate.RegisterMethod(function(){if(me.IsRendered()){me.m_dataInput.value=D2L.Serialization.JsonSerializer.Serialize(me.m_data);}});},DeserializeMin:function(deserializer){this.m_deleteIsEnabled=deserializer.GetBoolean();this.m_infoText=deserializer.GetMember();this.m_isDeleted=deserializer.GetBoolean();this.m_isModified=deserializer.GetBoolean();this.m_isNew=deserializer.GetBoolean();this.m_key=deserializer.GetMember();this.m_canDelete=deserializer.GetBoolean();this.m_originalIsDeleted=deserializer.GetBoolean();this.m_subject=deserializer.GetMember();this.m_order=deserializer.GetMember();this.m_actions=deserializer.GetObjectArrayMin(D2L.Control.CustomSelectorItemAction);},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);var item=this;this.IChildrenDomNode=this.GetDomNode().cells[0];this.m_actionsCell=this.GetDomNode().cells[1];this.m_deleteCell=this.GetDomNode().cells[2];this.m_infoCell=this.GetDomNode().cells[3];this.m_dataInput=this.m_actionsCell.childNodes[this.m_actionsCell.childNodes.length-1];if(this.m_actions){for(var i=0;i<this.m_actions.length;i++){this.m_actions[i].Integrate(this,this.m_actionsCell.childNodes[i]);}}
this.m_data=D2L.Serialization.JsonDeserializer.Deserialize(this.m_dataInput.value,D2L.Util.Dictionary);this.m_deleteAnchor=this.m_deleteCell.childNodes[0];this.AttachObject(this.m_deleteAnchor,'onclick',function(){item.Parent().ToggleDeleteItem(item);});this.m_deleteIcon=this.m_deleteAnchor.firstChild;this.m_infoAnchor=this.m_infoCell.firstChild;this.AttachObject(this.m_infoAnchor,'onclick',function(){item.DisplayInfoText();});this.m_infoIcon=this.m_infoAnchor.firstChild;this.Render_Row();this.Render_Status();var content=this.GetData("name");if(content&&this.m_contents==''){this.SetContent(content);}},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.Parent().GetDomNode().insertRow(-1));if(this.m_parent.AllowMultiple()){this.GetDomNode().style.borderTop='1px solid #cccccc';}else{this.GetDomNode().style.borderTopStyle='none';}
var item=this;this.Render_Row();this.IChildrenDomNode=this.GetDomNode().insertCell(-1);this.IChildrenDomNode.className='dcs_c dcs_cf';if(!this.m_parent.AllowMultiple()){this.IChildrenDomNode.style.borderTopStyle='none';}
this.SetContent(this.m_contents);if(this.m_parent.GetDomNode().style.width.length>0){this.IChildrenDomNode.style.width='100%';}
this.m_actionsCell=this.GetDomNode().insertCell(-1);this.m_actionsCell.className='dcs_c';this.m_actionsCell.style.paddingRight='0';this.m_actionsCell.style.whiteSpace='nowrap';if(!this.m_parent.AllowMultiple()){this.m_actionsCell.style.borderTopStyle='none';}
for(var i=0;i<this.m_actions.length;i++){this.AppendChild(this.m_actions[i],this.m_actionsCell);}
this.m_dataInput=this.CreateElement('input');this.m_dataInput.type='hidden';this.m_dataInput.name=this.Parent().m_name+'_'+this.GetKey()+'_data';this.m_actionsCell.appendChild(this.m_dataInput);this.m_deleteCell=this.GetDomNode().insertCell(-1);this.m_deleteCell.className='dcs_c';this.m_deleteCell.style.paddingRight='0';this.m_deleteCell.style.whiteSpace='nowrap';if(this.m_deleteCellVAlign!=null){this.m_deleteCell.style.verticalAlign=this.m_deleteCellVAlign;}
if(!this.m_parent.AllowMultiple()){this.m_deleteCell.style.borderTopStyle='none';}
this.m_deleteAnchor=document.createElement('a');this.m_deleteAnchor.href='javascript://';this.AttachObject(this.m_deleteAnchor,'onclick',function(){item.Parent().ToggleDeleteItem(item);});this.m_deleteIcon=document.createElement('img');this.m_deleteIcon.className='dcs_a';this.m_deleteAnchor.appendChild(this.m_deleteIcon);this.m_deleteCell.appendChild(this.m_deleteAnchor);this.Render_Delete();this.Render_Status();this.m_infoCell=this.GetDomNode().insertCell(-1);this.m_infoCell.className='dcs_c';this.m_infoCell.style.paddingLeft='0';if(!this.m_parent.AllowMultiple()){this.m_infoCell.style.borderTopStyle='none';}
this.m_infoAnchor=document.createElement('a');this.m_infoAnchor.href='javascript://';this.AttachObject(this.m_infoAnchor,'onclick',function(){item.DisplayInfoText();});this.m_infoIcon=document.createElement('img');this.m_infoIcon.className='dcs_a';this.m_infoIcon.style.display='none';this.m_infoAnchor.appendChild(this.m_infoIcon);this.m_infoCell.appendChild(this.m_infoAnchor);this.Render_Info();}},AddAction:function(action){if(this.GetDomNode()){this.AppendChild(action,this.m_actionsCell);}
this.m_actions.push(action);},CanDelete:function(){return this.m_canDelete;},Delete:function(){if(this.CanDelete()&&this.DeleteIsEnabled()&&!this.IsDeleted()){this.m_isDeleted=true;this.Render_Delete();this.Render_Row();this.Render_Status();this.Render_Actions();}},DeleteIsEnabled:function(){return this.m_deleteIsEnabled;},DisableDelete:function(){this.m_deleteIsEnabled=false;this.Render_Delete();this.Render_Info();},DisplayInfoText:function(){if(this.Parent&&this.Parent().IsEnabled()){alert(this.m_infoText);}},EnableDelete:function(){this.m_deleteIsEnabled=true;this.Render_Delete();this.Render_Info();},Focus:function(){},GetData:function(dataKey){if(this.m_data.ContainsKey(dataKey)){return this.m_data.Get(dataKey);}
return'';},GetInfoText:function(){return this.m_infoText;},GetKey:function(){return this.m_key;},GetSubject:function(){return this.m_subject;},IsDeleted:function(){return this.m_isDeleted;},IsModified:function(){return this.m_isModified;},IsNew:function(){return this.m_isNew;},RemoveAction:function(action){this.RemoveChild(action);},RemoveData:function(dataKey){this.m_data.Remove(dataKey);},Restore:function(){if(this.CanDelete()&&this.DeleteIsEnabled()&&this.IsDeleted()){this.m_isDeleted=false;this.Render_Delete();this.Render_Row();this.Render_Status();this.Render_Actions();}},Serialize:function(serializer){serializer.AddMember("CD",this.CanDelete());serializer.AddMember("ID",this.IsDeleted());serializer.AddMember("IM",this.IsModified());serializer.AddMember("IN",this.IsNew());serializer.AddMember("DE",this.DeleteIsEnabled());serializer.AddMember("T",this.GetInfoText());serializer.AddMember("K",this.GetKey());serializer.AddMember("C",this.IChildrenDomNode.innerHTML);serializer.AddMember("OD",this.m_originalIsDeleted);serializer.AddMember("OR",this.GetData('order'));serializer.AddMember("A",this.m_actions);serializer.AddMember('D',this.m_data);},SetCanDelete:function(canDelete){this.m_canDelete=canDelete;this.Render_Delete();},SetContent:function(content){this.m_contents=content;if(content.length>0){if(this.IChildrenDomNode){this.IChildrenDomNode.innerHTML=content;}}},SetData:function(key,val,isModification){if(val===undefined||val===null){val='';}
if(isModification===undefined||isModification===null){isModification=false;}
if(this.m_data.ContainsKey(key)){isModification=isModification&&(this.m_data.Get()!=val);}
this.m_data.Add(key,val);if(isModification){this.SetIsModified(true);}},SetSubject:function(subject){this.m_subject=subject;this.Render_Delete();},SetInfoText:function(infoText){this.m_infoText=infoText;this.Render_Info();},SetIsModified:function(isModified){var doRender=(this.m_isModified!=isModified);this.m_isModified=isModified;if(doRender){this.Render_Row();this.Render_Status();}},SetIsNew:function(isNew){this.m_isNew=isNew;this.Render_Row();this.Render_Status();},Render_Actions:function(){for(var i=0;i<this.m_actions.length;i++){this.m_actions[i].SetIsEnabled((this.Parent().IsEnabled()&&!this.IsDeleted()));}},Render_Delete:function(){if(this.m_deleteAnchor){if(this.CanDelete()){this.m_deleteAnchor.style.display='inline';var iconTerm;var iconClassName='dcs_a';var altTerm=null;if(this.IsDeleted()){altTerm=this.m_parent.m_restoreTermName;if(this.m_parent.IsEnabled()){iconTerm='Shared.Main.actAdd';}else{iconTerm='Shared.Main.actAddDisabled';iconClassName+=' dcs_ad';}}else{altTerm=this.m_parent.m_removeTermName;if(this.m_parent.IsEnabled()&&this.DeleteIsEnabled()){iconTerm='Shared.Main.actDelete';}else{iconTerm='Shared.Main.actDeleteDisabled';iconClassName+=' dcs_ad';}}
var term=new D2L.LP.Text.LangTerm(altTerm);term.SetSubject(this.m_subject);term.AssignText(this.m_deleteAnchor,'title');term.AssignText(this.m_deleteIcon,'alt');this.m_deleteIcon.className=iconClassName;D2L.Images.ImageTerm.Assign(iconTerm,this.m_deleteIcon);}else{this.m_deleteAnchor.style.display='none';}}},Render_Info:function(){if(this.m_infoIcon){if(this.DeleteIsEnabled()){this.m_infoIcon.style.display='none';}else{this.m_infoIcon.style.display='inline';}
if(this.m_parent.IsEnabled()){D2L.Images.ImageTerm.Assign('Shared.Main.infInfo',this.m_infoIcon);}else{D2L.Images.ImageTerm.Assign('Shared.Main.infInfoDisabled',this.m_infoIcon);}}},Render_Row:function(){if(this.IsRendered()){var className='';if(this.IsDeleted()){className='dcs_r dcs_rd';}else{className='dcs_r';}
if(this.PreviousSibling()===null&&!this.Parent().m_hasDeleteAll&&this.Parent().m_addButton===null&&this.Parent().m_reorderButton===null){className+=' dcs_rnl';}
if(this.IsModified()||this.IsNew()||(this.m_originalIsDeleted!=this.IsDeleted())){className+=' D2LField_Modified';}
this.GetDomNode().className=className;}},Render_Status:function(){if(this.Parent()){var status='';if(this.IsNew()){if(this.IsDeleted()){status='newDeleted';}else{status='new';}}else{if(this.IsDeleted()){status='existingDeleted';}else if(this.IsModified()){status='existingModified';}else{status='existing';}}
this.Parent().SetItemStatus(this.GetKey(),status);}}});D2L.CustomSelectorItem=D2L.Control.CustomSelectorItem;D2L.Control.CustomSelectorItemAction=D2L.Control.extend({Construct:function(enabledSrc,disabledSrc,alt,onClick){arguments.callee.$.Construct.call(this,D2L.Control.Type.CustomSelectorItemAction);if(enabledSrc===undefined){enabledSrc='';}
if(disabledSrc===undefined){disabledSrc='';}
this.m_alt=D2L.LP.Text.IText.Normalize(alt,'D2L.Control.CustomSelectorItemAction','Constructor','alt');this.m_enabledSrc=enabledSrc;this.m_disabledSrc=disabledSrc;this.m_enabledInfo=null;this.m_disabledInfo=null;this.m_navInfo=null;this.m_img=null;this.m_isEnabled=true;if(onClick!==undefined){this.m_navInfo=new D2L.NavInfo();this.m_navInfo.SetOnClick(onClick);}},DeserializeMin:function(deserializer){this.m_isEnabled=deserializer.GetBoolean();this.SetAlt(deserializer.GetObjectMin(D2L.LP.Text.IText));this.m_enabledInfo=deserializer.GetObjectMin(D2L.Images.Image);this.m_disabledInfo=deserializer.GetObjectMin(D2L.Images.Image);this.m_navInfo=deserializer.GetObjectMin(D2L.NavInfo);},Serialize:function(serializer){if(serializer!==null&&serializer!==undefined){serializer.AddMember("IE",this.m_isEnabled);serializer.AddMember("A",this.m_alt);serializer.AddMember("EI",this.m_enabledInfo);serializer.AddMember("DI",this.m_disabledInfo);serializer.AddMember("NF",this.m_navInfo);}},BuildDom:function(){if(!this.m_hasDomBeenBuilt){arguments.callee.$.BuildDom.call(this);var item=this;this.SetDomNode(this.CreateElement('a'));this.m_img=this.CreateElement('img');this.m_img.className='dcs_a';if(this.IsEnabled()){if(this.m_enabledInfo){this.m_enabledInfo.Assign(this.m_img);}else{this.m_img.src=this.m_enabledSrc;}}else{if(this.m_disabledInfo){this.m_disabledInfo.Assign(this.m_img);}else{this.m_img.src=this.m_disabledSrc;}}
this.GetDomNode().appendChild(this.m_img);this.InstallEvents();}},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_img=this.GetDomNode().firstChild;this.InstallEvents();},InstallEvents:function(){var me=this;var alt=this.m_alt;if(this.Parent()&&this.Parent().GetSubject){alt.SetSubject(this.Parent().GetSubject());}
if(this.GetDomNode().tagName.toLowerCase()=='a'){alt.AssignText(this.GetDomNode(),'title');}
if(this.m_img){alt.AssignText(this.m_img,'alt');}
this.SetNav(this.m_navInfo);},SetNav:function(navInfo){if(navInfo){this.m_navInfo=navInfo;var navStruct=this.m_navInfo.SetupHrefOnClick(this);if(this.IsEnabled()){this.GetDomNode().href=navStruct.Href;}
if(navStruct.Target==null||navStruct.Target==''){if(this.GetDomNode().attributes.getNamedItem('target')){this.GetDomNode().attributes.removeNamedItem('target');}}else{this.GetDomNode().target=navStruct.Target;}
var me=this;if(navStruct.OnClick){this.AttachObject(this.GetDomNode(),'onclick',function(){if(me.IsEnabled()&&navStruct.OnClick){return navStruct.OnClick.call(me);}});}}},GetAlt:function(){return this.m_alt;},SetAlt:function(alt){this.m_alt=D2L.LP.Text.IText.Normalize(alt,'D2L.Control.CustomSelectorItemAction','SetAlt','alt');if(this.m_img){var me=this;this.m_alt.GetText().Register(function(val){if(val.length>0){me.m_img.alt=val;}});}},GetDisabledSrc:function(){if(this.m_disabledInfo){return this.m_disabledInfo.GetImageFile();}else{return this.m_disabledSrc;}},GetDisabledInfo:function(){return this.m_disabledInfo;},SetDisabledInfo:function(info){if(info){this.m_disabledInfo=info;if(this.m_img&&!this.IsEnabled()){this.m_disabledInfo.Assign(this.m_img);}}},GetEnabledSrc:function(){if(this.m_enabledInfo){return this.m_enabledInfo.GetImageFile();}else{return this.m_enabledSrc;}},GetEnabledInfo:function(){return this.m_enabledInfo;},SetEnabledInfo:function(info){if(info){this.m_enabledInfo=info;if(this.m_img&&this.IsEnabled()){this.m_enabledInfo.Assign(this.m_img);}}},GetOnClick:function(){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('CustomSelectorItemAction.SetOnClick() '+'is obsolete. Please use SetNav() instead.'),true);if(this.m_navInfo&&this.m_navInfo.GetOnClick()){return this.m_navInfo.GetOnClick();}else{return false;}},SetOnClick:function(onClick){if(onClick){if(this.m_navInfo==null){this.m_navInfo=new D2L.NavInfo();}
this.m_navInfo.SetOnClick(onClick);this.SetNav(this.m_navInfo);}},IsEnabled:function(){return this.m_isEnabled;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.m_img){if(isEnabled){if(this.m_enabledInfo){this.m_enabledInfo.Assign(this.m_img);}else{this.m_img.src=this.m_enabledSrc;}
this.GetDomNode().href=this.m_href;}else{if(this.m_disabledInfo){this.m_disabledInfo.Assign(this.m_img);}else{this.m_img.src=this.m_disabledSrc;}
if(this.GetDomNode().attributes.getNamedItem('href')){this.GetDomNode().attributes.removeNamedItem('href');}}}}});D2L.CustomSelectorItemAction=D2L.Control.CustomSelectorItemAction;D2L.Control.OrgUnitSelector=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.showCurrentOuCheckbox=true;this.m_cs=null;this.m_currentOu=null
this.m_currentOuDiv=null;this.m_dialog=null;this.m_doEnableCheckbox=true;this.OnAdd=null;this.m_langTheOrgUnitTypeOrgUnitName='';this.m_langEveryDescendant='';},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var isEnabled=deserializer.GetBoolean();this.m_doEnableCheckbox=deserializer.GetBoolean();this.showCurrentOuCheckbox=deserializer.GetBoolean();this.m_langTheOrgUnitTypeOrgUnitName=deserializer.GetMember();this.m_langEveryDescendant=deserializer.GetMember();var allowMultiple=deserializer.GetBoolean();var options=deserializer.GetMember();var ouOptions=deserializer.GetMember();var dataSplit=deserializer.GetMember();var name=deserializer.GetMember();if(name.length>0){this.m_cs=UI.GetByName(name+'_cs');}else{this.m_cs=UI.GetControl(this.GetMappedId()+'_cs');}
if(this.showCurrentOuCheckbox){if(name.length>0){this.m_currentOu=UI.GetByName(name+'_currentOu');}else{this.m_currentOu=UI.GetControl(this.GetMappedId()+'_currentOu');}
this.m_currentOuDiv=UI.GetById(this.GetMappedId()+'_currentOuDiv');}
this.OnAdd=this.m_cs.OnAdd;this.CreateDialog(allowMultiple,options,ouOptions,dataSplit);if(!isEnabled){this.Disable();}},Add:function(orgUnitId,orgUnitName,orgUnitTypeName,ancestorOrgUnitId,ancestorOrgUnitName,ancestorOrgUnitTypeName,descendantOrgUnitTypeId,descendantOrgUnitTypeName){var key=orgUnitId+'_'+ancestorOrgUnitId+'_'+descendantOrgUnitTypeId;var contents='';if(orgUnitId>0){contents=this.m_langTheOrgUnitTypeOrgUnitName.replace('[0]',orgUnitTypeName).replace('[1]',orgUnitName);}else{contents=this.m_langEveryDescendant.replace('[0]',descendantOrgUnitTypeName).replace('[1]',ancestorOrgUnitTypeName).replace('[2]',ancestorOrgUnitName);}
if(orgUnitId==Global.OrgUnitId&&this.showCurrentOuCheckbox){this.m_currentOu.checked=true;this.m_currentOuDiv.style.backgroundColor='#e8e8ff';}else{var existing=this.m_cs.GetItem(key);if(!existing){var newItem=new D2L.Control.CustomSelectorItem(key,contents);newItem.SetSubject(contents.stripHtml());this.m_cs.AppendChild(newItem);}}},CreateDialog:function(allowMultiple,descendantOptions,orgUnitOptions,dataSplit){var dialogCallback=function(response){if(response.GetType()==D2L.Dialog.ResponseType.Positive){var orgUnits=response.GetData('OrgUnits');if(orgUnits){for(var i in orgUnits){me.Add(orgUnits[i].OrgUnitId,orgUnits[i].OrgUnitName,orgUnits[i].OrgUnitTypeName,orgUnits[i].AncestorOrgUnitId,orgUnits[i].AncestorOrgUnitName,orgUnits[i].AncestorOrgUnitTypeName,orgUnits[i].DescendantOrgUnitTypeId,orgUnits[i].DescendantOrgUnitTypeName);}}}
response.GetDialog().Close();};this.m_dialog=new D2L.Dialog.OrgUnitSelector(dialogCallback);this.m_dialog.SetAllowMultiple(allowMultiple);this.m_dialog.SetDescendantOptions(descendantOptions);this.m_dialog.SetOrgUnitOptions(orgUnitOptions);if(dataSplit){this.m_dialog.SetDataSplit(dataSplit);}
var me=this;var onclick=function(){me.m_dialog.Open();};this.m_cs.SetAddOnClick(onclick);},Disable:function(){if(this.m_doEnableCheckbox&&this.showCurrentOuCheckbox){this.m_currentOu.disabled=true;}
this.m_cs.Disable();},Enable:function(){if(this.m_doEnableCheckbox&&this.showCurrentOuCheckbox){this.m_currentOu.disabled=false;}
this.m_cs.Enable();},Focus:function(){this.m_cs.Focus();},HasValue:function(){return new D2L.Util.DelayedReturn(this.HasValueNoDelay());},HasValueNoDelay:function(){return this.m_cs.GetNumItems()>0;},IsEnabled:function(){return this.m_cs.IsEnabled();},SetIsEnabled:function(isEnabled){if(isEnabled){this.Enable();}else{this.Disable();}}});D2L.OrgUnitSelector=D2L.Control.OrgUnitSelector;D2L.Control.OrgUnitSelector.OrgUnitOptions={DescendantsOnly:1,All:2};D2L.Control.OrgUnitSelector.DescendantOptions={None:0,All:1,UserChoice:2,CourseOfferings:3};D2L.Control.Attachments=D2L.Control.CustomSelector.extend({Construct:function(){arguments.callee.$.Construct.call(this,'',true);this.m_name='';this.type=0;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var items=deserializer.GetObjectArrayMin(D2L.Control.Attachment);for(var i=0;i<items.length;i++){this.AppendChild(items[i]);}},AddAttachment:function(attachment){this.AddItem(attachment);}});D2L.Control.Attachment=D2L.Control.CustomSelectorItem.extend({Construct:function(fileId,text,canDelete){arguments.callee.$.Construct.call(this,fileId,text);this.SetIsNew(false);},DeserializeMin:function(deserializer){this.m_key=deserializer.GetMember();this.SetCanDelete(deserializer.GetBoolean());this.SetContent(deserializer.GetMember());},BuildDom:function(){if(this.Parent().type==1){this.SetDomNode(document.createElement('span'));this.IChildrenDomNode=this.GetDomNode();if(this.Parent().type==1&&this.Parent().Children().length>0){this.m_contents=';&nbsp;'+this.m_contents;}
this.GetDomNode().innerHTML=this.m_contents;}else{arguments.callee.$.BuildDom.call(this);}}});D2L.Attachments=D2L.Control.Attachments;D2L.Attachment=D2L.Control.Attachment;

D2L.Control.ConditionSet=D2L.Control.CustomSelector.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_name='';this.m_newId=0;this.m_setIdInput=null;this.m_table=null;this.externalObjectId=0;this.setId=0;this.toolId=0;this.m_toolIdInput=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.setId=deserializer.GetMember();this.toolId=deserializer.GetMember();this.externalObjectId=deserializer.GetMember();var c=this.GetDomNode().parentNode.parentNode.parentNode.parentNode.parentNode;this.m_setIdInput=c.childNodes[0];this.m_toolIdInput=c.childNodes[1];this.m_table=c.childNodes[2];},AddExisting:function(){var me=this;var AddCondition=function(response){if(response.GetType()==D2L.Dialog.ResponseType.Positive){var conditions=response.GetData('conditions');for(var i in conditions){var existing=me.GetItem(conditions[i].Id);if(existing){new D2L.Control.Balloon.Validation(existing,new D2L.LP.Text.LangTerm('Conditions.Main.txtConditionExists')).Show();}else{var item=new D2L.Control.CustomSelectorItem(conditions[i].Id,conditions[i].Text);item.SetSubject(conditions[i].Text);me.AppendChild(item);var textContainer=UI.GetControl(me.m_name+'_nonEmptyText');if(textContainer){textContainer.SetIsDisplayed(true);}}}}else{response.GetDialog().Close();}};var myD=new D2L.Dialog();myD.SetTitle(new D2L.LP.Text.LangTerm('Conditions.Main.hdrAddCondition'));myD.SetSize('500px','400px');myD.SetCallback(AddCondition);myD.SetSrc('/d2l/common/dialogs/releaseCondition/attachReleaseCondition.d2l?ou='+Global.OrgUnitId,'AttachConditions');myD.AddButton(D2L.Control.Button.Type.Cancel);myD.AttachButton=myD.AddCustomButton(new D2L.LP.Text.LangTerm('Conditions.Main.btnAttach'),D2L.Dialog.ButtonPosition.Right,D2L.Dialog.ResponseType.Positive);myD.Open();},AddNew:function(){var me=this;var AddCondition=function(response){if(response.GetType()==D2L.Dialog.ResponseType.Positive){var condition=response.GetData('condition');if(condition){var id;if(condition.Id!==0){var existing=me.GetItem(condition.Id);if(existing){new D2L.Control.Balloon.Validation(existing,new D2L.LP.Text.LangTerm('Conditions.Main.txtConditionExists')).Show();return;}else{id=condition.Id;}}else{me.m_newId++;id='new_'+me.m_newId;}
var item=new D2L.Control.CustomSelectorItem(id,condition.Text);item.SetSubject(condition.Text);item.SetData('conditionTypeId',condition.ConditionTypeId);item.SetData('id1',condition.Id1);item.SetData('id2',condition.Id2);item.SetData('percentage1',condition.Percentage1);item.SetData('percentage2',condition.Percentage2);item.SetData('int1',condition.Int1);var textContainer=UI.GetControl(me.m_name+'_nonEmptyText');if(textContainer){textContainer.SetIsDisplayed(true);}
me.AppendChild(item);}}else{response.GetDialog().Close();}};var myD=new D2L.Dialog();myD.SetTitle(new D2L.LP.Text.LangTerm('Conditions.CreateNewRelease.hdrCreateNewRelease'));myD.SetSize('425px','325px');myD.SetCallback(AddCondition);myD.SetSrc('/d2l/common/dialogs/releaseCondition/createReleaseCondition.d2l?ou='+Global.OrgUnitId,'CreateCondition');myD.AddButton(D2L.Control.Button.Type.Cancel);myD.CreateButton=myD.AddCustomButton(new D2L.LP.Text.LangTerm('Conditions.Main.btnCreate'),D2L.Dialog.ButtonPosition.Right,D2L.Dialog.ResponseType.Positive);myD.Open();},SetConditionSetId:function(setId){this.setId=setId;this.m_setIdInput.value=setId;}});

D2L.FormManager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_fileUploads=[];this.hasChanged=false;this.m_uploadIsPrepared=false;this.m_hasSaveConfirmation=false;this.m_hasSaveConfirmationOriginal=false;this.m_formElementDisabled=[];this.m_saveConfirmationDialog=null;this.m_saveConfirmationMethod=null;this.m_skipUploads=false;this.OnChange=new D2L.EventHandler();this.OnChangeReset=new D2L.EventHandler();this.IDomNode=null;Nav.OnNavigate.Register(this,'ShowSaveConfirmation');Nav.OnNavigate.Register(this,'UploadFilesNav');var me=this;UI.OnPageLoad().RegisterMethod(function(){me.IDomNode=UI.GetById('d2l_form');if(me.IDomNode){me.AttachObject(me.IDomNode,'ID2L',this);me.AttachObject(me.IDomNode,'onsubmit',function(){return false;});me.AttachObject(me.IDomNode,'ID2LOnChange',new D2L.EventHandler());me.IDomNode.ID2LOnChange.Register(me,'HandleFormChange');me.AttachObject(me.IDomNode,'ID2LOnTransform',new D2L.EventHandler());me.IDomNode.ID2LOnTransform.Register(me,'HandleTransform');}});},ForceChange:function(elem){if(elem===undefined||elem===null){this.hasChanged=true;return;}
if(D2L.Util.IsD2LControl(elem)){elem=elem.GetDomNode();}
WindowEventManager.BubbleChangeEvent(elem,null);},GetSaveConfirmationDialog:function(){if(!this.m_saveConfirmationDialog){this.m_saveConfirmationDialog=new D2L.Dialog.SaveConfirmation();}
return this.m_saveConfirmationDialog;},HandleFormChange:function(event){if(event.hasChangeBeenShown){this.hasChanged=true;this.OnChange.Trigger(event);}},HandleTransform:function(event){WindowEventManager.Transform.Trigger(event);},HasChanged:function(){return this.hasChanged;},ResetChanges:function(){this.hasChanged=false;this.m_hasSaveConfirmation=this.m_hasSaveConfirmationOriginal;this.OnChangeReset.Trigger();},SetHasSaveConfirmation:function(hasSaveConfirmation){this.m_hasSaveConfirmation=hasSaveConfirmation;},SetSaveConfirmation:function(methodName){if(methodName.length>0){if(window[methodName]){this.m_saveConfirmationMethod=window[methodName];}}
this.m_hasSaveConfirmation=true;this.m_hasSaveConfirmationOriginal=true;},ShowSaveConfirmation:function(ni){if(this.m_hasSaveConfirmation&&this.HasChanged()&&(!ni.IsAction()||ni.m_forceSaveConfirmation)){var formManager=this;var DoNavigation=function(ret){if(ret){formManager.m_hasSaveConfirmation=false;setTimeout(function(){Nav.Go(ni);});}};var DialogCallback=function(response){if(response.GetType()==D2L.Dialog.ResponseType.Positive){if(formManager.m_saveConfirmationMethod){var dr=formManager.m_saveConfirmationMethod();dr.Register(function(ret){if(ret===true){DoNavigation(true);}});}else{var PostCallback=function(response){if(response.GetResponseType()==D2L.Rpc.ResponseType.Success){return true;}else{return false;}};var dr=D2L.Rpc.CreatePost('Save',PostCallback).Call();dr.Register(DoNavigation);}}else if(response.GetType()==D2L.Dialog.ResponseType.Negative){DoNavigation(true);}};var dialog=this.GetSaveConfirmationDialog();dialog.SetCallback(DialogCallback);dialog.Open();return false;}
return true;},RegisterFileUpload:function(fileUpload){this.m_fileUploads.push(fileUpload);},PrepareForUpload:function(delayedReturn){var me=this;if(!this.m_uploadIsPrepared){var formAction=UI.form.action;var formTarget=UI.form.target;delayedReturn.Register(function(){try{UI.form.action=formAction;UI.form.target=formTarget;}catch(e){}
for(var x in me.m_formElementDisabled){me.m_formElementDisabled[x].disabled=false;}
me.m_uploadIsPrepared=false;});var iframe=UI.GetById('upload_frame');if(iframe===null){if(document.body.insertAdjacentHTML){document.body.insertAdjacentHTML('beforeEnd','<iframe id=\'upload_frame\' name=\'upload_frame\' style=\'position:absolute;left:-200px;top:-200px;width:1px;height:1px;\'></iframe>');}else{iframe=document.createElement('iframe');iframe.id='upload_frame';iframe.name='upload_frame';iframe.style.position='absolute';iframe.style.left='-200px';iframe.style.top='-200px';iframe.style.width='1px';iframe.style.height='1px';document.body.appendChild(iframe);}}
UI.form.target='upload_frame';this.m_uploadIsPrepared=true;}
for(var i=0;i<UI.form.elements.length;i++){if(!UI.form.elements[i].disabled){this.m_formElementDisabled.push(UI.form.elements[i]);UI.form.elements[i].disabled=true;}}},UploadFilesNav:function(ni){if(this.m_skipUploads||!ni.IsAction()){return true;}
var numToUpload=0;for(var i=0;i<this.m_fileUploads.length;i++){numToUpload+=this.m_fileUploads[i].GetNumToUpload();}
if(numToUpload===0){return true;}
var me=this;this.UploadFiles().Register(function(success){if(success&&ni){me.m_skipUploads=true;Nav.Go(ni);me.m_skipUploads=false;}});return false;},UploadFiles:function(){var delayedReturn=new D2L.Util.DelayedReturn();var me=this;var FinishUpload=function(success){delayedReturn.Trigger(success);};if(this.m_fileUploads.length===0){FinishUpload(true);}
var Upload=function(index){if(index<me.m_fileUploads.length){var uploadReturn=me.m_fileUploads[index].Upload();uploadReturn.Register(function(success){if(success){Upload(++index);}else{FinishUpload(false);}});}else{FinishUpload(true);}};var totalUploads=0;var PrepareUpload=function(index){if(index<me.m_fileUploads.length){var fi=me.m_fileUploads[index];if(fi.IsEnabled()){fi.UploadPrepare().Register(function(numUploads){if(numUploads<0){FinishUpload(false);}else{totalUploads+=numUploads;}
if(index==me.m_fileUploads.length-1){if(totalUploads===0){FinishUpload(true);}else{me.PrepareForUpload(delayedReturn);Upload(0);}}
PrepareUpload(++index)});}}};PrepareUpload(0);return delayedReturn;}});

D2L.Control.TreeView=D2L.Control.extend({Construct:function(type){arguments.callee.$.Construct.call(this,D2L.Control.Type.TreeView2);if(!type||type===undefined){type=D2L.Control.TreeView.Type.Normal;}
this.m_activeNode=null;this.m_activeKeyInput=null;this.m_allNodes=[];this.m_allNodesList=[];this.m_autoSelectChildren=false;this.m_autoSelectParents=false;this.m_autoSort=true;this.m_callbackUrl='';this.m_type=type;this.m_isEnabled=true;this.m_name='';this.m_width='auto';this.m_hasLines=true;this.OnNodeSelectionChange=new D2L.EventHandler();this.OnChildAdd.Register(this,'OnNodeAdd');this.OnChildRemove.Register(this,'OnNodeRemove');this.OnChildRemoveStructure.Register(this,'OnNodeRemoveStructure');},AppendTo:function(parentNode){arguments.callee.$.AppendTo.call(this,parentNode);this.AdjustOffsets();},AppendChild:function(childNode){if(childNode&&childNode.GetControlType&&childNode.GetControlType()==D2L.Control.Type.TreeNode2){return arguments.callee.$.AppendChild.call(this,childNode);}else{return null;}},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('ul'));this.m_name=this.GetMappedId();this.GetDomNode().className='dtv';this.RenderContainer();this.m_activeKeyInput=this.CreateElement('input');this.m_activeKeyInput.type='hidden';this.m_activeKeyInput.name=this.GetMappedId()+'_activeKey';var item=this.CreateElement('li');item.style.display='none';item.appendChild(this.m_activeKeyInput);this.GetDomNode().appendChild(item);}},InsertSorted:function(childNode){return arguments.callee.$.InsertSorted.call(this,childNode,D2L.Control.TreeView.IsGreaterThan);},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_type=deserializer.GetMember();this.m_autoSelectChildren=deserializer.GetBoolean();this.m_autoSelectParents=deserializer.GetBoolean();this.m_autoSort=deserializer.GetBoolean();this.m_hasLines=deserializer.GetBoolean();this.m_isEnabled=deserializer.GetBoolean();this.SetWidth(deserializer.GetMember());this.m_callbackUrl=deserializer.GetMember();this.m_name=deserializer.GetMember();var activatedKey=deserializer.GetMember();if(this.m_name.length===0){this.m_name=this.GetMappedId();}
var children=deserializer.GetObjectArrayMin(D2L.Control.TreeNode);this.m_activeKeyInput=this.GetDomNode().firstChild.firstChild;for(var i=0;i<children.length;i++){children[i].IntegrateChild(this,this.GetDomNode().childNodes[i+1]);}
for(var i=0;i<this.Children().length;i++){this.Children()[i].RenderSelectionInput(true);}
this.AdjustOffsets();if(this.m_type==D2L.Control.TreeView.Type.Activation){this.ActivateNode(this.GetNode(activatedKey));}},RemoveChild:function(child){var previousSibling=child.PreviousSibling();var nextSibling=child.NextSibling();child=arguments.callee.$.RemoveChild.call(this,child);if(child===null){return null;}
if(this.m_hasLines){if(previousSibling){previousSibling.Render_Lines();}
if(this.Children().length==1&&nextSibling){nextSibling.Render_Lines();}}
return child;},AdjustOffsets:function(){if(this.m_hasLines){var offset=0;var tempOffset=0;var DoOffset=function(node){var height=node.GetDomNode().offsetHeight;node.GetDomNode().style.backgroundPosition='0px '+offset+'px';if((height%2)!==0){offset=(offset+1)%2;}
if(node.IsExpanded()){tempOffset=offset;offset=(node.m_contentDiv.offsetHeight%2);for(var j=0;j<node.Children().length;j++){DoOffset(node.Children()[j]);}
offset=tempOffset;}};for(var i=0;i<this.Children().length;i++){DoOffset(this.Children()[i]);}}},ActivateNode:function(node){if(this.GetType()==D2L.Control.TreeView.Type.Activation&&this.IsEnabled()){if(node&&!this.GetNode(node.GetKey())){node=null;}
if(this.m_activeNode){if(this.m_activeNode.m_anchor){this.m_activeNode.m_anchor.className='';}
if(this.m_activeKeyInput){this.m_activeKeyInput.value='';}
this.m_activeNode=null;}
if(node){if(node.m_anchor){node.m_anchor.className='dtn_a';}
if(this.m_activeKeyInput){this.m_activeKeyInput.value=node.GetKey();}}else if(this.m_activeKeyInput){this.m_activeKeyInput.value='';}
this.m_activeNode=node;}},AddNode:function(parentKey,node){if(node&&node.GetControlType&&node.GetControlType()==D2L.Control.Type.TreeNode2){var parent=this.GetNode(parentKey);if(!parent){parent=this;}
if(this.AutoSort()){return parent.InsertSorted(node);}else{return parent.AppendChild(node);}}else{return null;}},AllNodes:function(){return this.m_allNodes;},AllNodesList:function(){return this.m_allNodesList;},AutoSelectChildren:function(){return this.m_autoSelectChildren;},AutoSort:function(){return this.m_autoSort;},AutoSelectParents:function(){return this.m_autoSelectParents;},CollapseAll:function(){for(var key in this.m_allNodes){this.m_allNodes[key].SetIsExpanded(false,false);}
this.AdjustOffsets();},ExpandAll:function(){for(var key in this.m_allNodes){this.m_allNodes[key].SetIsExpanded(true,false);}
this.AdjustOffsets();},GetActiveNode:function(){return this.m_activeNode;},GetActiveKey:function(){var retVal='';var activeNode=this.GetActiveNode();if(activeNode){retVal=activeNode.GetKey();}
return retVal;},GetExpandedKeys:function(){var retVal=[];var nodes=this.GetExpandedNodes();for(var i=0;i<nodes.length;i++){retVal.push(nodes[i].GetKey());}
return retVal;},GetExpandedNodes:function(){var retVal=new Array();for(var key in this.m_allNodes){if(this.m_allNodes[key].IsExpanded()){retVal.push(this.m_allNodes[key]);}}
return retVal;},GetNode:function(key){var node=null;if(this.m_allNodes[key]){node=this.m_allNodes[key];}
return node;},GetSelectedKeys:function(){var retVal=[];var nodes=this.GetSelectedNodes();for(var i=0;i<nodes.length;i++){retVal.push(nodes[i].GetKey());}
return retVal;},GetSelectedNodes:function(){var retVal=new Array();for(var key in this.m_allNodes){if(this.m_allNodes[key].IsSelected()){retVal.push(this.m_allNodes[key]);}}
return retVal;},GetWidth:function(){return this.m_width;},GetType:function(){return this.m_type;},GetState:function(serializer){var activeNode=this.GetActiveNode();serializer.AddMember('ActivatedKey',(activeNode!==null)?activeNode.GetKey():'');serializer.AddMember('ExpandedKeys',this.GetExpandedKeys());serializer.AddMember('SelectedKeys',this.GetSelectedKeys());},IsEnabled:function(){return this.m_isEnabled;},OnNodeAdd:function(){var node=arguments[1];var root=this;var addFunc=function(node){root.m_allNodes[node.GetKey()]=node;root.m_allNodesList.push(node);node.m_root=root;if(node.m_hasSelection===null){node.SetHasSelection(root.GetType()==D2L.Control.TreeView.Type.Selection);}else if((root.GetType()==D2L.Control.TreeView.Type.Normal||root.GetType()==D2L.Control.TreeView.Type.Activation)&&node.m_hasSelection===true){node.m_hasSelection=false;node.m_isSelected=false;}
var parent=node.Parent();while(parent.GetControlType()==D2L.Control.Type.TreeNode2){parent.m_numDesc=null;if(node.IsSelected()){parent.m_numDescSel++;}
parent=parent.Parent();}
if(node.m_expandInput&&node.IsExpanded()){node.m_expandInput.name=root.m_name+'_expandedKeys';}
node.m_depth=(node.Parent()&&node.Parent().GetControlType()==D2L.Control.Type.TreeNode2)?node.Parent().m_depth+1:0;node.BuildAnchorDom();node.RenderExpandImage();node.Render_Lines();node.RenderSelectionInput();node.RenderIconImage();node.Render_Indent();if(node.Parent()&&node.Parent().GetControlType()==D2L.Control.Type.TreeNode2&&node.Parent().Children().length<2){node.Parent().RenderExpandImage();node.Parent().Render_Lines();}
if(root.m_hasLines){if(node.PreviousSibling()){node.PreviousSibling().RenderExpandImage();node.PreviousSibling().Render_Lines();}
if(node.NextSibling()){node.NextSibling().RenderExpandImage();node.NextSibling().Render_Lines();}}
node.OnChildAdd.Register(root,'OnNodeAdd');node.OnChildRemove.Register(root,'OnNodeRemove');node.OnChildRemoveStructure.Register(root,'OnNodeRemoveStructure');for(var key in node.Children()){addFunc(node.Children()[key]);}};addFunc(node);this.AdjustOffsets();},OnNodeRemove:function(evt,node){var root=this;var removeFunc=function(node){for(var key in node.Children()){removeFunc(node.Children()[key]);}
if(node.m_selectionInput){node.m_selectionHidden.name='';node.m_selectionHidden.value='';}
var parent=node.Parent();while(parent&&parent.GetControlType()==D2L.Control.Type.TreeNode2){parent.m_numDesc=null;if(node.IsSelected()){parent.m_numDescSel--;}
parent=parent.Parent();}
if(node.m_expandInput){node.m_expandInput.name='';}
if(node==root.GetActiveNode()){root.m_activeNode=null;if(root.m_activeKeyInput){root.m_activeKeyInput.value='';}}};removeFunc(node);this.AdjustOffsets();},OnNodeRemoveStructure:function(evt,node){var root=this;var removeFunc=function(node){for(var key in node.Children()){removeFunc(node.Children()[key]);}
delete root.m_allNodes[node.GetKey()];for(var i=0;i<root.m_allNodesList.length;i++){if(root.m_allNodesList[i]==node){break;}}
if(i<root.m_allNodesList.length){root.m_allNodesList.splice(i,1);}
node.m_root=null;};removeFunc(node);},RemoveNode:function(node){if(node&&node.Parent()){return node.Parent().RemoveChild(node);}
return null;},RenderContainer:function(){if(this.IsRendered()){this.GetDomNode().style.width=this.m_width;}},SelectAll:function(){if(this.GetType()==D2L.Control.TreeView.Type.Selection){for(var key in this.m_allNodes){this.m_allNodes[key].SetIsSelected(true);}}},SetAutoSelectChildren:function(autoSelectChildren){if(this.GetType()==D2L.Control.TreeView.Type.Selection){this.m_autoSelectChildren=autoSelectChildren;}},SetAutoSelectParents:function(autoSelectParents){if(this.GetType()==D2L.Control.TreeView.Type.Selection){this.m_autoSelectParents=autoSelectParents;}},SetIsEnabled:function(isEnabled){if(isEnabled!=this.m_isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){this.GetDomNode().className=isEnabled?'dtv':'dtv_d';}
for(var key in this.m_allNodes){var child=this.m_allNodes[key];child.RenderHref();child.RenderExpandImage();child.RenderIconImage();child.RenderSelectionInput();for(var i=0;i<child.m_actions.length;i++){child.m_actions[i].SetIsEnabled(isEnabled);}}}},SetType:function(type){if(type!=this.m_type){var key;var oldType=this.m_type;if(oldType==D2L.Control.TreeView.Type.Selection){for(var key in this.m_allNodes){this.m_allNodes[key].SetHasSelection(false);}}
if(oldType==D2L.Control.TreeView.Type.Activation){this.ActivateNode(null);}
this.m_type=type;if(type==D2L.Control.TreeView.Type.Selection){for(key in this.m_allNodes){this.m_allNodes[key].SetHasSelection(true);}}
if(oldType==D2L.Control.TreeView.Type.Activation||type==D2L.Control.TreeView.Type.Activation){for(key in this.m_allNodes){this.m_allNodes[key].BuildAnchorDom();}}}},SetWidth:function(width){if(width===undefined||width===null||width.length==0){width='auto';}
if(width&&width.isString){this.m_width=width;this.RenderContainer();}},UnSelectAll:function(){if(this.GetType()==D2L.Control.TreeView.Type.Selection){for(var key in this.m_allNodes){this.m_allNodes[key].SetIsSelected(false);}}}});D2L.TreeView2=D2L.Control.TreeView.extend({Construct:function(name,type){if(type!==undefined){if(type=='Normal'){type=D2L.Control.TreeView.Type.Normal;}else if(type=='Activation'){type=D2L.Control.TreeView.Type.Activation;}else if(type=='Selection'){type=D2L.Control.TreeView.Type.Selection;}}
arguments.callee.$.Construct.call(this,type);}});D2L.Control.TreeView.Type={Normal:1,Activation:2,Selection:3};D2L.TreeView2.Type=D2L.Control.TreeView.Type;D2L.Control.TreeView.IsGreaterThan=function(node1,node2){return(node1.GetText().toLowerCase()>node2.GetText().toLowerCase());};D2L.TreeView2.IsGreaterThan=D2L.Control.TreeView.IsGreaterThan;D2L.Control.TreeView.TextFormat={Normal:1,Bold:2};D2L.TreeView2.TextFormat=D2L.Control.TreeView.TextFormat;D2L.Control.TreeView.CountType={Unread:0,Unapproved:1};D2L.TreeView2.CountType=D2L.Control.TreeView.CountType
D2L.Control.TreeNode=D2L.Control.extend({Construct:function(key,text,onClick){arguments.callee.$.Construct.call(this,D2L.Control.Type.TreeNode2);if(key===undefined||key===null){key='';}
if(!text||text===undefined){text='';}
this.m_actions=[];this.m_actionSpan=null;this.m_contentDiv=null;this.m_counts={};this.m_countSpan=null;this.m_data=[];this.m_depth=0;this.m_description=null;this.m_expandAnchor=null;this.m_expandImg=null;this.m_expandInput=null;this.m_expandMode=D2L.Control.TreeNode.ExpandMode.Normal;this.m_hasSelection=null;this.m_iconCollapsedInfo=null;this.m_iconDisabledInfo=null;this.m_iconExpandedInfo=null;this.m_iconExpandedDisabledInfo=null;this.m_isExpanded=false;this.m_isSelected=false;this.m_key=key;this.m_nodeDiv=null;this.m_numDesc=0;this.m_numDescSel=null;this.m_onClick=null;this.m_iconOnClick=null;this.m_root=null;this.m_selectionInput=null;this.m_selectionHidden=null;this.m_stuffDiv=null;this.m_text=text;this.m_textFormat=D2L.Control.TreeView.TextFormat.Normal;this.m_textLabel=null;this.m_textSpan=null;this.m_nodes=[];this.m_href='javascript://';this.m_target=null;this.m_navInfo=null;},DeserializeMin:function(deserializer){this.m_key=deserializer.GetMember();this.m_description=deserializer.GetMember();this.m_expandMode=deserializer.GetMember();this.m_hasSelection=deserializer.GetBoolean();this.m_iconCollapsedInfo=deserializer.GetObjectMin(D2L.Images.Image);this.m_iconDisabledInfo=deserializer.GetObjectMin(D2L.Images.Image);this.m_iconExpandedInfo=deserializer.GetObjectMin(D2L.Images.Image);this.m_iconExpandedDisabledInfo=deserializer.GetObjectMin(D2L.Images.Image);this.m_isExpanded=deserializer.GetBoolean();this.m_isSelected=deserializer.GetBoolean();var onClick=deserializer.GetMember();if(onClick&&onClick!=''){this.m_onClick=new Function(onClick);}
this.m_text=deserializer.GetMember();this.m_textFormat=deserializer.GetMember();this.m_data=deserializer.GetDictionaryMin('string','string');this.m_counts=deserializer.GetDictionaryMin('number','string');this.m_actions=deserializer.GetObjectArrayMin(D2L.Control.CustomSelectorItemAction);this.m_nodes=deserializer.GetObjectArrayMin(D2L.Control.TreeNode);var iconOnClick=deserializer.GetMember();if(iconOnClick&&iconOnClick!=''){this.m_iconOnClick=new Function(iconOnClick);}
this.m_href=deserializer.GetMember();this.m_navInfo=deserializer.GetObjectMin(D2L.NavInfo);},AddAction:function(action){action.m_parent=this;if(this.m_actionSpan){action.BuildDom();this.m_actionSpan.appendChild(action.GetDomNode());}
this.m_actions.push(action);},AppendChild:function(childNode){if(childNode&&childNode.GetControlType&&childNode.GetControlType()==D2L.Control.Type.TreeNode2){return arguments.callee.$.AppendChild.call(this,childNode);}else{return null;}},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('li'));this.GetDomNode().className='dtn';this.m_nodeDiv=this.CreateElement('div');this.m_nodeDiv.className='dtn_n';this.GetDomNode().appendChild(this.m_nodeDiv);this.m_stuffDiv=this.CreateElement('div');this.m_stuffDiv.className='dtn_s';this.m_nodeDiv.appendChild(this.m_stuffDiv);this.m_contentDiv=this.CreateElement('div');this.m_contentDiv.className='dtn_c';this.m_nodeDiv.appendChild(this.m_contentDiv);this.m_expandImg=this.CreateElement('img');this.m_stuffDiv.appendChild(this.m_expandImg);this.m_expandInput=this.CreateElement('input');this.m_expandInput.type='hidden';this.m_expandInput.value=this.GetKey();this.m_stuffDiv.appendChild(this.m_expandInput);this.m_iconImg=this.CreateElement('img');this.m_iconImg.style.display='none';this.m_iconImg.width=16;this.m_iconImg.height=16;this.m_stuffDiv.appendChild(this.m_iconImg);this.m_textLabel=this.CreateElement('label');this.m_textSpan=this.CreateElement('span');this.m_textSpan.innerHTML=this.GetText();if(this.m_textFormat==D2L.Control.TreeView.TextFormat.Bold){this.m_textSpan.className='dtn_bold';}
this.m_textLabel.appendChild(this.m_textSpan);this.m_countSpan=this.CreateElement('span');for(var type in this.m_counts){var span=this.CreateElement('span');span.className='dtn_c'+type;if(this.m_counts[type]!=0){span.className+=' dtn_cb';}
D2L.LP.Text.LangTerm.AssignText('FrameWork.TreeView.altCount'+type,span,'title');span.appendChild(document.createTextNode('('+this.m_counts[type]+')'));this.m_countSpan.appendChild(span);}
this.m_textLabel.appendChild(this.m_countSpan);this.m_actionSpan=this.CreateElement('span');for(var i in this.m_actions){this.m_actions[i].BuildDom();this.m_actionSpan.appendChild(this.m_actions[i].GetDomNode());}
this.m_textLabel.appendChild(this.m_actionSpan);this.m_contentDiv.appendChild(this.m_textLabel);this.IChildrenDomNode=this.CreateElement('ul');this.IChildrenDomNode.className='dtn_ch';this.GetDomNode().appendChild(this.IChildrenDomNode);var clrDiv=this.CreateElement('div');clrDiv.className='dtn_clr';this.GetDomNode().appendChild(clrDiv);this.SetNav(this.m_navInfo);}},InsertBefore:function(childNode,beforeNode){if(childNode&&childNode.GetControlType&&childNode.GetControlType()==D2L.Control.Type.TreeNode2){return arguments.callee.$.InsertBefore.call(this,childNode,beforeNode);}else{return null;}},InsertSorted:function(childNode){if(childNode&&childNode.GetControlType&&childNode.GetControlType()==D2L.Control.Type.TreeNode2){return arguments.callee.$.InsertSorted.call(this,childNode,D2L.Control.TreeView.IsGreaterThan);}else{return null;}},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_depth=(parent.GetControlType()==D2L.Control.Type.TreeNode2)?parent.m_depth+1:0;this.m_root=(parent.GetControlType()==D2L.Control.Type.TreeNode2)?parent.m_root:parent;this.m_countSpan=this.GetDomNode().childNodes[0].childNodes[1].childNodes[0].childNodes[1];this.m_actionSpan=this.GetDomNode().childNodes[0].childNodes[1].childNodes[0].childNodes[2];for(var i=0;i<this.m_actions.length;i++){this.m_actions[i].IntegrateChild(null,this.m_actionSpan.childNodes[i]);}
this.m_root.m_allNodes[this.GetKey()]=this;this.m_root.m_allNodesList.push(this);this.OnChildAdd.Register(this.m_root,'OnNodeAdd');this.OnChildRemove.Register(this.m_root,'OnNodeRemove');this.OnChildRemoveStructure.Register(this.m_root,'OnNodeRemoveStructure');var nodeDivIndex=0;this.m_nodeDiv=this.GetDomNode().childNodes[0];this.m_stuffDiv=this.m_nodeDiv.firstChild;this.m_contentDiv=this.m_nodeDiv.childNodes[1];if(this.m_nodes.length>0||this.m_expandMode==D2L.Control.TreeNode.ExpandMode.LoadOnDemand){this.m_expandAnchor=this.m_stuffDiv.childNodes[nodeDivIndex];this.m_expandImg=this.m_expandAnchor.childNodes[0];}else{this.m_expandImg=this.m_stuffDiv.childNodes[nodeDivIndex];}
nodeDivIndex++;this.m_expandInput=this.m_stuffDiv.childNodes[nodeDivIndex];nodeDivIndex++;if(this.m_hasSelection){this.m_selectionInput=this.m_stuffDiv.childNodes[nodeDivIndex];nodeDivIndex++;this.m_selectionHidden=this.m_stuffDiv.childNodes[nodeDivIndex];nodeDivIndex++;}
this.m_iconImg=this.m_stuffDiv.childNodes[nodeDivIndex];nodeDivIndex++;this.m_textLabel=this.m_contentDiv.childNodes[0];if(this.m_textLabel.childNodes[0].tagName.toLowerCase()=='a'){this.m_anchor=this.m_textLabel.childNodes[0];this.m_textSpan=this.m_anchor.childNodes[0];}else{this.m_textSpan=this.m_textLabel.childNodes[0];}
D2L.Control.TreeNode.InstallEvent_Click(this);D2L.Control.TreeNode.InstallEvent_Expand(this);D2L.Control.TreeNode.InstallEvent_Selection(this);this.IChildrenDomNode=this.GetDomNode().childNodes[1];for(var i=0;i<this.m_nodes.length;i++){this.m_nodes[i].IntegrateChild(this,this.IChildrenDomNode.childNodes[i]);this.m_numDescSel=this.m_numDescSel+this.m_nodes[i].m_numDescSel;if(this.m_nodes[i].IsSelected()){this.m_numDescSel++;}}},RemoveChild:function(childNode){if(!childNode){return null;}
var previousSibling=childNode.PreviousSibling();var nextSibling=childNode.NextSibling();childNode=arguments.callee.$.RemoveChild.call(this,childNode);if(childNode===null){return null;}
if(this.Children().length===0){this.m_isExpanded=false;this.RenderExpandImage();this.Render_Lines();}
if(this.m_root&&this.m_root.m_hasLines){if(previousSibling){previousSibling.Render_Lines();}
if(this.m_depth===0&&this.m_root&&this.m_root.Children().length==1&&nextSibling){nextSibling.Render_Lines();}}
return childNode;},AddNode:function(childNode){if(this.m_root&&this.m_root.AutoSort()){return this.InsertSorted(childNode);}else{return this.AppendChild(childNode);}},BuildAnchorDom:function(){if(this.m_root&&(this.m_root.GetType()==D2L.Control.TreeView.Type.Activation||this.m_onClick!==null)){if(!this.m_anchor){this.m_anchor=document.createElement('a');if(this.m_root.IsEnabled()){this.m_anchor.href=this.m_href;}
if(this.m_target==null||this.m_target==''){if(this.m_anchor.attributes.getNamedItem('target')){this.m_anchor.attributes.removeNamedItem('target');}}else{this.m_anchor.target=this.m_target;}
if(this.m_description!==null){this.m_anchor.title=this.m_description;}else if(this.m_root.GetType()==D2L.Control.TreeView.Type.Activation){D2L.LP.Text.LangTerm.AssignText('Framework.TreeView.lblActivateNode',this.m_anchor,'title');}
D2L.Control.TreeNode.InstallEvent_Click(this);this.m_anchor.appendChild(this.m_textSpan);this.m_textLabel.appendChild(this.m_anchor);}}else if(this.m_anchor){this.m_textLabel.appendChild(this.m_textSpan);D2L.Util.Purge(this.m_anchor);this.m_textLabel.removeChild(this.m_anchor);this.m_anchor=null;}},ExpandAllParents:function(){var parent=this.Parent();if(parent&&parent.GetControlType()==D2L.Control.Type.TreeNode2){parent.SetIsExpanded(true,false);parent.ExpandAllParents();}
if(this.m_root){this.m_root.AdjustOffsets();}},GetCount:function(type){if(this.m_counts[type]===undefined||this.m_counts[type]==null){return null;}else{return this.m_counts[type];}},GetData:function(key){return this.m_data[key];},GetExpandMode:function(){return this.m_expandMode;},GetKey:function(){return this.m_key;},GetNumDescendants:function(){if(this.m_numDesc===null){if(!this.m_root.AutoSelectChildren()&&this.GetExpandMode()==D2L.Control.TreeNode.ExpandMode.LoadOnDemand){return 1;}else{this.m_numDesc=this.Children().length;for(var i=0;i<this.Children().length;i++){this.m_numDesc+=this.Children()[i].GetNumDescendants();}}}
return this.m_numDesc;},GetOnClick:function(){return this.m_onClick;},GetText:function(){return this.m_text;},HasSelection:function(){if(this.m_hasSelection!==null){return this.m_hasSelection;}
return false;},IsExpanded:function(){return this.m_isExpanded;},IsSelected:function(){return this.m_isSelected;},LoadOnDemand:function(){var dr=new D2L.Util.DelayedReturn();if(this.m_root&&this.m_root.m_callbackUrl.length>0){var me=this;var sComm=new d2l_ServerComm();sComm.Url=this.m_root.m_callbackUrl+'&d2l_tv_cb='+UI.EncodeUrl(this.GetKey());sComm.CallbackFunction=function(output,status){var deserializer=new D2L.Serialization.JsonDeserializerMin(output);var nodes=deserializer.GetObjectArrayMin(D2L.Control.TreeNode);for(var i=0;i<nodes.length;i++){var node=me.m_root.GetNode(nodes[i].GetKey());if(node===null){node=nodes[i];}else{node.m_expandMode=nodes[i].m_expandMode;node.SetText(nodes[i].m_text);node.SetNav(nodes[i].m_navInfo);node.m_iconCollapsedInfo=nodes[i].m_iconCollapsedInfo;node.m_iconDisabledInfo=nodes[i].m_iconDisabledInfo;node.m_iconExpandedInfo=nodes[i].m_iconExpandedInfo;node.m_iconExpandedDisabledInfo=nodes[i].m_iconExpandedDisabledInfo;node.RenderIconImage();node.SetHasSelection(nodes[i].m_hasSelection);if(nodes[i].IsExpanded()){node.SetIsExpanded(nodes[i].m_isExpanded,false);}
if(me.m_root.AutoSelectChildren()&&me.IsSelected()){node.SetIsSelected(true);}else{node.SetIsSelected(nodes[i].IsSelected());}}
if(me.m_root.AutoSort()){me.InsertSorted(node);}else{me.AppendChild(node);}
me.m_root.AdjustOffsets();}
me.m_expandMode=D2L.Control.TreeNode.ExpandMode.Normal;me.SetIsExpanded(me.Children().length>0,true);me.RenderExpandImage();dr.Trigger(true);};D2L.Images.ImageTerm.Assign('Framework.TreeView2.actLoading',this.m_expandImg);sComm.Send();}else{dr.Trigger(true);}
return dr;},RenderExpandImage:function(){if(this.m_expandImg&&this.m_root){var showPlus=(this.Children().length>0||this.m_expandMode==D2L.Control.TreeNode.ExpandMode.LoadOnDemand);var disabledStr=showPlus&&!this.m_root.IsEnabled()?'Disabled':'';var expandStr=showPlus?((this.m_isExpanded)?'Collapse':'Expand'):'';if(showPlus){if(!this.m_expandAnchor){this.m_expandAnchor=this.CreateElement('a');this.m_expandAnchor.href='javascript://';this.m_expandAnchor.className='dtn_e';D2L.Control.TreeNode.InstallEvent_Expand(this);this.m_stuffDiv.insertBefore(this.m_expandAnchor,this.m_expandImg);this.m_expandAnchor.appendChild(this.m_expandImg);}}else{if(this.m_expandAnchor){this.m_stuffDiv.insertBefore(this.m_expandImg,this.m_expandInput);D2L.Util.Purge(this.m_expandAnchor);this.m_stuffDiv.removeChild(this.m_expandAnchor);this.m_expandAnchor=null;}}
var icon=expandStr+disabledStr;if(icon.length===0){this.m_expandImg.src='/d2l/img/lp/pixel.gif';this.m_expandImg.width=16;this.m_expandImg.height=16;this.m_expandImg.alt='';this.m_expandImg.title='';}else{D2L.Images.ImageTerm.Assign('Framework.TreeView2.act'+icon,this.m_expandImg);D2L.LP.Text.LangTerm.AssignText(this.m_isExpanded?'Framework.TreeView.lblCollapseNode':'Framework.TreeView.lblExpandNode',this.m_expandImg,'alt');D2L.LP.Text.LangTerm.AssignText(this.m_isExpanded?'Framework.TreeView.lblCollapseNode':'Framework.TreeView.lblExpandNode',this.m_expandImg,'title');}
this.m_nodeDiv.className=(this.m_isExpanded)?'dtn_n dtn_ne':'dtn_n';if(this.m_root.m_hasLines){for(var key in this.Children()){this.Children()[key].Render_Lines();}}}},RenderHref:function(){if(this.m_anchor){if(this.m_root&&this.m_root.IsEnabled()){this.m_anchor.href=this.m_href;}else{if(this.m_anchor.attributes.getNamedItem('href')){this.m_anchor.attributes.removeNamedItem('href');}}}},RenderIconImage:function(){if(this.m_iconImg&&this.m_root){var info=(this.IsExpanded()&&this.m_iconExpandedInfo!==null)?this.m_iconExpandedInfo:this.m_iconCollapsedInfo;if(!this.m_root.IsEnabled()){if(this.IsExpanded()&&this.m_iconExpandedDisabledInfo!==null){info=this.m_iconExpandedDisabledInfo;}else if(this.m_iconDisabledInfo!==null){info=this.m_iconDisabledInfo;}}
if(info!==null){this.m_iconImg.style.display='inline';info.Assign(this.m_iconImg);}else{this.m_iconImg.style.display='none';}
this.Render_Indent();}},RenderSelectionInput:function(recurse){if(recurse===undefined){recurse=false;}
if(this.m_root){if(this.HasSelection()&&!this.m_selectionInput&&!this.m_selectionHidden){this.m_selectionInput=document.createElement('input');this.m_selectionInput.type='checkbox';this.m_selectionInput.id=UI.GetUniqueHtmlId();this.m_textLabel.htmlFor=this.m_selectionInput.id;D2L.Control.TreeNode.InstallEvent_Selection(this);D2L.LP.Text.LangTerm.AssignText('Framework.TreeView.lblToggleNodeSelection',this.m_selectionInput,'title');this.m_stuffDiv.insertBefore(this.m_selectionInput,this.m_iconImg);this.m_selectionHidden=document.createElement('input');this.m_selectionHidden.type='hidden';this.m_stuffDiv.insertBefore(this.m_selectionHidden,this.m_iconImg);}else if(!this.HasSelection()&&this.m_selectionInput&&this.m_selectionHidden){D2L.Util.Purge(this.m_selectionInput);this.m_stuffDiv.removeChild(this.m_selectionInput);D2L.Util.Purge(this.m_selectionHidden);this.m_stuffDiv.removeChild(this.m_selectionHidden);this.m_selectionInput=null;this.m_selectionHidden=null;}
if(this.HasSelection()){this.m_selectionInput.disabled=!this.m_root.IsEnabled();this.m_selectionInput.checked=this.IsSelected();this.m_selectionHidden.name='';this.m_selectionHidden.value='';if(this.IsSelected()){var parentAllDescSel=false;var parent=this.Parent();while(parent.GetControlType()==D2L.Control.Type.TreeNode2){if(parent.IsSelected()&&parent.GetNumDescendants()==parent.m_numDescSel){parentAllDescSel=true;break;}else if(!parent.IsSelected()){break;}
parent=parent.Parent();}
if(!parentAllDescSel){var includeDesc=false;if(this.GetNumDescendants()>0||(this.m_root.AutoSelectChildren()&&this.GetExpandMode()==D2L.Control.TreeNode.ExpandMode.LoadOnDemand)){if(this.GetNumDescendants()==this.m_numDescSel){includeDesc=true;}}
this.m_selectionHidden.name=this.m_root.m_name+'_sk';this.m_selectionHidden.value=this.GetKey()+'~'+(includeDesc?'1':'0');}}}
if(recurse){for(var i=0;i<this.Children().length;i++){this.Children()[i].RenderSelectionInput();}}}},Render_Indent:function(){var selection=this.HasSelection()?16:0
var icon=(this.m_iconImg.style.display=='inline')?16:0;this.m_contentDiv.style.marginLeft=(22+selection+icon)+'px';},Render_Lines:function(){if(this.m_root){var showPlus=(this.Children().length>0||this.m_expandMode==D2L.Control.TreeNode.ExpandMode.LoadOnDemand);var linesStr='';if(this.m_root.m_hasLines){if(this.Parent()==this.m_root&&this.m_root.Children().length==1){if(showPlus){linesStr='r';}}else if(this.Parent()==this.m_root&&this.PreviousSibling()===null&&this.m_root.Children().length>1){linesStr='rb';}else if(this.IsLastSibling()){linesStr='tr';}else{linesStr='trb';}}
if(this.GetDomNode()){this.GetDomNode().className='dtn dtn_'+linesStr;}}},SelectAll:function(){var numChildrenWithSelection=0;for(var i=0;i<this.Children().length;i++){var child=this.Children()[i];if(child.HasSelection()&&!child.IsSelected()){numChildrenWithSelection++;child.m_isSelected=true;this.m_root.OnNodeSelectionChange.Trigger(child);}
child.SelectAll();}
var parent=this;while(parent&&parent.GetControlType()==D2L.Control.Type.TreeNode2){parent.m_numDescSel=parent.m_numDescSel+numChildrenWithSelection;parent=parent.Parent();}
this.RenderSelectionInput();for(var i=0;i<this.Children().length;i++){this.Children()[i].RenderSelectionInput();}},SelectAllParents:function(){var numWithSelection=0;var parent=this.Parent();while(parent&&parent.GetControlType()==D2L.Control.Type.TreeNode2){if(parent.HasSelection()&&!parent.IsSelected()){parent.m_numDescSel=parent.m_numDescSel+numWithSelection;numWithSelection++;parent.m_isSelected=true;this.m_root.OnNodeSelectionChange.Trigger(parent);}
parent=parent.Parent();}
parent=this;while(parent&&parent.GetControlType()==D2L.Control.Type.TreeNode2){parent.RenderSelectionInput();parent=parent.Parent();}},SetCount:function(type,count){var sort=function(a,b){return(a.Type-b.Type);};if(this.m_counts[type]===undefined){this.m_counts[type]=count;if(this.m_countSpan){var insertNode=null;for(var i=0;i<this.m_countSpan.childNodes.length;i++){var nodeType=this.m_countSpan.childNodes[i].className.substr(5,1);if(type<nodeType){insertNode=this.m_countSpan.childNodes[i];break;}}
var span=document.createElement('span');span.className='dtn_c'+type;if(count!=0){span.className+=' dtn_cb';}
span.appendChild(document.createTextNode('('+count+')'));for(var i in D2L.Control.TreeView.CountType){if(type==D2L.Control.TreeView.CountType[i]){D2L.LP.Text.LangTerm.AssignText('FrameWork.TreeView.altCount'+i,span,'title');break;}}
this.m_countSpan.insertBefore(span,insertNode);}}else{this.m_counts[type]=count;if(this.m_countSpan){for(var i=0;i<this.m_countSpan.childNodes.length;i++){var nodeType=this.m_countSpan.childNodes[i].className.substr(5,1);if(type==nodeType){var span=this.m_countSpan.childNodes[i];span.firstChild.data='('+count+')';span.className='dtn_c'+type;if(count!=0){span.className+=' dtn_cb';}
break;}}}}},SetData:function(key,value){this.m_data[key]=value;},SetDescription:function(desc){if(!desc||desc===undefined||!desc.isString){desc='';}
if(this.m_description!=desc&&this.m_anchor){this.m_anchor.title=desc;}
this.m_description=desc;},SetExpandMode:function(expandMode){this.m_expandMode=expandMode;this.Render_Lines();},SetHasSelection:function(hasSelection){if(!this.m_root||this.m_root.GetType()==D2L.Control.TreeView.Type.Selection){if(this.m_hasSelection!=hasSelection){if(!hasSelection){this.SetIsSelected(false);}}
this.m_hasSelection=hasSelection;this.RenderSelectionInput();}},SetImages:function(collapsedTerm,expandedTerm,collapsedDisabledTerm,expandedDisabledTerm){this.SetImageCollapsed(collapsedTerm,false);this.SetImageExpanded(expandedTerm,false);this.SetImageDisabled(collapsedDisabledTerm,expandedDisabledTerm,false);this.RenderIconImage();},SetImageCollapsed:function(collapsedTerm,doRender){if(doRender===undefined){doRender=true;}
if(collapsedTerm===null){this.m_iconCollapsedInfo=null;if(doRender){this.RenderIconImage();}}else{this.m_iconCollapsedInfo=collapsedTerm;if(doRender){this.RenderIconImage();}}},SetImageExpanded:function(expandedTerm,doRender){if(doRender===undefined){doRender=true;}
if(expandedTerm===null){this.m_iconExpandedInfo=null;if(doRender){this.RenderIconImage();}}else{this.m_iconExpandedInfo=expandedTerm;if(doRender){this.RenderIconImage();};}},SetImageDisabled:function(disabledTerm,expandedDisabledTerm,doRender){if(doRender===undefined){doRender=true;}
if(disabledTerm===null){this.m_iconDisabledInfo=null;if(doRender){this.RenderIconImage();}}else{this.m_iconDisabledInfo=disabledTerm;if(doRender){this.RenderIconImage();}}
if(expandedDisabledTerm===null){this.m_iconExpandedDisabledInfo=null;if(doRender){this.RenderIconImage();}}else{this.m_iconExpandedDisabledInfo=expandedDisabledTerm;if(doRender){this.RenderIconImage();}}},SetIsExpanded:function(isExpanded,doRender){var dr=new D2L.Util.DelayedReturn(true);if(doRender===undefined){doRender=true;}
if((this.m_root&&this.m_root.IsEnabled())||!this.m_root){if(this.m_expandMode==D2L.Control.TreeNode.ExpandMode.LoadOnDemand){dr=this.LoadOnDemand();}else if(this.Children().length>0){this.m_isExpanded=isExpanded;if(this.IChildrenDomNode){if(this.m_isExpanded){this.IChildrenDomNode.style.display='block';}else{this.IChildrenDomNode.style.display='none';}}
if(this.m_expandInput&&this.m_root){if(this.m_isExpanded){this.m_expandInput.name=this.m_root.m_name+'_expandedKeys';}else{this.m_expandInput.name='';}}
this.RenderExpandImage();this.RenderIconImage();if(doRender){this.m_root.AdjustOffsets();}}}
return dr;},SetIsSelected:function(isSelected){var changed=false;if(this.HasSelection()&&isSelected!=this.m_isSelected){changed=true;this.m_isSelected=isSelected;var parent=this.Parent();while(parent&&parent.GetControlType()==D2L.Control.Type.TreeNode2){if(isSelected){parent.m_numDescSel++;}else{parent.m_numDescSel--;}
parent=parent.Parent();}
var parent=this;while(parent&&parent.GetControlType()==D2L.Control.Type.TreeNode2){parent.RenderSelectionInput();for(var j=0;j<parent.Children().length;j++){parent.Children()[j].RenderSelectionInput();}
parent=parent.Parent();}
for(var i=0;i<this.Children().length;i++){this.Children()[i].RenderSelectionInput(true);}}
if(this.m_root){if(isSelected){if(this.m_root.AutoSelectChildren()){this.SelectAll();}
if(this.m_root.AutoSelectParents()){this.SelectAllParents();}}else if(this.m_root.AutoSelectChildren()){this.UnSelectAll();}}
if(this.m_root&&changed){this.m_root.OnNodeSelectionChange.Trigger(this);}},SetOnClick:function(onClick){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('TreeNode2.SetOnClick() is obsolete. '+'Please use SetNav() instead.'),true);if(onClick===undefined){onClick=null;}else if(onClick.isString){if(onClick.length>0){onClick=new Function(onClick);}else{onClick=null;}}
if(onClick){if(this.m_navInfo==null){this.m_navInfo=new D2L.NavInfo();}
this.m_navInfo.SetOnClick(onClick);this.SetNav(this.m_navInfo);}},SetNav:function(navInfo){if(navInfo){this.m_navInfo=navInfo;var navStruct=this.m_navInfo.SetupHrefOnClick(this);var iconNavStruct=this.m_navInfo.SetupHrefOnClick(this,false);if(navStruct.OnClick){this.m_onClick=navStruct.OnClick;}
this.m_href=navStruct.Href;this.m_target=navStruct.Target;if(iconNavStruct.OnClick){this.m_iconOnClick=iconNavStruct.OnClick;}
this.BuildAnchorDom();}},SetText:function(text){if(!text||text===undefined||!text.isString){text='';}
if(this.m_text!=text&&this.m_textSpan){this.m_textSpan.innerHTML=text;}
this.m_text=text;if(this.Parent()&&this.m_root&&this.m_root.AutoSort()){this.Parent().InsertSorted(this);}},SetTextFormat:function(textFormat){if(!textFormat||textFormat===undefined){textFormat=D2L.Control.TreeView.TextFormat.Normal;}
if(this.m_textFormat!=textFormat&&this.m_textSpan){if(textFormat==D2L.Control.TreeView.TextFormat.Bold){this.m_textSpan.className='dtn_bold';}else{this.m_textSpan.className='';}}
this.m_textFormat=textFormat;},ToggleIsExpanded:function(){this.SetIsExpanded(!this.m_isExpanded,true);},ToggleIsSelected:function(){this.SetIsSelected(!this.m_isSelected);},UnSelectAll:function(){for(var i=0;i<this.Children().length;i++){this.Children()[i].SetIsSelected(false);this.Children()[i].UnSelectAll();}}});D2L.TreeNode2=D2L.Control.TreeNode;D2L.Control.TreeNode.ExpandMode={Normal:0,LoadOnDemand:1};D2L.Control.TreeNode.InstallEvent_Click=function(node){var click=function(){if(node.m_root&&node.m_root.IsEnabled()){node.m_root.ActivateNode(node);if(node.m_onClick!==null){return node.m_onClick.call(node);}}
if(node.m_href.indexOf('javascript://')<0){return true;}else{return false;}};if(node.m_anchor){node.AttachObject(node.m_anchor,'onclick',function(evt){click();});}
if(node.m_iconImg){node.AttachObject(node.m_iconImg,'onclick',function(evt){click();});}
node.Click=function(){click();};};D2L.Control.TreeNode.InstallEvent_Selection=function(node){if(node.HasSelection()&&node.m_selectionInput){node.AttachObject(node.m_selectionInput,'onclick',function(evt){node.ToggleIsSelected();});}};D2L.Control.TreeNode.InstallEvent_Expand=function(node){if(node.m_expandAnchor){node.AttachObject(node.m_expandAnchor,'onclick',function(evt){node.ToggleIsExpanded();});}};

D2L.Control.Rating=D2L.Control.extend({Construct:function(name,key){arguments.callee.$.Construct.call(this,D2L.Control.Type.Rating);if(key===undefined){key='';}
this.m_ratingAverage=null;this.m_domKey=null;this.m_key=key;this.m_value=null;this.m_width=16;this.m_name=name;this.m_imgStars=[];this.m_clrOffset=0;this.m_subject="";this.m_averageName='';this.m_averageControlId=null;this.OnSetValue=new D2L.EventHandler();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_value=this.GetDomNode().previousSibling;this.m_domKey=this.GetDomNode().previousSibling.previousSibling;this.m_name=deserializer.GetMember();this.m_value.value=deserializer.GetMember();this.m_clrOffset=deserializer.GetMember();this.m_key=this.m_domKey.value;this.m_averageName=deserializer.GetMember();this.m_averageControlId=deserializer.GetObjectMin(D2L.Control.Id);this.m_subject=deserializer.GetMember();var onSetValue=deserializer.GetMember();if(this.m_value.value>=0&&this.m_value.value<6){this.GetDomNode().firstChild.style.width=(this.m_width*this.m_value.value)+"px";this.GetDomNode().firstChild.style.left=this.m_clrOffset+"px";var curRating="";if(this.m_subject===null){curRating=new D2L.LP.Text.LangTerm('Framework.Rating.altCurRating',this.m_value.value);curRating.AssignText(this.GetDomNode().firstChild,'innerHTML',true);}else{curRating=new D2L.LP.Text.LangTerm('Framework.Rating.altCurRatingSubj',this.m_subject,this.m_value.value);curRating.AssignText(this.GetDomNode().firstChild,'innerHTML',true);}}
var me=this;if(this.GetDomNode().childNodes[1]&&this.GetDomNode().childNodes[1].className.toLowerCase()=='drat_cl'){var clearAnchor=this.GetDomNode().childNodes[1].firstChild;if(clearAnchor){this.AttachObject(clearAnchor,'onclick',function(){me.SetValue(0);});this.AttachObject(clearAnchor,'onfocus',function(){clearAnchor.className='drat_claf';});this.AttachObject(clearAnchor,'onblur',function(){clearAnchor.className='';});}}
if(this.GetDomNode().childNodes.length>=5){for(var i=this.GetDomNode().childNodes.length-5;i<this.GetDomNode().childNodes.length;i++){this.m_imgStars.push(this.GetDomNode().childNodes[i].firstChild);}}
for(var i=0;i<this.m_imgStars.length;i++){this.m_imgStars[i].style.width=this.m_width+"px";this.m_imgStars[i].style.left=(this.m_clrOffset+(i*this.m_width))+"px";this.AttachObject(this.m_imgStars[i],'value',i+1);this.AttachObject(this.m_imgStars[i],'onclick',function(){me.m_imgStars[this.value-1].className='';me.SetValue(this.value);});this.AttachObject(this.m_imgStars[i],'onmouseover',function(){me.GetDomNode().firstChild.style.width="0px";me.m_imgStars[this.value-1].style.width=(this.value*me.m_width)+"px";me.m_imgStars[this.value-1].style.left=me.m_clrOffset+"px";me.m_imgStars[this.value-1].className='';});this.AttachObject(this.m_imgStars[i],'onmouseout',function(){me.GetDomNode().firstChild.style.width=(me.m_width*me.m_value.value)+"px";me.m_imgStars[this.value-1].style.width=me.m_width+"px";me.m_imgStars[this.value-1].style.left=(me.m_clrOffset+((this.value-1)*me.m_width))+"px";me.m_imgStars[this.value-1].className='';});this.AttachObject(this.m_imgStars[i],'onfocus',function(){me.GetDomNode().firstChild.style.width="0px";me.m_imgStars[this.value-1].style.width=(this.value*me.m_width)+"px";me.m_imgStars[this.value-1].style.left=me.m_clrOffset+"px";me.m_imgStars[this.value-1].className='drat_stl';});this.AttachObject(this.m_imgStars[i],'onblur',function(){me.GetDomNode().firstChild.style.width=(me.m_width*me.m_value.value)+"px";me.m_imgStars[this.value-1].style.width=me.m_width+"px";me.m_imgStars[this.value-1].style.left=(me.m_clrOffset+((this.value-1)*me.m_width))+"px";me.m_imgStars[this.value-1].className='';});}
if(onSetValue.length>0){this.OnSetValue.RegisterMethod(this.GetWindow()[onSetValue]);}else{this.OnSetValue.RegisterMethod(function(){WindowEventManager.BubbleChangeEvent(me.GetDomNode(),null);});}},Clear:function(){this.SetValue(0);},GetKey:function(){return this.m_key;},GetName:function(){return this.m_name;},GetValue:function(){return parseInt(this.m_value.value);},SetKey:function(key){this.m_key=key;if(this.m_domKey){this.m_domKey.value=key;}},SetValue:function(value,triggerChange){if(triggerChange===undefined){triggerChange=true;}
if(this.m_ratingAverage==null){if(this.m_averageName.length>0){this.m_ratingAverage=UI.GetByName(this.m_averageName);}else if(this.m_averageControlId!==null){this.m_ratingAverage=UI.GetControl(this.m_averageControlId.ID(),this.m_averageControlId.SID());}}
if(this.m_ratingAverage!==null){var oldValue=this.GetValue();if(oldValue!=value){if(oldValue===0){this.m_ratingAverage.AddRating(value);}else if(value===0){this.m_ratingAverage.RemoveRating(oldValue);}else{this.m_ratingAverage.UpdateRating(oldValue,value);}}}
if(value>=0&&value<6){this.GetDomNode().firstChild.style.width=(this.m_width*value)+"px";this.m_value.value=value;var curRating="";if(this.m_subject===null){curRating=new D2L.LP.Text.LangTerm('Framework.Rating.altCurRating',value);curRating.AssignText(this.GetDomNode().firstChild,'innerHTML',true);}else{curRating=new D2L.LP.Text.LangTerm('Framework.Rating.altCurRatingSubj',this.m_subject,value);curRating.AssignText(this.GetDomNode().firstChild,'innerHTML',true);}}
if(triggerChange){this.OnSetValue.Trigger(this);}}});D2L.Control.RatingAverage=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.RatingAverage);this.m_value=0;this.m_valueSpan=null;this.m_count=0;this.m_countSpan=null;this.m_subject=null;this.m_img1=null;this.m_img2=null;this.m_type=D2L.Control.RatingAverage.Type.Both;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_value=deserializer.GetMember();this.m_count=deserializer.GetMember();this.m_type=deserializer.GetMember();this.m_subject=deserializer.GetMember();if(this.m_type==D2L.Control.RatingAverage.Type.Graphical||this.m_type==D2L.Control.RatingAverage.Type.Both){this.m_img1=this.GetDomNode().firstChild.firstChild.firstChild;this.m_img2=this.GetDomNode().firstChild.childNodes[2];}
if(this.m_type==D2L.Control.RatingAverage.Type.Both){this.m_countSpan=this.GetDomNode().childNodes[2];}else if(this.m_type==D2L.Control.RatingAverage.Type.Textual){this.m_valueSpan=this.GetDomNode().childNodes[0];this.m_countSpan=this.GetDomNode().childNodes[2];}},AddRating:function(newValue){var total=(this.GetCount()*this.GetValue()+newValue);this.m_count++;this.RenderCount()
this.m_value=Math.round(((total)/this.GetCount())*100)/100;this.RenderValue();},GetCount:function(){return this.m_count;},GetValue:function(){return this.m_value;},RemoveRating:function(value){var total=(this.GetCount()*this.GetValue()-value);this.m_count--;this.RenderCount();if(this.GetCount()===0){this.m_value=0;}else{this.m_value=Math.round(((total)/this.GetCount())*100)/100;}
this.RenderValue();},RenderCount:function(){if(this.m_countSpan){if(this.GetCount()===0){D2L.LP.Text.LangTerm.AssignText('Framework.Rating.lblCountZero',this.m_countSpan,'innerHTML',true);}else if(this.GetCount()==1){D2L.LP.Text.LangTerm.AssignText('Framework.Rating.lblCountSingular',this.m_countSpan,'innerHTML',true);}else{var l=new D2L.LP.Text.LangTerm('Framework.Rating.lblCountPlural',this.GetCount());l.AssignText(this.m_countSpan,'innerHTML',true);}}},RenderValue:function(){if(this.GetValue()>=0&&this.GetValue()<6){if(this.m_type==D2L.Control.RatingAverage.Type.Graphical||this.m_type==D2L.Control.RatingAverage.Type.Both){var width=(16*Math.round(this.GetValue()));if(width===0){width=1;}
if(width==80){width=79;}
this.m_img1.width=width;this.m_img2.width=80-width;var curRating=null;if(this.m_subject!==null){curRating=new D2L.LP.Text.LangTerm('Framework.Rating.altAvRatingSubj',this.m_subject,this.m_value);}else{curRating=new D2L.LP.Text.LangTerm('Framework.Rating.altAvRating',this.m_value);}
curRating.AssignText(this.GetDomNode().firstChild.childNodes[1],'innerHTML',true);}}
if(this.m_type==D2L.Control.RatingAverage.Type.Textual){var l=new D2L.LP.Text.LangTerm('Framework.Rating.lblAverage',this.m_value);l.AssignText(this.m_valueSpan,'innerHTML',true);}},UpdateRating:function(oldValue,newValue){var total=(this.GetCount()*this.GetValue()-oldValue+newValue);this.m_value=Math.round(((total)/this.GetCount())*100)/100;this.RenderValue()}});D2L.Control.RatingAverage.Type={Textual:0,Graphical:1,Both:2};D2L.Rating=D2L.Control.Rating;D2L.RatingAverage=D2L.Control.RatingAverage;

D2L.Reorder={};D2L.Reorder.ReorderManager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_groups=[];},DeserializeMin:function(deserializer){this.m_groups=deserializer.GetObjectArrayMin(D2L.Reorder.ReorderManager.ItemGroupData);},Init:function(){for(var i=0;i<this.m_groups.length;i++){var group=UI.GetControl(this.m_groups[i].m_controlId.ID(),this.m_groups[i].m_controlId.SID());if(group){group.m_name=this.m_groups[i].m_name;for(var j=0;j<this.m_groups[i].m_items.length;j++){this.m_groups[i].m_items[j].IntegrateChild(group,UI.GetById(this.m_groups[i].m_items[j].m_myMappedId));}
group.Init();}}},GetGroup:function(groupName){groupName=groupName.toLowerCase();for(var i=0;i<this.m_groups.length;i++){if(this.m_groups[i].m_name==groupName){return UI.GetControl(this.m_groups[i].m_controlId.ID(),this.m_groups[i].m_controlId.SID());}}
return null;}});D2L.Reorder.ReorderManager.ItemGroupData=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_controlId=null;this.m_name='';this.m_items=[];},DeserializeMin:function(deserializer){this.m_controlId=deserializer.GetObjectMin(D2L.Control.Id);this.m_name=deserializer.GetMember();this.m_items=deserializer.GetObjectArrayMin(D2L.Control.ReorderItem);}});D2L.Control.ReorderItemGroup=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.ReorderItemGroup);this.m_name='';this.m_hasChangedHidden=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);},Init:function(){var c;for(var i=0;i<this.Children().length;i++){if(i===0){this.m_hasChangedHidden=this.CreateElement('input');this.m_hasChangedHidden.type='hidden';this.m_hasChangedHidden.name=this.m_name+'_hasChanged';this.Children()[i].GetDomNode().parentNode.insertBefore(this.m_hasChangedHidden,this.Children()[i].GetDomNode());}
var child=this.Children()[i];if(child.IsEnabled()){if(child.GetDomNode().remove){child.GetDomNode().remove(0);}else{}
c=-1;for(var j=0;j<this.Children().length;j++){if(i==j||this.Children()[j].IsEnabled()){c++;var option=document.createElement('option');option.appendChild(document.createTextNode(j+1));if(i==j){option.selected=true;child.m_prevSortOrder=(j+1);option.value=(j+1)+'_'+child.GetKey();}
child.GetDomNode().appendChild(option);}}}else{child.GetDomNode().innerHTML=(i+1);child.m_hidden.value=(i+1)+'_'+child.GetKey();}
if(this.m_hasChangedHidden.value.length>0){this.m_hasChangedHidden.value+=',';}
this.m_hasChangedHidden.value+=child.GetKey();}},GetItem:function(key){for(var i=0;i<this.Children().length;i++){if(this.Children()[i].GetKey()==key){return this.Children()[i];}}
return null;},Update:function(item,prevSortOrder,sortOrder){var temp;var i=item.m_prevSortOrder-1;var direction=(sortOrder>i)?1:-1;var offset=0;var j;while((i+1)!=sortOrder){offset=0;j=i+direction;while(j<this.Children().length&&j>-1&&!this.Children()[j].IsEnabled()){offset=offset+direction;j=j+direction;}
temp=this.Children()[i+direction+offset];this.Children()[i+direction+offset]=item;this.Children()[i]=temp;i=i+direction+offset;}
for(i=0;i<this.Children().length;i++){if(this.Children()[i].m_prevSortOrder!=(i+1)){this.Children()[i].m_prevSortOrder=0;this.Children()[i].SetSortOrder(i+1);}}}});D2L.Control.ReorderItem=D2L.Control.extend({Construct:function(key){arguments.callee.$.Construct.call(this,D2L.Control.Type.ReorderItem);this.m_hidden=null;this.m_isEnabled=true;this.m_key=key;this.m_prevSortOrder=0;this.m_myMappedId='';},DeserializeMin:function(deserializer){this.m_key=deserializer.GetMember();this.m_myMappedId=deserializer.GetMember();},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_isEnabled=(this.GetDomNode().tagName.toLowerCase()=='select')?!this.GetDomNode().disabled:false;if(!this.IsEnabled()){this.m_hidden=this.GetDomNode().previousSibling;}
var me=this;this.AttachObject(this.GetDomNode(),'onchange',function(){me.SetSortOrder(parseInt(this.options[this.selectedIndex].innerHTML));});},GetKey:function(){return this.m_key;},GetSortOrder:function(){if(this.IsEnabled()){return parseInt(this.GetDomNode().options[this.GetDomNode().selectedIndex].innerHTML);}else{return parseInt(this.GetDomNode().innerHTML);}},IsEnabled:function(){return this.m_isEnabled;},SetSortOrder:function(sortOrder){if(this.IsEnabled()){for(var i=0;i<this.GetDomNode().options.length;i++){if(parseInt(this.GetDomNode().options[i].innerHTML)==sortOrder){this.GetDomNode().selectedIndex=i;this.GetDomNode().options[i].value=sortOrder+'_'+this.GetKey();if(this.m_hidden){this.m_hidden.value=sortOrder+'_'+this.GetKey();}
WindowEventManager.BubbleChangeEvent(this.GetDomNode());if(this.m_prevSortOrder!==0){this.Parent().Update(this,this.m_prevSortOrder,sortOrder);}
this.m_prevSortOrder=sortOrder;break;}}}}});

D2L.Data={};D2L.Data.DataSource=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_count=0;this.m_index=-1;this.m_rawData=[];this.m_fields=[];},Deserialize:function(deserializer){this.m_fields=deserializer.GetMember('Fields');this.m_rawData=deserializer.GetMember('Data');this.m_count=this.m_rawData.length;},GetFields:function(){return this.m_fields;},GetFieldIndex:function(field){for(var i=0;i<this.m_fields.length;i++){if(this.m_fields[i]==field){return i;}}
return-1;},GetNumRows:function(){return this.m_count;},GetRow:function(){return this.m_index;},GetValue:function(field,type){if(this.IsEOF()){throw('DataSource has reached end of data.');}else{var fieldIndex=this.GetFieldIndex(field);if(fieldIndex<0){throw('DataSource does not contain field \''+field+'\'.');}
if(this.m_index==-1){this.MoveAhead();}
var rawValue=this.m_rawData[this.m_index][fieldIndex];return D2L.Serialization.JsonDeserializer.Deserialize(rawValue,type);}},IsEOF:function(){return(this.m_index>=this.m_count);},MoveAhead:function(num){if(num===undefined){num=1;}
this.m_index+=num;},Read:function(){this.m_index++;return!this.IsEOF();}});

D2L.Control.ProgressBar=D2L.Control.extend({Construct:function(progressId){arguments.callee.$.Construct.call(this,D2L.Control.Type.ProgressBar);this.m_pollInterval=3000;this.m_progress=0;this.m_progressId=0;this.m_status=D2L.Control.ProgressBar.ProgressStatus.NotStarted;this.m_total=0;this.m_domBar=null;this.m_domBarProgress=null;this.m_errorCode=null;this.m_errorMessage=null;this.m_steps=[];this.m_allowCancel=true;this.OnStatusChange=new D2L.EventHandler();if(progressId!==undefined){this.SetProgressId(progressId);}},BuildDom:function(){if(!this.m_hasDomBeenBuilt){arguments.callee.$.BuildDom.call(this);var me=this;this.IDomNode=this.CreateElement('span');this.IDomNode.className='dpb_c';this.m_domBar=this.CreateElement('span');this.m_domBar.className='dpb_s';this.m_domBarProgress=this.CreateElement('img');this.m_domBarProgress.className='dpb_p';this.m_domBarProgress.alt='0%';this.m_domBarProgress.src='/d2l/img/lp/pixel.gif';this.m_domBarProgress.style.display='none';this.m_domBarTotal=this.CreateElement('img');this.m_domBarTotal.className='dpb_b';this.m_domBarTotal.alt='';this.m_domBarTotal.src='/d2l/img/lp/pixel.gif';this.m_domBar.appendChild(this.m_domBarProgress);this.m_domBar.appendChild(this.m_domBarTotal);this.m_domCancel=this.CreateElement('a');this.m_domCancel.href='javascript://';this.AttachObject(this.m_domCancel,'onclick',function(){me.Cancel(true);});this.m_domCancel.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Framework.ProgressBar.lblCancel')));this.m_domCancel.style.paddingLeft='0.5em';this.m_domCancel.style.display='none';this.m_domMessage=this.CreateElement('span');this.m_domMessage.style.paddingLeft='0.5em';this.m_domMessage.style.display='none';this.m_domSteps=this.CreateElement('ul');this.m_domSteps.className='dpb_sl';this.IDomNode.appendChild(this.m_domBar);this.IDomNode.appendChild(this.m_domCancel);this.IDomNode.appendChild(this.m_domMessage);this.IDomNode.appendChild(this.m_domSteps);this.Render();}},Cancel:function(doRpc){if(doRpc===undefined){doRpc=false;}
this.SetStatus(D2L.Control.ProgressBar.ProgressStatus.Cancel);this.Render();if(doRpc&&this.m_progressId>0){D2L.Rpc.Create('Cancel',undefined,'/d2l/common/rpc/progress/progress.d2l').Call(this.m_progressId);}},Complete:function(){this.SetProgress(this.m_total);},Fail:function(errorCode,errorMessage){if(errorCode===undefined){errorCode=null;}
if(errorMessage===undefined||errorMessage.length===0){errorMessage=null;}
this.m_errorCode=errorCode;this.m_errorMessage=errorMessage;this.SetStatus(D2L.Control.ProgressBar.ProgressStatus.Fail);this.Render();},GetStatus:function(){return this.m_status;},GetErrorCode:function(){if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Fail){return this.m_errorCode;}
return null;},GetErrorMessage:function(){if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Fail){return this.m_errorMessage;}
return null;},OnStatusChangeEvent:function(){return this.OnStatusChange;},Render:function(){if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Fail||this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Cancel){this.IDomNode.className='dpb_c dpb_cd';}else{this.IDomNode.className='dpb_c';}
this.Render_Cancel();this.Render_Progress();this.Render_Message();this.Render_Steps();},Render_Cancel:function(){if(this.m_domCancel&&this.m_allowCancel){if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.InProgress){this.m_domCancel.style.display='inline';}else{this.m_domCancel.style.display='none';}}},Render_Progress:function(){if(this.m_domBar){var totalSrc='/d2l/img/lp/pixel.gif';var totalIsDisplayed=true;var progressIsDisplayed=true;var barIsDisplayed=true;if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.InProgress||this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.NotStarted||this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Complete){var percent=0;if(this.m_total>0){var percent=Math.round((this.m_progress/this.m_total)*100);var width=Math.round((percent/100)*28)*7;this.m_domBarProgress.alt=percent+'%';this.m_domBarProgress.title=percent+'%';this.m_domBarProgress.style.width=width+'px';}else{progressIsDisplayed=false;totalSrc='/d2l/img/lp/progressBar/a.gif';}}
this.m_domBarTotal.src=totalSrc;this.m_domBarTotal.style.display=(totalIsDisplayed)?'inline':'none';this.m_domBarProgress.style.display=(progressIsDisplayed)?'inline':'none';this.m_domBar.style.display=(barIsDisplayed)?'inline':'none';}},Render_Message:function(){if(this.m_domMessage){var term=null;if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.NotStarted){term=new D2L.LP.Text.LangTerm('Framework.ProgressBar.lblPleaseWait');this.m_domMessage.style.color='#000000';}else if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Cancel){term=new D2L.LP.Text.LangTerm('Framework.ProgressBar.lblCancelled');this.m_domMessage.style.color='#cc0000';}else if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Fail){if(this.m_errorMessage!==null){term=new D2L.LP.Text.LangTerm('Framework.ProgressBar.lblErrorWithMessage',this.m_errorMessage);}else{term=new D2L.LP.Text.LangTerm('Framework.ProgressBar.lblError');}
this.m_domMessage.style.color='#cc0000';}else if(this.GetStatus()==D2L.Control.ProgressBar.ProgressStatus.Complete){this.m_domMessage.style.color='#000000';term=new D2L.LP.Text.LangTerm('Framework.ProgressBar.lblComplete');}
if(term!==null){term.AssignText(this.m_domMessage,'innerHTML',true);this.m_domMessage.style.display='inline';}else{this.m_domMessage.style.display='none';}}},Render_Steps:function(){if(this.m_domSteps){for(var i=0;i<this.m_steps.length;i++){var step=this.m_steps[i];if(this.m_domSteps.childNodes.length<=i){this.m_domSteps.appendChild(this.CreateElement('li'));}
var domStep=this.m_domSteps.childNodes[i];var className='';if(step.Status==D2L.Control.ProgressBar.ProgressStatus.InProgress){className='dbp_sip';}else if(step.Status==D2L.Control.ProgressBar.ProgressStatus.Complete){className='dbp_sc'}
domStep.className=className;domStep.innerHTML=step.Title;}
this.m_domSteps.style.display=(this.m_steps.length>0)?'block':'none';}},SetAllowCancel:function(allowCancel){this.m_allowCancel=allowCancel;this.Render_Cancel();},SetProgressId:function(progressId){this.m_progressId=progressId;this.Start();},SetProgress:function(progress){if(progress>=this.m_total){progress=this.m_total;}
if(progress<0){progress=0;}
if(progress!=this.m_progress){if(progress==this.m_total){this.SetStatus(D2L.Control.ProgressBar.ProgressStatus.Complete);}else if(progress>0){this.SetStatus(D2L.Control.ProgressBar.ProgressStatus.InProgress);}
this.m_progress=progress;this.Render();}},SetStatus:function(status){if(this.GetStatus()!=status){this.m_status=status;this.OnStatusChange.Trigger(this.m_status);}},Start:function(){var me=this;var callback=function(response){if(response.GetResponseType()==D2L.Rpc.ResponseType.Success){var pbi=response.GetResult();me.m_total=pbi.Total;me.SetProgress(pbi.Progress);me.m_steps=pbi.Steps;me.Render_Steps();if(pbi.Status==D2L.Control.ProgressBar.ProgressStatus.Cancel){me.Cancel(false);}else if(pbi.Status==D2L.Control.ProgressBar.ProgressStatus.Fail){me.Fail(pbi.ErrorCode,pbi.ErrorMessage);}else if(pbi.Status==D2L.Control.ProgressBar.ProgressStatus.InProgress||pbi.Status==D2L.Control.ProgressBar.ProgressStatus.NotStarted){if(response.GetDuration()>=me.m_pollInterval){poll();}else{setTimeout(poll,(me.m_pollInterval-response.GetDuration()));}}}else{me.Cancel(false);}};var poll=function(){if(me.GetStatus()<D2L.Control.ProgressBar.ProgressStatus.Complete){D2L.Rpc.Create('GetProgressBar',callback,'/d2l/common/rpc/progress/progress.d2l').Call(me.m_progressId);}};poll();}});D2L.Control.ProgressBar.ProgressStatus={NotStarted:1,InProgress:2,Complete:3,Fail:4,Cancel:5};

D2L.Spreadsheet={};D2L.Spreadsheet.Manager=D2L.Class.extend({Construct:function(items){arguments.callee.$.Construct.call(this);this.m_col=-1;this.m_row=-1;this.m_records=[];var me=this;var HandleKeyPress=function(keyPressEvent){if(me.m_row>-1&&me.m_col>-1){var row=me.m_row;var col=me.m_col;var item=me.m_records[row][col];var isEditMode=(item.GetMode()==D2L.Spreadsheet.Item.Mode.Edit);var key=keyPressEvent.GetKey();var c=keyPressEvent.GetCharacter();if(key==D2L.KeyPressEvent.Key.Enter){keyPressEvent.Cancel();}
if(item.GetMode()==D2L.Spreadsheet.Item.Mode.ReadOnly){if(c.length===0){if(key==D2L.KeyPressEvent.Key.ArrowUp&&me.m_row!==0){row--;}else if(key==D2L.KeyPressEvent.Key.ArrowRight&&me.m_col<me.m_records[me.m_row].length-1){col++;}else if(key==D2L.KeyPressEvent.Key.ArrowDown&&me.m_row<me.m_records.length-1){row++;}else if(key==D2L.KeyPressEvent.Key.ArrowLeft&&me.m_col!==0){col--;}else if(key==D2L.KeyPressEvent.Key.Enter){isEditMode=true;}}else{isEditMode=true;}}else{if(key==D2L.KeyPressEvent.Key.Enter){isEditMode=false;if(me.m_row<me.m_records.length-1){item.GetDomNode().blur();row++;}}else if(key==D2L.KeyPressEvent.Key.Escape){isEditMode=false;}}
if(col>me.m_records[row].length-1){col=me.m_records[row].length-1;}
if(row!=me.m_row||col!=me.m_col){var item=me.m_records[row][col];if(isEditMode){item.GetDomNode().focus();}else{item.m_anchor.focus();}}else if(isEditMode&&item.GetMode()!==D2L.Spreadsheet.Item.Mode.Edit){if(c.length>0){if(item.GetDomNode().type=='text'){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){item.GetDomNode().value='';}else{item.GetDomNode().value=c;WindowEventManager.BC(item.GetDomNode());}}else if(item.GetDomNode().type=='checkbox'&&c==' '){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){item.GetDomNode().checked=!item.GetDomNode().checked;FormManager.ForceChange(item.GetDomNode());}}}
item.GetDomNode().focus();}else if(!isEditMode&&item.GetMode()==D2L.Spreadsheet.Item.Mode.Edit){item.GetDomNode().blur();item.m_anchor.focus();}}};WindowEventManager.KeyPress.RegisterMethod(HandleKeyPress);for(var i=0;i<items.length;i++){this.AddItem((items[i][0]=='1'),items[i][1],items[i][2]);}},AddItem:function(isNewRecord,itemDomNodeId,domNodeId){if(isNewRecord||this.m_records.length===0){this.m_records.push([]);}
var row=this.m_records.length-1;var record=this.m_records[this.m_records.length-1];var col=record.length;record.push(new D2L.Spreadsheet.Item(row,col,itemDomNodeId,domNodeId));},GetSelectedItem:function(){if(this.m_row>-1&&this.m_col>-1){return this.m_records[this.m_row][this.m_col]}
return null;},SetSelectedItem:function(row,col){var newItem=null;if(row>-1&&col>-1){newItem=this.m_records[row][col];}
var currItem=this.GetSelectedItem();if(currItem!=newItem&&currItem!==null){this.m_row=-1;this.m_col=-1;currItem.SetMode(D2L.Spreadsheet.Item.Mode.None);}
this.m_row=row;this.m_col=col;}});D2L.Spreadsheet.Item=D2L.Class.extend({Construct:function(row,col,itemDomNodeId,domNodeId){arguments.callee.$.Construct.call(this);this.m_domNode=null;this.m_domNodeId=domNodeId;this.m_mode=D2L.Spreadsheet.Item.Mode.None;this.m_anchor=UI.GetById(itemDomNodeId);this.m_anchor.href='javascript://';this.m_anchor.className='fgskip';this.m_itemDomNode=this.m_anchor.nextSibling;this.m_itemDomNode.className='dsh_c';this.m_row=row;this.m_col=col;var me=this;this.AttachObject(this.m_anchor,'onfocus',function(){me.GetDomNode();UI.SpreadsheetManager.SetSelectedItem(row,col);me.SetMode(D2L.Spreadsheet.Item.Mode.ReadOnly);});this.AttachObject(this.m_anchor,'onblur',function(){UI.SpreadsheetManager.SetSelectedItem(-1,-1);me.SetMode(D2L.Spreadsheet.Item.Mode.None);});this.AttachObject(this.m_itemDomNode,'onclick',function(){var selectedItem=UI.SpreadsheetManager.GetSelectedItem();if(selectedItem!=me){me.m_anchor.focus();}});this.AttachObject(this.m_itemDomNode,'onmouseover',function(){me.GetDomNode();if(me.GetMode()==D2L.Spreadsheet.Item.Mode.None){this.className='dsh_c dsh_c_h';}});this.AttachObject(this.m_itemDomNode,'onmouseout',function(){if(me.GetMode()==D2L.Spreadsheet.Item.Mode.None){this.className='dsh_c';}});},GetDomNode:function(){if(this.m_domNode==null){this.m_domNode=UI.GetById(this.m_domNodeId);var me=this;this.AttachObject(this.m_domNode,'onfocus',function(){var selectedItem=UI.SpreadsheetManager.GetSelectedItem();if(selectedItem!=me){UI.SpreadsheetManager.SetSelectedItem(me.m_row,me.m_col);}
me.SetMode(D2L.Spreadsheet.Item.Mode.Edit);});this.AttachObject(this.m_domNode,'onblur',function(){var selectedItem=UI.SpreadsheetManager.GetSelectedItem();if(selectedItem==me){UI.SpreadsheetManager.SetSelectedItem(-1,-1);me.SetMode(D2L.Spreadsheet.Item.Mode.None);}});}
return this.m_domNode;},GetMode:function(){return this.m_mode;},Render:function(){var className='dsh_c';if(this.m_mode==D2L.Spreadsheet.Item.Mode.ReadOnly){className+=' dsh_c_e';}else if(this.m_mode==D2L.Spreadsheet.Item.Mode.Edit){className+=' dsh_c_f';}
this.m_itemDomNode.className=className;},SetMode:function(mode){this.m_mode=mode;this.Render();}});D2L.Spreadsheet.Item.Mode={None:0,ReadOnly:1,Edit:2};

D2L.Control.LargeClassSize=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_viewType=0;this.m_groupTypeId=0;this.m_groupId=0;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_viewType=deserializer.GetMember();this.m_groupTypeId=deserializer.GetMember();this.m_groupId=deserializer.GetMember();},GetInfo:function(){return new D2L.Control.LargeClassSize.Info(this.m_viewType,this.m_groupTypeId,this.m_groupId);}});D2L.Control.LargeClassSize.Info=D2L.Class.extend({Construct:function(viewType,groupTypeId,groupId){arguments.callee.$.Construct.call(this);this.m_viewType=viewType;this.m_groupTypeId=groupTypeId;this.m_groupId=groupId;},GetViewType:function(){return this.m_viewType;},GetGroupTypeId:function(){return this.m_groupTypeId;},GetGroupId:function(){return this.m_groupId;}});D2L.Control.LargeClassSize.ViewType={None:0,Users:1,Groups:2,Sections:3};

D2L.Control.ActionBar=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.ActionBar);this.m_isVisible=true;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var cellIndex=0;var childIndex=-1;var children=deserializer.GetObjectArrayMin(D2L.Control.ActionBarItem);for(var i=0;i<children.length;i++){var domNode=null;childIndex++;if(this.GetDomNode().firstChild.firstChild.tagName.toLowerCase()=='ul'){if(i<this.GetDomNode().firstChild.firstChild.childNodes.length){domNode=this.GetDomNode().firstChild.firstChild.childNodes[i].firstChild;}else{domNode=this.GetDomNode().firstChild.childNodes[1].childNodes[i-this.GetDomNode().firstChild.firstChild.childNodes.length].firstChild;}}else{var row=this.GetDomNode().firstChild.firstChild.rows[0];while(cellIndex<3){if(row.cells[cellIndex].childNodes.length>0&&childIndex<row.cells[cellIndex].firstChild.rows[0].cells.length){domNode=row.cells[cellIndex].firstChild.rows[0].cells[childIndex].firstChild;if(domNode.className&&domNode.className.indexOf('dab_i')>-1){break;}else{domNode=null;}}
cellIndex++;childIndex=0;}}
children[i].IntegrateChild(this,domNode);}
this.UpdateVisibility();},GetItem:function(key){for(var i=0;i<this.Children().length;i++){if(this.Children()[i].GetKey()==key){return this.Children()[i];}}
return null;},Hide:function(){this.SetIsVisible(false);},IsVisible:function(){return this.m_isVisible;},SetIsVisible:function(isVisible){this.m_isVisible=isVisible;this.UpdateVisibility();},Show:function(){this.SetIsVisible(true);},UpdateVisibility:function(){if(this.IDomNode){var visibleChildren=false;for(var i=0;i<this.Children().length;i++){if(this.Children()[i].IsVisible()){visibleChildren=true;break;}}
if(!visibleChildren||!this.IsVisible()){this.IDomNode.style.display='none';}else if(visibleChildren&&this.IsVisible()){this.IDomNode.style.display='block';}}}});D2L.Control.ActionBarItem=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.ActionBarItem);this.m_isVisible=true;this.m_key='';this.m_text='';this.m_domImg=null;this.m_domText=null;this.m_anchor=null;this.m_navInfo=null;this.m_hasLink=false;},DeserializeMin:function(deserializer){this.m_key=deserializer.GetMember();this.m_text=deserializer.GetMember();this.m_isVisible=deserializer.GetBoolean();this.m_hasLink=deserializer.GetBoolean();},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_domImg=this.IDomNode.firstChild.childNodes[0];this.m_domText=this.IDomNode.firstChild.childNodes[1];this.m_separator=this.IDomNode.parentNode;this.m_anchor=this.IDomNode.firstChild;if(this.m_hasLink){this.InstallEvents();}},InstallEvents:function(){var me=this;var isDown=false;this.AttachObject(this.m_anchor,'onfocus',function(){if(!isDown){me.m_anchor.className='dab_o';}});this.AttachObject(this.m_anchor,'onmouseover',function(){if(!isDown){me.m_anchor.className='dab_o';}});this.AttachObject(this.m_anchor,'onmouseout',function(){isDown=false;me.m_anchor.className='';});this.AttachObject(this.m_anchor,'onblur',function(){me.m_anchor.className='';});this.AttachObject(this.m_anchor,'onmousedown',function(){isDown=true;me.m_anchor.className='dab_d';});this.AttachObject(this.m_anchor,'onmouseup',function(){isDown=false;me.m_anchor.className='';});},GetKey:function(){return this.m_key;},GetText:function(){return this.m_text;},Hide:function(){this.SetIsVisible(false);},IsVisible:function(){return this.m_isVisible;},SetDescription:function(description){description=D2L.LP.Text.IText.Normalize(description,'D2L.Control.ActionBarItem','SetDescription','description');if(this.m_anchor){description.AssignText(this.m_anchor,'title');}},SetImage:function(imageTerm){if(this.m_domImg){imageTerm.Assign(this.m_domImg);}},SetIsVisible:function(isVisible){if(this.IDomNode){this.IDomNode.style.display=(isVisible?'inline':'none');}
this.m_isVisible=isVisible;var firstVisibleItem=null;if(this.Parent()){for(var i=0;i<this.Parent().Children().length;i++){var child=this.Parent().Children()[i];if(firstVisibleItem===null&&child.IsVisible()){firstVisibleItem=child;child.IDomNode.className='dab_i';}else if(child.IsVisible()){child.IDomNode.className='dab_i dab_s';}else{child.IDomNode.className='dab_i';}}}
if(this.Parent()){this.Parent().UpdateVisibility();}},SetOnClick:function(onClick){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('ActionBarItem.SetOnClick() is '+'obsolete. Please use SetNav() instead.'),true);if(onClick){if(this.m_navInfo==null){this.m_navInfo=new D2L.NavInfo();}
this.m_navInfo.SetOnClick(onClick);this.SetNav(this.m_navInfo);}},SetNav:function(navInfo){if(navInfo){this.m_navInfo=navInfo;if(!this.m_hasLink){this.InstallEvents();this.m_hasLink=true;}
var navStruct=this.m_navInfo.SetupHrefOnClick(this);this.m_anchor.href=navStruct.Href;if(navStruct.Target==null||navStruct.Target==''){if(this.m_anchor.attributes.getNamedItem('target')){this.m_anchor.attributes.removeNamedItem('target');}}else{this.m_anchor.target=navStruct.Target;}
var me=this;if(navStruct.OnClick){var me=this;this.AttachObject(this.m_anchor,'onclick',function(){if(navStruct.OnClick){return navStruct.OnClick.call();}});}}},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.ActionBarItem','SetText','text');if(this.m_domText){if(this.m_domText.firstChild){D2L.Util.Purge(this.m_domText.firstChild);this.m_domText.removeChild(this.m_domText.firstChild);}
this.m_domText.appendChild(this.CreateTextNode(this.m_text));}},Show:function(){this.SetIsVisible(true);}});D2L.ActionBar=D2L.Control.ActionBar;D2L.ActionBarItem=D2L.Control.ActionBarItem;

D2L.Control.AreaList=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_domList=null;this.m_domArea=null;this.m_selectedItem=null;this.m_onBeforeSelectionChange=null;this.m_showChanges=false;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_domArea=YAHOO.util.Dom.getFirstChild(this.GetDomNode()).firstChild.firstChild;this.m_domList=YAHOO.util.Dom.getFirstChild(YAHOO.util.Dom.getChildren(this.GetDomNode())[1]);this.m_showChanges=deserializer.GetBoolean();var items=deserializer.GetObjectArrayMin(D2L.Control.AreaListItem);var children=YAHOO.util.Dom.getChildren(this.m_domList);var isAlternate=false;for(var i=0;i<items.length;i++){items[i].IntegrateChild(this,children[i]);items[i].m_isAlternate=isAlternate;if(items[i].IsSelected()){items[i].SetIsSelected(true,true);}
isAlternate=!isAlternate;}
if(deserializer.HasMember()){var onBeforeSelectionChange=deserializer.GetMember();if(window[onBeforeSelectionChange]!==undefined){this.m_onBeforeSelectionChange=window[onBeforeSelectionChange];}}},GetItem:function(key){key=key.toLowerCase();var children=this.Children();for(var i=0;i<children.length;i++){if(children[i].GetKey()==key){return children[i];}}
return null;},GetSelectedItem:function(){return this.m_selectedItem;},SelectItem:function(key){var item=this.GetItem(key);if(item!==null){item.SetIsSelected(true);}}});D2L.Control.AreaListItem=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_img=null;this.m_isSelected=false;this.m_key='';this.m_text=new D2L.LP.Text.PlainText();this.m_domAnchor=null;this.m_domSelected=null;this.m_domMargin=null;this.m_container=new D2L.Control.Container.IFrame();this.m_containerIsLoaded=false;this.m_isAlternate=false;this.m_hasChanged=false;},DeserializeMin:function(deserializer){this.m_img=deserializer.GetObjectMin(D2L.Images.Image);this.m_isSelected=deserializer.GetMember();this.m_key=deserializer.GetMember();this.m_text=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_container.SetSrc(deserializer.GetMember());},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_domAnchor=YAHOO.util.Dom.getFirstChild(this.GetDomNode());this.m_domMargin=YAHOO.util.Dom.getLastChild(this.m_domAnchor);if(this.IsSelected()){this.m_domSelected=YAHOO.util.Dom.getLastChild(this.m_domMargin);}
var me=this;var over=function(){if(!me.IsSelected()){me.m_domAnchor.className='dal_ih';}};var out=function(){me.m_domAnchor.className='';};this.AttachObject(this.m_domAnchor,'onclick',function(){me.SetIsSelected(true);});this.AttachObject(this.m_domAnchor,'onmouseover',over);this.AttachObject(this.m_domAnchor,'onfocus',over);this.AttachObject(this.m_domAnchor,'onmouseout',out);this.AttachObject(this.m_domAnchor,'onblur',out);this.m_container.SetIFrameTitle(this.GetText());if(this.Parent().m_showChanges){this.m_container.OnLoad.RegisterMethod(function(){var win=me.m_container.GetIFrameWindow();var ui=undefined;try{ui=win.UI;}catch(e){}
if(ui!==undefined){var fm=ui.GetFormManager();fm.OnChange.RegisterMethod(function(){me.m_hasChanged=true;me.Render();});fm.OnChangeReset.RegisterMethod(function(){me.m_hasChanged=false;me.Render();});}});}},GetAreaList:function(){return this.Parent();},GetKey:function(){return this.m_key;},GetSrc:function(){return this.m_container.GetSrc();},GetSrcWindow:function(){return this.m_container.GetIFrameWindow();},GetText:function(){return this.m_text;},IsSelected:function(){return this.m_isSelected;},Render:function(){if(this.IsRendered()){var className='';if(this.m_hasChanged){className='dal_ic';}else if(this.m_isAlternate){className='dal_ia';}
if(this.IsSelected()){if(className.length>0){className+=' ';}
className+='dal_is';}
this.GetDomNode().className=className;this.m_domAnchor.className='';if(this.IsSelected()){if(this.m_domSelected===null){this.m_domSelected=this.CreateElement('span');this.m_domSelected.className='dsr';this.m_domSelected.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Framework.AreaList.altSelected')));this.m_domMargin.appendChild(this.m_domSelected);}}else{if(this.m_domSelected!==null){D2L.Util.Purge(this.m_domSelected);this.m_domSelected.parentNode.removeChild(this.m_domSelected);this.m_domSelected=null;}}}},SetIsSelected:function(isSelected,byPass){if(byPass===undefined){byPass=false;}
if(isSelected!=this.IsSelected()||byPass){var me=this;var SelectMe=function(){if(isSelected){if(me.Parent().m_selectedItem!==null){me.Parent().m_selectedItem.SetIsSelected(false);}
me.Parent().m_selectedItem=me;}else if(!isSelected){me.Parent().m_selectedItem=null;}
if(me.IsRendered()){if(!me.m_containerIsLoaded){me.m_containerIsLoaded=true;me.m_container.AppendTo(me.Parent().m_domArea);me.m_container.Load();}
me.m_container.SetIsDisplayed(isSelected);}
me.m_isSelected=isSelected;me.Render();};if(isSelected&&this.Parent().m_onBeforeSelectionChange!==null){var result=this.Parent().m_onBeforeSelectionChange.apply(this.Parent().m_onBeforeSelectionChange,[this.Parent().GetSelectedItem(),this]);if(result===undefined||result===true){SelectMe();}else if(D2L.Util.IsDelayedReturn(result)){result.Register(function(pass){if(pass){SelectMe();}});}}else{SelectMe();}}},SetSrc:function(src){this.m_src=src;this.m_container.SetSrc(src);},SetSrcParam:function(name,value){this.m_container.SetSrcParam(name,value);}});

D2L.Control.AutoComplete=D2L.Control.extend({Construct:function(callback){arguments.callee.$.Construct.call(this);this.m_autoPopulateEdit=true;this.m_callback=callback;this.m_callbackDelayedReturn=null;this.m_callbackDelayedReturnHandler=null;this.m_highlightedMatchIndex=-1;this.m_ignoreKeysTimeout=null;this.m_ignoreCallbackData=false;this.m_isExpanded=false;this.m_inputDomNode=null;this.m_keypressPause=150;this.m_listDomNode=null;this.m_loadingDomNode=null;this.m_loadingOption=D2L.Control.AutoComplete.LoadingOption.DisplayPreviousMatches;this.m_loadingOptionTimeout=0;this.m_matchesInfo=null;this.m_prevInputValue=null;this.m_threshold=1;this.m_width=null;this.m_onHighlightMatch=null;this.m_OnCancel=null;this.m_onSelectMatch=null;},AddMatch:function(index){var me=this;var matchInfo=this.m_matchesInfo[index];var primaryD2LText=matchInfo.GetPrimaryText();var secondaryD2LText=matchInfo.GetSecondaryText();var listItem=this.CreateElement('li');listItem.className='dbvrac_i';listItem.id=index;this.AttachObject(listItem,'onmouseover',function(){me.HighlightMatch(parseInt(listItem.id),D2L.Control.AutoComplete.HeighlightSource.Mouse);});this.AttachObject(listItem,'onmousedown',function(){me.SelectMatch();return false;});if(primaryD2LText!=null){primaryD2LText.GetText().Register(function(primaryText){var primaryTextWithoutMatchKeyword='';var highlightLength=matchInfo.GetHighlightLength();if(highlightLength==-1){highlightLength=me.m_inputDomNode.value.length;}
var highlightStartIndex=matchInfo.GetHighlightStartIndex();if((highlightStartIndex+highlightLength)>primaryText.length){highlightLength=(primaryText.length-highlightStartIndex);}
preMatchKeyword=primaryText.substring(0,highlightStartIndex);matchKeyword=primaryText.substr(highlightStartIndex,highlightLength);postMatchKeyword=primaryText.substring((highlightStartIndex+highlightLength),primaryText.length);var primaryTextSpan=me.CreateElement('span');primaryTextSpan.className='dbvrac_it';if(preMatchKeyword.length>0){primaryTextSpan.appendChild(me.CreateTextNode(preMatchKeyword));}
if(matchKeyword.length>0){var matchKeywordSpan=me.CreateElement('span');matchKeywordSpan.className='dbvrac_im';matchKeywordSpan.appendChild(me.CreateTextNode(matchKeyword));primaryTextSpan.appendChild(matchKeywordSpan);}
if(postMatchKeyword.length>0){primaryTextSpan.appendChild(me.CreateTextNode(postMatchKeyword));}
listItem.appendChild(primaryTextSpan);if(secondaryD2LText!=null){primaryTextSpan.style.width='60%';var secondaryTextSpan=me.CreateElement('span');secondaryTextSpan.className='dbvrac_ic';secondaryTextSpan.innerHTML='&nbsp;';secondaryD2LText.GetText().Register(function(secondaryTextValue){if(secondaryTextValue&&secondaryTextValue.trim().length>0){me.AttachObject(secondaryTextSpan,'innerHTML',D2L.Util.Html.Encode(secondaryTextValue));}});listItem.appendChild(secondaryTextSpan);}else{if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){primaryTextSpan.style.styleFloat='none';}else{primaryTextSpan.style.cssFloat='none';}}
me.m_listDomNode.appendChild(listItem);});}},BuildDom:function(){if(!this.m_hasDomBeenBuilt){arguments.callee.$.BuildDom.call(this);}},BuildPanel:function(){this.IDomNode=this.CreateElement('div');this.IDomNode.className='dbvrac_c';this.IDomNode.style.zIndex=this.GetWindow()['UI'].GetZIndex();this.SetWidth(this.m_width);this.m_listDomNode=this.CreateElement('ul');this.m_listDomNode.className='dbvrac_l';this.m_listDomNode.style.width='100%';this.IDomNode.appendChild(this.m_listDomNode);if(this.m_inputDomNode!=null){var insertAfterDom=this.m_inputDomNode;var parent=insertAfterDom.parentNode;if(parent){var nextSibiling=insertAfterDom.nextSibling;if(nextSibiling){parent.insertBefore(this.GetDomNode(),nextSibiling);}else{parent.appendChild(this.GetDomNode());}}}},CallCallback:function(value){var me=this;if(this.m_callbackDelayedReturn!=null&&this.m_callbackDelayedReturnHandler!=null&&!this.m_callbackDelayedReturn.HasReturned()){this.m_callbackDelayedReturn.Unregister(this.m_callbackDelayedReturnHandler);}
this.m_ignoreCallbackData=false;if(this.m_loadingOption==D2L.Control.AutoComplete.LoadingOption.Hide){if(this.m_loadingOptionTimeout>0){setTimeout(function(){if(me.m_callbackDelayedReturn==null||!me.m_callbackDelayedReturn.HasReturned()){me.Collapse(false);}},this.m_loadingOptionTimeout);}else{this.Collapse(false);}}else if(this.m_loadingOption==D2L.Control.AutoComplete.LoadingOption.DisplayLoadingIcon){if(this.m_loadingOptionTimeout>0){setTimeout(function(){if(me.m_callbackDelayedReturn==null||!me.m_callbackDelayedReturn.HasReturned()){me.DisplayLoadingIcon();}},this.m_loadingOptionTimeout);}else{this.DisplayLoadingIcon();}}
var result=this.m_callback.call(this,value);if(result!=null){this.m_callbackDelayedReturn=result
this.m_callbackDelayedReturnHandler=function(matchesInfo){me.HandleCallbackReturn(matchesInfo);};this.m_callbackDelayedReturn.Register(this.m_callbackDelayedReturnHandler);}else{this.Collapse();}},Collapse:function(ignorePendingCallbacks){if(this.IDomNode!=null){if(ignorePendingCallbacks===undefined){ignorePendingCallbacks=true;}
var me=this;this.m_ignoreCallbackData=ignorePendingCallbacks;setTimeout(function(){me.m_isExpanded=false;},0);WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(false,this.IDomNode,null));this.IDomNode.style.display='none';}},DefaultOnCancelHandler:function(){if(this.m_autoPopulateEdit){this.m_inputDomNode.value=this.m_prevInputValue;}},DefaultOnHighlightMatchHandler:function(matchInfo,highlightSource){if(this.m_autoPopulateEdit){if(highlightSource==D2L.Control.AutoComplete.HeighlightSource.Keyboard){matchInfo.GetPrimaryText().AssignText(this.m_inputDomNode,'value');}}},DefaultOnSelectMatchHandler:function(matchInfo){if(this.m_autoPopulateEdit){var me=this;matchInfo.GetPrimaryText().GetText().Register(function(value){me.m_inputDomNode.value=value;me.m_prevInputValue=value;});}},DisplayLoadingIcon:function(){D2L.Util.Purge(this.m_listDomNode);while(this.m_listDomNode.hasChildNodes()){this.m_listDomNode.removeChild(this.m_listDomNode.firstChild);}
this.m_listDomNode.appendChild(this.m_loadingDomNode);this.SetPos();this.IDomNode.style.display='block';},Expand:function(){if(this.IDomNode!=null){WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(false,this.IDomNode,null));this.m_prevInputValue=this.m_inputDomNode.value;this.m_isExpanded=true;this.m_highlightedMatchIndex=-1;D2L.Util.Purge(this.m_listDomNode);while(this.m_listDomNode.hasChildNodes()){this.m_listDomNode.removeChild(this.m_listDomNode.firstChild);}
for(var i=0;i<this.m_matchesInfo.length;i++){this.AddMatch(i);}
this.SetPos();this.IDomNode.style.display='block';WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(true,this.IDomNode,null));}},GetThreshold:function(){return this.m_threshold;},HandleCallbackReturn:function(matchesInfo){this.m_matchesInfo=matchesInfo;if(this.m_matchesInfo==null||this.m_matchesInfo.length==0){this.Collapse(false);}else{if(!this.m_ignoreCallbackData){this.Expand();}}},HandleKeyPressEvents:function(obj,evt){var me=this;evt.StopPropagation();if(evt.GetKey()!=D2L.KeyPressEvent.Key.Escape&&evt.GetKey()!=D2L.KeyPressEvent.Key.Enter&&(evt.GetCharacter()!=''||evt.GetKey()==D2L.KeyPressEvent.Key.Delete||evt.GetKey()==D2L.KeyPressEvent.Key.Backspace)){if(this.m_ignoreKeysTimeout!=null){clearTimeout(this.m_ignoreKeysTimeout);}
this.m_ignoreKeysTimeout=setTimeout(function(){if(obj.value&&obj.value.length>=me.GetThreshold()){me.CallCallback(obj.value);}else{me.Collapse();}},this.m_keypressPause);return false;}else if(evt.GetKey()==D2L.KeyPressEvent.Key.Enter){if(this.IsExpanded()){evt.Cancel();this.SelectMatch();}
return false;}else if(evt.GetKey()==D2L.KeyPressEvent.Key.Escape){if(this.IsExpanded()){evt.Cancel();this.OnCancel().Trigger();this.Collapse();}
return false;}else if(evt.GetKey()==D2L.KeyPressEvent.Key.ArrowUp||evt.GetKey()==D2L.KeyPressEvent.Key.ArrowDown){evt.Cancel();if(evt.GetKey()==D2L.KeyPressEvent.Key.ArrowUp&&this.IsExpanded()){if(this.m_matchesInfo!=null){if(this.m_highlightedMatchIndex<=0){this.HighlightMatch(this.m_matchesInfo.length-1,D2L.Control.AutoComplete.HeighlightSource.Keyboard);}else{this.HighlightMatch(this.m_highlightedMatchIndex-1,D2L.Control.AutoComplete.HeighlightSource.Keyboard);}}}else if(evt.GetKey()==D2L.KeyPressEvent.Key.ArrowDown&&this.IsExpanded()){if(this.m_matchesInfo!=null){if(this.m_highlightedMatchIndex==this.m_matchesInfo.length-1){this.HighlightMatch(0,D2L.Control.AutoComplete.HeighlightSource.Keyboard);}else{this.HighlightMatch(this.m_highlightedMatchIndex+1,D2L.Control.AutoComplete.HeighlightSource.Keyboard);}}}
return false;}else{return true;}},HighlightMatch:function(index,highlightSource){if(index>=0&&this.m_highlightedMatchIndex!=index){if(highlightSource==undefined){highlightSource=D2L.Control.AutoComplete.HeighlightSource.Code;}
this.m_highlightedMatchIndex=index;for(var i=0;i<this.m_listDomNode.childNodes.length;i++){this.m_listDomNode.childNodes[i].className='dbvrac_i';}
if(index<this.m_listDomNode.childNodes.length&&index>=0){this.m_listDomNode.childNodes[index].className='dbvrac_is';}
this.OnHighlightMatch().Trigger(this.m_matchesInfo[this.m_highlightedMatchIndex],highlightSource);}},Install:function(edit){if(D2L.Util.IsD2LControl(edit)){edit=edit.GetDomNode();}
if(!this.m_inputDomNode){this.m_inputDomNode=edit;this.BuildPanel();this.m_prevInputValue=this.m_inputDomNode.value;this.m_inputDomNode.setAttribute('autocomplete','off');this.BuildDom();this.InstallEvents();this.OnHighlightMatch().Register(this,'DefaultOnHighlightMatchHandler');this.OnSelectMatch().Register(this,'DefaultOnSelectMatchHandler');this.OnCancel().Register(this,'DefaultOnCancelHandler');}else{D2L.Debug.Error('This AutoComplete object is already installed on another edit.');}},InstallEvents:function(){var me=this;this.GetWindow()['WindowEventManager'].InstallKpel(this.m_inputDomNode,function(obj,evt){me.HandleKeyPressEvents(obj,evt)});this.AttachObject(this.m_inputDomNode,'onblur',function(){me.Collapse(true);});},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var callback=deserializer.GetMember();var threshold=deserializer.GetMember();var width=deserializer.GetMember();this.SetCallback(this.GetWindow()[callback]);this.SetThreshold(threshold);if(width&&width!=0){this.SetWidth(width);}},IsExpanded:function(){return this.m_isExpanded;},OnHighlightMatch:function(){if(this.m_onHighlightMatch==null){this.m_onHighlightMatch=new D2L.EventHandler();}
return this.m_onHighlightMatch;},OnCancel:function(){if(this.m_OnCancel==null){this.m_OnCancel=new D2L.EventHandler();}
return this.m_OnCancel;},OnSelectMatch:function(){if(this.m_onSelectMatch==null){this.m_onSelectMatch=new D2L.EventHandler();}
return this.m_onSelectMatch;},SetAutoPopulateEdit:function(bool){this.m_autoPopulateEdit=bool;},SetCallback:function(callback){this.m_callback=callback;},SelectMatch:function(){if(this.m_highlightedMatchIndex>=0&&this.m_matchesInfo!=null&&this.m_highlightedMatchIndex<this.m_matchesInfo.length){var matchInfo=this.m_matchesInfo[this.m_highlightedMatchIndex];this.OnSelectMatch().Trigger(matchInfo);}
this.Collapse(true);},SetKeypressPause:function(ms){this.m_keypressPause=ms;},SetLoadingOption:function(option){if(option==D2L.Control.AutoComplete.LoadingOption.DisplayLoadingIcon&&this.m_loadingDomNode==null){this.m_loadingDomNode=this.CreateElement('li');this.m_loadingDomNode.className='dbvrac_il'
var img=this.CreateElement('img');img.src='/d2l/img/LP/dialog/loading.gif';this.m_loadingDomNode.appendChild(img);}
this.m_loadingOption=option;},SetLoadingTimeout:function(timeout){this.m_loadingOptionTimeout=timeout;},SetPos:function(){if(this.IDomNode!=null){var top=FindPosY(this.m_inputDomNode)+this.m_inputDomNode.offsetHeight+4;var left=FindPosX(this.m_inputDomNode);this.IDomNode.style.top=top+'px';this.IDomNode.style.left=left+'px';}},SetWidth:function(width){this.m_width=width;if(this.IDomNode!=null&&this.m_inputDomNode!=null){if(this.m_width==null){this.m_width=this.m_inputDomNode.offsetWidth;}
this.IDomNode.style.width=this.m_width+'px';}},SetThreshold:function(threshold){this.m_threshold=threshold;}});D2L.Control.AutoComplete.MatchInfo=D2L.Class.extend({Construct:function(primaryText,secondaryText){arguments.callee.$.Construct.call(this);primaryText=D2L.LP.Text.IText.Normalize(primaryText,'D2L.Control.AutoComplete.MatchInfo','Constructor','primaryText');secondaryText=D2L.LP.Text.IText.Normalize(secondaryText,'D2L.Control.AutoComplete.MatchInfo','Constructor','secondaryText');this.m_highlightLength=-1;this.m_highlightStartIndex=0;this.m_primaryText=primaryText;this.m_secondaryText=secondaryText;this.m_data=[];},GetHighlightLength:function(){return this.m_highlightLength;},GetHighlightStartIndex:function(){return this.m_highlightStartIndex;},GetSecondaryText:function(){return this.m_secondaryText;},GetData:function(key){return this.m_data[key];},GetPrimaryText:function(){return this.m_primaryText;},SetHighlightLength:function(length){this.m_highlightLength=length;},SetHighlightStartIndex:function(index){this.m_highlightStartIndex=index;},SetSecondaryText:function(secondaryText){if(secondaryText!=null){this.m_secondaryText=D2L.LP.Text.IText.Normalize(secondaryText,'D2L.Control.AutoComplete.MatchInfo','SetSecondaryText','secondaryText');}else{this.m_secondaryText=null;}},SetData:function(key,val){this.m_data[key]=val;},SetPrimaryText:function(primaryText){this.m_primaryText=D2L.LP.Text.IText.Normalize(primaryText,'D2L.Control.AutoComplete.MatchInfo','SetPrimaryText','primaryText');},Deserialize:function(deserializer){this.SetPrimaryText(deserializer.GetObject('PT',D2L.LP.Text.IText));this.SetSecondaryText(deserializer.GetObject('ST',D2L.LP.Text.IText));this.SetHighlightLength(deserializer.GetMember('HL'));this.SetHighlightStartIndex(deserializer.GetMember('HI'));this.m_data=deserializer.GetMember('D');}});D2L.Control.AutoComplete.LoadingOption={DisplayPreviousMatches:1,Hide:2,DisplayLoadingIcon:3}
D2L.Control.AutoComplete.HeighlightSource={Mouse:1,Keyboard:2,Code:3}

D2L.Control.Band=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Band);this.m_text=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_text=new D2L.LP.Text.PlainText(YAHOO.util.Dom.getFirstChild(this.GetDomNode()).innerHTML);},SetText:function(text){if(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Band','SetText','text');if(this.GetDomNode()&&YAHOO.util.Dom.getFirstChild(this.GetDomNode())){var me=this;this.m_text.GetText().Register(function(val){if(val.length>0){if(YAHOO.util.Dom.getFirstChild(me.GetDomNode()).firstChild){YAHOO.util.Dom.getFirstChild(me.GetDomNode()).firstChild.nodeValue=val;}else{YAHOO.util.Dom.getFirstChild(me.GetDomNode()).appendChild(me.CreateTextNode(val));}}});}}}});

D2L.Control.Calendar=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Calendar);this.m_displayedCalendarDays=[];this.m_eventDates=[];this.m_firstDayOfWeek=Culture.GetFirstDayOfWeek();this.m_firstMonthViewTable=null;this.m_highlightMode=D2L.Control.Calendar.HighlightMode.Day;this.m_horizontalAlignment=D2L.Style.HorizontalAlignment.Left;this.m_isRendered=false;this.m_getEventsCallback=null;this.m_loadedEventMonths=[];this.m_maxDate=new D2L.Util.DateTime(2200,12,31);this.m_minDate=new D2L.Util.DateTime(1900,1,1);this.m_monthsLongName=Culture.GetLongMonthNames();this.m_name='';this.m_noEarlierThanDate=null;this.m_noLaterThanDate=null;this.m_numDaysInMonths=[31,28,31,30,31,30,31,31,30,31,30,31];this.m_prevAnchor=null;this.m_nextAnchor=null;this.m_secondMonthViewTable=null;this.m_selectedDate=null;this.m_selectedDay=null;this.m_selectedDayInput=null;this.m_todayButton=null;this.m_today=new D2L.Util.DateTime.Today();this.m_type=D2L.Control.Calendar.Type.Single;this.m_weekdaysAbbrName=Culture.GetShortestDayOfWeekNames();this.m_weekdaysLongName=Culture.GetLongDayOfWeekNames();this.m_weekendDays=[D2L.Util.DateTime.DayOfWeek.Saturday,D2L.Util.DateTime.DayOfWeek.Sunday];this.OnSelectDate=new D2L.EventHandler();},BuildCalendar:function(month,year){this.m_isRendered=false;if(month===undefined&&year===undefined){if(this.GetSelectedDate()!=null){month=this.GetSelectedDate().GetMonth();year=this.GetSelectedDate().GetYear();}else{month=this.m_today.GetMonth();year=this.m_today.GetYear();}}
this.m_displayedCalendarDays=[];if(this.m_firstMonthViewTable!=null){this.GetDomNode().removeChild(this.m_firstMonthViewTable);this.m_firstMonthViewTable=null;}
if(this.m_secondMonthViewTable!=null){this.GetDomNode().removeChild(this.m_secondMonthViewTable);this.m_secondMonthViewTable=null;}
this.m_firstMonthViewTable=this.BuildMonth(month,year,true);this.AppendChild(this.m_firstMonthViewTable);if(this.GetType()==D2L.Control.Calendar.Type.Dual){var nextMonth;if(month==12){nextMonth=1;year=year+1;}else{nextMonth=month+1;}
this.m_secondMonthViewTable=this.BuildMonth(nextMonth,year,false);this.AppendChild(this.m_secondMonthViewTable);}
this.BuildTodayButton();this.BuildCalendarTitle();this.m_isRendered=true;},BuildCalendarTitle:function(){var me=this;var formatLongDate=function(date){return(me.m_monthsLongName[date.GetMonth()-1]+' '+date.GetDay()+', '+date.GetYear());}
var todayLongText=formatLongDate(this.m_today);if(this.GetSelectedDate()==null){var langTerm=new D2L.LP.Text.LangTerm('Framework.Calendar.altCalendarTitleNoSelected',todayLongText);if(this.m_firstMonthViewTable!=null){langTerm.AssignText(this.m_firstMonthViewTable,'summary');}
if(this.m_secondMonthViewTable!=null){langTerm.AssignText(this.m_secondMonthViewTable,'summary');}}else{var selectedLongText=formatLongDate(this.GetSelectedDate());var langTerm=new D2L.LP.Text.LangTerm('Framework.Calendar.altCalendarTitleWithSelected',selectedLongText,todayLongText);if(this.m_firstMonthViewTable!=null){langTerm.AssignText(this.m_firstMonthViewTable,'summary');}
if(this.m_secondMonthViewTable!=null){langTerm.AssignText(this.m_secondMonthViewTable,'summary');}}},BuildDay:function(date,calendarDayCell,isWeekendDay,weekOfMonth){var calendarDay=new D2L.Control.Calendar.Day(date,this,calendarDayCell,weekOfMonth);calendarDay.SetIsWeekendDay(isWeekendDay);if(this.GetNoEarlierThanDate()!=null){if(date.CompareTo(this.GetNoEarlierThanDate())==-1){calendarDay.SetIsUnavailable(true);}}
if(this.GetNoLaterThanDate()!=null){if(date.CompareTo(this.GetNoLaterThanDate())==1){calendarDay.SetIsUnavailable(true);}}
if(this.m_eventDates[date.GetTimestamp()]){calendarDay.SetHasEvents(true);}
if(date.CompareTo(this.m_today)==0){calendarDay.SetIsToday(true);}
calendarDay.Render();this.m_displayedCalendarDays[date.GetTimestamp()]=calendarDay;},BuildDom:function(){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('div'));if(this.m_horizontalAlignment==D2L.Style.HorizontalAlignment.Middle){this.GetDomNode().style.marginLeft='Auto';this.GetDomNode().style.marginRight='Auto';}else if(this.m_horizontalAlignment==D2L.Style.HorizontalAlignment.Right){this.GetDomNode().style.marginLeft='Auto';}
this.BuildSelectedDateHiddenInput();this.BuildCalendar();},BuildMonth:function(month,year,hasNavigation){var numDaysInMonth=this.GetNumDaysInMonth(month,year);var firstDayOfMonthDate=new D2L.Util.DateTime(year,month,1);var firstDayOfMonth=firstDayOfMonthDate.GetDayOfWeek();var monthName=this.m_monthsLongName[month-1];var calendarTable=this.CreateElement('table');if(this.m_horizontalAlignment==D2L.Style.HorizontalAlignment.Middle){calendarTable.style.marginLeft='Auto';calendarTable.style.marginRight='Auto';}else if(this.m_horizontalAlignment==D2L.Style.HorizontalAlignment.Right){calendarTable.style.marginLeft='Auto';}
calendarTable.className='dca_t';var calendarHeader=this.CreateElement('thead');var calendarHeaderMonthRow=this.CreateElement('tr');var calendarHeaderPrevCell=this.CreateElement('td');calendarHeaderPrevCell.colSpan=1;var calendarHeaderMonthNameCell=this.CreateElement('td');calendarHeaderMonthNameCell.colSpan=5;var calendarHeaderNextCell=this.CreateElement('td');calendarHeaderNextCell.colSpan=1;var captionSpan=this.CreateElement('span');captionSpan.className='dca_cap';captionSpan.appendChild(this.CreateTextNode(monthName+' '+year));calendarHeaderMonthNameCell.appendChild(captionSpan);var me=this;var nextMonth;var nextYear;if(month==12){nextMonth=1;nextYear=year+1;}else{nextMonth=month+1;nextYear=year;}
var moveNext=function(){me.BuildCalendar(nextMonth,nextYear);};var prevMonth;var prevYear;if(month==1){prevMonth=12;prevYear=year-1;}else{prevMonth=month-1;prevYear=year;}
var movePrev=function(){me.BuildCalendar(prevMonth,prevYear);};if(hasNavigation){var firstDayOfThisMonth=new D2L.Util.DateTime(year,month,1);var firstDayOfNextMonth=new D2L.Util.DateTime(nextYear,nextMonth,1);if((this.GetNoEarlierThanDate()==null||firstDayOfThisMonth.CompareTo(this.GetNoEarlierThanDate())>0)&&firstDayOfThisMonth.CompareTo(this.m_minDate)>0){if(this.m_prevAnchor==null){this.m_prevAnchor=this.CreateElement('a');this.m_prevAnchor.href='javascript://';var prevImage=this.CreateElement('img');D2L.Images.ImageTerm.Assign('Framework.Calendar.actPrev',prevImage);this.m_prevAnchor.appendChild(prevImage);}
var prevMonthLangTerm=new D2L.LP.Text.LangTerm('Framework.Calendar.altShowMonth',this.m_monthsLongName[prevMonth-1]);prevMonthLangTerm.AssignText(this.m_prevAnchor.firstChild,'title');prevMonthLangTerm.AssignText(this.m_prevAnchor.firstChild,'alt');calendarHeaderPrevCell.appendChild(this.m_prevAnchor);this.AttachObject(this.m_prevAnchor,'onclick',movePrev);}
if((this.GetNoLaterThanDate()==null||firstDayOfNextMonth.CompareTo(this.GetNoLaterThanDate())<=0)&&firstDayOfNextMonth.CompareTo(this.m_maxDate)<=0){if(this.m_nextAnchor==null){this.m_nextAnchor=this.CreateElement('a');this.m_nextAnchor.href='javascript://';var nextImage=this.CreateElement('img');D2L.Images.ImageTerm.Assign('Framework.Calendar.actNext',nextImage);this.m_nextAnchor.appendChild(nextImage);}
var nextMonthLangTerm=new D2L.LP.Text.LangTerm('Framework.Calendar.altShowMonth',this.m_monthsLongName[nextMonth-1]);nextMonthLangTerm.AssignText(this.m_nextAnchor.firstChild,'title');nextMonthLangTerm.AssignText(this.m_nextAnchor.firstChild,'alt');calendarHeaderNextCell.appendChild(this.m_nextAnchor);this.AttachObject(this.m_nextAnchor,'onclick',moveNext);}}
calendarHeaderMonthRow.appendChild(calendarHeaderPrevCell);calendarHeaderMonthRow.appendChild(calendarHeaderMonthNameCell);calendarHeaderMonthRow.appendChild(calendarHeaderNextCell);var calendarHeaderDaysRow=this.CreateElement('tr');for(var i=0;i<this.m_weekdaysAbbrName.length;i++){var calendarHeaderCell=this.CreateElement('th');calendarHeaderCell.className='dca_dch';var index=D2L.Util.Number.Mod(i+this.m_firstDayOfWeek,7);var calendarHeaderAbbr=this.CreateElement('abbr');calendarHeaderAbbr.style.borderBottomWidth='0px';calendarHeaderAbbr.appendChild(this.CreateTextNode(this.m_weekdaysAbbrName[index]));this.AttachObject(calendarHeaderAbbr,'title',this.m_weekdaysLongName[index]);calendarHeaderCell.appendChild(calendarHeaderAbbr);this.AttachObject(calendarHeaderCell,'abbr',this.m_weekdaysLongName[index]);calendarHeaderDaysRow.appendChild(calendarHeaderCell);}
calendarHeader.appendChild(calendarHeaderMonthRow);calendarHeader.appendChild(calendarHeaderDaysRow);var calendarBody=this.CreateElement('tbody');var numStartEmptyCells=D2L.Util.Number.Mod(firstDayOfMonth-this.m_firstDayOfWeek,7);var numCalendarRows=Math.ceil((numStartEmptyCells+numDaysInMonth)/7);var dayNumber=1;for(var i=0;i<numCalendarRows;i++){var calendarWeekRow=this.CreateElement('tr');for(var j=0;j<7;j++){var calendarDayCell=this.CreateElement('td');var isWeekendDay=this.IsWeekendDay(D2L.Util.Number.Mod(j+this.m_firstDayOfWeek,7));if(isWeekendDay){calendarDayCell.className='dca_dcwe';}else{calendarDayCell.className='dca_dc';}
if(j<numStartEmptyCells&&i==0){calendarDayCell.className=calendarDayCell.className+' dca_dce';}else if(dayNumber<=numDaysInMonth){var date=new D2L.Util.DateTime(year,month,dayNumber);dayNumber++;this.BuildDay(date,calendarDayCell,isWeekendDay,i+1);}else{calendarDayCell.className=calendarDayCell.className+' dca_dce';}
calendarWeekRow.appendChild(calendarDayCell);}
calendarBody.appendChild(calendarWeekRow);}
calendarTable.appendChild(calendarHeader);calendarTable.appendChild(calendarBody);if(this.GetSelectedDate()!=null&&this.GetSelectedDate().GetMonth()==month){this.SetSelectedDate(this.GetSelectedDate(),false,false);}
if(this.m_getEventsCallback!=null){if(this.m_loadedEventMonths[year+''+month]===undefined){var startDate=new D2L.Util.DateTime(year,month,1,0,0,0);var endDate=new D2L.Util.DateTime(year,month,numDaysInMonth,23,59,59);var delayedEventDates=this.m_getEventsCallback.call(this.m_getEventsCallback,this,startDate,endDate);if(delayedEventDates){delayedEventDates.Register(function(result){for(var i=0;i<result.length;i++){me.AddEventDate(result[i]);}});this.m_loadedEventMonths[year+''+month]=true;}else{D2L.Debug.Error('GetEventsCallback must retrun a delayed return');}}}
return calendarTable;},BuildSelectedDateHiddenInput:function(){this.m_selectedDayInput=this.CreateElement('input');this.m_selectedDayInput.type='hidden';if(this.m_name.length>0){this.m_selectedDayInput.name=this.m_name+'_sd';}else{this.m_selectedDayInput.name=this.GetMappedId()+'_sd';}
this.m_selectedDayInput.value='';this.GetDomNode().appendChild(this.m_selectedDayInput);},BuildTodayButton:function(){if(!((this.GetNoEarlierThanDate()!=null&&this.m_today.CompareTo(this.GetNoEarlierThanDate())==-1)||(this.GetNoLaterThanDate()!=null&&this.m_today.CompareTo(this.GetNoLaterThanDate())==1))){var me=this;var handleTodayOnClick=function(){me.SetSelectedDate(me.m_today,true,true);};this.m_todayButton=new D2L.Control.Button(new D2L.LP.Text.LangTerm('Framework.Calendar.btnToday'));this.m_todayButton.SetOnClick(handleTodayOnClick);var calendarFooter=this.CreateElement('tfoot');var calendarFooterRow=this.CreateElement('tr');var calendarFooterCell=this.CreateElement('td');calendarFooterCell.colSpan=7;calendarFooterCell.style.paddingTop='10px';this.AppendChild(this.m_todayButton,calendarFooterCell);calendarFooterRow.appendChild(calendarFooterCell);calendarFooter.appendChild(calendarFooterRow);if(this.m_secondMonthViewTable!=null){this.m_secondMonthViewTable.appendChild(calendarFooter);}else{this.m_firstMonthViewTable.appendChild(calendarFooter);}}},AddEventDate:function(date){date=new D2L.Util.DateTime(date.GetYear(),date.GetMonth(),date.GetDay());this.m_eventDates[date.GetTimestamp()]=true;var day=this.m_displayedCalendarDays[date.GetTimestamp()];if(day){day.SetHasEvents(true);}},GetHighlightMode:function(){return this.m_highlightMode;},GetNoEarlierThanDate:function(){return this.m_noEarlierThanDate;},GetNoLaterThanDate:function(){return this.m_noLaterThanDate;},GetNumDaysInMonth:function(month,year){var result;if(month!=2){result=this.m_numDaysInMonths[month-1];}else{if((year%4)!=0){result=28;}else if((year%400)==0){result=29;}else if((year%100)==0){result=28;}else{result=29;}}
return result;},GetSelectedDate:function(){return this.m_selectedDate;},GetType:function(){return this.m_type;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_name=deserializer.GetMember();this.BuildSelectedDateHiddenInput();this.SetType(deserializer.GetMember());this.SetHighlightMode(deserializer.GetMember());var convertToDateTime=function(dateString){var year=dateString.substr(0,4);var month=dateString.substr(4,2);var day=dateString.substr(6,2);if(month.indexOf("0")==0){month=month.substr(1,1);}
if(day.indexOf("0")==0){day=day.substr(1,1);}
var date=new D2L.Util.DateTime(parseInt(year),parseInt(month),parseInt(day));return date;};var ned=deserializer.GetMember();if(ned.length>0){this.SetNoEarlierThanDate(convertToDateTime(ned));}
var nld=deserializer.GetMember();if(nld.length>0){this.SetNoLaterThanDate(convertToDateTime(nld));}
var sd=deserializer.GetMember();if(sd.length>0){this.SetSelectedDate(convertToDateTime(sd),false,false);}
var os=deserializer.GetMember();if(os.length>0){var me=this;var onSelectDateTrigger=function(date){if(me.GetWindow()&&me.GetWindow()[os]){me.GetWindow()[os](date);}};this.OnSelectDate.RegisterMethod(onSelectDateTrigger);}
this.SetHorizontalAlignment(deserializer.GetMember());this.BuildCalendar();},IsWeekendDay:function(dayOfWeek){for(var i=0;i<this.m_weekendDays.length;i++){if(dayOfWeek==this.m_weekendDays[i]){return true;}}
return false;},RemoveEventDate:function(date){date=new D2L.Util.DateTime(date.GetYear(),date.GetMonth(),date.GetDay());this.m_eventDates[date.GetTimestamp()]=false;var day=this.m_displayedCalendarDays[date.GetTimestamp()];if(day){day.SetHasEvents(false);}},RemoveNoEarlierThanDate:function(){this.m_noEarlierThanDate=null;if(this.m_isRendered){this.BuildCalendar();}},RemoveNoLaterThanDate:function(){this.m_noLaterThanDate=null;if(this.m_isRendered){this.BuildCalendar();}},SetGetEventsCallback:function(callback){this.m_getEventsCallback=callback;if(this.m_isRendered){this.BuildCalendar();}},SetHighlightMode:function(highlightMode){this.m_highlightMode=highlightMode;if(this.m_isRendered&&this.GetSelectedDate()!=null){this.SetSelectedDate(this.GetSelectedDate(),false,false);}},SetHorizontalAlignment:function(hAlign){this.m_horizontalAlignment=hAlign;if(this.m_isRendered){this.BuildCalendar();}},SetNoEarlierThanDate:function(date){if(this.GetNoLaterThanDate()!=null&&date.CompareTo(this.GetNoLaterThanDate())==1){var error='Error: No earlier than date is set to a date latter than no later than date for calendar.'
UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText(error),true);D2L.Debug.Error(error);return;}
this.m_noEarlierThanDate=date;if(this.m_isRendered){this.BuildCalendar();if(this.GetSelectedDate()!=null){this.SetSelectedDate(this.GetSelectedDate(),true,false);}}},SetNoLaterThanDate:function(date){if(this.GetNoEarlierThanDate()!=null&&date.CompareTo(this.GetNoEarlierThanDate())==-1){var error='Error: No later than date is set to a date earlier than no earlier than date for calendar.'
UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText(error),true);D2L.Debug.Error(error);return;}
this.m_noLaterThanDate=date;if(this.m_isRendered){this.BuildCalendar();if(this.GetSelectedDate()!=null){this.SetSelectedDate(this.GetSelectedDate(),true,false);}}},SetSelectedDate:function(date,doNavigation,raiseOnSelectEvent){var i;if(doNavigation===undefined){doNavigation=true;}
if(raiseOnSelectEvent===undefined){raiseOnSelectEvent=true;}
if(this.GetNoEarlierThanDate()!=null&&date.CompareTo(this.GetNoEarlierThanDate())==-1){this.SetSelectedDate(this.GetNoEarlierThanDate(),doNavigation,raiseOnSelectEvent);return;}
if(this.GetNoLaterThanDate()!=null&&date.CompareTo(this.GetNoLaterThanDate())==1){this.SetSelectedDate(this.GetNoLaterThanDate(),doNavigation,raiseOnSelectEvent);return;}
this.m_selectedDate=date;if(this.IsRendered()){this.UpdateSelectedDateHiddenInput(date);var day=this.m_displayedCalendarDays[date.GetTimestamp()];if(day){this.BuildCalendarTitle();for(i in this.m_displayedCalendarDays){if(this.m_displayedCalendarDays[i].IsSelected()){this.m_displayedCalendarDays[i].SetIsSelected(false);}
if(this.m_displayedCalendarDays[i].IsHighlighted()){this.m_displayedCalendarDays[i].SetIsHighlighted(false);}
if(this.GetHighlightMode()==D2L.Control.Calendar.HighlightMode.Week&&day.GetWeekOfMonth()==this.m_displayedCalendarDays[i].GetWeekOfMonth()&&day.GetDate().GetMonth()==this.m_displayedCalendarDays[i].GetDate().GetMonth()&&day.GetDate().GetYear()==this.m_displayedCalendarDays[i].GetDate().GetYear()){this.m_displayedCalendarDays[i].SetIsHighlighted(true);}
if(this.GetHighlightMode()==D2L.Control.Calendar.HighlightMode.Month&&day.GetDate().GetMonth()==this.m_displayedCalendarDays[i].GetDate().GetMonth()&&day.GetDate().GetYear()==this.m_displayedCalendarDays[i].GetDate().GetYear()){this.m_displayedCalendarDays[i].SetIsHighlighted(true);}}
day.SetIsSelected(true);}else{if(doNavigation){this.BuildCalendar();}else{for(i in this.m_displayedCalendarDays){if(this.m_displayedCalendarDays[i].IsSelected()){this.m_displayedCalendarDays[i].SetIsSelected(false);}
if(this.m_displayedCalendarDays[i].IsHighlighted()){this.m_displayedCalendarDays[i].SetIsHighlighted(false);}}}}
if(raiseOnSelectEvent){this.OnSelectDate.Trigger(date);}}},SetType:function(type){this.m_type=type;if(this.m_isRendered){this.BuildCalendar();}},UpdateSelectedDateHiddenInput:function(date){var year=date.GetYear();var month=date.GetMonth();var day=date.GetDay();if(month<=9){month='0'+month;}
if(day<=9){day='0'+day;}
this.m_selectedDayInput.value=year+'/'+month+'/'+day;}});D2L.Control.Calendar.Day=D2L.Class.extend({Construct:function(date,calendar,domNode,weekOfMonth){arguments.callee.$.Construct.call(this);this.m_calendar=calendar;this.m_date=date;this.m_dayNumberLink=null;this.m_domNode=domNode;this.m_hasEvents=false;this.m_isHighlighted=false;this.m_isRendered=false;this.m_isSelected=false;this.m_isToday=false;this.m_isWeekendDay=false;this.m_isUnavailable=false;this.m_weekOfMonth=weekOfMonth
this.m_hiddenText=null;},GetDate:function(){return this.m_date;},GetWeekOfMonth:function(){return this.m_weekOfMonth;},HasEvents:function(){return this.m_hasEvents;},IsHighlighted:function(){return this.m_isHighlighted;},IsSelected:function(){return this.m_isSelected;},IsToday:function(){return this.m_isToday;},IsUnavilable:function(){return this.m_isUnavailable;},IsWeekendDay:function(){return this.m_isWeekendday;},Render:function(){this.m_isRendered=true;this.m_dayNumberLink=this.m_calendar.CreateElement('a');this.m_dayNumberLink.appendChild(this.m_calendar.CreateTextNode(this.m_date.GetDay().toString()));this.m_domNode.appendChild(this.m_dayNumberLink);this.Render_Link();this.Render_Cell();this.Render_HiddenText();},Render_Cell:function(){if(this.m_isRendered){if(this.m_isUnavailable){this.m_domNode.className='dca_dcu';}else if(this.m_isSelected){this.m_domNode.className='dca_dcsl';if(this.m_dayNumberLink!=null){this.m_dayNumberLink.className='dca_dl';}}else if(this.m_isHighlighted){this.m_domNode.className='dca_dch';}else if(this.m_isWeekendDay){this.m_domNode.className='dca_dcwe';}else{this.m_domNode.className='dca_dc';}
if(this.m_isToday){this.m_domNode.className=this.m_domNode.className+' dca_dct';}}},Render_HiddenText:function(){if(this.m_isRendered){var term='';if(this.m_isUnavailable){term='altUnavailable';}else if(this.m_isSelected){if(this.m_isToday){term='altTodaySelected'}else{term='altSelected';}}else if(this.m_isToday){term='altToday';}
if(term.length>0){term=new D2L.LP.Text.LangTerm('Framework.Calendar.'+term);if(this.m_hiddenText===null){this.m_hiddenText=this.m_calendar.CreateElement('span');this.m_hiddenText.className='dsr';this.m_dayNumberLink.appendChild(this.m_hiddenText);}
term.AssignText(this.m_hiddenText,'innerHTML',true);}else if(this.m_hiddenText!==null){D2L.Util.Purge(this.m_hiddenText);this.m_dayNumberLink.removeChild(this.m_hiddenText);this.m_hiddenText=null;}}},Render_Link:function(){if(this.m_isRendered){if(this.m_hasEvents){this.m_dayNumberLink.style.fontWeight='bold';}else{this.m_dayNumberLink.style.fontWeight='';}
if(this.m_isUnavailable){this.m_dayNumberLink.className='dca_dl';this.m_dayNumberLink.removeAttribute('href');this.m_dayNumberLink.removeAttribute('onfocus');this.m_dayNumberLink.removeAttribute('onblur');this.m_domNode.removeAttribute('onmouseover');this.m_domNode.removeAttribute('onmouseout');this.m_domNode.removeAttribute('onclick');}else{this.m_dayNumberLink.href='javascript://';this.m_dayNumberLink.className='dca_dl';var me=this;var handleOnFocus=function(){me.m_dayNumberLink.className='dca_dlf';};var handleOnBlur=function(){me.m_dayNumberLink.className='dca_dl';};var handleOnClick=function(){me.m_calendar.SetSelectedDate(me.m_date,false,true);return false;};this.m_calendar.AttachObject(this.m_dayNumberLink,'onfocus',handleOnFocus);this.m_calendar.AttachObject(this.m_dayNumberLink,'onblur',handleOnBlur);this.m_calendar.AttachObject(this.m_domNode,'onmouseover',handleOnFocus);this.m_calendar.AttachObject(this.m_domNode,'onmouseout',handleOnBlur);this.m_calendar.AttachObject(this.m_domNode,'onclick',handleOnClick);}}},SetHasEvents:function(val){this.m_hasEvents=val;this.Render_Link();},SetIsHighlighted:function(val){this.m_isHighlighted=val;this.Render_Cell();this.Render_HiddenText();},SetIsSelected:function(val){this.m_isSelected=val;this.Render_Cell();this.Render_HiddenText();},SetIsToday:function(val){this.m_isToday=val;this.Render_Cell();this.Render_HiddenText();},SetIsUnavailable:function(val){this.m_isUnavailable=val;this.Render_Link();this.Render_Cell();this.Render_HiddenText();},SetIsWeekendDay:function(val){this.m_isWeekendDay=val;this.Render_Cell();this.Render_HiddenText();}});D2L.Control.Calendar.Type={Single:1,Dual:2};D2L.Control.Calendar.HighlightMode={Day:1,Week:2,Month:3};

D2L.Control.Checkbox=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isChecked=false;this.m_isEnabled=true;this.m_value='True';this.m_text=null;this.m_showText=true;this.m_textLabel=null;this.m_fieldName='';this.m_onClick=function(){};var me=this;this.OnDomInsertion.RegisterMethod(function(){me.SetText(me.GetText());});},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);if(this.m_text===null){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Checkbox control missing '+'associated label. Use SetText() and SetShowText().'),true);}
this.SetDomNode(this.CreateElement('input'));this.AttachObject(this.IDomNode,'ID2L',this);this.GetDomNode().id=this.GetMappedId();if(this.GetFieldName().length>0){this.GetDomNode().name=this.GetFieldName();}else{this.GetDomNode().name=this.GetMappedId();}
this.GetDomNode().type='checkbox';this.GetDomNode().className='d_chb';var me=this;this.AttachObject(this.GetDomNode(),'onclick',function(evt){if(me.IsEnabled()){me.m_onClick.call(me);}
D2L.Util.Dom.CancelBubble(evt);});this.SetValue(this.m_value);this.SetIsChecked(this.m_isChecked);this.SetIsEnabled(this.IsEnabled());this.SetText(this.GetText());}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var hasText=deserializer.GetBoolean();this.m_showText=deserializer.GetBoolean();if(deserializer.HasMember()){this.GetDomNode().ID2L=null;}
if(hasText){if(this.m_showText){this.m_textLabel=this.GetDomNode().nextSibling;this.m_text=new D2L.LP.Text.PlainText(this.m_textLabel.innerHTML);}else{this.m_text=new D2L.LP.Text.PlainText(this.GetDomNode().title);}}
this.m_isChecked=this.GetDomNode().checked;this.m_isEnabled=!this.GetDomNode().disabled;this.m_value=this.GetDomNode().value;},Focus:function(){if(this.IsRendered()){this.GetDomNode().focus();}},GetFieldName:function(){return this.m_fieldName;},GetMultiEditValue:function(){return this.IsChecked()?'1':'0';},GetText:function(){return this.m_text;},GetValue:function(){if(this.IsRendered()){return this.GetDomNode().value;}else{return this.m_value;}},GetState:function(serializer){serializer.AddMember('IsChecked',this.IsChecked());serializer.AddMember('Val',this.GetValue());},IsChecked:function(){if(this.IsRendered()){return this.GetDomNode().checked;}else{return this.m_isChecked;}},IsEnabled:function(){return this.m_isEnabled;},SetFieldName:function(fieldName){this.m_fieldName=fieldName;},SetIsChecked:function(isChecked){this.m_isChecked=isChecked;if(this.IsRendered()){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<8){this.GetDomNode().defaultChecked=isChecked;}
this.GetDomNode().checked=isChecked;}},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){if(this.m_textLabel!==null){this.m_textLabel.className=(this.m_isEnabled)?'':'d_rdo_d';}
this.GetDomNode().disabled=!this.m_isEnabled;}},SetOnClick:function(onClick){this.m_onClick=onClick;},SetShowText:function(showText){if(showText!=this.m_showText&&this.IsRendered()){if(this.m_textLabel!==null){D2L.Util.Purge(this.m_textLabel);this.m_textLabel.parentNode.removeChild(this.m_textLabel);this.m_textLabel=null;}
this.GetDomNode().title='';}
this.m_showText=showText;this.SetText(this.GetText());},SetText:function(text){this.m_text=text;if(this.IsRendered()&&this.m_text!==null){if(this.ShowText()){if(this.m_textLabel===null&&this.GetDomNode().parentNode){this.m_textLabel=this.CreateElement('label');this.m_textLabel.className=(this.m_isEnabled)?'':'d_rdo_d';this.m_textLabel.htmlFor=this.GetMappedId();if(this.GetDomNode().nextSibling){this.GetDomNode().parentNode.insertBefore(this.m_textLabel,this.GetDomNode().nextSibling);}else{this.GetDomNode().parentNode.appendChild(this.m_textLabel);}}else if(this.m_textLabel!==null){while(this.m_textLabel.childNodes.length>0){this.m_textLabel.removeChild(this.m_textLabel.firstChild);}}
if(this.m_textLabel!==null){this.m_textLabel.appendChild(this.CreateTextNode(this.m_text));}}else{this.m_text.AssignText(this.GetDomNode(),'title');}}},SetValue:function(value){this.m_value=value;if(this.IsRendered()){this.GetDomNode().value=value;}},ShowText:function(){return this.m_showText;}});

D2L.Control.ColourPicker=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.ColourPicker);this.m_canEdit=true;this.m_colourBox=null;this.m_colours=[];this.m_hasNone=false;this.m_imgDrop=null;this.m_isAdvanced=true;this.m_ignoreHide=false;this.m_isDisplayed=true;this.m_isEnabled=true;this.m_isShown=false;this.m_value='ffffff';this.m_selectedColourBox=null;this.m_valueHidden=null;this.m_originalValueHidden=null;this.m_hexPreview=null;this.m_hexInput=null;this.m_container=null;this.m_srHelp=null;},BuildDom_ColourTable:function(){if(this.m_container===null&&this.m_canEdit){var me=this;this.m_container=new D2L.Control.Container.Floating();var border=new D2L.Style.BorderInfo();border.SetWidth(1);border.SetStyle(D2L.Style.BorderStyle.Solid);border.SetColour('#999999');this.m_container.SetBorder(border);var row,cell,anchor,img;var div=this.CreateElement('div');div.className='dcp_ct';div.style.padding='2px';this.AttachObject(div,'onclick',function(e){me.m_ignoreHide=true;});var table=this.CreateElement('table');table.cellSpacing=5;if(this.m_hasNone){row=table.insertRow(-1);cell=row.insertCell(-1);cell.colSpan=8;cell.style.textAlign='center';this.BuildDom_ColourBox(cell,'',new D2L.LP.Text.LangTerm('Framework.ColourPicker.lblNoColour'),'100%',new D2L.LP.Text.LangTerm('Framework.ColourPicker.lblNone'),false);}
var count=0;for(var i=0;i<this.m_colours.length;i++){if(count%8===0){row=table.insertRow(-1);}
var alt=this.GetColourDescription(this.m_colours[i]);cell=row.insertCell(-1);cell.style.width='12px';cell.style.height='12px';this.BuildDom_ColourBox(cell,this.m_colours[i],alt,12,null,false);count++;}
while(count%8!==0){cell=row.insertCell(-1);count++;}
if(this.m_isAdvanced){row=table.insertRow(-1);cell=row.insertCell(-1);cell.colSpan=8;var table2=this.CreateElement('table');cell.appendChild(table2);row=table2.insertRow(-1);cell=row.insertCell(-1);var hexLabel=this.CreateElement('label');hexLabel.forId=UI.GetUniqueHtmlId();hexLabel.appendChild(this.CreateTextNode('HEX: # '));cell.appendChild(hexLabel);cell=row.insertCell(-1);this.m_hexInput=this.CreateElement('input');this.m_hexInput.type='text';this.m_hexInput.size=6;this.m_hexInput.maxLength=6;this.m_hexInput.id=hexLabel.forId;this.m_hexInput.value=this.m_value;cell.appendChild(this.m_hexInput);this.m_hexPreview=this.CreateElement('span');this.BuildDom_ColourBox(this.m_hexPreview,this.m_value,new D2L.LP.Text.LangTerm('Framework.ColourPicker.altChooseHex'),12,null,true);var anchor=this.CreateElement('a');anchor.href='javascript://';anchor.style.margin='5px 0px';D2L.LP.Text.LangTerm.AssignText('Framework.ColourPicker.altPreviewHex',anchor,'title');this.AttachObject(anchor,'onclick',function(){if(me.m_hexInput.value.match(/^[a-fA-F0-9]{6}$/)!==null){me.m_hexPreview.firstChild.style.background='#'+me.m_hexInput.value;me.m_hexPreview.firstChild.value=me.m_hexInput.value;}});cell=row.insertCell(-1);cell.appendChild(anchor);var img=this.CreateElement('img');D2L.Images.ImageTerm.Assign('Framework.ColourPicker.actCopy',img);anchor.appendChild(img);cell=row.insertCell(-1);cell.appendChild(this.m_hexPreview);}
div.appendChild(table);this.m_container.AppendChild(div);}},BuildDom_ColourBox:function(box,colour,title,width,text,isAdvanced){var me=this;var anchor=this.CreateElement('a');anchor.href='javascript://';anchor.style.display='block';anchor.style.border='1px solid #999999';if(colour.length>0){anchor.style.backgroundColor='#'+colour;}else{if(!isAdvanced){anchor.style.backgroundColor='#ffffff';}else{anchor.style.background='url(/d2l/img/lp/transparent.gif)';}}
this.AttachObject(anchor,'value',colour);this.AttachObject(anchor,'onclick',function(){this.style.borderColor='#000000';if(me.m_selectedColourBox){me.m_selectedColourBox.style.borderColor='#999999';}
me.m_selectedColourBox=this;me.SetValue(this.value);});this.AttachObject(anchor,'onmouseover',function(){this.style.borderColor='#000000';});this.AttachObject(anchor,'onmouseout',function(){if(this.value!=me.m_value){this.style.borderColor='#999999';}});if(colour==this.m_value&&!isAdvanced){anchor.style.borderColor='#000000';this.m_selectedColourBox=anchor;}
if(text===null){var img=this.CreateElement('img');img.src='/d2l/img/lp/pixel.gif';img.style.width=width;img.height=12;title.AssignText(img,'title');title.AssignText(img,'alt');anchor.appendChild(img);}else{anchor.appendChild(this.CreateTextNode(text));}
box.appendChild(anchor);},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_canEdit=deserializer.GetBoolean();this.m_colours=deserializer.GetMember();this.m_isAdvanced=deserializer.GetBoolean();this.m_isEnabled=deserializer.GetBoolean();this.m_hasNone=deserializer.GetBoolean();this.m_isDisplayed=deserializer.GetBoolean();this.m_originalValueHidden=this.GetDomNode().childNodes[0];this.m_valueHidden=this.GetDomNode().childNodes[1];this.m_srHelp=this.GetDomNode().childNodes[3];this.m_colourBox=this.GetDomNode().childNodes[4];if(this.CanEdit()){this.m_imgDrop=this.GetDomNode().childNodes[5];if(!this.IsEnabled()){this.m_imgDrop.style.display='none';}}
this.m_value=this.m_valueHidden.value;this.InstallEvents();},InstallEvents:function(){if(!this.CanEdit()){return;}
var me=this;var domNode=this.GetDomNode();var over=function(){if(me.IsEnabled()&&!me.m_isShown){this.className='dcp_c dcp_ch';}};var out=function(){if(me.IsEnabled()&&!me.m_isShown){this.className='dcp_c';}};this.AttachObject(domNode,'onfocus',over);this.AttachObject(domNode,'onblur',out);this.AttachObject(domNode,'onmouseover',over);this.AttachObject(domNode,'onmouseout',out);this.AttachObject(domNode,'onclick',function(e){if(!me.IsEnabled()){return;}
D2L.Util.Dom.CancelBubble(e);if(me.m_isShown){me.HideColourTable();}else{WindowEventManager.Click.Trigger(new D2L.Event('click',e));me.ShowColourTable();}});WindowEventManager.Click.RegisterMethod(function(){me.HideColourTable();});},CanEdit:function(){return this.m_canEdit;},GetOriginalValue:function(){return this.m_originalValueHidden.value;},GetColourDescription:function(hex){var alt=null;if(UI.GetLanguageManager().HasTerm('Framework.ColourPicker.alt'+hex)){alt=new D2L.LP.Text.LangTerm('Framework.ColourPicker.alt'+hex);}else{alt=new D2L.LP.Text.PlainText('#'+hex);}
return alt;},GetState:function(serializer){serializer.AddMember('Value',this.GetValue());serializer.AddMember('OriginalValue',this.GetOriginalValue());},GetValue:function(){return this.m_value;},HideColourTable:function(){if(this.IsEnabled()&&this.m_isShown&&!this.m_ignoreHide){if(this.m_container){this.m_container.Hide();}
this.GetDomNode().className='dcp_c';this.m_isShown=false;}
this.m_ignoreHide=false;},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){return this.m_isEnabled;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'inline':'none';}
this.m_isDisplayed=isDisplayed;},SetIsEnabled:function(isEnabled){if(isEnabled!=this.m_isEnabled&&this.CanEdit()){this.m_isEnabled=isEnabled;if(isEnabled){this.GetDomNode().href='javascript://';D2L.LP.Text.LangTerm.AssignText('Framework.ColourPicker.altChangeColour',this.GetDomNode(),'title');this.m_imgDrop.style.display='inline';}else{if(this.GetDomNode().attributes.getNamedItem('href')){this.GetDomNode().attributes.removeNamedItem('href');}
this.GetDomNode().title='';this.m_imgDrop.style.display='none';}}},SetValue:function(value,triggerChange){if(triggerChange===undefined){triggerChange=true;}
if(value===undefined||value.length===0){if(this.m_hasNone){value='';}else{value='ffffff';}}
if(this.m_hexInput&&this.m_hexPreview){this.m_hexInput.value=value;this.m_hexPreview.firstChild.value=this.m_hexInput.value;if(value.length>0){this.m_hexPreview.firstChild.style.background='#'+value;var alt=this.GetColourDescription(value);alt.AssignHtml(this.m_srHelp,'innerHTML');}else{this.m_hexPreview.firstChild.style.background='url(/d2l/img/lp/transparent.gif)';D2L.LP.Text.LangTerm.AssignHtml('Framework.ColourPicker.lblNone',this.m_srHelp,'innerHTML');}}
this.m_value=value;this.m_valueHidden.value=value;if(value.length>0){this.m_colourBox.style.backgroundColor='#'+value;this.m_colourBox.style.backgroundImage='';}else{this.m_colourBox.style.backgroundColor='';this.m_colourBox.style.backgroundImage='url(/d2l/img/lp/transparent.gif)';}
this.HideColourTable();if(triggerChange){WindowEventManager.BC(this.GetDomNode(),null);}},ShowColourTable:function(){if(this.IsEnabled()&&!this.m_isShown){this.BuildDom_ColourTable();this.m_container.Show(this.GetDomNode());this.m_container.SetPosition(FindPosX(this.GetDomNode()),FindPosY(this.GetDomNode())+(this.GetDomNode().offsetHeight));this.GetDomNode().className='dcp_c dcp_ce';this.m_isShown=true;}}});D2L.ColourPicker=D2L.Control.ColourPicker;

D2L.ControlMap=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.ID={};this.SID={};},DeserializeMin:function(deserializer){var me=this;this.ID=deserializer.GetMember();for(var id in this.ID){var iInfo=D2L.Serialization.JsonDeserializerMin.Deserialize(this.ID[id],D2L.ControlMap.IntegrateInfo)
this.ID[id]=iInfo;if(iInfo.InstallEvents&&iInfo.JsClass!==undefined){iInfo.JsClass.InstallEvents(UI.GetById(iInfo.MappedId),new Function('return UI.GetControl(\''+id+'\');'));}
if(!iInfo.DelayClientSideIntegration){setTimeout(new Function('UI.GetControlMap().GetControl(\''+id+'\');'));}}
this.SID=deserializer.GetMember();for(var id in this.SID){for(var sid in this.SID[id]){var iInfo=D2L.Serialization.JsonDeserializerMin.Deserialize(this.SID[id][sid],D2L.ControlMap.IntegrateInfo)
this.SID[id][sid]=iInfo;if(iInfo.InstallEvents&&iInfo.JsClass!==undefined){iInfo.JsClass.InstallEvents(UI.GetById(iInfo.MappedId),new Function('return UI.GetControl(\''+id+'\',\''+sid+'\');'));}
if(!iInfo.DelayClientSideIntegration){setTimeout(new Function('UI.GetControlMap().GetControl(\''+id+'\',\''+sid+'\');'));}}}},Serialize:function(serializer){var ids={};for(var id in this.ID){ids[id]=this.ID[id].MappedId;}
var sids={};for(var id in this.SID){sids[id]={};for(var sid in this.SID[id]){sids[id][sid]=this.SID[id][sid].MappedId;}}
serializer.AddMember('ID',ids);serializer.AddMember('SID',sids);},AddControlMapToForm:function(){UI.GetByName('d2l_controlMapPrev').value=D2L.Serialization.JsonSerializer.Serialize(this);},GetControl:function(ID,SID){if(SID===undefined||SID===null){SID='';}
if(!ID.isString){ID=ID.toString();}
if(!SID.isString){SID=SID.toString();}
ID=ID.toLowerCase();SID=SID.toLowerCase();var integrateInfo=null;if(SID.length===0){if(this.ID[ID]!==undefined){if(this.ID[ID].Control!==null){return this.ID[ID].Control;}
integrateInfo=this.ID[ID];}}else{if(this.SID[ID]!==undefined&&this.SID[ID][SID]!==undefined){if(this.SID[ID][SID].Control!==null){return this.SID[ID][SID].Control;}
integrateInfo=this.SID[ID][SID];}}
if(integrateInfo===null){return null;}
if(integrateInfo.JsClass===undefined){return null;}
var control=new integrateInfo.JsClass;control.m_mappedId=integrateInfo.MappedId;control.m_controlId=new D2L.Control.Id(ID,SID);control.IntegrateControlMin(new D2L.Serialization.JsonDeserializerMin(integrateInfo.SerializedDataMin));control.IntegrateControl(new D2L.Serialization.JsonDeserializer(integrateInfo.SerializedData));if(SID.length===0){this.ID[ID].Control=control;}else{this.SID[ID][SID].Control=control;}
return control;},GetControlByMappedId:function(mappedId){for(var id in this.ID){if(this.ID[id].MappedId==mappedId){return this.GetControl(id);}}
for(var id in this.SID){for(var sid in this.SID[id]){if(this.SID[id][sid].MappedId==mappedId){return this.GetControl(id,sid);}}}
return null;},GetControls:function(ID){if(ID===undefined||ID===null){return[];}
ID=ID.toLowerCase();var controls=[];if(this.ID[ID]!==undefined){controls.push(this.GetControl(ID));}
for(var sid in this.SID[ID]){controls.push(this.GetControl(ID,sid));}
return controls;},RegisterControl:function(control){var id=control.GetControlId().ID();var sid=control.GetControlId().SID();if(id.length===0){return false;}
var mappedId=control.GetMappedId();if(sid.length===0){this.ID[id]=new D2L.ControlMap.IntegrateInfo(mappedId);this.ID[id].Control=control;}else{if(this.SID[id]===undefined){this.SID[id]={};}
this.SID[id][sid]=new D2L.ControlMap.IntegrateInfo(mappedId);this.SID[id][sid].Control=control;}
return true;},UnregisterControl:function(control){var id=control.GetControlId().ID();var sid=control.GetControlId().SID();if(id.length===0){return false;}
if(sid.length===0){this.ID[id]=undefined;}else{if(this.SID[id]!==undefined){this.SID[id][sid]=undefined;}}}});D2L.ControlMap.IntegrateInfo=D2L.Class.extend({Construct:function(mappedId){if(mappedId===undefined){mappedId='';}
arguments.callee.$.Construct.call(this);this.MappedId=mappedId;this.JsClass=undefined;this.SerializedDataMin={};this.SerializedData={};this.InstallEvents=false;this.DelayClientSideIntegration=true;this.Control=null;},DeserializeMin:function(deserializer){this.MappedId=deserializer.GetMember();var jsClassName=deserializer.GetMember();if(jsClassName.indexOf('.')>-1){try{this.JsClass=eval(jsClassName);}catch(e){throw'Class \''+jsClassName+'\' is undefined.';}}else{try{this.JsClass=D2L.Control[jsClassName];}catch(e){throw'Class \'D2L.Control.'+jsClassName+'\' is undefined.';}}
this.SerializedDataMin=deserializer.GetMember();this.SerializedData=deserializer.GetMember();this.InstallEvents=deserializer.GetBoolean();this.DelayClientSideIntegration=deserializer.GetBoolean();}});

D2L.DragDrop={};D2L.DragDrop.DragDropInfo=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this)
this.OnDragDropped='';this.OnDragEnter='';this.OnDragExit='';this.OnDragOver='';this.OnDrop='';this.OnEndDrag='';this.OnEnter='';this.OnExit='';this.OnMouseDown='';this.OnOver='';this.OnStartDrag='';this.OnMouseOver='';this.OnMouseOut='';this.ScrollsPage=true;this.CustomGhostRenderer='';this.CustomInteractionValidator='';this.m_data=new D2L.Util.Dictionary();},DeserializeMin:function(deserializer){this.OnDragDropped=deserializer.GetMember();this.OnDragEnter=deserializer.GetMember();this.OnDragExit=deserializer.GetMember();this.OnDragOver=deserializer.GetMember();this.OnDrop=deserializer.GetMember();this.OnEndDrag=deserializer.GetMember();this.OnEnter=deserializer.GetMember();this.OnExit=deserializer.GetMember();this.OnMouseDown=deserializer.GetMember();this.OnOver=deserializer.GetMember();this.OnStartDrag=deserializer.GetMember();this.OnMouseOver=deserializer.GetMember();this.OnMouseOut=deserializer.GetMember();this.ScrollsPage=deserializer.GetBoolean();this.CustomGhostRenderer=deserializer.GetMember();this.CustomInteractionValidator=deserializer.GetMember();this.m_data=deserializer.GetObject(D2L.Util.Dictionary);},SetData:function(key,value){this.m_data.Add(key,value);}});D2L.Control.DragDropSettings=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_dragDropInfo;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_dragDropInfo=deserializer.GetObjectMin(D2L.DragDrop.DragDropInfo);},GetDragDropInfo:function(){return this.m_dragDropInfo;}});D2L.DragDrop.SetDragDropInfo=function(ddObject,ddInfo){var me=this;if(ddInfo.OnDragDropped){ddObject.OnDragDropped.RegisterMethod(function(ddArg){ddInfo.OnDragDropped(ddObject,ddArg);});}
if(ddInfo.OnDragEnter){ddObject.OnDragEnter.RegisterMethod(function(ddArg){ddInfo.OnDragEnter(ddObject,ddArg);});}
if(ddInfo.OnDragExit){ddObject.OnDragExit.RegisterMethod(function(ddArg){ddInfo.OnDragExit(ddObject,ddArg);});}
if(ddInfo.OnDragOver){ddObject.OnDragOver.RegisterMethod(function(ddArg,evt){ddInfo.OnDragOver(ddObject,ddArg,evt);});}
if(ddInfo.OnDrop){ddObject.OnDrop.RegisterMethod(function(ddArg,evt){ddInfo.OnDrop(ddObject,ddArg,evt);});}
if(ddInfo.OnEndDrag){ddObject.OnEndDrag.RegisterMethod(function(){ddInfo.OnEndDrag(ddObject);});}
if(ddInfo.OnEnter){ddObject.OnEnter.RegisterMethod(function(ddArg){ddInfo.OnEnter(ddObject,ddArg);});}
if(ddInfo.OnExit){ddObject.OnExit.RegisterMethod(function(ddArg){ddInfo.OnExit(ddObject,ddArg);});}
if(ddInfo.OnMouseDown){ddObject.OnMouseDown.RegisterMethod(function(){ddInfo.OnMouseDown(ddObject);});}
if(ddInfo.OnOver){ddObject.OnOver.RegisterMethod(function(ddArg,evt){ddInfo.OnOver(ddObject,ddArg,evt);});}
if(ddInfo.OnStartDrag){ddObject.OnStartDrag.RegisterMethod(function(){ddInfo.OnStartDrag(ddObject);});}
if(ddInfo.OnMouseOver){ddObject.OnMouseOver.RegisterMethod(function(){ddInfo.OnMouseOver(ddObject);});}
if(ddInfo.OnMouseOut){ddObject.OnMouseOut.RegisterMethod(function(){ddInfo.OnMouseOut(ddObject);});}
ddObject.SetScroll(ddInfo.ScrollsPage);if(ddInfo.CustomGhostRenderer){ddObject.SetCustomGhostRenderer(ddInfo.CustomGhostRenderer);}
if(ddInfo.CustomInteractionValidator){var customInteractionValidatorFunc=ddInfo.CustomInteractionValidator;var customInteractionValidatorHandler=function(dd,isOver){if(isOver){return customInteractionValidatorFunc(dd,ddObject);}else{return customInteractionValidatorFunc(ddObject,dd);}}
ddObject.SetCustomInteractionValidatorHandler(customInteractionValidatorHandler);}
for(var i=0;i<ddInfo.m_data.Keys().length;i++){var dicKey=ddInfo.m_data.Keys()[i];ddObject.SetData(dicKey,ddInfo.m_data.Get(dicKey));}};D2L.DragDrop.Modes={None:0,DraggableDroppable:1,Draggable:2,Droppable:3};D2L.DragDrop.Manager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_customProxy=null;this.m_dragdrops=new D2L.Util.Dictionary();},GetCustomProxy:function(){if(this.m_customProxy==null){var d2lBody=UI.GetById('d2l_body');this.m_customProxy=UI.CreateElement('div');this.m_customProxy.id=UI.GetUniqueHtmlId();this.m_customProxy.style.position='absolute';this.m_customProxy.style.height='0px';this.m_customProxy.style.width='0px';this.m_customProxy.style.overflow='hidden';d2lBody.appendChild(this.m_customProxy);}
return this.m_customProxy;},GetDragDrop:function(id){return this.m_dragdrops.Get(id);},RegisterDragDrop:function(id,dd){this.m_dragdrops.Add(id,dd);},RefreshCache:function(){YAHOO.util.DragDropMgr.refreshCache();}});D2L.DragDrop.DraggableDroppable=D2L.Class.extend({Construct:function(control,domNode,group,mode){arguments.callee.$.Construct.call(this);if(D2L.Util.Html.IsDomNode(control)){var d2lcontrol=new D2L.Control();d2lcontrol.IDomNode=control;d2lcontrol.m_hasDomBeenBuilt=true;control=d2lcontrol;}
if(domNode===undefined||domNode===null){domNode=control.GetDomNode();}
if(mode===undefined||mode===null){mode=D2L.DragDrop.Modes.DraggableDroppable;}
if(group===undefined||group===null){group='D2L.DragDrop.DefaultGroup';}
this.m_control=control;this.m_customGhostRenderer=null;this.m_customGhostControl=null;this.m_customInteractionValidatorHandler=null;this.m_cursorDrag='default';this.m_cursorInvalid='default';this.m_data=new D2L.Util.Dictionary();this.m_domNode=domNode;this.m_ghost=null;this.m_ghostOpacity=0.5;this.m_group=group;this.m_isValid=false;this.m_scroll=true;this.m_mode=mode;this.m_yuiDDObject=null;this.OnMouseDown=new D2L.EventHandler();this.OnStartDrag=new D2L.EventHandler();this.OnEndDrag=new D2L.EventHandler();this.OnDrop=new D2L.EventHandler();this.OnDragDropped=new D2L.EventHandler();this.OnOver=new D2L.EventHandler();this.OnDragOver=new D2L.EventHandler();this.OnEnter=new D2L.EventHandler();this.OnDragEnter=new D2L.EventHandler();this.OnExit=new D2L.EventHandler();this.OnDragExit=new D2L.EventHandler();this.OnMouseOver=new D2L.EventHandler();this.OnMouseOut=new D2L.EventHandler();this.InstallDragDrop();},AddToGroup:function(group){this.m_yuiDDObject.addToGroup(group);},GetControl:function(){return this.m_control;},GetCustomGhostControl:function(){return this.m_customGhostControl;},GetData:function(key){return this.m_data.Get(key);},GetDropIsValid:function(){return this.m_isValid;},GetGhost:function(){return this.m_ghost;},GetGhostOpacity:function(){return this.m_ghostOpacity;},GetMode:function(){return this.m_mode;},InstallDragDrop:function(){var me=this;if(this.m_domNode.id==''){this.m_domNode.id=UI.GetUniqueHtmlId();}
if(this.GetMode()==D2L.DragDrop.Modes.Droppable){this.m_yuiDDObject=new YAHOO.util.DDTarget(this.m_domNode.id,this.m_group);}else{this.m_domNode.style.cursor=this.m_cursorDrag;var customProxy=UI.GetDragDropManager().GetCustomProxy();this.m_yuiDDObject=new YAHOO.util.DDProxy(this.m_domNode.id,this.m_group,{dragElId:customProxy.id});}
this.m_yuiDDObject.scroll=this.m_scroll;UI.GetDragDropManager().RegisterDragDrop(this.m_domNode.id,this);var onMouseOverFunc=function(e){me.OnMouseOver.Trigger();};var onMouseOutFunc=function(e){me.OnMouseOut.Trigger();};YAHOO.util.Event.addListener(this.m_domNode,'mouseover',onMouseOverFunc);YAHOO.util.Event.addListener(this.m_domNode,'mouseout',onMouseOutFunc);if(this.GetMode()==D2L.DragDrop.Modes.Draggable||this.GetMode()==D2L.DragDrop.Modes.DraggableDroppable){this.m_yuiDDObject.onMouseDown=function(e){me.OnMouseDown.Trigger();}
this.m_yuiDDObject.startDrag=function(x,y){me.SetIsGhostMovedToCursor(true);if(me.m_customGhostRenderer){me.m_customGhostControl=me.m_customGhostRenderer.call(me,me);var customGhostDom;if(D2L.Util.IsD2LControl(me.m_customGhostControl)){me.m_customGhostControl.BuildDom();customGhostDom=me.m_customGhostControl.GetDomNode();}else{customGhostDom=me.m_customGhostControl;}
me.m_ghost=UI.CreateElement('div');me.m_ghost=customGhostDom;}else{me.m_ghost=me.m_domNode.cloneNode(true);}
customProxy.style.height='auto';customProxy.style.width='auto';me.m_ghost.id='';me.m_ghost.style.margin='';if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){me.m_ghost.style.styleFloat='';}else{me.m_ghost.style.cssFloat='';}
me.m_ghost.style.listStyleType='none';YAHOO.util.Dom.setStyle(me.m_ghost,"opacity",me.m_ghostOpacity);customProxy.appendChild(me.m_ghost);customProxy.style.cursor=me.m_cursorDrag;me.m_ghost.style.cursor=me.m_cursorDrag;me.OnStartDrag.Trigger();}
this.m_yuiDDObject.endDrag=function(e){var HideProxy=function(){customProxy.innerHTML='';customProxy.style.visibility='hidden';customProxy.style.height='0px';customProxy.style.width='0px';};customProxy.style.visibility='visible';var startPos=YAHOO.util.Dom.getXY(me.m_yuiDDObject.getEl());var anim=new YAHOO.util.Motion(me.m_yuiDDObject.getDragEl(),{points:{to:startPos}},0.25,YAHOO.util.Easing.easeOut);anim.onComplete.subscribe(function(){HideProxy();});if(!me.m_isValid){anim.animate();}else{HideProxy();}
me.OnEndDrag.Trigger();}
this.m_yuiDDObject.onInvalidDrop=function(e){me.m_isValid=false;me.m_ghost.style.paddingTop='0px';me.m_ghost.style.paddingLeft='0px';}}
this.m_yuiDDObject.onDragOver=function(e,id){var dd=UI.GetDragDropManager().GetDragDrop(id);if(dd.GetMode()==D2L.DragDrop.Modes.Droppable||dd.GetMode()==D2L.DragDrop.Modes.DraggableDroppable){if(me.m_isValid){me.OnOver.Trigger(dd,e);dd.OnDragOver.Trigger(me,e);}}}
var lastEnteredDD=null;this.m_yuiDDObject.onDragEnter=function(e,id){var dd=UI.GetDragDropManager().GetDragDrop(id);lastEnteredDD=dd;if(dd.GetMode()==D2L.DragDrop.Modes.Droppable||dd.GetMode()==D2L.DragDrop.Modes.DraggableDroppable){if(dd.IsInteractionValid(me,true)&&me.IsInteractionValid(dd,false)){me.m_ghost.style.cursor=me.m_cursorDrag;me.m_isValid=true;me.OnEnter.Trigger(dd);dd.OnDragEnter.Trigger(me);}else{me.m_isValid=false;me.m_ghost.style.cursor=me.m_cursorInvalid;}}}
this.m_yuiDDObject.onDragOut=function(e,id){var dd=UI.GetDragDropManager().GetDragDrop(id);if(dd.GetMode()==D2L.DragDrop.Modes.Droppable||dd.GetMode()==D2L.DragDrop.Modes.DraggableDroppable){me.m_ghost.style.cursor=me.m_cursorDrag;if(lastEnteredDD==dd){me.m_isValid=false;}
me.OnExit.Trigger(dd);dd.OnDragExit.Trigger(me);}}
this.m_yuiDDObject.onDragDrop=function(e,id){var dd=UI.GetDragDropManager().GetDragDrop(id);if(dd.GetMode()==D2L.DragDrop.Modes.Droppable||dd.GetMode()==D2L.DragDrop.Modes.DraggableDroppable){if(me.m_isValid){me.OnDrop.Trigger(dd);dd.OnDragDropped.Trigger(me);}}}},IsInteractionValid:function(dd,isOver){if(this.m_customInteractionValidatorHandler!=null){return this.m_customInteractionValidatorHandler(dd,isOver);}else{return true;}},RemoveFromGroup:function(group){this.m_yuiDDObject.removeFromGroup(group);},SetCustomGhostRenderer:function(func){this.m_customGhostRenderer=func;},SetIsGhostMovedToCursor:function(isMoved){if(this.m_yuiDDObject){if(isMoved){UI.GetDragDropManager().GetCustomProxy().style.paddingLeft='40px';UI.GetDragDropManager().GetCustomProxy().style.paddingTop='40px';if(this.m_yuiDDObject.setDelta){this.m_yuiDDObject.setDelta(25,25);}
this.m_yuiDDObject.centerFrame=true;this.m_yuiDDObject.resizeFrame=false;}else{this.m_yuiDDObject.centerFrame=false;this.m_yuiDDObject.resizeFrame=true;if(this.m_yuiDDObject.setDelta){this.m_yuiDDObject.setDelta(0,0);}
UI.GetDragDropManager().GetCustomProxy().style.paddingLeft='0px';UI.GetDragDropManager().GetCustomProxy().style.paddingTop='0px';UI.GetDragDropManager().GetCustomProxy().style.backgroundImage='';}}},SetCustomInteractionValidatorHandler:function(func){this.m_customInteractionValidatorHandler=func;},SetHandle:function(control){var domNode=null;if(control.isD2LControl){domNode=control.GetDomNode();}else{domNode=control;}
if(domNode.id==''){domNode.id=UI.GetUniqueHtmlId();}
this.m_yuiDDObject.setHandleElId(domNode.id);},SetData:function(key,value){this.m_data.Add(key,value);},SetGhostOpacity:function(opacity){this.m_ghostOpacity=opacity;},SetScroll:function(scroll){this.m_scroll=scroll;this.m_yuiDDObject.scroll=scroll;}});D2L.DragDrop.Draggable=D2L.DragDrop.DraggableDroppable.extend({Construct:function(control,domNode,group){arguments.callee.$.Construct.call(this,control,domNode,group,D2L.DragDrop.Modes.Draggable);}});D2L.DragDrop.Droppable=D2L.DragDrop.DraggableDroppable.extend({Construct:function(control,domNode,group){arguments.callee.$.Construct.call(this,control,domNode,group,D2L.DragDrop.Modes.Droppable);}});

D2L.Control.Edit=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_blurEvent=new D2L.EventHandler();this.m_isDisplayed=true;this.m_isEnabled=true;this.m_keyPressEvent=new D2L.EventHandler();this.m_text=new D2L.LP.Text.PlainText();this.m_width=-1;},BlurEvent:function(){return this.m_blurEvent;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('input'));domNode.type='text';domNode.name=this.GetMappedId();domNode.className='d_edt';if(this.m_width>0){domNode.style.width=this.m_width+'px';}else{domNode.size=50;}
if(this.m_text){this.SetText(this.m_text);}
this.SetIsEnabled(this.IsEnabled());this.SetIsDisplayed(this.IsDisplayed());this.InstallEvents();},Clear:function(triggerChange){if(triggerChange===undefined){triggerChange=false;}
this.m_text=new D2L.LP.Text.PlainText();if(this.IsRendered()){this.GetDomNode().value='';if(triggerChange){WindowEventManager.BC(this.GetDomNode());}}},Focus:function(){if(this.IsRendered()){this.GetDomNode().focus();}},GetMultiEditValue:function(){if(this.IsEnabled()&&this.IsRendered()){return this.GetDomNode().value;}
return'';},GetState:function(serializer){if(this.IsRendered()){serializer.AddMember('Text',this.GetDomNode().value);}},GetText:function(){if(this.IsRendered()){return new D2L.LP.Text.PlainText(this.GetDomNode().value);}else{return this.m_text;}},GetTextAsString:function(){if(this.IsRendered()){return this.GetDomNode().value;}
return'';},GetValue:function(){return this.GetText().GetText();},GetValueNoDelay:function(){return this.GetTextAsString();},GetWidth:function(){return this.m_width;},HasValue:function(){var dr=new D2L.Util.DelayedReturn();this.GetText().GetText().Register(function(text){dr.Trigger(text.trim().length>0);});return dr;},HasValueNoDelay:function(){return this.GetTextAsString().trim().length>0;},InstallEvents:function(){var domNode=this.GetDomNode();var me=this;this.AttachObject(domNode,'onblur',function(evt){me.BlurEvent().Trigger(evt||window.event);});this.GetUI().GetWindowEventManager().InstallKpel(domNode,function(obj,evt){me.KeyPressEvent().Trigger(evt);});this.AttachObject(domNode,'onchange',function(evt){WindowEventManager.BC(this,evt);});},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var domNode=this.GetDomNode();if(domNode!==null){if(deserializer.HasMember()){domNode.ID2L=null;}
this.m_isDisplayed=(domNode.style.display!='none');this.m_isEnabled=!domNode.disabled;this.m_text=new D2L.LP.Text.PlainText(domNode.value);}else{this.m_hasDomBeenBuilt=false;this.m_isEnabled=false;}},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){if(this.IsRendered()){return!this.GetDomNode().disabled;}else{return this.m_isEnabled;}},KeyPressEvent:function(){return this.m_keyPressEvent;},Select:function(){if(this.IsRendered()){this.GetDomNode().select();}},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'inline':'none';}
this.m_isDisplayed=isDisplayed;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){this.GetDomNode().disabled=!isEnabled;}},SetText:function(text,triggerChange){if(triggerChange===undefined){triggerChange=false;}
this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Edit','SetText','text');if(this.IsRendered()){this.m_text.AssignText(this.GetDomNode(),'value');if(triggerChange){WindowEventManager.BC(this.GetDomNode());}}},SetWidth:function(width){this.m_width=width;if(this.IsRendered()){if(width>0){this.GetDomNode().style.width=width+'px';}else{this.GetDomNode().style.width='auto';}}}});

D2L.Control.FileLink=D2L.Control.extend({Construct:function(file,source){if(file===undefined){file=null;}
if(source===undefined){source=null;}
arguments.callee.$.Construct.call(this,D2L.Control.Type.FileLink);this.m_iconIsDisplayed=true;this.m_img=null;this.m_link=null;this.m_name='';this.m_navigation='';this.m_size=0;this.m_sizeIsDisplayed=true;this.m_sizeNode=null;this.m_text=new D2L.LP.Text.PlainText('');this.m_fileName='';this.m_textIsOveridden=false;this.m_altIsOveridden=false;this.m_textNode=null;this.m_textFormat=D2L.Control.TextFormat.Normal;this.m_alt=new D2L.LP.Text.PlainText('');this.m_limitChars=50;this.m_hasLink=true;this.m_source=source;if(file){this.SetFile(file,false);}},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);if(!this.GetDomNode()){this.SetDomNode(this.CreateElement('span'));this.GetDomNode().className=(this.GetTextFormat()==D2L.Control.TextFormat.Bold)?'dfl dfl_b':'dfl';}
var parent=this.GetDomNode();if(this.m_hasLink){this.m_link=this.CreateElement('a');this.GetDomNode().appendChild(this.m_link);parent=this.m_link;var dotIndex=this.m_fileName.lastIndexOf('.');if(dotIndex>-1){var extension=this.m_fileName.substr(dotIndex);if(extension=='.d2lresource'){this.m_link.target='_blank';}}}
if(this.IconIsDisplayed()){this.m_img=this.CreateElement('img');this.m_img.src='/d2l/img/lp/pixel.gif';this.m_img.width=1;this.m_img.height=1;this.m_img.alt='';if(parent.firstChild){parent.insertBefore(this.m_img,parent.firstChild);}else{parent.appendChild(this.m_img);}
if(this.m_fileName.length>0){var me=this;D2L.Files.GetFileTypeInfo(this.m_fileName).Register(function(fileTypeInfo){fileTypeInfo.GetImage().Assign(me.m_img);});}}
if(this.m_textNode===null){this.m_textNode=this.CreateElement('span');parent.appendChild(this.m_textNode);}
this.SetNavigation(this.m_navigation);this.SetText(this.m_text);this.SetAlt(this.m_alt);if(this.SizeIsDisplayed()){this.m_sizeNode=this.CreateElement('span');this.GetDomNode().appendChild(this.m_sizeNode);this.SetSize(this.m_size);}
if(this.m_source!=null){var sourceSpan=this.CreateElement('span');sourceSpan.className='dfl_s';sourceSpan.style.paddingLeft='19px';sourceSpan.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Framework.FileSelector.lblSource')));var trimmedSource=this.m_source;if(trimmedSource.length>60){trimmedSource='...'+trimmedSource.substr(trimmedSource.length-60);}
sourceSpan.appendChild(this.CreateTextNode(trimmedSource));this.AppendChild(sourceSpan);var me=this;setTimeout(function(){if(me.m_img){sourceSpan.style.paddingLeft=me.m_img.offsetWidth+'px';}},0);}}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.SetFile(new D2L.Files.FileInfo(deserializer.GetMember(),deserializer.GetMember(),deserializer.GetMember()),false);var overrideText=deserializer.GetMember();var overrideAlt=deserializer.GetMember();this.m_iconIsDisplayed=deserializer.GetBoolean();this.m_sizeIsDisplayed=deserializer.GetBoolean();this.m_hasLink=deserializer.GetBoolean();this.m_limitChars=deserializer.GetMember();this.m_textFormat=deserializer.GetMember();if(overrideText.length>0){this.m_textIsOveridden=true;this.m_text=new D2L.LP.Text.PlainText(overrideText);}
if(overrideAlt.length>0){this.m_altIsOveridden=true;this.m_alt=new D2L.LP.Text.PlainText(overrideAlt);}
var domNode=this.GetDomNode();if(domNode.childNodes.length>0){if(this.m_hasLink){this.m_link=domNode.firstChild;if(this.IconIsDisplayed()){this.m_img=this.m_link.firstChild;this.m_textNode=this.m_link.childNodes[1];}}else if(this.IconIsDisplayed()){this.m_img=this.IDomNode.firstChild;this.m_textNode=this.IDomNode.childNodes[1];}else{this.m_textNode=this.IDomNode.firstChild;}
if(this.SizeIsDisplayed()){this.m_sizeNode=domNode.childNodes[domNode.childNodes.length-1];}}},Focus:function(){if(this.m_link){this.m_link.focus();}},GetText:function(){return this.m_text;},GetTextFormat:function(){return this.m_textFormat;},IconIsDisplayed:function(){return this.m_iconIsDisplayed;},SetAlt:function(alt){this.m_alt=D2L.LP.Text.IText.Normalize(alt,'D2L.Control.FileLink','SetAlt','alt');if(this.m_link!==null){var me=this;this.m_alt.GetText().Register(function(val){me.m_link.title=val;});}},SetFile:function(file,buildDom){if(buildDom===undefined){buildDom=true;}
if(buildDom){file=D2L.Serialization.JsonDeserializer.Deserialize(file,D2L.Files.FileInfo);}
this.m_fileName=file.FileName;this.SetNavigation(D2L.Util.GetViewFileUrl(file));this.SetSize(file.Size);if(!this.m_textIsOveridden){this.SetText(new D2L.LP.Text.PlainText(file.FileName));if(!this.m_altIsOveridden){this.SetAlt(new D2L.LP.Text.LangTerm('Framework.FileSelector.altOpenFile',file.FileName));}}else if(!this.m_altIsOveridden){this.SetAlt(new D2L.LP.Text.LangTerm('Framework.FileSelector.altOpenFile',this.m_text));}
if(buildDom){this.m_hasDomBeenBuilt=false;this.BuildDom();}else if(this.IconIsDisplayed()&&this.m_fileName.length>0&&this.m_img!==null){var me=this;D2L.Files.GetFileTypeInfo(this.m_fileName).Register(function(fileTypeInfo){fileTypeInfo.GetImage().Assign(me.m_img);});}},SetNavigation:function(navigation){this.m_navigation=navigation;if(this.m_link){this.m_link.href=navigation;}},SetSize:function(size){if(this.SizeIsDisplayed()){this.m_size=size;if(this.m_sizeNode){if(this.m_sizeNode.firstChild){D2L.Util.Purge(this.m_sizeNode.firstChild);this.m_sizeNode.removeChild(this.m_sizeNode.firstChild);}
this.m_sizeNode.appendChild(this.CreateTextNode(' ('+Culture.FormatFileSize(this.m_size)+')'));}}},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.FileLink','SetText','text');if(this.m_textNode){if(this.m_textNode.firstChild){D2L.Util.Purge(this.m_textNode.firstChild);this.m_textNode.removeChild(this.m_textNode.firstChild);}
var me=this;this.m_text.GetText().Register(function(val){var txt=val;if(me.m_limitChars>0&&val.length>me.m_limitChars){txt=val.substr(0,me.m_limitChars-3)+'...';}
me.m_textNode.appendChild(me.CreateTextNode(txt));});}},SetTextFormat:function(textFormat){this.m_textFormat=textFormat;if(this.GetDomNode()){this.GetDomNode().className=(this.GetTextFormat()==D2L.Control.TextFormat.Bold)?'dfl dfl_b':'dfl';}},SetSizeIsDisplayed:function(sizeIsDisplayed){this.m_sizeIsDisplayed=sizeIsDisplayed;},SizeIsDisplayed:function(){return this.m_sizeIsDisplayed;}});D2L.Files.FileLink=D2L.Control.FileLink;

D2L.Files.FilterType={All:0,WordProcessing:6,Archive:2,Images:1,Web:3,Spreadsheet:7,Presentation:8,Media:4,LiveRoom:5,Pdf:9,Executable:10,QuickTime:11,Xml:12,Text:13};D2L.Files.Area={MyComputer:'mycomputer',OuFiles:'oufiles',SharedFiles:'sharedfiles',MyLocker:'mylocker',GroupLocker:'grouplocker',LearningPortfolio:'learningportfolio'};D2L.Files.MaxDirectoryNameCharacters=50;D2L.Files.MaxFileNameCharacters=128;D2L.Files.ValidDirectoryNameRegex='^([^\\\\/:\*\?\"<>\|]{0,'+(D2L.Files.MaxDirectoryNameCharacters-1)+'}[^\\\\\./:\*\?\"<>\|])?$';D2L.Files.ValidFileNameRegex='^([^\\\\/:\*\?\"<>\|]{0,'+(D2L.Files.MaxFileNameCharacters-1)+'}[^\\\./:\*\?\"<>\|])?$';D2L.Files.ValidFileNameNoMaxCharactersRegex='^([^\\\\/:\*\?\"<>\|]*[^\\\\\./:\*\?\"<>\|])?$';D2L.Files.InvalidFileNameCharactersRegex='[\\\\/:\*\?\"<>\|]';D2L.Files.InvalidDirectoryNameCharacters='\\ / : * ? " < > |';D2L.Files.InvalidFileNameCharacters='\\ / : * ? " < > |';D2L.Files.TypeInfos=null;D2L.Files.TypeInfosDr=null;D2L.Files.RestrictedExtensions=[];D2L.Files.CleanFileName=function(fileName){var regExp=new RegExp(D2L.Files.InvalidFileNameCharactersRegex,'g');return fileName.replace(regExp,'');};D2L.Files.GetFileTypeInfo=function(fileName){var dr=new D2L.Util.DelayedReturn();var Handle=function(){var ext=fileName.substr(fileName.lastIndexOf('.')).toLowerCase();if(D2L.Files.TypeInfos[ext]){dr.Trigger(D2L.Files.TypeInfos[ext]);}else{var oldDef=D2L.Files.TypeInfos["*"];dr.Trigger(new D2L.Files.FileTypeInfo(oldDef.GetImageInfo(),oldDef.GetDescription().replace('[0]',ext.substr(1).toUpperCase())));}};if(D2L.Files.TypeInfos===null){D2L.Files.TypeInfosDr=new D2L.Util.DelayedReturn();D2L.Files.TypeInfosDr.Register(Handle);var script=document.createElement('script');script.type='text/javascript';script.src='/d2l/common/language/fileTypeInfo.d2l?ou='+
Global.OrgUnitId;UI.GetById('d2l_body').appendChild(script);}else{Handle();}
return dr;};D2L.Files.FileTypeInfo=D2L.Class.extend({Construct:function(image,description){arguments.callee.$.Construct.call(this);this.m_image=image;this.m_description=description;},GetImageInfo:function(){return this.GetImage();},GetImage:function(){return this.m_image;},GetDescription:function(){return this.m_description;}});D2L.Files.FileInfo=D2L.Class.extend({Construct:function(fileSystemType,fileId,fileName,size,description){arguments.callee.$.Construct.call(this);if(fileSystemType===undefined){fileSystemType='';}
if(fileId===undefined){fileId='';}
if(fileName===undefined){fileName='';}
if(size===undefined){size=0;}
size=parseInt(size);if(description===undefined){description='';}
this.FileSystemType=fileSystemType;this.FileId=fileId;this.FileName=fileName;this.Size=size;this.LastModified=0;this.m_description=description;},Deserialize:function(deserializer){this.FileSystemType=deserializer.GetMember('FileSystemType');this.FileId=deserializer.GetMember('FileId');this.FileName=deserializer.GetMember('FileName');this.Size=deserializer.GetMember('Size');this.LastModified=deserializer.GetMember('LastModified');this.m_description=deserializer.GetMember('Description');},DeserializeMin:function(deserializer){this.FileId=deserializer.GetMember();this.FileSystemType=deserializer.GetMember();this.FileName=deserializer.GetMember();this.Size=deserializer.GetMember();this.LastModified=deserializer.GetMember();this.m_description=deserializer.GetMember();},Serialize:function(serializer){serializer.AddMember('FileSystemType',this.GetFileSystemType());serializer.AddMember('FileId',this.GetFileId());serializer.AddMember('FileName',this.GetFileName());serializer.AddMember('Size',this.GetSize());serializer.AddMember('LastModified',this.GetLastModified());serializer.AddMember('Description',this.GetDescription());},Equals:function(fileInfo){if(fileInfo===null||fileInfo===undefined){return false;}
return(this.GetFileSystemType()!=fileInfo.GetFileSystemType()||this.GetFileId()!=fileInfo.GetFileId()||this.GetFileName()!=fileInfo.GetFileName()||this.GetSize()!=fileInfo.GetSize()||this.GetLastModified()!=fileInfo.GetLastModified()||this.GetDescription()!=fileInfo.GetDescription());},GetFileSystemType:function(){return this.FileSystemType;},GetFileId:function(){return this.FileId;},GetFileName:function(){return this.FileName;},GetSize:function(){return this.Size;},GetLastModified:function(){return this.LastModified;},GetDescription:function(){return this.m_description;},Rename:function(newFileName){this.FileName=newFileName;}});D2L.Files.HandleFileNameDuplicates=function(control,path,vFiles,vFile,showOverwrite){var dr=new D2L.Util.DelayedReturn();D2L.Files.HandleFileNameDuplicates.InProgress=true;if(showOverwrite===undefined){showOverwrite=true;}
var Finish=function(result){D2L.Files.HandleFileNameDuplicates.InProgress=false;dr.Trigger(result);};var fileNames=[];for(var i=0;i<control.Children().length;i++){var file=control.Children()[i].GetFile();if(file){fileNames.push(file.GetFileName());}else{if(control.Children()[i].GetFileName){var fileNameRaw=control.Children()[i].GetFileName(false);if(fileNameRaw!=null&&fileNameRaw.trim()!=''){fileNames.push(fileNameRaw);}}}}
var vFilesCallback=function(duplicateFileNames){var ShowDuplicateDialog=function(index){if(index>=duplicateFileNames.length){Finish(true);}else{var fileName=duplicateFileNames[index];var item=null;for(var i=0;i<control.Children().length;i++){var fileD=control.Children()[i].GetFile();var fileNameD;if(fileD){fileNameD=fileD.GetFileName();}else{if(control.Children()[i].GetFileName){var fileNameRaw=control.Children()[i].GetFileName(false);if(fileNameRaw!=null&&fileNameRaw.trim()!=''){fileNameD=fileNameRaw;}}}
if(fileNameD==fileName){item=control.Children()[i];break;}}
var DuplicateDialogCallback=function(dupDialogResponse){if(dupDialogResponse.GetType()==D2L.Dialog.ResponseType.Positive){if(item){item.m_overwriteFileName=true;}
dupDialogResponse.GetDialog().Close();ShowDuplicateDialog(++index);}else{dupDialogResponse.GetDialog().Close();Finish(false);}};if(!item.m_overwriteFileName){if(!showOverwrite){UI.Error(new D2L.LP.Text.LangTerm('FrameworkWebPages.DuplicateFileNameDialog.lblErrorPrimary',fileName,path));Finish(false);}else{UI.Confirm(DuplicateDialogCallback,new D2L.LP.Text.LangTerm('FrameworkWebPages.DuplicateFileNameDialog.lblPrimary',fileName,path),new D2L.LP.Text.LangTerm('FrameworkWebPages.DuplicateFileNameDialog.lblSecondary'));}}else{ShowDuplicateDialog(++index);}}};if(duplicateFileNames.length===0){Finish(true);}else{ShowDuplicateDialog(0);}};if(fileNames.length===0){Finish(true);}else{vFiles(fileNames,path).Register(vFilesCallback);}
return dr;}
D2L.Files.HandleFileNameDuplicates.InProgress=false;

D2L.Control.FileSelector=D2L.Control.CustomSelector.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_areaFilters=['MyComputer','OuFiles'];this.m_canDelete=true;this.m_selectedArea='';this.m_selectedAreaParam='';this.m_fileFilters=[D2L.Files.FilterType.All];this.m_maxFileSize=0;this.m_submitFileDialog=null;this.m_totalFileSize=0;this.m_raiseAddRemoveEvent=true;this.m_forceSaveToCourseFiles=false;this.OnAddRemove=new D2L.EventHandler();},AppendChild:function(file){file=arguments.callee.$.AppendChild.call(this,file);if(file){this.UpdateFileSizes();}
if(file&&this.m_raiseAddRemoveEvent){this.OnAddRemove.Trigger(file);}
return file;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_maxFileSize=deserializer.GetMember();this.m_canDelete=deserializer.GetBoolean();this.m_fileFilters=deserializer.GetMember();this.m_areaFilters=deserializer.GetMember();this.m_selectedArea=deserializer.GetMember();this.m_selectedAreaParam=deserializer.GetMember();this.m_forceSaveToCourseFiles=deserializer.GetBoolean();var files=deserializer.GetObjectArrayMin(D2L.Control.FileSelector.File);this.m_integrationComplete=false;for(var i=0;i<files.length;i++){this.AppendChild(files[i]);}
this.m_integrationComplete=true;},RemoveChild:function(file){file=arguments.callee.$.RemoveChild.call(this,file);if(file){this.UpdateFileSizes();}
if(file&&this.m_raiseAddRemoveEvent){this.OnAddRemove.Trigger(file);}
return file;},AddAreaFilter:function(area){area=area.toLowerCase();var found=false;for(var i=0;i<this.m_areaFilters.length;i++){if(this.m_areaFilters[i]==area){found=true;break;}}
if(!found){this.m_areaFilters.push(area);}},GetTotalFileSize:function(){var total=0;for(var i=0;i<this.Children().length;i++){if(!this.Children()[i].IsDeleted()){total+=this.Children()[i].GetFile().GetSize();}}
return total;},GetCount:function(){var count=0;for(var i=0;i<this.Children().length;i++){if(!this.Children()[i].IsDeleted()){count+=1;}}
return count;},HasValue:function(){return new D2L.Util.DelayedReturn(this.HasValueNoDelay());},HasValueNoDelay:function(){var numChildren=0;for(var i=0;i<this.Children().length;i++){if(!this.Children()[i].IsDeleted()){numChildren++;}}
return numChildren>0;},OpenDialog:function(){if(!this.m_submitFileDialog){var me=this;var callback=function(dialogResponse){var files=dialogResponse.GetData('files');var sources=dialogResponse.GetData('sources');if(files){for(var i=0;i<files.length;i++){var file=D2L.Serialization.JsonDeserializer.Deserialize(D2L.Serialization.JsonSerializer.Serialize(files[i]),D2L.Files.FileInfo);var item=new D2L.Control.FileSelector.File(file,sources[file.FileId]);item.SetIsNew(true);me.AppendChild(item);}}
dialogResponse.GetDialog().Close();};this.m_submitFileDialog=new D2L.Dialog.SelectFile(callback);}
this.m_submitFileDialog.SetForceSaveToCourseFiles(this.m_forceSaveToCourseFiles);this.m_submitFileDialog.SetFileFilters(this.m_fileFilters);this.m_submitFileDialog.SetAreaFilters(this.m_areaFilters);this.m_submitFileDialog.SetSelectedArea(this.m_selectedArea,this.m_selectedAreaParam);this.m_submitFileDialog.SetAllowMultiple(this.m_allowMultiple);this.m_submitFileDialog.SetMaxFileSize(this.m_maxFileSize);this.m_submitFileDialog.Open(this);},RemoveAreaFilter:function(area){area=area.toLowerCase();for(var i=0;i<this.m_areaFilters.length;i++){if(this.m_areaFilters[i]==area){this.m_areaFilters.splice(i,1);break;}}
if(area==this.m_selectedArea){this.m_selectedArea='';}},RestoreItem:function(file){arguments.callee.$.RestoreItem.call(this,file);this.UpdateFileSizes();if(file&&this.m_raiseAddRemoveEvent){this.OnAddRemove.Trigger(file);}},SetFile:function(file){file=D2L.Serialization.JsonDeserializer.Deserialize(file,D2L.Files.FileInfo);var existing=this.GetItem(file.FileId);if(existing){existing.SetSubject(file.GetFileName());existing.m_file=file;existing.m_domHasBeenBuilt=false;existing.BuildDom();this.UpdateFileSizes();}else{var fsFile=new D2L.Control.FileSelector.File(file);fsFile.SetCanDelete(this.m_canDelete);fsFile.SetIsNew(false);this.AppendChild(fsFile);}},SetFiles:function(files){this.m_raiseAddRemoveEvent=false;for(var i=0;i<files.length;i++){this.SetFile(files[i]);}
this.m_raiseAddRemoveEvent=true;},SetSelectedArea:function(selectedArea,param){selectedArea=selectedArea.toLowerCase();this.m_selectedArea=selectedArea;if(param!==undefined){this.m_selectedAreaParam=param;}
this.AddAreaFilter(selectedArea);},UpdateFileSizes:function(){this.m_totalFileSize=0;for(var i=0;i<this.Children().length;i++){if(!this.Children()[i].IsDeleted()){this.m_totalFileSize+=this.Children()[i].GetFile().Size;}}}});D2L.FileSelector=D2L.Control.FileSelector;D2L.FileSelector.FILE_TYPES=new Array("Url","CourseFile","UploadedFile");D2L.Control.FileSelector.File=D2L.Control.CustomSelectorItem.extend({Construct:function(file,source){var key='';if(file!==undefined){key=file.FileId;}
arguments.callee.$.Construct.call(this,key);this.m_file=file;this.m_fileLink=null;this.m_navigation='';this.m_source=null;this.m_deleteCellVAlign='top';if(file!==undefined){this.SetData('FileSystemType',file.GetFileSystemType());this.SetData('FileId',file.GetFileId());this.SetData('NewFileName','');this.SetSubject(file.GetFileName());}
if(source!==undefined){this.m_source=source;}},DeserializeMin:function(deserializer){var fileSystemType=deserializer.GetMember();var fileId=deserializer.GetMember();this.m_key=fileId;this.m_file=new D2L.Files.FileInfo(fileSystemType,fileId);this.m_canDelete=deserializer.GetBoolean();this.m_isDeleted=deserializer.GetBoolean();this.m_isNew=deserializer.GetBoolean();this.m_navigation=deserializer.GetMember();this.SetData('FileSystemType',this.m_file.GetFileSystemType());this.SetData('FileId',this.m_file.GetFileId());this.SetData('NewFileName','');this.SetSubject(this.m_file.GetFileName());},BuildDom:function(){arguments.callee.$.BuildDom.call(this);var container=this.CreateElement('div');if(!this.m_fileLink){this.m_fileLink=new D2L.Control.FileLink(this.m_file,this.m_source);}else{this.m_fileLink.SetFile(this.m_file,false);}
if(this.m_navigation.length>0){this.m_fileLink.SetNavigation(this.m_navigation);}
this.AppendChild(this.m_fileLink);},GetFile:function(){return this.m_file;},Focus:function(){if(this.m_fileLink){this.m_fileLink.Focus();}},RenameFile:function(newFileName){this.SetData('NewFileName',newFileName);this.SetSubject(newFileName);this.m_file.Rename(newFileName);if(this.m_fileLink){this.m_fileLink.SetFile(this.m_file,false);}}});D2L.FileSelector.File=D2L.Control.FileSelector.File;

D2L.Control.FileUpload=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.FileUpload);this.m_name='';this.m_allowMultiple=true;this.m_count=null;this.m_totalSize=0;this.m_isEnabled=true;this.m_isRequired=true;this.m_maxFileSize=0;this.m_maxTotalSize=0;this.m_validationFailureIndex=-1;this.OnAddRemove=new D2L.EventHandler();FormManager.RegisterFileUpload(this);},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_allowMultiple=deserializer.GetBoolean();this.m_isRequired=deserializer.GetBoolean();this.m_maxFileSize=deserializer.GetMember();this.m_maxTotalSize=deserializer.GetMember();this.m_name=deserializer.GetMember();if(this.m_name.length===0){this.m_name=this.GetMappedId();}
this.m_count=this.GetDomNode().childNodes[0];this.m_count.value=1;if(this.AllowMultiple()){var me=this;this.m_button=UI.GetControl(this.GetMappedId()+'_b');this.m_button.SetOnClick(function(){me.AppendChild(new D2L.Control.FileUpload.Item());});}
var item=new D2L.Control.FileUpload.Item();item.IntegrateChild(this,this.GetDomNode().childNodes[1].rows[0]);},AppendChild:function(child){child=arguments.callee.$.AppendChild.call(this,child);this.m_count.value=this.Children().length;var firstIncomplete=null;for(var i=0;i<this.Children().length;i++){this.Children()[i].SetRemoveVisibility(true);if(!this.Children()[i].IsUploaded()&&firstIncomplete===null){firstIncomplete=this.Children()[i];}}
if(this.Children().length===1&&firstIncomplete){firstIncomplete.SetRemoveVisibility(false);}
this.OnAddRemove.Trigger(child);return child;},RemoveChild:function(child){child=arguments.callee.$.RemoveChild.call(this,child);var firstIncomplete=null;for(var i=0;i<this.Children().length;i++){this.Children()[i].SetIndex(i);this.Children()[i].SetRemoveVisibility(true);if(!this.Children()[i].IsUploaded()&&firstIncomplete===null){firstIncomplete=this.Children()[i];}}
this.m_count.value=this.Children().length;if(child.IsUploaded()){this.m_totalSize=this.m_totalSize-child.GetFile().Size;}
if(this.Children().length===1&&firstIncomplete){firstIncomplete.SetRemoveVisibility(false);}else if(this.Children().length===0){this.AppendChild(new D2L.Control.FileUpload.Item());}
this.OnAddRemove.Trigger(child);return child;},AllowMultiple:function(){return this.m_allowMultiple;},Disable:function(){this.SetIsEnabled(false);},Enable:function(){this.SetIsEnabled(true);},Focus:function(){if(this.m_validationFailureIndex>-1){this.Children()[this.m_validationFailureIndex].Focus();}else{this.Children()[0].Focus();}},GetFiles:function(){var ret=[];for(var i=0;i<this.Children().length;i++){var file=this.Children()[i].GetFile();if(file){ret.push(file);}}
return ret;},GetFileNames:function(){var ret=[];for(var i=0;i<this.Children().length;i++){ret.push(this.Children()[i].GetFileName(false));}
return ret;},GetFileName:function(index){if(index===undefined){index=0;}
var file=this.Children()[index];if(file){return file.GetFileName();}
return'';},GetCount:function(){return this.Children().length;},GetMaxFileSize:function(){return this.m_maxFileSize;},GetMaxTotalSize:function(){return this.m_maxTotalSize;},GetNumToUpload:function(){var numToUpload=0;if(this.IsEnabled()&&!this.IsUploaded()){for(var i=0;i<this.Children().length;i++){if(!this.Children()[i].IsEmpty()){numToUpload++;}}}
return numToUpload;},GetValidationBalloonDomNode:function(){if(this.m_validationFailureIndex>-1){return this.Children()[this.m_validationFailureIndex].m_upload;}else{return this.GetDomNode().childNodes[1];}},HasValue:function(){for(var i=0;i<this.Children().length;i++){if(this.Children()[i].IsUploaded()||!this.Children()[i].IsEmpty()){return new D2L.Util.DelayedReturn(true);}}
return new D2L.Util.DelayedReturn(false);},IsEnabled:function(){return this.m_isEnabled;},IsUploaded:function(){for(var i=0;i<this.Children().length;i++){if(!this.Children()[i].IsUploaded()){return false;}}
return true;},Reset:function(){var numChildren=this.Children().length;for(var i=0;i<numChildren;i++){this.RemoveChild(this.Children()[i]);}},SetIsEnabled:function(isEnabled){for(var i=0;i<this.Children().length;i++){this.Children()[i].SetIsEnabled(isEnabled);}
if(this.m_button){this.m_button.SetIsEnabled(isEnabled);}
this.m_isEnabled=isEnabled;},SetValidationFailureIndex:function(validationFailureIndex){this.m_validationFailureIndex=validationFailureIndex;},UploadPrepare:function(){var dr=new D2L.Util.DelayedReturn();var me=this;var numNotUploaded=0;for(var i=0;i<me.Children().length;i++){if(!me.Children()[i].IsUploaded()&&!me.Children()[i].IsEmpty()){numNotUploaded++;}}
dr.Trigger(numNotUploaded);return dr;},Upload:function(){var dr=new D2L.Util.DelayedReturn();var me=this;var FinishUpload=function(success){dr.Trigger(success);};var UploadFile=function(index){if(index<me.Children().length){FormManager.PrepareForUpload(dr);var childReturn=me.Children()[index].Upload();childReturn.Register(function(success){if(success){UploadFile(++index);}else{FinishUpload(false);}});}else{FinishUpload(true);}};this.UploadPrepare().Register(function(prepare){if(prepare>0){for(var i=me.Children().length-1;i>-1;i--){if(me.Children()[i].IsEmpty()){me.RemoveChild(me.Children()[i]);}}
UploadFile(0);}else{FinishUpload(prepare===0);}});return dr;}});D2L.Control.FileUpload.Item=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_anchorRemove=null;this.m_txtNumber=null;this.m_upload=null;this.m_fileLink=null;this.m_file=null;this.m_fileIdInput=null;this.m_fstInput=null;this.m_fileNameInput=null;this.m_index=0;},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_index=this.GetDomNode().rowIndex;if(this.Parent().AllowMultiple()){this.m_txtNumber=this.GetDomNode().cells[0].childNodes[0].firstChild;this.m_upload=this.GetDomNode().cells[1].firstChild;this.m_anchorRemove=this.GetDomNode().cells[2].firstChild;}else{this.m_upload=this.GetDomNode().cells[0].firstChild;}
this.SetIsEnabled(parent.IsEnabled());var me=this;if(this.m_anchorRemove){this.m_anchorRemove.onclick=function(){me.Parent().RemoveChild(me);};}},BuildDom:function(){if(!this.m_hasDomBeenBuilt&&this.Parent()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.Parent().GetDomNode().childNodes[1].insertRow(-1));this.m_index=this.GetDomNode().rowIndex;if(this.Parent().AllowMultiple()){var cell1=this.GetDomNode().insertCell(-1);cell1.style.verticalAlign='top';cell1.style.paddingTop='6px';var lblNumber=this.CreateElement('label');lblNumber.forId=UI.GetUniqueHtmlId();this.m_txtNumber=this.CreateTextNode((this.m_index+1)+'.');lblNumber.appendChild(this.m_txtNumber);cell1.appendChild(lblNumber);}
var cell2=this.GetDomNode().insertCell(-1);cell2.style.verticalAlign='top';this.m_upload=this.CreateElement('input');this.m_upload.type='file';this.m_upload.name=this.Parent().m_name+'_file_'+this.m_index;if(this.Parent().AllowMultiple()){this.m_upload.id=lblNumber.forId;}
this.AttachObject(this.m_upload,'onchange',function(evt){UI.GetWindowEventManager().BC(this,evt);});cell2.appendChild(this.m_upload);if(this.Parent().AllowMultiple()){var me=this;var cell3=this.GetDomNode().insertCell(-1);cell3.style.verticalAlign='top';cell3.style.paddingTop='6px';this.m_anchorRemove=this.CreateElement('a');this.m_anchorRemove.href='javascript://';this.AttachObject(this.m_anchorRemove,'onclick',function(){me.Parent().RemoveChild(me);});this.m_anchorRemove.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Framework.FileUpload.lblRemove')));cell3.appendChild(this.m_anchorRemove);}}},Focus:function(){if(!this.IsUploaded()){this.m_upload.focus();}else{this.m_fileLink.Focus();}},GetIndex:function(){return this.m_index;},GetFile:function(){if(this.m_file){return this.m_file;}
return null;},GetFileLink:function(){if(this.m_fileLink){return this.m_fileLink;}
return null;},GetFileName:function(includePath){if(includePath===undefined){includePath=true;}
if(this.m_upload){if(!includePath){if(this.m_upload.value.indexOf('\\')!=-1){return this.m_upload.value.substring(this.m_upload.value.lastIndexOf('\\')+1);}else{return this.m_upload.value.substring(this.m_upload.value.lastIndexOf('/')+1);}}
return this.m_upload.value;}
return'';},IsEmpty:function(){if(this.m_upload){return(this.m_upload.value.trim().length===0);}
return true;},IsUploaded:function(){return(this.m_fileLink!=null);},RenameFile:function(newFileName){if(this.m_file){this.m_file.Rename(newFileName);}
this.m_fileNameInput.value=newFileName;if(this.m_fileLink){this.m_fileLink.SetFile(this.m_file,false);}},SetIndex:function(index){this.m_index=index;if(this.m_txtNumber){this.m_txtNumber.data=(this.m_index+1)+'.';}
if(this.m_upload){this.m_upload.name=this.Parent().m_name+'_file_'+this.m_index;}
if(this.m_fileIdInput){this.m_fileIdInput.name=this.Parent().m_name+'_fileUrl_'+this.m_index;}
if(this.m_fstInput){this.m_fstInput.name=this.Parent().m_name+'_fst_'+this.m_index;}
if(this.m_fileNameInput){this.m_fileNameInput.name=this.Parent().m_name+'_fn_'+this.m_index;}},SetIsEnabled:function(isEnabled){if(this.m_upload){this.m_upload.disabled=!isEnabled;}},SetRemoveVisibility:function(isVisible){if(this.m_anchorRemove){this.m_anchorRemove.style.display=(isVisible)?'inline':'none';}},Upload:function(){var fileName=this.GetFileName(false);if(this.IsUploaded()||fileName.length===0){return new D2L.Util.DelayedReturn(true);}
var delayedReturn=new D2L.Util.DelayedReturn();var me=this;var progress=new D2L.Control.ProgressBar();var Finish=function(fileData){if(progress.GetStatus()!=D2L.Control.ProgressBar.ProgressStatus.Cancel){me.m_file=D2L.Serialization.JsonDeserializer.Deserialize(fileData,D2L.Files.FileInfo);var parent=me.m_upload.parentNode;D2L.Util.Purge(me.m_upload);parent.removeChild(me.m_upload);me.Parent().m_totalSize+=me.m_file.Size;progress.Complete();progress.Remove();me.SetRemoveVisibility(true);me.m_fileLink=new D2L.Control.FileLink(me.m_file);me.m_fileLink.AppendTo(parent);me.m_fstInput=me.CreateElement('input');me.m_fstInput.type='hidden';me.m_fstInput.name=me.Parent().m_name+'_fst_'+me.GetIndex();me.m_fstInput.value=me.m_file.FileSystemType;parent.appendChild(me.m_fstInput);me.m_fileIdInput=me.CreateElement('input');me.m_fileIdInput.type='hidden';me.m_fileIdInput.name=me.Parent().m_name+'_fid_'+me.GetIndex();me.m_fileIdInput.value=me.m_file.FileId;parent.appendChild(me.m_fileIdInput);me.m_fileNameInput=me.CreateElement('input');me.m_fileNameInput.type='hidden';me.m_fileNameInput.name=me.Parent().m_name+'_fn_'+me.GetIndex();me.m_fileNameInput.value='';parent.appendChild(me.m_fileNameInput);delayedReturn.Trigger(true);}};var UploadFinish=function(fileData){setTimeout(function(){Finish(fileData);},1);};var ProgressStatus=function(status){if(status==D2L.Control.ProgressBar.ProgressStatus.Fail){var msg='';me.m_upload.style.display='inline';if(me.Parent().GetCount()>1){me.SetRemoveVisibility(true);}
progress.Remove();me.Parent().SetValidationFailureIndex(me.m_index);if(progress.GetErrorCode()==1){var errorText=new D2L.LP.Text.LangTerm('Framework.FileUpload.errFileSize',Culture.FormatFileSize(me.Parent().GetMaxFileSize()));UI.GetMessageArea().AddError(errorText,me.Parent());}else if(progress.GetErrorCode()==2){var errorText=new D2L.LP.Text.LangTerm('Framework.FileUpload.errTotalFileSize',Culture.FormatFileSize(me.Parent().GetMaxFileSize()));UI.GetMessageArea().AddError(errorText,me.Parent());}
UI.GetMessageArea().ShowErrors();delayedReturn.Trigger(false);}else if(status==D2L.Control.ProgressBar.ProgressStatus.Cancel){me.m_upload.style.display='inline';me.SetRemoveVisibility(true);progress.Remove();delayedReturn.Trigger(false);}};var StartUpload=function(progressId){progress.SetProgressId(progressId);var uniqueId=UI.GetUniqueHtmlId();window[uniqueId]=UploadFinish;me.m_upload.disabled=false;UI.form.action='/d2l/common/upload/uploadFile.d2l'+'?ou='+Global.OrgUnitId+'&cb='+uniqueId+'&fileName='+D2L.Util.Url.Encode(fileName)+'&maxFileSize='+me.Parent().GetMaxFileSize()+'&maxTotalSize='+me.Parent().GetMaxTotalSize()+'&totalSize='+me.Parent().m_totalSize+'&progressId='+progressId;me.m_upload.style.display='inline';setTimeout(function(){UI.form.submit();UI.GenerateHitCode();me.m_upload.style.display='none';me.m_upload.disabled=true;},1);};var GetProgressId=function(){var SetProgressId=function(response){if(response.GetType()==D2L.Rpc.ResponseType.Success){StartUpload(response.GetResult());}else{delayedReturn.Trigger(false);}};D2L.Rpc.Create('CreateProgressBar',SetProgressId,'/d2l/common/rpc/progress/progress.d2l').Call();};this.m_upload.style.display='none';this.SetRemoveVisibility(false);progress.OnStatusChange.RegisterMethod(ProgressStatus);progress.AppendTo(this.m_upload.parentNode);GetProgressId();return delayedReturn;}});

D2L.Control.Heading=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_text=new D2L.LP.Text.PlainText('');this.m_isInFieldGroup=false;this.m_hasActions=false;this.m_isDisplayed=true;this.m_domHeading=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isInFieldGroup=deserializer.GetBoolean();this.m_hasActions=deserializer.GetBoolean();this.m_isDisplayed=deserializer.GetBoolean();if(this.m_isInFieldGroup){this.m_domHeading=this.GetDomNode().cells[0].firstChild;}else{this.m_domHeading=this.GetDomNode();}
this.m_text=new D2L.LP.Text.PlainText(this.m_domHeading.innerHTML);},SetIsDisplayed:function(isDisplayed){if(isDisplayed!=this.m_isDisplayed){if(this.IsRendered()){if(!isDisplayed){this.GetDomNode().style.display='none';}else{if(this.m_isInFieldGroup){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){this.GetDomNode().style.display='inline';}else{this.GetDomNode().style.display='table-row';}}else{this.GetDomNode().style.display='block';}}}
this.m_isDisplayed=isDisplayed;}},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Heading','SetText','text');if(this.IsRendered()){this.m_text.AssignText(this.m_domHeading,'innerHTML',true);}}});

D2L.Control.Hidden=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_value='';},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);if(deserializer.HasMember()){this.GetDomNode().ID2L=null;}
this.m_value=this.GetDomNode().value;},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('input'));this.GetDomNode().type='hidden';this.GetDomNode().name=this.GetMappedId();this.GetDomNode().value=this.m_value;}},GetMultiEditValue:function(){return this.GetValue();},GetState:function(serializer){serializer.AddMember('Value',this.GetValue());},GetValue:function(){if(this.IsRendered()){return this.GetDomNode().value;}else{return this.m_value;}},SetValue:function(value){this.m_value=value;if(this.IsRendered()){this.GetDomNode().value=value;}}});

D2L.Control.ImageViewer=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isDisplayed=true;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isDisplayed=deserializer.GetBoolean();},IsDisplayed:function(){return this.m_isDisplayed;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().display.display=isDisplayed?'inline':'none';}
this.m_isDisplayed=isDisplayed;}});

D2L.Control.InlineHelp=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isDisplayed=true;this.m_isEnabled=true;this.m_text=new D2L.LP.Text.PlainText();this.m_isInLine=true;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isDisplayed=this.GetDomNode().style.display!='none';this.m_isEnabled=this.GetDomNode().className!='dh_sd';this.m_isInLine=this.GetDomNode().style.display!='block';this.m_text=new D2L.LP.Text.PlainText(this.GetDomNode().innerHTML);},GetText:function(){return this.m_text;},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){return this.m_isEnabled;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){var dis='inline';if(!this.m_isInLine){dis='block';}
this.GetDomNode().style.display=isDisplayed?dis:'none';}
this.m_isDisplayed=isDisplayed;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){if(isEnabled){this.GetDomNode().className='dh_s';}else{this.GetDomNode().className='dh_sd';}}},SetText:function(text){this.m_text=text;if(this.IsRendered()){this.m_text.AssignHtml(this.GetDomNode(),'innerHTML');}}});

D2L.Control.Label=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isDisplayed=true;this.m_text=new D2L.LP.Text.PlainText();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isDisplayed=this.GetDomNode().style.display!='none';this.m_text=new D2L.LP.Text.PlainText(this.GetDomNode().innerHTML);},GetText:function(){return this.m_text;},IsDisplayed:function(){return this.m_isDisplayed;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'inline':'none';}
this.m_isDisplayed=isDisplayed;},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Label','SetText','text');if(this.IsRendered()){this.m_text.AssignHtml(this.GetDomNode(),'innerHTML');}}});

D2L.Layouts={};D2L.Layouts.ViewModeIntegration=function(domNodeId){var tableNode=UI.GetById(domNodeId);var Transform=function(){setTimeout(function(){for(var i=0;i<tableNode.rows.length;i++){var row=tableNode.rows[i];for(var j=0;j<row.cells.length;j++){var cell=row.cells[j];for(var k=0;k<cell.childNodes.length;k++){var child=cell.childNodes[k];if(child.className&&child.className.indexOf('dlay_autofill')!=-1){child.style.height='auto';}else if(child.firstChild&&child.firstChild.className&&child.firstChild.className.indexOf('dlay_autofill')!=-1){child.firstChild.style.height='auto';}}}}
D2L.Layouts.Adjustautofill(tableNode);},0);}
WindowEventManager.Transform.RegisterMethod(function(){try{Transform();}catch(e){}});try{Transform();}catch(e){}};D2L.Layouts.Adjustautofill=function(tableNode){for(var i=0;i<tableNode.rows.length;i++){var row=tableNode.rows[i];for(var j=0;j<row.cells.length;j++){var cell=row.cells[j];var panelsWithautofill=[];for(var k=0;k<cell.childNodes.length;k++){var child=cell.childNodes[k];if(child.className&&child.className.indexOf('dlay_autofill')!=-1){panelsWithautofill.push(child);}else if(child.firstChild&&child.firstChild.className&&child.firstChild.className.indexOf('dlay_autofill')!=-1){panelsWithautofill.push(child.firstChild);}}
for(var k=0;k<panelsWithautofill.length;k++){panelsWithautofill[k].style.height='auto';}
var originalCellHeight=cell.offsetHeight;if(panelsWithautofill.length>0){var originalHeight=panelsWithautofill[panelsWithautofill.length-1].offsetHeight;var increase=originalCellHeight+1;panelsWithautofill[panelsWithautofill.length-1].style.height=panelsWithautofill[panelsWithautofill.length-1].offsetHeight+increase+'px';var diff=increase-(cell.offsetHeight-originalCellHeight);var indDiff=diff/panelsWithautofill.length;for(var k=0;k<panelsWithautofill.length-1;k++){panelsWithautofill[k].style.height=panelsWithautofill[k].offsetHeight+indDiff+'px';}
panelsWithautofill[panelsWithautofill.length-1].style.height=originalHeight+indDiff+'px';}}}};

D2L.Control.LongEdit=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_backgroundColor='';this.m_height=-1;this.m_isDisplayed=true;this.m_isEnabled=true;this.m_text=new D2L.LP.Text.PlainText();this.m_title=new D2L.LP.Text.PlainText();this.m_width=-1;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);if(deserializer.HasMember()){this.GetDomNode().ID2L=null;}
this.m_isDisplayed=(this.GetDomNode().style.display!='none');this.m_isEnabled=!this.GetDomNode().disabled;this.m_text=new D2L.LP.Text.PlainText(this.GetDomNode().value);this.m_title=new D2L.LP.Text.PlainText(this.GetDomNode().getAttribute('title'));},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('textarea'));this.GetDomNode().name=this.GetMappedId();this.SetIsDisplayed(this.m_isDisplayed);this.SetText(this.m_text);this.SetTitle(this.m_title);this.SetBackgroundColor(this.m_backgroundColor);if(this.m_width>0){this.GetDomNode().style.width=this.m_width+'px';}
if(this.m_height>0){this.GetDomNode().style.height=this.m_height+'px';}}},Focus:function(){if(this.IsRendered()){this.GetDomNode().focus();}},GetMultiEditValue:function(){if(this.IsEnabled()&&this.IsRendered()){return this.GetDomNode().value;}
return'';},GetText:function(){if(this.IsRendered()){return new D2L.LP.Text.PlainText(this.GetDomNode().value);}
return this.m_text;},GetTextAsString:function(){if(this.IsRendered()){return this.GetDomNode().value;}
return'';},GetTitle:function(){return this.m_title;},GetState:function(serializer){if(this.IsRendered()){serializer.AddMember('Text',this.GetDomNode().value);}},GetValue:function(){return this.GetText().GetText();},GetValueNoDelay:function(){return this.GetTextAsString();},HasValue:function(){var dr=new D2L.Util.DelayedReturn();this.GetText().GetText().Register(function(value){dr.Trigger(value.trim().length>0);});return dr;},HasValueNoDelay:function(){return this.GetTextAsString().trim().length>0;},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){if(this.IsRendered()){return!this.GetDomNode().disabled;}else{return this.m_isEnabled;}},SetBackgroundColor:function(color){this.m_backgroundColor=color;if(this.IsRendered()){this.GetDomNode().style.backgroundColor=color;}},SetHeight:function(height){this.m_height=height;if(this.IsRendered()){if(height>0){this.GetDomNode().style.height=height+'px';}else{this.GetDomNode().style.height='auto';}}},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'inline':'none';}
this.m_isDisplayed=isDisplayed;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){this.GetDomNode().disabled=!isEnabled;}},SetText:function(text){this.m_text=text;if(this.IsRendered()){this.m_text.AssignText(this.GetDomNode(),'value');}},SetTitle:function(title){this.m_title=title;if(this.IsRendered()){this.m_title.AssignText(this.GetDomNode(),'title');}},SetWidth:function(width){this.m_width=width;if(this.IsRendered()){if(width>0){this.GetDomNode().style.width=width+'px';}else{this.GetDomNode().style.width='auto';}}}});

D2L.Control.PathSelector=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.PathSelector);this.m_allowSharedFilesPaths=true;this.m_browseButton=null;this.m_canEdit=true;this.m_domLabel=null;this.m_domInput=null;this.m_domInputOriginal=null;this.m_instructions='';this.m_isEnabled=true;this.m_path='';this.m_restrictToCurrentOrgUnit=true;this.m_selectPathDialog=null;},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('span'));this.GetDomNode().className=this.IsEnabled()?'dps_c':'dps_c dps_c_d';this.m_domInput=this.CreateElement('input');this.m_domInput.type='hidden';this.m_domInput.name=this.GetMappedId()+'_v';this.m_domInput.value=this.GetPath();this.GetDomNode().appendChild(this.m_domInput);this.m_domInputOriginal=this.CreateElement('input');this.m_domInputOriginal.type='hidden';this.m_domInputOriginal.name=this.GetMappedId()+'_o';this.m_domInputOriginal.value=this.GetPath();this.GetDomNode().appendChild(this.m_domInputOriginal);this.m_domLabel=this.CreateElement('label');this.m_domLabel.appendChild(this.CreateTextNode(this.GetDisplayPath()));this.GetDomNode().appendChild(this.m_domLabel);var me=this;this.m_browseButton=new D2L.Control.Button(new D2L.LP.Text.LangTerm('Standard.Buttons.btnBrowse'));this.m_browseButton.SetOnClick(function(){me.OpenDialog();});this.m_browseButton.AppendTo(this.GetDomNode());}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_canEdit=deserializer.GetBoolean();this.m_allowSharedFilesPaths=deserializer.GetBoolean();this.m_restrictToCurrentOrgUnit=deserializer.GetBoolean();this.m_instructions=deserializer.GetMember();;this.m_isEnabled=deserializer.GetBoolean();var name=deserializer.GetMember();this.m_domInput=this.GetDomNode().childNodes[0];this.m_domInputOriginal=this.GetDomNode().childNodes[1];this.m_path=this.m_domInput.value;this.m_domLabel=this.GetDomNode().childNodes[2];if(this.m_canEdit){this.m_browseButton=UI.GetControl(this.GetMappedId()+'_b');var me=this;this.m_browseButton.SetOnClick(function(){me.OpenDialog();});}},Disable:function(){this.SetIsEnabled(false);},Enable:function(){this.SetIsEnabled(true);},GetPath:function(){return this.m_path;},GetDisplayPath:function(){var path=this.GetPath();var displayPath=path;if(path.substr(0,1)!='/'){displayPath=Global.OrgUnitPath+path;}
return displayPath;},HasChanged:function(){if(this.m_domInput&&this.m_domInputOriginal){return(this.m_domInput.value!=this.m_domInputOriginal.value);}
return false;},IsEnabled:function(){return this.m_isEnabled;},OpenDialog:function(){if(!this.m_selectPathDialog){var me=this;var Callback=function(dialogResponse){if(dialogResponse.GetType()==D2L.Dialog.ResponseType.Positive){me.SetPath(dialogResponse.GetData('path'));}
dialogResponse.GetDialog().Close();};this.m_selectPathDialog=new D2L.Dialog.SelectPath(Callback);}
this.m_selectPathDialog.SetAllowSharedFilesPaths(this.m_allowSharedFilesPaths);this.m_selectPathDialog.SetRestrctToCurrentOrgUnit(this.m_restrictToCurrentOrgUnit);this.m_selectPathDialog.SetInstructions(this.m_instructions);this.m_selectPathDialog.SetInitialPath(this.m_path);this.m_selectPathDialog.Open(this.m_browseButton);},SetCanEdit:function(canEdit){if(canEdit!=this.m_canEdit){this.m_canEdit=canEdit;if(this.m_browseButton){if(canEdit){this.m_browseButton.Show();}else{this.m_browseButton.Hide();}}}},SetInstructions:function(instructions){this.m_instructions=instructions;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.m_browseButton){this.m_browseButton.SetIsEnabled(isEnabled);}
if(this.GetDomNode()){var className='dps_c';if(!isEnabled){className+=' dps_c_d';}
this.GetDomNode().className=className;}},SetPath:function(path,triggerChange){if(triggerChange===undefined){triggerChange=true;}
if(this.m_path!=path){this.m_path=path;if(this.m_domInput){this.m_domInput.value=path;}
if(this.m_domLabel){if(this.m_domLabel.firstChild){D2L.Util.Purge(this.m_domLabel.firstChild);this.m_domLabel.removeChild(this.m_domLabel.firstChild);}
this.m_domLabel.appendChild(document.createTextNode(this.GetDisplayPath()));}
if(triggerChange){WindowEventManager.BC(this.GetDomNode(),null);}}}});D2L.Files.PathSelector=D2L.Control.PathSelector;

D2L.Control.RadioButton=D2L.Control.extend({Construct:function(group,text,value){arguments.callee.$.Construct.call(this);if(group===undefined){group='';}
text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.RadioButton','Constructor','text');if(value===undefined){value='';}
this.m_group=group;this.m_text=text;this.m_value=value;this.m_isEnabled=true;this.m_label=null;this.m_input=null;this.m_isSelected=false;this.m_onClickEvent=new D2L.EventHandler();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_input=this.GetDomNode();this.m_isEnabled=!this.m_input.disabled;var hasText=deserializer.GetBoolean();if(hasText){this.m_label=this.m_input.nextSibling;this.m_text=new D2L.LP.Text.PlainText(this.m_label.innerHTML);}
this.m_group=this.m_input.name;this.m_value=this.m_input.value;this.InstallEvents();},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.GetUI().CreateElement('span'));if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<8){this.m_input=this.GetUI().CreateElement('<input type="radio" name="'+this.m_group+'" />');}else{this.m_input=this.GetUI().CreateElement('input');this.m_input.type='radio';this.m_input.name=this.m_group;}
this.m_input.className='d_rdo';this.m_input.id=this.GetMappedId();this.m_input.value=this.m_value;this.GetDomNode().appendChild(this.m_input);this.SetIsSelected(this.m_isSelected);this.SetIsEnabled(this.m_isEnabled);this.SetText(this.m_text);this.InstallEvents();},GetMultiEditValue:function(){return D2L.Control.RadioButton.GetSelectedValue(this.m_group);},GetState:function(serializer){serializer.AddMember('SelectedVal',D2L.Control.RadioButton.GetSelectedValue(this.m_group));},GetValue:function(){return this.m_value;},InstallEvents:function(){var me=this;var clickFunc=function(evt){me.OnClickEvent().Trigger(me);};if(this.m_input.addEventListener){this.m_input.addEventListener('click',clickFunc,false);}else if(this.m_input.attachEvent){this.m_input.attachEvent('onclick',clickFunc);}},IsEnabled:function(){return this.m_isEnabled;},IsSelected:function(){if(this.IsRendered()){return this.m_input.checked;}else{return this.m_isSelected;}},OnClickEvent:function(){return this.m_onClickEvent;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){if(this.m_label!==null){this.m_label.className=(this.m_isEnabled)?'':'d_rdo_d';}
this.m_input.disabled=!this.m_isEnabled;}},SetIsSelected:function(isSelected){this.m_isSelected=isSelected;if(this.IsRendered()){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<8){this.m_input.defaultChecked=isSelected;}
this.m_input.checked=isSelected;}},SetText:function(text){this.m_text=text;if(this.IsRendered()){if(this.m_label===null){this.m_label=this.CreateElement('label');this.m_label.htmlFor=this.GetMappedId();this.m_label.className=(this.m_isEnabled)?'':'d_rdo_d';if(this.m_input.nextSibling){this.m_input.parentNode.insertBefore(this.m_label,this.m_input.nextSibling);}else{this.m_input.parentNode.appendChild(this.m_label);}}
while(this.m_label.childNodes.length>0){this.m_label.removeChild(this.m_label.childNodes[0]);}
this.m_label.appendChild(this.CreateTextNode(this.m_text));}},SetValue:function(value){this.m_value=value;if(this.IsRendered()){this.m_input.value=value;}}});D2L.Control.RadioButton.GetSelectedValue=function(group){var form=UI.GetForm();if(form){var rdoGroup=form[group];if(rdoGroup){if(rdoGroup.length===undefined){if(rdoGroup.checked){return rdoGroup.value;}}else{for(var i=0;i<rdoGroup.length;i++){if(rdoGroup[i].checked){return rdoGroup[i].value;}}}}}
return'';};D2L.Control.RadioButton.SetSelectedValue=function(group,value){var form=UI.GetForm();if(form){var rdoGroup=form[group];if(rdoGroup){if(rdoGroup.length===undefined){if(rdoGroup.value==value){rdoGroup.checked=true;}}else{for(var i=0;i<rdoGroup.length;i++){if(rdoGroup[i].value==value){rdoGroup[i].checked=true;}}}}}};

D2L.Control.RichText=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_text=new D2L.LP.Text.PlainText();this.m_isHtml=false;this.m_isInline=false;this.m_textDomNode=null;},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('div'));this.GetDomNode().className='D2LRichText';this.m_textDomNode=this.GetDomNode();this.SetIsInline(this.m_isInline);this.SetText(this.m_text);}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isInline=deserializer.GetBoolean();this.m_isHtml=deserializer.GetBoolean();var domNode=this.GetDomNode();if(domNode.firstChild&&domNode.firstChild.tagName&&domNode.firstChild.tagName.toLowerCase()=='label'){this.m_textDomNode=domNode.firstChild;}else{this.m_textDomNode=domNode;}
if(this.m_isHtml){this.m_text=new D2L.LP.Text.HtmlText(this.m_textDomNode.innerHTML,false);}else{this.m_text=new D2L.LP.Text.PlainText(D2L.Util.Html.Decode(this.m_textDomNode.innerHTML));}},IsInline:function(){return this.m_isInline;},GetText:function(){return this.m_text;},SetIsInline:function(isInline){this.m_isInline=isInline;if(this.IsRendered()){this.GetDomNode().style.display=this.m_isInline?'inline':'block';}},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.RichText','SetText','text');if(this.IsRendered()){this.m_textDomNode.innerHTML='';var textDomNode=this.m_textDomNode;this.m_text.GetHtml().Register(function(val){D2L_MathML.AssignHtml(textDomNode,val);});}}});

function d2l_ServerComm(){var me=this;this.DefaultRequestMethod='GET';this.XmlHttp=false;this.IsInit=false;this.RequestMethod=this.DefaultRequestMethod;this.CallbackFunction=null;this.Url=null;this.Send=ServerComm_Send;this.Init=ServerComm_Init;this.OnReadyStateChange=function ServerComm_OnReadyStateChange(){if(me.XmlHttp.readyState==4){me.CallbackFunction(me.XmlHttp.responseText,me.XmlHttp.status);}};}
function ServerComm_Send(params){if(this.Url===null){throw('No Url specified in d2l_ServerComm class.');}
if(this.CallbackFunction===null){throw('No callback function specified in d2l_ServerComm class.');}
if(!this.IsInit){this.Init();}
if(params===undefined){params=null;}
var reqMethod=this.RequestMethod.toString().toUpperCase();switch(reqMethod){case'GET':break;case'POST':break;default:this.RequestMethod=this.DefaultRequestMethod;break;}
if(this.XmlHttp){try{this.XmlHttp.open(this.RequestMethod,this.Url,true);this.XmlHttp.onreadystatechange=this.OnReadyStateChange;if(reqMethod=='POST'){this.XmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');}
this.XmlHttp.send(encodeURI(params));}catch(E){}}}
function ServerComm_Init(){if(this.IsInit){return;}
try{this.XmlHttp=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{this.XmlHttp=new ActiveXObject(' Microsoft.XMLHTTP');}catch(E){this.XmlHttp=false;}}
if(!this.XmlHttp&&(typeof XMLHttpRequest!='undefined')){this.XmlHttp=new XMLHttpRequest();}
this.IsInit=true;}

D2L.Control.Slideshow=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Slideshow);this.m_timer=null;this.m_oldImageNumber=-1;this.m_imageNumber=-1;this.m_numImages=0;this.m_paused=false;this.m_autoplay=true;this.m_displayTime=3000;this.m_randomize=false;this.m_showCaption=true;this.m_size=300;this.m_images=[];this.m_caption=null;this.m_prevImg=null;this.m_playPauseImg=null;this.m_nextImg=null;this.m_slideImg=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var me=this;this.m_paused=!deserializer.GetBoolean();this.m_displayTime=deserializer.GetMember();this.m_randomize=deserializer.GetBoolean();this.m_showCaption=deserializer.GetBoolean();this.m_size=deserializer.GetMember();this.m_images=deserializer.GetObjectArrayMin(D2L.Files.FileInfo);this.m_numImages=this.m_images.length;this.m_slideImg=this.GetDomNode().childNodes[0];if(this.m_showCaption){this.m_caption=this.GetDomNode().childNodes[1];}
this.m_prevImg=UI.GetControl(this.GetMappedId()+'_prev');this.m_playPauseImg=UI.GetControl(this.GetMappedId()+'_playPause');this.m_nextImg=UI.GetControl(this.GetMappedId()+'_next');this.InstallEvents();this.Start();},InstallEvents:function(){var me=this;this.m_prevImg.SetOnClick(function(){me.Previous();});this.m_playPauseImg.SetOnClick(function(){if(me.IsPaused()){me.Resume();}else{me.Pause();}});this.m_nextImg.SetOnClick(function(){me.Next();});var swap=function(img,term){img.SetImage(new D2L.Images.ImageTerm(term));};this.m_playPauseImg.OnMouseOver.RegisterMethod(function(img){swap(img,me.IsPaused()?'Framework.Slideshow.actPlayHover':'Framework.Slideshow.actPauseHover');});this.m_playPauseImg.OnMouseOut.RegisterMethod(function(img){swap(img,me.IsPaused()?'Framework.Slideshow.actPlay':'Framework.Slideshow.actPause');});this.m_nextImg.OnMouseOver.RegisterMethod(function(img){swap(img,'Framework.Slideshow.actNextHover');});this.m_nextImg.OnMouseOut.RegisterMethod(function(img){swap(img,'Framework.Slideshow.actNext');});this.m_prevImg.OnMouseOver.RegisterMethod(function(img){swap(img,'Framework.Slideshow.actPrevHover');});this.m_prevImg.OnMouseOut.RegisterMethod(function(img){swap(img,'Framework.Slideshow.actPrev');});},IsPaused:function(){return this.m_paused;},Start:function(){this.m_imageNumber=0;this.ChangeImage();if(!this.m_paused){this.StartTimer();}},ChooseNewImage:function(direction){if(this.m_numImages>1){if(direction>0){if(this.m_randomize){this.m_oldImageNumber=this.m_imageNumber;this.m_imageNumber=this.m_numImages;while(this.m_imageNumber>=this.m_numImages||this.m_imageNumber==this.m_oldImageNumber){this.m_imageNumber=Math.floor(this.m_numImages*Math.random());}}else{this.m_imageNumber=(this.m_imageNumber+1)%this.m_numImages;}}else{if(this.m_randomize){if(this.m_oldImageNumber!=-1){this.m_imageNumber=this.m_oldImageNumber;}}else{this.m_imageNumber=(this.m_imageNumber+this.m_numImages-1)%this.m_numImages;}}}},ChangeImage:function(){if(this.m_images.length>this.m_imageNumber){this.m_slideImg.src=D2L.Util.GetViewImageFileUrl(this.m_images[this.m_imageNumber],this.m_size,'#eff8ff');if(this.m_showCaption){this.m_caption.innerHTML=this.m_images[this.m_imageNumber].GetDescription();}}},Next:function(){this.ChooseNewImage(1);this.ChangeImage();if(!this.m_paused){this.StopTimer();this.StartTimer();}},Previous:function(){this.ChooseNewImage(-1);this.ChangeImage();if(!this.m_paused){this.StopTimer();this.StartTimer();}},Pause:function(){if(!this.IsPaused()){this.m_paused=true;this.m_playPauseImg.SetImage(new D2L.Images.ImageTerm('Framework.Slideshow.actPlayHover'));this.m_playPauseImg.SetAlt(new D2L.LP.Text.LangTerm('Framework.Slideshow.altPlay'));this.StopTimer();}},Resume:function(){if(this.IsPaused()){this.m_paused=false;this.m_playPauseImg.SetImage(new D2L.Images.ImageTerm('Framework.Slideshow.actPauseHover'));this.m_playPauseImg.SetAlt(new D2L.LP.Text.LangTerm('Framework.Slideshow.altPause'));this.StartTimer();}},StartTimer:function(){var me=this;this.m_intervalId=setInterval(function(){me.ChooseNewImage(1);me.ChangeImage();},this.m_displayTime);},StopTimer:function(){clearInterval(this.m_intervalId);}});

D2L.Control.StyleSheet=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_sheet=null;},IntegrateControl:function(deserializer){this.m_sheet=YAHOO.util.StyleSheet(YAHOO.util.Dom.get(this.GetMappedId()));},Set:function(selector,obj){this.m_sheet.set(selector,obj);},UnSet:function(selector,obj){this.m_sheet.unset(selector,obj);}});

D2L.Tagging={};D2L.Tagging.Tag=D2L.Class.extend({Construct:function(tagText,tagType){arguments.callee.$.Construct.call(this);if(tagText==undefined){tagText='';}
if(tagType==undefined){tagType=D2L.Tagging.TagType.Public;}
this.m_tagText=tagText.trim().toLowerCase();this.m_tagType=tagType;},GetText:function(){return this.m_tagText;},GetType:function(){return this.m_tagType;},SetText:function(text){this.m_tagText=text.trim().toLowerCase();},SetType:function(type){this.m_tagType=type;},Serialize:function(serializer){serializer.AddMember('Text',this.m_tagText);serializer.AddMember('Type',this.m_tagType);},Deserialize:function(deserializer){this.m_tagText=deserializer.GetMember('Text').trim().toLowerCase();this.m_tagType=deserializer.GetMember('Type');}});D2L.Tagging.TagType={Public:0,Private:1};D2L.Tagging.TokenizeTags=function(tags){var tokenizedTags=new Array();tags=' '+tags+' ';var origTags=tags;var regExPhrases=/@?"[^"]+"/g;var phrases=tags.match(regExPhrases);if(phrases==null){phrases=new Array();}
var sWeirdString='5t$5b6aaf4b8a6c6c498a74cc6d$$35';for(var i=0;i<phrases.length;i++){var phrase=' '+phrases[i].trim()+' ';tags=tags.replace(phrase,' '+sWeirdString+''+i+' ');}
var wordsAndPhrases=tags.split(/\s+/);if(wordsAndPhrases==null){wordsAndPhrases=new Array();}
for(var i=0;i<wordsAndPhrases.length;i++){if(wordsAndPhrases[i].trim()!=''){if(wordsAndPhrases[i].trim().indexOf(sWeirdString)!=-1){var ph=wordsAndPhrases[i].trim();var a=ph.lastIndexOf(sWeirdString);var ind=ph.substr(a+sWeirdString.length).trim();wordsAndPhrases[i]=phrases[ind];}
tokenizedTags.push(wordsAndPhrases[i].trim());}}
if(tokenizedTags==null){tokenizedTags=new Array();}
return tokenizedTags;};D2L.Tagging.ConvertTokenizedTagsToTagEntity=function(tokenizedTags){var result=[];for(var i=0;i<tokenizedTags.length;i++){var tagValue=tokenizedTags[i];var tagType;if(tagValue.indexOf('@')==0){tagType=D2L.Tagging.TagType.Private;tagValue=tagValue.substr(1);}else{tagType=D2L.Tagging.TagType.Public;}
if(tagValue.charAt(0)=='"'&&tagValue.charAt(tagValue.length-1)=='"'){tagValue=tagValue.substring(1,tagValue.length-1);}
if(tagValue.trim()!=''){var tagEntity=new D2L.Tagging.Tag(tagValue,tagType);result.push(tagEntity);}}
return result;};D2L.Tagging.ValidateTagsSyntax=function(tags){var isValid=true;for(var i=0;i<tags.length;i++){var tag=tags[i];if(tag.GetText().length>128){isValid=false;var primaryError=new D2L.LP.Text.LangTerm('Framework.Tags.errNumCharsPrimary',tag.GetText().substring(0,30)+'...');var secondaryError=new D2L.LP.Text.LangTerm('Framework.Tags.errNumCharsSecondary');UI.Error(primaryError,secondaryError);break;}
if(tag.GetText().indexOf('"')>-1){isValid=false;var primaryError=new D2L.LP.Text.LangTerm('Framework.Tags.errInvalidCharPrimary',tag.GetText());var secondaryError=new D2L.LP.Text.LangTerm('Framework.Tags.errInvalidCharSecondary');UI.Error(primaryError,secondaryError);break;}}
return isValid;};D2L.Control.TagInput=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Tags);this.m_autoCompleteHandler=null;this.m_canAddTags=null;this.m_canDelete=null;this.m_isEnabled=true;this.m_tagsListControl=null;this.m_tagsEditControl=null;this.m_domEdit=null;this.m_addTagButtonControl=null;this.m_inlineHelpControl=null;this.m_tagItems=[];this.m_prevEditValue='';this.m_prevEditCursorIndex=-1;this.m_editedTagIndex=-1;this.m_autoCompleteHandler=null;this.m_canUsePrivateTags=null;this.m_canUseTagVocabulary=null;this.m_isForCriteria=null;},AddTag:function(tag,isNewTag){this.AddTags([tag],isNewTag);},AddTags:function(tags,areNewTags){if(areNewTags===undefined){areNewTags=true;}
var newItemsToAdd=[];var tagsToRestore=[];var me=this;for(var i=0;i<tags.length;i++){var tag=tags[i];var isValid=true;if(tag.GetText().length>128||tag.GetText().indexOf('"')>-1){isValid=false;}
if(areNewTags){if(!this.m_canUsePrivateTags&&tag.GetType()==D2L.Tagging.TagType.Private){isValid=false;}
if(!this.m_canUseTagVocabulary&&tag.GetType()==D2L.Tagging.TagType.Public){isValid=false;}}
if(isValid){for(var j=0;j<this.m_tagItems.length;j++){if(this.m_tagItems[j].GetTag().GetText()==tag.GetText()&&this.m_tagItems[j].GetTag().GetType()==tag.GetType()){isValid=false;if(this.m_tagItems[j].IsDeleted()){tagsToRestore.push(this.m_tagItems[j]);}
break;}}}
if(isValid){var tagItem=new D2L.Control.TagInput.TagItem(tag,areNewTags,this);tagItem.SetIsEnabled(this.IsEnabled());this.m_tagItems.push(tagItem);var listItem=new D2L.Control.ListItem();listItem.AppendChild(tagItem);newItemsToAdd.push(listItem);}}
if(newItemsToAdd.length>0||tagsToRestore.length>0){var changeEvent=new D2L.ChangeEvent(this.m_tagsListControl.GetDomNode());changeEvent.hasChangeBeenShown=true;changeEvent.Bubble();}
this.m_tagsListControl.AppendChildren(newItemsToAdd);for(var i=0;i<tagsToRestore.length;i++){this.DeleteRestoreHelper(tagsToRestore[i]);}},AddTags_Helper:function(tags){var tagValues=D2L.Tagging.TokenizeTags(tags);var tagsToAdd=D2L.Tagging.ConvertTokenizedTagsToTagEntity(tagValues);var isValid=D2L.Tagging.ValidateTagsSyntax(tagsToAdd);if(isValid){this.AddTags(tagsToAdd,true);if(this.m_domEdit!=null){this.m_domEdit.value='';this.m_domEdit.focus();}}},AutoCompleteCallback:function(matchInfo){var tags=D2L.Tagging.TokenizeTags(this.m_prevEditValue);var me=this;matchInfo.GetPrimaryText().GetText().Register(function(primaryText){var isPrivate=matchInfo.GetData('IsPrivate');if(primaryText.indexOf(' ')!=-1){primaryText='"'+primaryText+'"';}
if(isPrivate=='1'){primaryText="@"+primaryText;}
if(isPrivate=='0'&&primaryText.charAt(0)=='@'){primaryText='"'+primaryText+'"';}
tags[me.m_editedTagIndex]=primaryText;var cursorPosition=0;var newVal='';for(var i=0;i<tags.length;i++){newVal+=tags[i]+' ';if(i==me.m_editedTagIndex){cursorPosition=newVal.length;}}
me.m_domEdit.value=newVal;var setCursorPosition=function(){UI.SetCursorPositionInEdit(me.GetWindow(),me.m_domEdit,cursorPosition-1);}
setTimeout(setCursorPosition,0);});},AutoCompleteDataProvider:function(val){var ret=new D2L.Util.DelayedReturn();var me=this;var returnEmpty=false;var isPrivate=false;var formatKeyword=function(keyword){if(keyword.indexOf('@')==0){if(me.m_canUsePrivateTags){isPrivate=true;keyword=keyword.substring(1,keyword.length);}else{isPrivate=false;}}else if(!me.m_canUseTagVocabulary){return'';}
keyword=keyword.trim().toLowerCase();if(keyword.charAt(0)=='"'&&keyword.charAt(keyword.length-1)=='"'){return keyword.substring(1,keyword.length-1).trim();}else if(keyword.indexOf('"')!=-1){return'';}else{return keyword;}};index=UI.GetCursorPositionInEdit(this.GetWindow(),this.m_domEdit)-1;var keyword=val;if(keyword==''){returnEmpty=true;}else{var cVal=val.substring(0,index+1)+'$5b6aaf4b8a6c6c498a74cc6d$'+val.substring(index+1);newTokenizedTags=D2L.Tagging.TokenizeTags(cVal);for(var i=0;i<newTokenizedTags.length;i++){if(newTokenizedTags[i].indexOf('$5b6aaf4b8a6c6c498a74cc6d$')!=-1){var unformattedKeyword=newTokenizedTags[i].replace('$5b6aaf4b8a6c6c498a74cc6d$','')
var aTag=formatKeyword(unformattedKeyword);if(aTag!=''||(isPrivate&&unformattedKeyword=='@')){this.m_editedTagIndex=i;keyword=aTag;break;}else{returnEmpty=true;break;}}}}
var callback=function(response){var matches=[];if(response.GetResponseType()==D2L.Rpc.ResponseType.Success){var result=response.GetResult(D2L.Control.AutoComplete.MatchInfo);matches=result;}
ret.Trigger(matches);};if(!returnEmpty){D2L.Rpc.Create('Lookup',callback,'/d2l/common/rpc/tags/tags.d2l').Call(keyword,isPrivate);}else{setTimeout(function(){ret.Trigger([]);},0);}
this.m_prevEditValue=val;this.m_prevEditCursorIndex=index+1;return ret;},DeleteRestoreHelper:function(tag){var changeEvent=new D2L.ChangeEvent(this.m_tagsListControl.GetDomNode());changeEvent.hasChangeBeenShown=true;changeEvent.Bubble();if(!tag.IsDeleted()){this.RemoveTagHelper(tag);}else{this.RestoreTagHelper(tag);}},InstallEvents:function(){var me=this;Nav.OnNavigate.RegisterMethod(function(){var hiddenNewTags=UI.GetControl(me.GetMappedId()+'_nt');var serializedNewTags=D2L.Serialization.JsonSerializer.Serialize(me.GetNewTags());hiddenNewTags.SetValue(serializedNewTags);var hiddenDeletedTags=UI.GetControl(me.GetMappedId()+'_dt');var serializedDeletedTags=D2L.Serialization.JsonSerializer.Serialize(me.GetDeletedTags());hiddenDeletedTags.SetValue(serializedDeletedTags);});if(this.m_addTagButtonControl!=null){this.m_addTagButtonControl.SetOnClick(function(){me.AddTags_Helper(me.m_tagsEditControl.GetTextAsString());});}
if(this.m_domEdit!=null){this.m_domEdit.setAttribute('autocomplete','off');}
var handleOnKeyPress=function(obj,evt){if(evt.GetKey()==D2L.KeyPressEvent.Key.Enter){evt.StopPropagation();if(me.m_autoCompleteHandler==null||!me.m_autoCompleteHandler.IsExpanded()){me.AddTags_Helper(obj.value);}
return false;}else{return true;}};if(this.m_domEdit!=null){WindowEventManager.InstallKpel(this.m_domEdit,handleOnKeyPress);if(this.HasAutoComplete()){var width=350;this.m_autoCompleteHandler=new D2L.Control.AutoComplete(function(val){return me.AutoCompleteDataProvider(val);});this.m_autoCompleteHandler.SetWidth(width);this.m_autoCompleteHandler.SetAutoPopulateEdit(false);this.m_autoCompleteHandler.OnSelectMatch().RegisterMethod(function(matchInfo){me.AutoCompleteCallback(matchInfo);});this.m_autoCompleteHandler.OnHighlightMatch().RegisterMethod(function(matchInfo,source){if(source==D2L.Control.AutoComplete.HeighlightSource.Keyboard){me.AutoCompleteCallback(matchInfo);}});this.m_autoCompleteHandler.OnCancel().RegisterMethod(function(){if(me.m_domEdit){me.m_domEdit.value=me.m_prevEditValue.trim();}
if(me.m_prevEditCursorIndex>=0){UI.SetCursorPositionInEdit(me.GetWindow(),me.m_domEdit,me.m_prevEditCursorIndex);}});this.m_autoCompleteHandler.Install(this.m_domEdit);}}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_tagsListControl=UI.GetControl(this.GetMappedId()+'_l');this.m_addTagButtonControl=UI.GetControl(this.GetMappedId()+'_b');this.m_tagsEditControl=UI.GetControl(this.GetMappedId()+'_e');this.m_inlineHelpControl=UI.GetControl(this.GetMappedId()+'_i');if(this.m_tagsEditControl!=null){this.m_domEdit=this.m_tagsEditControl.GetDomNode();}
this.m_isEnabled=deserializer.GetBoolean();this.m_hasAutoComplete=deserializer.GetBoolean();this.m_canDelete=deserializer.GetBoolean();var existingTags=deserializer.GetObject(D2L.Tagging.Tag);this.m_isForCriteria=deserializer.GetBoolean();this.m_canUseTagVocabulary=deserializer.GetBoolean();this.m_canUsePrivateTags=deserializer.GetBoolean();this.m_canAddTags=this.m_canUsePrivateTags||this.m_canUseTagVocabulary;this.InstallEvents();this.AddTags(existingTags,false);},IsEnabled:function(){return this.m_isEnabled;},GetAllTags:function(){var result=[];for(var i=0;i<this.m_tagItems.length;i++){var item=this.m_tagItems[i];if(!item.IsDeleted()){result.push(item.GetTag());}}
return result;},GetDeletedTags:function(){var result=[];for(var i=0;i<this.m_tagItems.length;i++){var item=this.m_tagItems[i];if(item.IsDeleted()&&!item.IsNew()){result.push(item.GetTag());}}
return result;},GetNewTags:function(){var result=[];for(var i=0;i<this.m_tagItems.length;i++){var item=this.m_tagItems[i];if(!item.IsDeleted()&&item.IsNew()){result.push(item.GetTag());}}
return result;},HasAutoComplete:function(){return this.m_hasAutoComplete;},RemoveTagHelper:function(tagItem){var changeEvent=new D2L.ChangeEvent(this.IDomNode);changeEvent.hasChangeBeenShown=true;changeEvent.Bubble();if(!tagItem.IsDeleted()){tagItem.SetIsDeleted(true);}
tagItem.RenderDeleteRestore();},RestoreTagHelper:function(tagItem){if(tagItem.IsDeleted()){tagItem.SetIsDeleted(false);}
tagItem.RenderDeleteRestore();},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){if(this.m_canAddTags){this.m_tagsEditControl.SetIsEnabled(isEnabled);this.m_addTagButtonControl.SetIsEnabled(isEnabled);}
if(this.m_inlineHelpControl){this.m_inlineHelpControl.SetIsEnabled(isEnabled);}
for(var i=0;i<this.m_tagItems.length;i++){this.m_tagItems[i].SetIsEnabled(isEnabled);}}}});D2L.Control.TagInput.TagItem=D2L.Control.extend({Construct:function(tag,isNew,parentTagInput){arguments.callee.$.Construct.call(this,D2L.Control.Type.TagItem);this.m_deleteAnchor=null;this.m_deleteIcon=null;this.m_isDeleted=false;this.m_isEnabled=true;this.m_isMouseOver=false;this.m_isNew=isNew;this.m_parentTagInputControl=parentTagInput;this.m_tag=tag;},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('span'));this.GetDomNode().className=(this.IsNew()?'dta_p':'dta_c');var tagText=this.GetTag().GetText();var tagTextFontStyle='normal';if(this.GetTag().GetType()==D2L.Tagging.TagType.Private){tagText=new D2L.LP.Text.LangTerm('Framework.Tags.lblPrivateTag',tagText);tagTextFontStyle='italic';}
var textSpanDom=this.CreateElement('span');textSpanDom.appendChild(this.CreateTextNode(tagText));textSpanDom.style.fontStyle=tagTextFontStyle;if(this.GetTag().GetType()==D2L.Tagging.TagType.Private){textSpanDom.style.color='#666666';}
textSpanDom.className='dta_t';this.GetDomNode().appendChild(textSpanDom);if(this.m_parentTagInputControl.m_canDelete||this.IsNew()){this.m_deleteAnchor=this.CreateElement('a');if(this.IsEnabled()){this.m_deleteAnchor.href='javascript://';}
var item=this;this.AttachObject(this.m_deleteAnchor,'onclick',function(){if(item.IsEnabled()){item.m_parentTagInputControl.DeleteRestoreHelper(item);}});var mouseOverHandler=function(e){if(!item.IsEnabled()){return false;}
var timeOutFunction=function(){if(item.m_isMouseOver){var span=item.GetDomNode();span.className='dta_h';}};item.m_isMouseOver=true;if(e===undefined){e=window.event;}
if(e.type=='focus'){timeOutFunction();}else{setTimeout(timeOutFunction,600);}};var mouseOutHandler=function(){if(!item.IsEnabled()){return false;}
var span=item.GetDomNode();item.m_isMouseOver=false;if(!item.IsDeleted()){span.className=(item.IsNew()?'dta_p':'dta_c');}else{span.className='dta_p';}};this.AttachObject(this.m_deleteAnchor,'onmouseover',mouseOverHandler);this.AttachObject(this.m_deleteAnchor,'onfocus',mouseOverHandler);this.AttachObject(this.m_deleteAnchor,'onmouseout',mouseOutHandler);this.AttachObject(this.m_deleteAnchor,'onblur',mouseOutHandler);this.m_deleteIcon=this.CreateElement('img');this.m_deleteIcon.className='dta_i';this.RenderDeleteRestore();this.m_deleteAnchor.appendChild(this.m_deleteIcon);this.GetDomNode().appendChild(this.m_deleteAnchor);}}},GetTag:function(){return this.m_tag;},IsDeleted:function(){return this.m_isDeleted;},IsEnabled:function(){return this.m_isEnabled;},IsNew:function(){return this.m_isNew;},RenderDeleteRestore:function(){var deleteIconImageTerm;if(this.IsDeleted()){if(this.IsEnabled()){deleteIconImageTerm='Shared.Main.actAdd';}else{deleteIconImageTerm='Shared.Main.actAddDisabled';}
this.GetDomNode().className='dta_p';this.GetDomNode().firstChild.className='dta_td';var restoreLangTerm=new D2L.LP.Text.LangTerm('Framework.Tags.altRestoreTag',this.GetTag().GetText());restoreLangTerm.AssignText(this.m_deleteIcon,'title');}else{if(this.IsEnabled()){deleteIconImageTerm='Shared.Main.actDelete';}else{deleteIconImageTerm='Shared.Main.actDeleteDisabled';}
this.GetDomNode().className=(this.IsNew()?'dta_p':'dta_c');this.GetDomNode().firstChild.className='dta_t';var deleteLangTerm=new D2L.LP.Text.LangTerm('Framework.Tags.altDeleteTag',this.GetTag().GetText());deleteLangTerm.AssignText(this.m_deleteIcon,'title');}
D2L.Images.ImageTerm.Assign(deleteIconImageTerm,this.m_deleteIcon);},SetIsNew:function(isNew){this.m_isNew=isNew;},SetIsDeleted:function(isDeleted){this.m_isDeleted=isDeleted;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){if(isEnabled){this.m_deleteAnchor.href='javascript://';}else{this.m_deleteAnchor.removeAttribute('href');}
this.RenderDeleteRestore();}}});D2L.Control.TagViewer=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Tags);this.m_parameters=[];this.m_onTagClickJsFunction=null;this.m_linkAlt=null;this.m_onDemandTagsJsFunction=null;this.m_tags=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_parameters=deserializer.GetMember();var onTagClickJsFunctionName=deserializer.GetMember();if(onTagClickJsFunctionName!=''){this.m_onTagClickJsFunction=eval(onTagClickJsFunctionName);}
this.m_linkAlt=deserializer.GetMember();var onDemandTagsJsFunctionName=deserializer.GetMember();if(onDemandTagsJsFunctionName!=''){this.m_onDemandTagsJsFunction=eval(onDemandTagsJsFunctionName);}
this.m_tags=deserializer.GetObject(D2L.Tagging.Tag);},C:function(index){if(this.m_onTagClickJsFunction){this.m_onTagClickJsFunction.call(this,this.m_tags[index],this.m_parameters);}
return false;},OD:function(listControl){var result=new D2L.Util.DelayedReturn();var dr=this.m_onDemandTagsJsFunction.call(this,this.m_parameters);var me=this;dr.Register(function(tags){var listItems=[];me.m_tags=[];for(var i=0;i<tags.length;i++){var tag=tags[i];me.m_tags.push(tag);var tagText;var listItem=new D2L.Control.ListItem();if(tag.GetType()==D2L.Tagging.TagType.Private){if(me.m_onTagClickJsFunction){tagText=new D2L.LP.Text.LangTerm('Framework.Tags.lblPrivateTag',tag.GetText());}else{tagText=new D2L.LP.Text.LangTerm('Framework.Tags.lblPrivateTagGray',tag.GetText());}}else{tagText=new D2L.LP.Text.PlainText(tag.GetText());}
if(me.m_onTagClickJsFunction){var link=new D2L.Control.Link();link.SetText(tagText);var navInfo=new D2L.NavInfo();var onClick=function(){me.C(this.GetDomNode().tagIndex);};navInfo.SetOnClick(onClick);link.SetNav(navInfo);if(this.m_linkAlt!=''){link.SetAlt(new D2L.LP.Text.PlainText(me.m_linkAlt.replace('{tag}',tag.GetText())));}
listItem.AppendChild(link);me.AttachObject(link.GetDomNode(),'tagIndex',i);}else{listItem.SetText(tagText);}
listItems.push(listItem);}
result.Trigger(listItems);});return result;}});

D2L.Control.Thumbnail=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Thumbnail);this.m_size=100;this.m_isDisplayed=true;this.m_fileInfo=null;this.m_queryString='';},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isDisplayed=deserializer.GetBoolean();this.m_size=deserializer.GetMember();this.m_queryString=deserializer.GetMember();},SetFile:function(json){var fileInfo=D2L.Serialization.JsonDeserializer.Deserialize(json,D2L.Files.FileInfo);this.SetImageFile(fileInfo);},SetImageFile:function(fileInfo){if(this.IsRendered()){this.GetDomNode().src='/d2l/img/lp/pixel.gif';var me=this;setTimeout(function(){me.GetDomNode().src=D2L.Control.Thumbnail.GetViewThumbUrl(fileInfo,me.m_size)+me.m_queryString;});}
this.m_fileInfo=fileInfo;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'inline':'none';}
this.m_isDisplayed=isDisplayed;}});D2L.Control.Thumbnail.GetViewThumbUrl=function(fileInfo,size){var fileId=fileInfo.GetFileId();var fileSystemType=fileInfo.GetFileSystemType();var lastModified=fileInfo.GetLastModified();fileId=D2L.Util.Base64.Encode(fileId);fileId=fileId.replace("=","").replace("/","_");if(fileId.Length>100){return"/d2l/common/viewThumb.d2lfile/"+fileSystemType+"/"+DateTime.Now.Ticks+"/"+lastModified+"/"+size+"?ou="+Global.OrgUnitId+"&fid="+fileId;}else{return"/d2l/common/viewThumb.d2lfile/"+fileSystemType+"/"+fileId+"/"+lastModified+"/"+size+"?ou="+Global.OrgUnitId;}};

D2L.Control.Toggle=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Toggle);this.m_childrenData=undefined;this.m_img=null;this.m_input=null;this.m_isInit=false;this.m_key='';this.m_name='';this.m_selectedIndex=0;this.m_initialValue='';this.m_subject='';this.m_type=D2L.Control.Toggle.Type.Custom;this.OnToggle=new D2L.EventHandler();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_name=deserializer.GetMember();this.m_key=deserializer.GetMember();this.m_type=deserializer.GetMember();this.m_initialValue=deserializer.GetMember();this.m_subject=deserializer.GetMember();var onToggle=deserializer.GetMember();this.m_childrenData=deserializer.GetObjectArrayMin(D2L.Control.ToggleItem);if(onToggle.length>0&&window[onToggle]){this.OnToggle.RegisterMethod(window[onToggle]);}},DoToggle:function(triggerChange){this.Init();var index=this.m_selectedIndex+1;if(index==this.Children().length){index=0;}
this.ToggleTo(index,triggerChange);},GetKey:function(){return this.m_key;},GetName:function(){return'';},GetSelectedValue:function(){this.Init();return this.Children()[this.m_selectedIndex].GetValue();},Init:function(){if(!this.m_isInit){this.m_isInit=true;this.m_img=this.GetDomNode().firstChild;this.m_input=this.CreateElement('input');this.m_input.type='hidden';this.m_input.name=(this.m_name.length>0?this.m_name:this.GetMappedId())+'_v';this.m_input.value=this.m_value;this.GetDomNode().appendChild(this.m_input);this.m_keyInput=this.CreateElement('input');this.m_keyInput.type='hidden';this.m_keyInput.name=(this.m_name.length>0?this.m_name:this.GetMappedId())+'_k';this.m_keyInput.value='null';this.GetDomNode().appendChild(this.m_keyInput);for(var i=0;i<this.m_childrenData.length;i++){this.AppendChild(this.m_childrenData[i]);}
if(this.m_type==D2L.Control.Toggle.Type.Flag){this.AppendChild(new D2L.Control.ToggleItem(0,new D2L.Images.ImageTerm('Framework.Toggle.actNotFlagged'),new D2L.LP.Text.LangTerm('Framework.Toggle.altNotFlagged'),new D2L.LP.Text.LangTerm('Framework.Toggle.altNotFlaggedActionDescription')));this.AppendChild(new D2L.Control.ToggleItem(1,new D2L.Images.ImageTerm('Framework.Toggle.actFlagged'),new D2L.LP.Text.LangTerm('Framework.Toggle.altFlagged'),new D2L.LP.Text.LangTerm('Framework.Toggle.altFlaggedActionDescription')));}else if(this.m_type==D2L.Control.Toggle.Type.Unread){this.AppendChild(new D2L.Control.ToggleItem(0,new D2L.Images.ImageTerm('Framework.Toggle.actUnread'),new D2L.LP.Text.LangTerm('Framework.Toggle.altUnread'),new D2L.LP.Text.LangTerm('Framework.Toggle.altUnreadActionDescription')));this.AppendChild(new D2L.Control.ToggleItem(1,new D2L.Images.ImageTerm('Framework.Toggle.actRead'),new D2L.LP.Text.LangTerm('Framework.Toggle.altRead'),new D2L.LP.Text.LangTerm('Framework.Toggle.altReadActionDescription')));}else if(this.m_type==D2L.Control.Toggle.Type.Priority){this.AppendChild(new D2L.Control.ToggleItem(0,new D2L.Images.ImageTerm('Framework.Toggle.actPriorityLow'),new D2L.LP.Text.LangTerm('Framework.Toggle.altPriorityLow'),new D2L.LP.Text.LangTerm('Framework.Toggle.altPriorityLowActionDescription')));this.AppendChild(new D2L.Control.ToggleItem(1,new D2L.Images.ImageTerm('Framework.Toggle.actPriorityNormal'),new D2L.LP.Text.LangTerm('Framework.Toggle.altPriorityNormal'),new D2L.LP.Text.LangTerm('Framework.Toggle.altPriorityNormalActionDescription')));this.AppendChild(new D2L.Control.ToggleItem(2,new D2L.Images.ImageTerm('Framework.Toggle.actPriorityHigh'),new D2L.LP.Text.LangTerm('Framework.Toggle.altPriorityHigh'),new D2L.LP.Text.LangTerm('Framework.Toggle.altPriorityHighActionDescription')));}
for(var i=0;i<this.Children().length;i++){if(this.Children()[i].GetValue()==this.m_initialValue){this.m_selectedIndex=i;}}}},SetKey:function(key){this.Init();this.m_key=key;if(item.GetValue()!=this.m_initialValue){this.m_keyInput.value=(this.m_key.length>0?this.m_key:'null');}else{this.m_keyInput.value='';}},SetSelectedValue:function(selectedValue,triggerChange){this.Init();for(var i=0;i<this.Children().length;i++){if(this.Children()[i].GetValue()==selectedValue){this.ToggleTo(i,triggerChange);break;}}},ToggleTo:function(index,triggerChange){if(index!==this.m_selectedIndex){this.Init();if(triggerChange===undefined){triggerChange=false;}
var item=this.Children()[index];this.m_selectedIndex=index;var me=this;var term=new D2L.LP.Text.LangTerm('Framework.Toggle.altAll',item.m_altTerm,item.m_titleTerm);term.SetSubject(this.m_subject);term.AssignText(me.m_img,'alt');term.AssignText(me.m_img,'title');item.m_imgTerm.Assign(this.m_img);this.m_input.value=item.GetValue();if(item.GetValue()!=this.m_initialValue){this.m_keyInput.value=(this.m_key.length>0?this.m_key:'null');}else{this.m_keyInput.value='';}
this.OnToggle.Trigger(this);if(triggerChange){WindowEventManager.BubbleChangeEvent(this.GetDomNode(),null);}}}});D2L.Control.Toggle.C=function(id,sid,triggerChange){var t=UI.GetControl(id,sid);if(t!==null){t.DoToggle(triggerChange==1);}};D2L.Control.ToggleItem=D2L.Control.extend({Construct:function(value,imgTerm,alt,title){arguments.callee.$.Construct.call(this,D2L.Control.Type.ToggleItem);this.m_imgTerm=imgTerm;this.m_value=value;this.m_altTerm=D2L.LP.Text.IText.Normalize(alt,'D2L.Control.ToggleItem','Constructor','alt');this.m_titleTerm=D2L.LP.Text.IText.Normalize(title,'D2L.Control.ToggleItem','Constructor','title');},DeserializeMin:function(deserializer){this.m_altTerm=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_titleTerm=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_imgTerm=deserializer.GetObject(D2L.Images.Image);this.m_value=deserializer.GetMember();},GetValue:function(){return this.m_value;}});D2L.Control.Toggle.Type={Custom:0,Flag:1,Unread:2,Priority:3};D2L.Control.Toggle.Flag={};D2L.Control.Toggle.Flag.Values={NotFlagged:0,Flagged:1};D2L.Control.Toggle.Unread={};D2L.Control.Toggle.Unread.Values={Unread:0,Read:1};D2L.Toggle=D2L.Control.Toggle;D2L.ToggleItem=D2L.Control.ToggleItem;

D2L.Control.UserProfileBadge=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_cacheBuster='';this.m_isDisplayed=true;this.m_orgId=0;this.m_size=100;this.m_userId=0;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isDisplayed=(this.GetDomNode().style.display!='none');this.m_orgId=deserializer.GetMember();this.m_userId=deserializer.GetMember();this.m_size=deserializer.GetMember();this.m_cacheBuster=deserializer.GetMember();},IsDisplayed:function(){return this.m_isDisplayed;},SetFile:function(json){var fileInfo=D2L.Serialization.JsonDeserializer.Deserialize(json,D2L.Files.FileInfo);this.GetDomNode().src='/d2l/common/viewprofileimage.d2l?'+'oi='+this.m_orgId+'&ui='+this.m_userId+'&s='+this.m_size+'&lm='+fileInfo.GetLastModified()+'&v='+this.m_cacheBuster;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'inline':'none';}
this.m_isDisplayed=isDisplayed;},SetProfileImage:function(profileImage){if(profileImage!==null){this.GetDomNode().src=D2L.Control.Thumbnail.GetViewThumbUrl(profileImage,this.m_size);}else{var me=this;var img=new D2L.Images.ImageTerm('Framework.UserProfileBadge.actProfile'+this.m_size);img.GetSrc().Register(function(src){me.GetDomNode().src=src;});}}});

D2L.Control.Actions=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_clickItemEvent=new D2L.EventHandler();this.m_float=D2L.Style.Float.None;this.m_groups=[];this.m_isDisplayed=true;},AddItemGroup:function(itemGroup){this.AppendChild(itemGroup);this.m_groups.push(itemGroup);},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('ul'));domNode.className='da_a';this.RenderFloat();this.RenderIsDisplayed();for(var i=0;i<this.m_groups.length;i++){if(!this.m_groups[i].IsRendered()){this.AppendChild(this.m_groups[i]);}}},ClickItem:function(item){if(item.IsEnabled()){item.ClickEvent().Trigger(item);item.GetItemGroup().ClickItemEvent().Trigger(item);this.ClickItemEvent().Trigger(item);}},ClickItemEvent:function(){return this.m_clickItemEvent;},GetFloat:function(){return this.m_float;},GetGroups:function(){return this.m_groups;},GetItem:function(key){var item=null;for(var i=0;i<this.m_groups.length;i++){item=this.m_groups[i].GetItem(key);if(item!==null){break;}}
return item;},IsDisplayed:function(){return this.m_isDisplayed;},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this,deserializer);this.m_float=deserializer.GetMember('Float',D2L.Style.Float.None);this.m_groups=deserializer.GetObjectArray('Groups');this.m_isDisplayed=deserializer.GetMember('IsDisplayed',true);var onClickItem=deserializer.GetMember('OnClickItem','');if(onClickItem.length>0&&window[onClickItem]!==undefined){this.ClickItemEvent().RegisterMethod(window[onClickItem]);}
var domNode=this.GetDomNode();if(domNode===null){this.m_hasDomBeenBuilt=false;}
var childIndex=0;for(var i=0;i<this.m_groups.length;i++){var child=null;if(domNode!==null){child=domNode.childNodes[childIndex];}
this.m_groups[i].IntegrateChild(this,child,i);if(this.m_groups[i].IsCollapsed()){childIndex++;}else{childIndex+=this.m_groups[i].m_items.length;}}},RenderFloat:function(){if(this.IsRendered()){D2L.Util.Style.ApplyFloat(this.GetDomNode(),this.GetFloat());}},RenderIsDisplayed:function(){if(this.IsRendered()){this.GetDomNode().style.display=this.IsDisplayed()?'inline':'none';}},SetIsDisplayed:function(isDisplayed){this.m_isDisplayed=isDisplayed;this.RenderIsDisplayed();},SetIsEnabled:function(isEnabled){for(var i=0;i<this.m_groups.length;i++){this.m_groups[i].SetIsEnabled(isEnabled);}},SetFloat:function(val){this.m_float=val;this.RenderFloat();}});

D2L.Control.Actions.Item=D2L.Control.extend({Construct:function(key,img,text){arguments.callee.$.Construct.call(this);if(key===undefined){key='';}
if(img===undefined){img=null;}
if(text===undefined){text=new D2L.LP.Text.PlainText();}
this.m_clickEvent=new D2L.EventHandler();this.m_contextMenuItem=null;this.m_hasSeparator=false;this.m_hasSeparatorLeading=false;this.m_img=img;this.m_imgDisabled=null;this.m_isDisplayed=true;this.m_isEnabled=true;this.m_key=key;this.m_text=text;this.m_textIsDisplayed=true;this.m_title=null;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);if(this.GetItemGroup().IsCollapsed()){if(this.m_contextMenuItem===null){this.m_contextMenuItem=new D2L.Control.ContextMenuItem();this.m_contextMenuItem.SetKey(this.GetKey());this.m_contextMenuItem.SetImage(this.GetImage());this.m_contextMenuItem.SetImageDisabled(this.GetImageDisabled());this.m_contextMenuItem.SetItemIsDisplayed(this.IsDisplayed());this.m_contextMenuItem.SetIsEnabled(this.IsEnabled());this.m_contextMenuItem.SetText(this.GetText());this.m_contextMenuItem.SetHasSeparator(this.HasSeparator());this.GetItemGroup().m_contextMenuStructure.AddItem(this.m_contextMenuItem);this.InstallEvents();}}else{var domNode=this.SetDomNode(this.GetUI().CreateElement('li'));domNode.className=this.GetClassName();var anchor=this.GetUI().CreateElement('a');domNode.appendChild(anchor);if(!this.TextIsDisplayed()){anchor.appendChild(this.GetUI().CreateElement('img'));}else{anchor.appendChild(this.GetUI().CreateElement('span'));}
this.RenderIsDisplayed();this.RenderIsEnabled();this.RenderText();this.RenderHasSeparator();this.RenderTitle();this.InstallEvents();}},ClickEvent:function(){return this.m_clickEvent;},Deserialize:function(deserializer){this.m_hasSeparator=deserializer.GetMember('HasSeparator',false);this.m_hasSeparatorLeading=deserializer.GetMember('HasSeparatorLeading',false);this.m_img=deserializer.GetObject('Img');if(deserializer.HasMember('ImgDisabled')){this.m_imgDisabled=deserializer.GetObject('ImgDisabled');}
this.m_isDisplayed=deserializer.GetMember('IsDisplayed',true);this.m_isEnabled=deserializer.GetMember('IsEnabled',true);this.m_key=deserializer.GetMember('Key','');this.m_text=deserializer.GetObject('Text');this.m_textIsDisplayed=deserializer.GetMember('TextIsDisplayed',true);if(deserializer.HasMember('Title')){this.m_title=deserializer.GetObject('Title');}
var onClick=deserializer.GetMember('OnClick','');if(onClick.length>0&&window[onClick]!==undefined){this.ClickEvent().RegisterMethod(window[onClick]);}},Focus:function(){if(this.IsRendered()&&this.IsDisplayed()){this.GetDomNode().firstChild.focus();}},GetActions:function(){var itemGroup=this.GetItemGroup();if(itemGroup!==null){return itemGroup.GetActions();}
return null;},GetClassName:function(){var className='da_ai';if(!this.IsEnabled()){className+=' da_aid';}
if(this.HasSeparator()){className+=' da_ais';}
return className;},GetImage:function(){return this.m_img;},GetImageDisabled:function(){return this.m_imgDisabled;},GetItemGroup:function(){return this.Parent();},GetKey:function(){return this.m_key;},GetText:function(){return this.m_text;},GetTitle:function(){return this.m_title;},HasSeparator:function(){return this.m_hasSeparator;},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);if(this.GetItemGroup().IsCollapsed()){this.m_contextMenuItem=this.GetItemGroup().m_contextMenuStructure.GetItem(this.GetKey());}
this.InstallEvents();},InstallEvents:function(){var me=this;var HandleClick=function(){me.GetActions().ClickItem(me);};if(this.GetItemGroup().IsCollapsed()){this.m_contextMenuItem.ClickEvent().RegisterMethod(HandleClick);}else{var domNode=this.GetDomNode();if(domNode===null){this.m_hasDomBeenBuilt=false;return;}
var anchor=domNode.firstChild;if(this.m_hasSeparatorLeading){anchor=anchor.firstChild;}
anchor.tabIndex=0;this.AttachObject(anchor,'onclick',HandleClick);UI.GetWindowEventManager().InstallKpel(anchor,function(obj,evt){if(evt.GetKey()==D2L.KeyPressEvent.Key.Enter){HandleClick();}});}},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){return this.m_isEnabled;},RenderHasSeparator:function(){if(this.IsRendered()){this.GetDomNode().className=this.GetClassName();}},RenderImage:function(){if(!this.IsRendered()){return;}
var domNode=this.GetDomNode();var img=this.GetImage();if(!this.IsEnabled()&&this.GetImageDisabled()!==null){img=this.GetImageDisabled();}
if(!this.TextIsDisplayed()){img.Assign(domNode.firstChild.firstChild);}else{img.GetSrc().Register(function(src){domNode.firstChild.firstChild.style.backgroundImage='url('+src+')';});}},RenderIsDisplayed:function(){if(this.IsRendered()){this.GetDomNode().style.display=this.IsDisplayed()?'inline':'none';}},RenderIsEnabled:function(){if(!this.IsRendered()){return;}
this.GetDomNode().className=this.GetClassName();this.RenderImage();},RenderText:function(){if(!this.IsRendered()){return;}
var node=this.GetDomNode().firstChild.firstChild;if(this.TextIsDisplayed()){this.GetText().AssignText(node,'innerHTML',true);}else if(this.GetTitle()===null){this.GetText().AssignText(node,'alt',true);this.GetText().AssignText(node,'title',true);}},RenderTitle:function(){if(this.IsRendered()&&this.GetTitle()!==null){var domNode=this.GetDomNode();var anchor=domNode.firstChild;if(this.TextIsDisplayed()){this.GetTitle().AssignText(anchor,'title',true);}else{this.GetTitle().AssignText(anchor.firstChild,'title',true);this.GetTitle().AssignText(anchor.firstChild,'title',true);}}},SetHasSeparator:function(hasSeparator){this.m_hasSeparator=hasSeparator;if(this.m_contextMenuItem===null){this.RenderHasSeparator();}},SetImage:function(image){this.m_img=image;if(this.m_contextMenuItem!==null){this.m_contextMenuItem.SetImage(image);}else{this.RenderImage();}},SetImageDisabled:function(imageDisabled){this.m_imgDisabled=imageDisabled;if(this.m_contextMenuItem!==null){this.m_contextMenuItem.SetImageDisabled(imageDisabled);}else{this.RenderImage();}},SetIsDisplayed:function(isDisplayed){this.m_isDisplayed=isDisplayed;if(this.m_contextMenuItem!==null){this.m_contextMenuItem.SetItemIsDisplayed(isDisplayed);}else{this.RenderIsDisplayed();}},SetIsEnabled:function(isEnabled){if(isEnabled!=this.IsEnabled()){this.m_isEnabled=isEnabled;if(this.m_contextMenuItem!==null){this.m_contextMenuItem.SetIsEnabled(isEnabled);}else{this.RenderIsEnabled();}}},SetText:function(text){this.m_text=text;if(this.m_contextMenuItem!==null){this.m_contextMenuItem.SetText(text);}else{this.RenderText();}},SetTitle:function(title){this.m_title=title;if(this.m_contextMenuItem===null){this.RenderTitle();}},SetTextIsDisplayed:function(textIsDisplayed){if(this.IsRendered()){throw'SetTextIsDisplayed() can only be called before rendering.';}
this.m_textIsDisplayed=textIsDisplayed;},TextIsDisplayed:function(){return this.m_textIsDisplayed;}});

D2L.Control.Actions.ItemGroup=D2L.Control.extend({Construct:function(isCollapsed){arguments.callee.$.Construct.call(this);if(isCollapsed===undefined){isCollapsed=false;}
this.m_clickItemEvent=new D2L.EventHandler();this.m_contextMenuPlaceHolder=null;this.m_contextMenuStructure=null;this.m_isCollapsed=isCollapsed;this.m_items=[];this.m_text=null;this.m_title=null;if(isCollapsed){this.m_contextMenuStructure=new D2L.Control.ContextMenuStructure();this.m_contextMenuPlaceHolder=new D2L.Control.ContextMenuPlaceHolder();this.m_contextMenuPlaceHolder.SetStructure(this.m_contextMenuStructure);}},AddItem:function(item){this.m_items.push(item);this.AppendChild(item);},BuildDom:function(){arguments.callee.$.BuildDom.call(this);if(!this.IsCollapsed()){this.IChildrenDomNode=this.GetActions().GetDomNode();}else{this.m_contextMenuPlaceHolder.SetText(this.GetText());this.m_contextMenuPlaceHolder.SetAlt(this.GetTitle());this.m_contextMenuPlaceHolder.BuildDom();this.m_contextMenuPlaceHolder.GetDomNode().style.marginRight='0';this.IDomNode=this.m_contextMenuPlaceHolder.GetDomNode();}
for(var i=0;i<this.m_items.length;i++){if(!this.m_items[i].IsRendered()){this.AppendChild(this.m_items[i]);}}},ClickItemEvent:function(){return this.m_clickItemEvent;},Deserialize:function(deserializer){this.m_isCollapsed=deserializer.GetMember('IsCollapsed',false);this.m_items=deserializer.GetObjectArray('Items');if(deserializer.HasMember('Text')){this.m_text=deserializer.GetObject('Text');}
if(deserializer.HasMember('Title')){this.m_title=deserializer.GetObject('Title');}
var onClickItem=deserializer.GetMember('OnClickItem','');if(onClickItem.length>0&&window[onClickItem]!==undefined){this.ClickItemEvent().RegisterMethod(window[onClickItem]);}},Focus:function(){if(this.IsCollapsed()){this.m_contextMenuPlaceHolder.Focus();}else{for(var i=0;i<this.m_items.length;i++){if(this.m_items[i].IsDisplayed()){this.m_items[i].Focus();break;}}}},GetActions:function(){return this.Parent();},GetItem:function(key){key=key.toLowerCase();var item=null;for(var i=0;i<this.m_items.length;i++){if(this.m_items[i].GetKey()==key){item=this.m_items[i];break;}}
return item;},GetItems:function(){return this.m_items;},GetText:function(){if(this.m_text!==null){return this.m_text;}else{return new D2L.LP.Text.LangTerm('Framework.Actions.lblGroupMoreActions')}},GetTitle:function(){if(this.m_title!==null){return this.m_title;}else{return this.GetText();}},IntegrateChild:function(parent,domNode,groupNum){arguments.callee.$.IntegrateChild.call(this,parent,domNode);if(this.IsCollapsed()){this.m_contextMenuStructure=UI.GetControl(this.GetActions().GetMappedId()+'_'+groupNum+'_cms');this.m_contextMenuPlaceHolder=UI.GetControl(this.GetActions().GetMappedId()+'_'+groupNum+'_cmp');}
for(var i=0;i<this.m_items.length;i++){if(this.IsCollapsed()){this.m_items[i].IntegrateChild(this,null);}else{this.m_items[i].IntegrateChild(this,domNode);if(domNode!==null){domNode=domNode.nextSibling;}}}
if(domNode===null){this.m_hasDomBeenBuilt=false;}},IsCollapsed:function(){return this.m_isCollapsed;},SetIsEnabled:function(isEnabled){for(var i=0;i<this.m_items.length;i++){this.m_items[i].SetIsEnabled(isEnabled);}},SetText:function(text){this.m_text=text;},SetTitle:function(title){this.m_title=title;if(this.m_contextMenuPlaceHolder!==null){this.m_contextMenuPlaceHolder.SetAlt(title);}}});

D2L.Control.Button=D2L.Control.extend({Construct:function(text){arguments.callee.$.Construct.call(this);this.m_float=D2L.Style.Float.None;this.m_isEnabled=true;this.m_isDisplayed=true;this.m_onClick=function(){};this.m_navInfo=null;this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Button','Constructor','text');this.m_title=null;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('button'));this.GetDomNode().setAttribute('type','button');this.GetDomNode().style.display='none';this.SetText(this.m_text);this.SetTitle(this.m_title);this.SetIsEnabled(this.IsEnabled());this.RenderFloat();var me=this;D2L.Control.Button.InstallEvents(this.GetDomNode(),function(){return me;});},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);if(this.GetDomNode().firstChild){this.m_text=new D2L.LP.Text.PlainText(this.GetDomNode().firstChild.data);}
this.m_isEnabled=!this.GetDomNode().disabled;this.m_isDisplayed=(this.GetDomNode().style.display!='none');if(this.GetDomNode().title.length>0){this.m_title=new D2L.LP.Text.PlainText(this.GetDomNode().title);}
this.SetOnClick(new Function(deserializer.GetMember()));this.m_float=deserializer.GetMember();},Click:function(){this.m_onClick.call(this);},Focus:function(){if(this.IsRendered()&&this.IsDisplayed()){this.GetDomNode().focus();}},GetFloat:function(){return this.m_float;},GetName:function(){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Button.GetName() is obsolete. '+'Use GetControlId() instead.'),true);return this.GetControlId().ID();},GetOnClick:function(){return this.m_onClick;},GetText:function(){return this.m_text;},Hide:function(){this.SetIsDisplayed(false);},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){return this.m_isEnabled;},RenderFloat:function(){if(this.IsRendered()){D2L.Util.Style.ApplyFloat(this.GetDomNode(),this.GetFloat());}},SetIsDisplayed:function(isDisplayed){if(isDisplayed!=this.IsDisplayed()){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'inline':'none';var e=new D2L.TransformEvent(this.GetDomNode());e.Bubble();}
this.m_isDisplayed=isDisplayed;}},SetFloat:function(val){this.m_float=val;this.RenderFloat();},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.IsRendered()){this.GetDomNode().disabled=!isEnabled;this.GetDomNode().className=isEnabled?'dbtn dbtn_n':'dbtn dbtn_d';}},SetOnClick:function(onClick){if(onClick){if(this.m_navInfo==null){this.m_navInfo=new D2L.NavInfo();}
this.m_navInfo.SetOnClick(onClick);this.SetNav(this.m_navInfo);}},SetNav:function(navInfo){if(navInfo){this.m_navInfo=navInfo;var navStruct=this.m_navInfo.SetupHrefOnClick(this,false);this.m_onClick=navStruct.OnClick;}},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Button','SetText','text');if(this.IsRendered()){if(this.GetDomNode().firstChild){D2L.Util.Purge(this.GetDomNode().firstChild);this.GetDomNode().removeChild(this.GetDomNode().firstChild);}
var me=this;this.m_text.GetText().Register(function(val){if(val.length>0){me.GetDomNode().appendChild(me.CreateTextNode(me.m_text));me.GetDomNode().style.display='inline';}else{me.GetDomNode().style.display='none';}});}},SetTitle:function(title){this.m_title=D2L.LP.Text.IText.Normalize(title,'D2L.Control.Button','SetTitle','title');if(this.IsRendered()){if(this.m_title!==null){this.m_title.AssignText(this.GetDomNode(),'title');}else{this.GetDomNode().removeAttribute('title');}}},Show:function(){this.SetIsDisplayed(true);}});D2L.Control.Button.InstallEvents=function(domNode,GetControl){var isDown=false;UI.AttachObject(domNode,'onclick',function(){var me=GetControl();if(me!==null&&me.IsEnabled()&&me.m_onClick){me.m_onClick.call(me);}});UI.AttachObject(domNode,'onmouseover',function(){domNode.className='dbtn dbtn_o';});UI.AttachObject(domNode,'onfocus',function(){if(!isDown){domNode.className='dbtn dbtn_o';}});UI.AttachObject(domNode,'onmouseup',function(){isDown=false;domNode.className='dbtn dbtn_o';});UI.AttachObject(domNode,'onmouseout',function(){isDown=false;domNode.className='dbtn dbtn_n';});UI.AttachObject(domNode,'onblur',function(){domNode.className='dbtn dbtn_n';});UI.AttachObject(domNode,'onmousedown',function(){isDown=true;domNode.className='dbtn dbtn_c';});};D2L.Button=D2L.Control.Button.extend({Construct:function(name,text,onClick){arguments.callee.$.Construct.call(this,text);if(name!==undefined){this.SetControlId(name);}
if(onClick!==undefined){this.SetOnClick(onClick)}
UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('D2L.Button( name, text, onClick ) '+'constructor is obsolete. Use D2L.Control.Button( text ) '+'instead.'),true);}});D2L.Control.Button.Type={Custom:0,Cancel:1,Ok:2,Yes:3,No:4,Save:5,Create:6,Copy:7,Insert:8,Close:9,Add:10};D2L.Control.Button.GetTermForType=function(type){var term=null;if(type==D2L.Control.Button.Type.Cancel){term='Cancel';}else if(type==D2L.Control.Button.Type.Ok){term='Ok';}else if(type==D2L.Control.Button.Type.Yes){term='Yes';}else if(type==D2L.Control.Button.Type.No){term='No';}else if(type==D2L.Control.Button.Type.Save){term='Save';}else if(type==D2L.Control.Button.Type.Create){term='Create';}else if(type==D2L.Control.Button.Type.Copy){term='Copy';}else if(type==D2L.Control.Button.Type.Insert){term='Insert';}else if(type==D2L.Control.Button.Type.Close){term='Close';}else if(type==D2L.Control.Button.Type.Add){term='Add';}
return new D2L.LP.Text.LangTerm('Standard.Buttons.btn'+term);};

D2L.Control.ClearFloat=D2L.Control.extend({Construct:function(text){arguments.callee.$.Construct.call(this);},BuildDom:function(){if(this.IsRendered()){return;}
var domNode=this.SetDomNode(this.GetUI().CreateElement('div'));domNode.className='clear';}});

D2L.Control.Container=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_height=null;this.m_hasTitle=false;this.m_isCollapsible=false;this.m_isCollapseAnimated=false;this.m_collapseAnimationSpeed='0.2';this.m_title=new D2L.LP.Text.PlainText();this.m_titleNode=null;this.m_collapseImg=null;this.m_isDisplayed=true;this.m_isExpanded=true;this.m_mergeTitleWithContent=true;this.m_border=new D2L.Style.BorderInfo();this.m_borderRadius=0;this.m_backgroundColour=null;this.m_float=D2L.Style.Float.None;this.m_padding=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Padding);this.m_spacing=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing);this.m_ddObject=null;this.m_dragDropMode=D2L.DragDrop.Modes.None;this.m_dragDropInfo=null;this.m_contextMenuPlaceHolder=null;this.OnExpandCollapse=new D2L.EventHandler();this.m_isDisplayedChangeEvent=new D2L.EventHandler();this.m_width=null;this.m_widthType=D2L.Style.WidthType.None;this.m_widthTypeIsSet=false;this.InstallEvents();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<7){this.GetDomNode().style.zIndex=this.GetWindow()['UI'].GetRelativeZIndex();}
this.m_hasTitle=deserializer.GetBoolean();this.m_isCollapsible=deserializer.GetBoolean();this.m_isCollapseAnimated=deserializer.GetBoolean();this.m_isDisplayed=deserializer.GetBoolean();this.m_isExpanded=deserializer.GetBoolean();this.m_mergeTitleWithContent=deserializer.GetBoolean();this.m_border=deserializer.GetObjectMin(D2L.Style.BorderInfo);this.m_borderRadius=deserializer.GetMember();this.m_float=deserializer.GetMember();this.m_dragDropMode=deserializer.GetMember();var hasDragDropInfo=deserializer.GetBoolean();if(hasDragDropInfo){var dragDropSettingsControlId=deserializer.GetObjectMin(D2L.Control.Id);if(dragDropSettingsControlId){this.m_dragDropInfo=UI.GetControl(dragDropSettingsControlId.ID(),dragDropSettingsControlId.SID()).GetDragDropInfo();}}
if(this.HasTitle()){this.m_titleNode=this.GetDomNode().firstChild;this.m_collapseImg=UI.GetControl(this.GetMappedId()+'_imgCol');}
this.m_title=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_contextMenuPlaceHolder=this.GetUI().GetControl(this.GetMappedId()+'_cmp');this.IChildrenDomNode=this.GetDomNode().childNodes[this.GetDomNode().childNodes.length-1];this.InstallEvents();if(this.m_dragDropMode!=D2L.DragDrop.Modes.None){this.InstallDragDrop();}},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.BuildDom_Container();this.SetBorder(this.m_border);if(this.GetBorderRadius()>0){this.SetBorderRadius(this.m_borderRadius);}
this.SetBackgroundColour(this.m_backgroundColour);this.RenderFloat();this.RenderPadding();this.RenderSpacing();this.RenderWidth();this.RenderHeight();if(this.m_dragDropMode!=D2L.DragDrop.Modes.None){this.SetDragDrop(this.m_dragDropMode,this.m_dragDropInfo);}}},BuildDom_Container:function(){this.SetDomNode(this.CreateElement('div'));this.GetDomNode().style.zIndex=this.GetWindow()['UI'].GetZIndex();this.GetDomNode().className=this.GetClassName();this.IChildrenDomNode=this.CreateElement('div');this.IChildrenDomNode.className='dco_c';this.GetDomNode().appendChild(this.IChildrenDomNode);this.SetHasTitle(this.HasTitle(),true);},InstallDragDrop:function(){var ddObject;var handle=this.GetDomNode();if(this.HasTitle()){handle=this.m_titleNode;}
if(this.m_dragDropMode==D2L.DragDrop.Modes.DraggableDroppable){ddObject=new D2L.DragDrop.DraggableDroppable(this,handle);}
if(this.m_dragDropMode==D2L.DragDrop.Modes.Draggable){ddObject=new D2L.DragDrop.Draggable(this,handle);}
if(this.m_dragDropMode==D2L.DragDrop.Modes.Droppable){ddObject=new D2L.DragDrop.Droppable(this,handle);}
if(this.m_dragDropMode==D2L.DragDrop.Modes.DraggableDroppable||this.m_dragDropMode==D2L.DragDrop.Modes.Draggable){this.IChildrenDomNode.className=this.IChildrenDomNode.className+" draggable ";}
this.SetDragDropObject(ddObject);if(this.GetDragDropObject()&&this.m_dragDropInfo){D2L.DragDrop.SetDragDropInfo(this.GetDragDropObject(),this.m_dragDropInfo);}},InstallEvents:function(){var me=this;this.m_spacing.OnChange().RegisterMethod(function(){me.RenderSpacing();});this.m_padding.OnChange().RegisterMethod(function(){me.RenderPadding();});if(this.m_isCollapsible){this.AttachObject(this.GetDomNode(),'ID2LOnExpand',new D2L.EventHandler());this.GetDomNode().ID2LOnExpand.RegisterMethod(function(evt){if(!me.IsExpanded()){me.SetIsExpanded(true);}});}},RenderFloat:function(){if(this.IsRendered()){D2L.Util.Style.ApplyFloat(this.GetDomNode(),this.GetFloat());}},RenderHeight:function(){if(this.IsRendered()){if(this.m_height!==null){this.GetDomNode().style.height=this.m_height+'px';}else{this.GetDomNode().style.height='auto';}}},RenderPadding:function(){if(this.IsRendered()){this.IChildrenDomNode.style.padding=this.GetPadding().ToCss();}},RenderSpacing:function(){if(this.IsRendered()){this.GetDomNode().style.margin=this.GetSpacing().ToCss();}},RenderWidth:function(){if(!this.IsRendered()){return;}
var width='auto';if(this.m_width!==null){if(this.m_widthTypeIsSet){if(this.m_widthType==D2L.Style.WidthType.Em){width=this.m_width+'em';}else if(this.m_widthType==D2L.Style.WidthType.Percent){width=this.m_width+'%';}else{width=this.m_width+'px';}}else{width=this.m_width+'px';}}
this.GetDomNode().style.width=width;},GetBackgroundColour:function(){if(this.IsRendered()){return this.IChildrenDomNode.style.backgroundColor;}
return'';},GetBorder:function(){return this.m_border;},GetBorderRadius:function(){return this.m_borderRadius;},GetClassName:function(){return'dco';},GetDragDropObject:function(){return this.m_ddObject;},GetFloat:function(){return this.m_float;},GetHeight:function(){return this.m_height;},GetPadding:function(){return this.m_padding;},GetSpacing:function(){return this.m_spacing;},GetTextAlignment:function(){if((this.IsRendered())&&(this.IChildrenDomNode!=null)){var cssTextAlign=this.IChildrenDomNode.style.textAlign;return D2L.Style.Utility.CssToTextAlign(cssTextAlign);}else{return D2L.Style.TextAlignment.Left;}},GetTitle:function(){return this.m_title;},GetTitleAlignment:function(){if(this.IsRendered()&&this.HasTitle()){return this.m_titleNode.style.textAlign;}
return'';},GetTitleBackgroundColour:function(){if(this.IsRendered()&&this.HasTitle()){return this.m_titleNode.style.backgroundColor;}
return'';},GetTitleColour:function(){if(this.IsRendered()&&this.HasTitle()){return this.m_titleNode.style.color;}
return'';},GetWidth:function(){return this.m_width;},GetWidthType:function(){return this.m_widthType;},HasTitle:function(){return this.m_hasTitle;},IsCollapsible:function(){return this.m_isCollapsible;},IsCollapseAnimated:function(){return this.m_isCollapseAnimated;},IsDisplayed:function(){return this.m_isDisplayed;},IsDisplayedChangeEvent:function(){return this.m_isDisplayedChangeEvent;},IsExpanded:function(){return this.m_isExpanded;},MergeTitleWithContent:function(){return this.m_mergeTitleWithContent;},SetBackgroundColour:function(backgroundColour){this.m_backgroundColour=backgroundColour;if(this.IsRendered()&&backgroundColour!==null){this.IChildrenDomNode.style.backgroundColor=backgroundColour;}},SetBorder:function(borderInfo){this.m_border=borderInfo;if(this.IsRendered()){this.IChildrenDomNode.style.border=this.m_border.ToCss();}},SetBorderRadius:function(radius){this.m_borderRadius=radius;if(this.IsRendered()){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Safari){this.IChildrenDomNode.style.WebkitBorderRadius=radius+'px';}else if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Firefox){this.IChildrenDomNode.style.MozBorderRadius=radius+'px';}}},SetDragDrop:function(dragDropMode,dragDropInfo){this.m_dragDropMode=dragDropMode;this.m_dragDropInfo=dragDropInfo;if(this.IsRendered()&&this.m_dragDropMode!=D2L.DragDrop.Modes.None){this.InstallDragDrop();}},SetDragDropObject:function(ddObject){this.m_ddObject=ddObject;},SetFloat:function(val){this.m_float=val;this.RenderFloat();},SetHasTitle:function(hasTitle,firstTime){if(firstTime===undefined){firstTime=false;}
this.m_hasTitle=hasTitle;if(this.IsRendered()||firstTime){if(!hasTitle&&this.m_titleNode!==null){this.m_titleNode.parentNode.removeChild(this.m_titleNode);this.m_titleNode=null;if(this.m_collapseImg){this.m_collapseImg.Remove();this.m_collapseImg=null;}}else if(hasTitle&&this.m_titleNode===null){this.m_titleNode=this.CreateElement('div');this.m_titleNode.className='dco_t';var me=this;this.m_collapseImg=new D2L.Image();this.m_collapseImg.AppendTo(this.m_titleNode);this.m_collapseImg.SetOnClick(function(){me.TC();});var h3=this.CreateElement('h3');this.m_titleNode.appendChild(h3);this.GetDomNode().insertBefore(this.m_titleNode,this.IChildrenDomNode);}}
this.SetTitle(this.GetTitle());this.SetIsCollapsible(this.IsCollapsible());this.SetIsExpanded(this.IsExpanded());},SetHeight:function(height){this.m_height=height;this.RenderHeight();},SetIsCollapsible:function(isCollapsible){if(this.IsRendered()&&this.HasTitle()){if(!isCollapsible){if(this.m_collapseImg!==null){this.m_collapseImg.SetIsDisplayed(false);}}else{this.m_collapseImg.SetIsDisplayed(true);}}
if(!isCollapsible){this.SetIsExpanded(true);}
this.m_isCollapsible=isCollapsible;if(isCollapsible){this.SetIsExpanded(this.IsExpanded());}},SetIsCollapseAnimated:function(isCollapseAnimated){this.m_isCollapseAnimated=isCollapseAnimated;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){this.GetDomNode().style.display=isDisplayed?'block':'none';}
if(isDisplayed!=this.m_isDisplayed){this.m_isDisplayed=isDisplayed;this.IsDisplayedChangeEvent().Trigger(isDisplayed);}},SetIsExpanded:function(isExpanded){if(this.IsCollapsible()&&this.m_isExpanded!=isExpanded){if(this.IsRendered()&&this.HasTitle()){var me=this;var DoExpandCollapse=function(){var altTerm='Framework.Container.alt';var imgTerm='Shared.Main.act';var hoverTerm='Shared.Main.hover';if(isExpanded){me.IChildrenDomNode.style.display='block';imgTerm+='Hide';altTerm+='Collapse';hoverTerm+='Hide';}else{me.IChildrenDomNode.style.display='none';imgTerm+='Show';altTerm+='Expand';hoverTerm+='Show';}
var term=new D2L.LP.Text.LangTerm(altTerm);me.GetTitle().GetText().Register(function(title){me.m_collapseImg.SetImage(new D2L.Images.ImageTerm(imgTerm));me.m_collapseImg.SetHoverImage(new D2L.Images.ImageTerm(hoverTerm));term.SetSubject(title);me.m_collapseImg.SetAlt(term);});var border=me.GetBorder();if(border.GetStyle()!=D2L.Style.BorderStyle.None&&me.m_mergeTitleWithContent){if(isExpanded){me.m_titleNode.style.borderBottom='none';}else{me.m_titleNode.style.borderBottom=border.ToCss();}}
me.m_isExpanded=isExpanded;me.OnExpandCollapse.Trigger(me);};if(this.m_isCollapseAnimated){var DoAnimate=function(height){var toOpt=1;var fromOpt=0.2;if(!isExpanded){toOpt=0.2;fromOpt=1;}
me.IChildrenDomNode.style.position='relative';var sizeAnim=new YAHOO.util.Anim(me.IChildrenDomNode,{height:{to:height}},me.m_collapseAnimationSpeed,YAHOO.util.Easing.easeNone);var fadeAnim=new YAHOO.util.ColorAnim(me.IChildrenDomNode,{opacity:{from:fromOpt,to:toOpt}},me.m_collapseAnimationSpeed,YAHOO.util.Easing.easeNon);sizeAnim.onComplete.subscribe(function(){DoExpandCollapse();me.IChildrenDomNode.style.position='';me.IChildrenDomNode.style.overflow='visible';me.IChildrenDomNode.style.height='auto';if(isExpanded){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){me.IChildrenDomNode.style.filter='';}else{me.IChildrenDomNode.style.opacity='';}}
me.m_collapseImg.SetIsEnabled(true);});if(isExpanded){me.IChildrenDomNode.style.height='0px';}
me.IChildrenDomNode.style.overflow='hidden';me.IChildrenDomNode.style.display='block';me.m_collapseImg.SetIsEnabled(false);sizeAnim.animate();fadeAnim.animate();};if(isExpanded){DoAnimate(D2L.Util.Dom.GetHeightHelper(this.IChildrenDomNode));}else{DoAnimate(0);}}else{DoExpandCollapse();}}}},SetSize:function(width,height){this.SetWidth(width);this.SetHeight(height);},SetTextAlignment:function(textAlign){if((this.IsRendered())&&(this.IChildrenDomNode!=null)){var cssTextAlign=D2L.Style.Utility.TextAlignToCss(textAlign);this.IChildrenDomNode.style.textAlign=cssTextAlign;}},SetTitle:function(title){this.m_title=D2L.LP.Text.IText.Normalize(title,'D2L.Control.Container','SetTitle','title');if(!this.IsRendered()||!this.HasTitle()){return;}
var t=this.m_titleNode.childNodes[this.m_titleNode.childNodes.length-2];if(t.firstChild){t.removeChild(t.firstChild);}
t.appendChild(this.CreateTextNode(this.m_title));if(this.m_contextMenuPlaceHolder!==null){this.m_contextMenuPlaceHolder.SetSubject(title);}},SetWidth:function(width){this.m_width=width;this.RenderWidth();},SetWidthType:function(widthType){this.m_widthType=widthType;this.m_widthTypeIsSet=true;this.RenderWidth();},TC:function(){if(this.IsCollapsible()){this.SetIsExpanded(!this.IsExpanded());}
return false;}});D2L.Control.Container.InstallEvents=function(domNode,GetControl){var me=null;if(domNode.ID2LOnChange===undefined){UI.AttachObject(domNode,'ID2LOnChange',new D2L.EventHandler());}
domNode.ID2LOnChange.RegisterMethod(function(evt){if(!evt.hasChangeBeenShown){domNode.style.backgroundColor='#e8e8ff';evt.hasChangeBeenShown=true;}});FormManager.OnChangeReset.RegisterMethod(function(){domNode.style.backgroundColor='#ffffff';});};

D2L.Control.Container.Floating=D2L.Control.Container.extend({Construct:function(name){arguments.callee.$.Construct.call(this,name);this.m_doIgnoreHide=false;this.m_hasAutoHide=false;this.m_posX=0;this.m_posY=0;this.m_isDisplayed=false;this.m_animationMode=D2L.Style.AnimationMode.None;},IntegrateControlMin:function(deserializer){},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);this.GetDomNode().id=this.GetMappedId();if(this.m_hasAutoHide){var me=this;WindowEventManager.Click.RegisterMethod(function(evt){if(me.IsDisplayed()&&!me.m_doIgnoreHide){me.Hide();}});this.AttachObject(this.GetDomNode(),'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);});}},GetAnimationMode:function(){return this.m_animationMode;},GetClassName:function(){return'dco_f';},GetPosX:function(){return this.m_posX;},GetPosY:function(){return this.m_posY;},Hide:function(){if(!this.IsDisplayed()){return;}
if(this.IsRendered()){WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(false,this.GetDomNode(),null));this.IDomNode=this.GetDomNode().parentNode.removeChild(this.GetDomNode());}
this.m_isDisplayed=false;this.IsDisplayedChangeEvent().Trigger(false);},RenderPosition:function(){if(!this.IsRendered()||!this.IsDisplayed()){return;}
YAHOO.util.Dom.setXY(this.GetDomNode(),[this.m_posX,this.m_posY],true);},SetAnimationMode:function(mode){this.m_animationMode=mode;},SetIsDisplayed:function(isDisplayed){if(isDisplayed){this.Show();}else{this.Hide();}},SetHasAutoHide:function(hasAutoHide){this.m_hasAutoHide=hasAutoHide;},SetPosition:function(posX,posY){this.m_posX=posX;this.m_posY=posY;this.RenderPosition();},SetPosX:function(posX){this.m_posX=posX;this.RenderPosition();},SetPosY:function(posY){this.m_posY=posY;this.RenderPosition();},Show:function(insertAfter){if(this.IsDisplayed()){return;}
this.m_isDisplayed=true;if(insertAfter===undefined){D2L.Debug.Error('You must define the insertAfter parameter. For accessbility reasons it is important to put the container in the right DOM order. insertAfter could be a D2L.Control or a DOM node. For instance if you have an icon that opens a floating div, you must pass that image node as the insertBefore so floating container is inserted rigth after that node in DOM hierarchy.');}
var insertAfterDom;if(!insertAfter.isD2LControl){insertAfterDom=insertAfter;}else{if(!insertAfter.IsRendered()){insertAfter.BuildDom();}
insertAfterDom=insertAfter.GetDomNode();}
if(!this.IsRendered()){this.BuildDom();}
this.GetDomNode().style.zIndex=this.GetWindow()['UI'].GetZIndex();var parent=insertAfterDom.parentNode;if(parent){var nextSibiling=insertAfterDom.nextSibling;if(nextSibiling){parent.insertBefore(this.GetDomNode(),nextSibiling);}else{parent.appendChild(this.GetDomNode());}}
this.RenderPosition();WindowEventManager.SelectIeHack.Trigger(new D2L.SelectIeHackEvent(true,this.GetDomNode(),null));var me=this;if(this.GetAnimationMode()===D2L.Style.AnimationMode.Slide){var size=D2L.Util.Dom.GetSizeHelper(this.GetDomNode());this.GetDomNode().style.display='none';var height=size.height;me.GetDomNode().style.overflow='hidden';me.GetDomNode().style.display='block';me.GetDomNode().style.height='1px';me.GetDomNode().style.width='1px';var width=this.GetWidth();if(width===null){width=size.width;}
var myAnim=new YAHOO.util.Anim(me.GetMappedId(),{height:{to:height},width:{to:width}},0.1,YAHOO.util.Easing.easeOut);myAnim.onComplete.subscribe(function(){me.GetDomNode().style.overflow='visible';me.GetDomNode().style.height='auto';ScrollToDomNode(me.GetDomNode(),false,true);});myAnim.animate();}else{me.GetDomNode().style.display='block';}
if(this.m_hasAutoHide){this.m_doIgnoreHide=true;setTimeout(function(){me.m_doIgnoreHide=false;},0);}
this.IsDisplayedChangeEvent().Trigger(true);}});

D2L.Control.Container.IFrame=D2L.Control.Container.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_autoResizeToContents=true;this.m_iframe=null;this.m_loadingDiv=null;this.m_iframeDiv=null;this.m_src=null;this.m_srcParams=[];this.m_iframeWindow=null;this.m_iframeTitle=null;this.OnLoad=new D2L.EventHandler();this.SetSrcParam('d2l_body_type',D2L.UI.BodyType.IFrame);},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);}},BuildDom_Container:function(){arguments.callee.$.BuildDom_Container.call(this);this.m_loadingDiv=this.CreateElement('div');this.m_loadingDiv.className='d2l_loading';var img=this.CreateElement('img');D2L.Images.ImageTerm.Assign('Shared.Main.actLoadingLg',img,false);this.m_loadingDiv.appendChild(img);this.m_loadingDiv.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Standard.Misc.txtLoading')));this.m_iframeDiv=this.CreateElement('div');this.GetDomNode().appendChild(this.m_loadingDiv);this.GetDomNode().appendChild(this.m_iframeDiv);},BuildDom_IFrame:function(){var me=this;var name=this.GetWindow()['UI'].GetUniqueHtmlId();this.m_iframeDiv.innerHTML='<iframe name=\''+name+'\' id=\''+name+'\' style=\'width:100%;height:1px;border:none;\' scrolling=\'no\' frameBorder=\'0\'></iframe><div class=\'d2l_loading\' style=\'display:none;\'><img src=\'/d2l/img/lp/loading_lg.gif\' width=\'24\' height=\'24\' />';this.m_iframe=this.m_iframeDiv.firstChild;if(this.m_iframeTitle!==null){this.SetIFrameTitle(this.m_iframeTitle);}
var onload=function(){try{me.m_iframeWindow=me.GetWindow().frames[name];}catch(e){}
if(me.m_autoResizeToContents){var ui=undefined;try{ui=me.m_iframeWindow.UI;}catch(e){}
if(ui!==undefined){ui.GetWindowEventManager().Transform.RegisterMethod(function(){me.ResizeToContents();});}
me.ResizeToContents();}
if(me.m_iframeTitle===null){try{me.m_iframe.title=me.m_iframeWindow.document.title;}catch(e){}}
me.m_loadingDiv.style.display='none';me.OnLoad.Trigger();};if(this.m_iframe.attachEvent){this.m_iframe.attachEvent('onload',onload);}else{this.m_iframe.onload=onload;}},GetIFrameWindow:function(){return this.m_iframeWindow;},GetSrc:function(){return this.m_src;},Load:function(){if(this.IsRendered()&&this.m_src!==null){var me=this;var AfterIFrame=function(){if(me.m_src.indexOf('.d2l')>0){var body=me.GetWindow()['UI'].GetById('d2l_body');var f=me.CreateElement('form');f.method='post';f.target=me.m_iframe.name;f.action=me.m_src;for(var name in me.m_srcParams){var input=me.CreateElement('input');input.type='hidden';input.name=name;input.value=me.m_srcParams[name];f.appendChild(input);}
body.appendChild(f);f.submit();D2L.Util.Purge(f);body.removeChild(f);}else{me.m_iframe.src=me.m_src;}
me.m_loadingDiv.style.display='block';};setTimeout(function(){if(me.m_iframe===null){me.BuildDom_IFrame();}
AfterIFrame();},0);}},RenderHeight:function(){if(this.IsRendered()&&this.m_iframe){if(this.m_height!==null){this.GetDomNode().style.height=this.m_height+'px';this.m_iframe.style.height=this.m_height+'px';}else{this.GetDomNode().style.height='auto';}}},ResizeToContents:function(){this.m_iframe.style.height='auto';var docHeight=this.GetWindow()['UI'].GetPageHeight(this.m_iframeWindow);if(docHeight>0){this.SetHeight(docHeight);}},SetAutoResizeToContents:function(autoResizeToContents){this.m_autoResizeToContents=autoResizeToContents;},SetIFrameTitle:function(iframeTitle){this.m_iframeTitle=D2L.LP.Text.IText.Normalize(iframeTitle,'D2L.Control.Container.IFrame','SetIFrameTitle','iframeTitle');if(this.IsRendered()&&this.m_iframe){this.m_iframeTitle.AssignText(this.m_iframe,'title');}},SetSrc:function(src){this.m_src=src;if(this.m_src.indexOf('.d2l')>0){if(this.m_src.indexOf('ou=')<0){this.m_src+=(this.m_src.indexOf('?')<0)?'?':'&';this.m_src+='ou='+Global.OrgUnitId;}}},SetSrcParam:function(name,value){this.m_srcParams[name]=value;}});

D2L.Control.ContextArea=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_breadCrumbControl=null;this.m_breadCrumbStack=[];this.m_currentPanel=null;this.m_isNavigationAnimated=true;this.m_panelContainer=null;this.m_slidingAnimationSpeed=0.25;this.m_slidingAnimationEease=YAHOO.util.Easing.easeIn;},AddBreadCrumb:function(bci){this.m_breadCrumbStack.push(bci);this.m_breadCrumbControl.AppendChild(bci);return bci;},AnimateNavigation:function(isForward,numBack,nextPanel){var posX=FindPosX(this.m_panelContainer);var posY=FindPosY(this.m_panelContainer);var separatorWidth=3;var currWidth=this.m_panelContainer.offsetWidth;var currHeight=this.m_panelContainer.offsetHeight;var breadCrumbsToRemove=[];var breadCrumbToAdd;if(isForward){breadCrumbToAdd=this.CreateBreadCrumb(this.m_currentPanel.GetTitle());}else{for(var i=0;i<numBack;i++){var bci=this.m_breadCrumbStack.pop();bci.Remove();breadCrumbsToRemove.push(bci);if(!isForward&&i==numBack-1){nextPanel=bci.GetPanel();}}}
var currPanelCloneWrapper=this.CreateElement('div');if(!isForward){var currPanelBreadCrumbs=new D2L.Control.ContextArea.BreadCrumb();for(var i=breadCrumbsToRemove.length-1;i>=0;i--){currPanelBreadCrumbs.AppendChild(breadCrumbsToRemove[i].Clone());}
currPanelBreadCrumbs.AppendTo(currPanelCloneWrapper);}
var currPanelClone=this.m_currentPanel.GetDomNode().cloneNode(true);currPanelCloneWrapper.style.width=currWidth+'px';currPanelCloneWrapper.appendChild(currPanelClone);var nextPanelCloneWrapper=this.CreateElement('div');var nextPanelBreadCrumbs=new D2L.Control.ContextArea.BreadCrumb();if(isForward){nextPanelBreadCrumbs.AppendChild(breadCrumbToAdd.Clone());}
nextPanelBreadCrumbs.AppendTo(nextPanelCloneWrapper);var nextPanelClone=nextPanel.GetDomNode().cloneNode(true);nextPanelClone.style.display='block';nextPanelCloneWrapper.style.width=currWidth+'px';nextPanelCloneWrapper.appendChild(nextPanelClone);if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){currPanelCloneWrapper.style.styleFloat='left';nextPanelCloneWrapper.style.styleFloat='left';}else{currPanelCloneWrapper.style.cssFloat='left';nextPanelCloneWrapper.style.cssFloat='left';}
var clearDiv=this.CreateElement('div');clearDiv.className='clear';var clonesContainer=this.CreateElement('div');if(isForward){clonesContainer.appendChild(currPanelCloneWrapper);clonesContainer.appendChild(nextPanelCloneWrapper);}else{clonesContainer.appendChild(nextPanelCloneWrapper);clonesContainer.appendChild(currPanelCloneWrapper);}
clonesContainer.appendChild(clearDiv);clonesContainer.style.width=(2*currWidth+separatorWidth)+'px';clonesContainer.style.position='relative';this.GetDomNode().style.position='relative';if(isForward){clonesContainer.style.left='0px';}else{clonesContainer.style.left=-currWidth+'px';}
this.GetDomNode().style.width=currWidth+'px';this.GetDomNode().style.overflow='hidden';this.m_currentPanel.SetIsDisplayed(false);this.GetDomNode().appendChild(clonesContainer);var tallerPanelCloneWrapper=nextPanelCloneWrapper;if(nextPanelCloneWrapper.offsetHeight<currPanelCloneWrapper.offsetHeight){tallerPanelCloneWrapper=currPanelCloneWrapper;}
if((isForward&&tallerPanelCloneWrapper==nextPanelCloneWrapper)||(!isForward&&tallerPanelCloneWrapper==currPanelCloneWrapper)){tallerPanelCloneWrapper.style.borderLeftStyle='solid';tallerPanelCloneWrapper.style.borderLeftColor='#666666';tallerPanelCloneWrapper.style.borderLeftWidth=separatorWidth+'px';}else{tallerPanelCloneWrapper.style.borderRightStyle='solid';tallerPanelCloneWrapper.style.borderRightColor='#666666';tallerPanelCloneWrapper.style.borderRightWidth=separatorWidth+'px';}
var myAnim=new YAHOO.util.Motion(clonesContainer,{points:{to:[(posX-currWidth)]}},this.m_slidingAnimationSpeed,this.m_slidingAnimationEease);if(!isForward){myAnim=new YAHOO.util.Motion(clonesContainer,{points:{to:[(posX)]}},this.m_slidingAnimationSpeed,this.m_slidingAnimationEease);}
var me=this;myAnim.onComplete.subscribe(function(){me.GetDomNode().style.overflow='';me.GetDomNode().style.width='100%';me.GetDomNode().style.position='';if(isForward){me.AddBreadCrumb(breadCrumbToAdd);}
nextPanel.SetIsDisplayed(true);me.m_currentPanel.SetIsDisplayed(false);me.GetDomNode().removeChild(clonesContainer);me.m_currentPanel=nextPanel;});myAnim.animate();},CreateBreadCrumb:function(text){var bci=new D2L.Control.ContextArea.BreadCrumbItem(text,this.m_currentPanel);var me=this;var level=me.m_breadCrumbStack.length;var onClick=function(){me.NavigateBack(level);};bci.SetOnClick(onClick);return bci;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var activePanelControlId=deserializer.GetObjectMin(D2L.Control.Id);this.m_currentPanel=UI.GetControl(activePanelControlId.ID(),activePanelControlId.SID());this.m_breadCrumbControl=new D2L.Control.ContextArea.BreadCrumb();this.m_breadCrumbControl.AppendTo(this.GetDomNode().firstChild);this.m_panelContainer=this.GetDomNode().childNodes[1];},Navigate:function(panel){if(!this.m_isNavigationAnimated){this.AddBreadCrumb(this.CeateBreadCrumb(this.m_currentPanel.GetTitle()));panel.SetIsDisplayed(true);this.m_currentPanel.SetIsDisplayed(false);this.m_currentPanel=panel;}else{this.AnimateNavigation(true,undefined,panel);}},NavigateBack:function(level){var num=this.m_breadCrumbStack.length-level;if(!this.m_isNavigationAnimated){var panel;for(var i=0;i<num;i++){var bci=this.m_breadCrumbStack.pop();bci.Remove();if(i==num-1){panel=bci.GetPanel();}}
panel.SetIsDisplayed(true);this.m_currentPanel.SetIsDisplayed(false);this.m_currentPanel=panel;}else{this.AnimateNavigation(false,num,undefined);}}});

D2L.Control.ContextArea.BreadCrumb=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.IDomNode=this.CreateElement('ul');this.IDomNode.className='dcar_bul';}}});

D2L.Control.ContextArea.BreadCrumbItem=D2L.Control.extend({Construct:function(text,panel){arguments.callee.$.Construct.call(this);this.m_icon=null;this.m_panel=panel;this.m_onClick=null;this.m_text=text;},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.IDomNode=this.CreateElement('li');this.IDomNode.className='dcar_bci';var container=this.CreateElement('a');container.className='dcar_bcic';container.href='javascript://';var altTerm=new D2L.LP.Text.LangTerm('Framework.ContextArea.altGoBack',this.m_text);altTerm.AssignText(container,'title');if(this.m_onClick){this.AttachObject(container,'onclick',this.m_onClick);}
this.m_icon=new D2L.Control.Image();this.m_icon.SetText(this.m_text);this.m_icon.SetImage(new D2L.Language.ImageTerm('Framework.ContextArea.actBack'));this.m_icon.SetAlt(altTerm);this.m_icon.AppendTo(container);this.IDomNode.appendChild(container);}},GetPanel:function(){return this.m_panel;},GetText:function(){return this.m_text;},SetOnClick:function(onClick){if(this.IsRendered()){this.AttachObject(this.IDomNode.firstChild,'onclick',this.m_onClick);}
this.m_onClick=onClick;},Clone:function(){var clone=new D2L.Control.ContextArea.BreadCrumbItem(this.m_text,this.m_panel);clone.SetOnClick(this.m_onClick);return clone;}});

D2L.Control.ContextAreaPanel=D2L.Control.extend({Construct:function(title){arguments.callee.$.Construct.call(this);this.m_title=title;this.m_focusAnchor=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_title=deserializer.GetObject(D2L.LP.Text.IText);this.m_focusAnchor=this.GetDomNode().firstChild;},GetTitle:function(){return this.m_title;},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){if(isDisplayed){this.GetDomNode().style.display='block';}else{this.GetDomNode().style.display='none';}
if(isDisplayed){this.m_focusAnchor.focus();}}}});

D2L.Control.ContextMenuItemList=D2L.Control.Container.Floating.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_domDrop=null;this.m_selectedItemIndex=-1;this.m_expandedItemIndex=-1;this.m_isRendered=false;var border=new D2L.Style.BorderInfo();border.SetWidth(1);border.SetStyle(D2L.Style.BorderStyle.Solid);border.SetColour('#aaaaaa');this.SetWidth(D2L.Control.ContextMenuItemList.WIDTH);this.SetBorder(border);this.SetHasAutoHide(true);this.SetAnimationMode(D2L.Style.AnimationMode.Slide);var me=this;this.IsDisplayedChangeEvent().RegisterMethod(function(isDisplayed){if(!isDisplayed){me.SelectItemIndex(-1,false);}});},Deserialize:function(deserializer){var items=deserializer.GetObjectArray('Items',D2L.Control.ContextMenuItem);for(var i=0;i<items.length;i++){this.AppendChild(items[i]);}},DeserializeMin:function(deserializer){var items=deserializer.GetObjectArrayMin(D2L.Control.ContextMenuItem);for(var i=0;i<items.length;i++){items[i].IntegrateChild(this);}},GetParent:function(){var parent=this;while(parent.Parent()!==null){parent=parent.Parent();}
return parent;},IntegrateControl:function(deserializer){},IntegrateControlMin:function(deserializer){this.DeserializeMin(deserializer);},Show:function(insertAfter){this.BuildDom_Helper();if(insertAfter.id!==undefined&&insertAfter.id.length>0){D2L.Util.Aria.SetAttribute(this.GetDomNode(),'labelledby',insertAfter.id);}
arguments.callee.$.Show.call(this,insertAfter);},BuildDom_Helper:function(){if(this.m_isRendered){return;}
this.BuildDom();var domNode=this.GetDomNode();domNode.tabIndex=-1;D2L.Util.Aria.SetRole(domNode,'menu');this.m_domDrop=this.CreateElement('ul');this.m_domDrop.className='dcm';D2L.Util.Aria.SetRole(this.m_domDrop,'presentation');this.ChildrenDomNode().appendChild(this.m_domDrop);for(var i=0;i<this.Children().length;i++){if(i>0&&this.Children().length>i&&this.Children()[i-1].HasSeparator()){this.Children()[i-1].SetShowSeparator(true);}}
for(var i=0;i<this.Children().length;i++){this.BuildDom_Item(this.Children()[i]);}
this.m_isRendered=true;},BuildDom_Item:function(item){var me=this;var labelId=UI.GetUniqueHtmlId();var li=this.CreateElement('li');D2L.Util.Aria.SetRole(li,'presentation');if(item.Children().length>0){li.className='dcm_c';}else{li.className='dcm_i';}
var domAnchor=this.CreateElement('a');domAnchor.tabIndex=-1;D2L.Util.Aria.SetRole(domAnchor,'menuitem');D2L.Util.Aria.SetAttribute(domAnchor,'labelledby',labelId);if(item.Children().length>0){D2L.Util.Aria.SetAttribute(domAnchor,'haspopup','true');}
domAnchor.id=UI.GetUniqueHtmlId();li.appendChild(domAnchor);if(this.GetWidth()!==null){domAnchor.style.width=(this.GetWidth()-11)+'px';}
var s1=this.CreateElement('span');s1.className='dcm_i1';domAnchor.appendChild(s1);var domText=this.CreateElement('span');domText.id=labelId;domText.className='dcm_i2';domAnchor.appendChild(domText);var domImg=null;var clr=this.CreateElement('div');clr.className='clear';domAnchor.appendChild(clr);if(item.HasSeparator()){var domSeparator=this.CreateElement('div');D2L.Util.Aria.SetRole(domSeparator,'separator');domSeparator.className='dcm_s';li.appendChild(domSeparator);domSeparator.style.display=(item.m_showSeparator)?'block':'none';}
var renderImage=function(image){if(image===null){return;}
if(domImg===null){domImg=me.CreateElement('img');li.firstChild.firstChild.appendChild(domImg);}
if(domImg!==null){image.Assign(domImg);}};var renderEnabled=function(isEnabled){var className='dcm_a';if(!isEnabled){className+=' dcm_ad';D2L.Util.Aria.SetAttribute(domAnchor,'disabled','true');}else{D2L.Util.Aria.SetAttribute(domAnchor,'disabled','false');}
domAnchor.className=className;var img=item.m_img;if(!isEnabled&&item.m_imgDisabled!==null){img=item.m_imgDisabled;}
renderImage(img);};var renderText=function(text){if(text!==null){while(domText.firstChild){domText.removeChild(domText.firstChild);}
domText.appendChild(me.GetUI().CreateTextNode(text));}};var renderVisibility=function(isDisplayed){li.style.display=isDisplayed?'list-item':'none';};renderEnabled(item.IsEnabled());renderText(item.m_text);renderVisibility(item.ItemIsDisplayed());var index=this.GetItemIndex(item);var over=function(evt,doExpand){D2L.Util.Dom.CancelBubble(evt);me.SelectItemIndex(index,doExpand);};var out=function(evt){D2L.Util.Dom.CancelBubble(evt);if(me.m_expandedItemIndex!==index){me.SelectItemIndex(-1,true);}};item.ItemIsDisplayedChangeEvent().RegisterMethod(function(isDisplayed){renderVisibility(isDisplayed);});item.TextChangeEvent().RegisterMethod(function(text){renderText(text);});item.ImageChangeEvent().RegisterMethod(function(image){renderImage(image);});item.IsEnabledChangeEvent().RegisterMethod(function(isEnabled){renderEnabled(isEnabled);});this.AttachObject(domAnchor,'onmouseover',function(evt){over(evt,true);});this.AttachObject(domAnchor,'onmouseout',function(evt){out(evt);});this.AttachObject(domAnchor,'onfocus',function(evt){over(evt,false);});this.AttachObject(domAnchor,'onblur',function(evt){out(evt);});this.AttachObject(domAnchor,'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);if(item.IsEnabled()){if(item.Children().length===0){me.ClickItemIndex(index);}else{me.ExpandItemIndex(index,false);}}
return false;});this.m_domDrop.appendChild(li);},AddItem:function(item){this.AppendChild(item);},AddSeparator:function(){if(this.Children().length>0){this.Children()[this.Children().length-1].SetHasSeparator(true);}},Focus:function(){if(this.m_expandedItemIndex>0){this.SelectItemIndex(this.m_expandedItemIndex,false);}},GetExpandedStructure:function(){var structure=this;while(true){for(var i=0;i<structure.Children().length;i++){if(structure.Children()[i].IsDisplayed()){structure=structure.Children()[i];break;}}
if(i===structure.Children().length){break;}}
return structure;},GetItem:function(key){for(var i=0;i<this.Children().length;i++){if(this.Children()[i].GetKey()==key){return this.Children()[i];}}
return null;},GetSelectedItem:function(){if(this.m_selectedItemIndex>-1){return this.Children()[this.m_selectedItemIndex];}
return null;},GetItemIndex:function(item){for(var i=0;i<this.Children().length;i++){if(this.Children()[i]==item){return i;}}
return-1;},ClickItemIndex:function(index){var parent=this.GetParent();var Hide=function(list){for(var i=0;i<list.Children().length;i++){Hide(list.Children()[i]);}
list.Hide();};Hide(parent);if(parent.m_opener!==null){parent.m_opener.Focus();}
if(index>-1){var item=this.Children()[index];item.ClickEvent().Trigger(item);parent.SelectItemEvent().Trigger(item);}},ExpandItemIndex:function(index,doSelect){var item=this.Children()[index];if(!item.IsEnabled()||!item.ItemIsDisplayed()){return;}
this.m_expandedItemIndex=index;if(item.IsDisplayed()){return;}
var xy=FindPosXY(this.m_domDrop);var winWidth=this.GetUI().GetWindowWidth();var left=xy[0]+this.m_domDrop.offsetWidth-2;var top=xy[1]+this.m_domDrop.childNodes[index].offsetTop-1;var mode=D2L.Style.AnimationMode.Slide;if(winWidth-left<D2L.Control.ContextMenuItemList.WIDTH){left=xy[0]-D2L.Control.ContextMenuItemList.WIDTH;mode=D2L.Style.AnimationMode.None;}
item.SetAnimationMode(mode);item.SetPosition(left,top);item.Show(this.m_domDrop.childNodes[index].firstChild);if(doSelect){setTimeout(function(){item.SelectItemIndex(0,false);});}},SelectItemIndex:function(index,doExpand){if(index>=this.Children().length){return;}
var item=this.Children()[index];var selectedItem=this.GetSelectedItem();if(index!=this.m_selectedItemIndex&&selectedItem!==null){this.m_domDrop.childNodes[this.m_selectedItemIndex].firstChild.className=selectedItem.IsEnabled()?'dcm_a':'dcm_a dcm_ad';this.m_selectedItemIndex=-1;}
var me=this;if(index!=this.m_expandedItemIndex&&this.m_expandedItemIndex>-1){var expIndex=this.m_expandedItemIndex;setTimeout(function(){me.Children()[expIndex].Hide();},300);this.m_expandedItemIndex=-1;}
if(index>-1){var anchor=this.m_domDrop.childNodes[index].firstChild;anchor.className=item.IsEnabled()?'dcm_a dcm_ah':'dcm_a dcm_adh';anchor.focus();if(doExpand&&item.Children().length>0){setTimeout(function(){if(me.m_selectedItemIndex==index){me.ExpandItemIndex(index,false);}},400);}}
this.m_selectedItemIndex=index;}});D2L.Control.ContextMenuItemList.WIDTH=190;

D2L.Control.ContextMenu=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_structure=null;this.m_placeHolder=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var structureId=deserializer.GetObjectMin(D2L.Control.Id);var placeHolderId=deserializer.GetObjectMin(D2L.Control.Id);this.m_structure=UI.GetControl(structureId.ID(),structureId.SID());this.m_placeHolder=UI.GetControl(placeHolderId.ID(),placeHolderId.SID());},AppendChild:function(child){return this.m_structure.AppendChild(child);},AppendSeparator:function(){this.m_structure.AppendSeparator();},Expand:function(){},Collapse:function(){},IsExpanded:function(){return false;},SetAlt:function(alt){this.m_placeHolder.SetAlt(alt);},SetSubject:function(subject){this.m_placeHolder.SetSubject(new D2L.LP.Text.PlainText(subject));},ToggleExpanded:function(){}});

D2L.Control.ContextMenuItem=D2L.Control.ContextMenuItemList.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_hasSeparator=false;this.m_img=null;this.m_imgDisabled=null;this.m_text=null;this.m_onClick=function(){};this.m_navInfo=null;this.m_showSeparator=false;this.m_itemIsDisplayed=true;this.m_isEnabled=true;this.m_key='';this.m_structure=null;this.m_itemIsDisplayedChangeEvent=new D2L.EventHandler();this.m_imageChangeEvent=new D2L.EventHandler();this.m_isEnabledChangeEvent=new D2L.EventHandler();this.m_textChangeEvent=new D2L.EventHandler();this.m_clickEvent=new D2L.EventHandler();var me=this;this.ClickEvent().RegisterMethod(function(){me.m_onClick.call(me);});},ClickEvent:function(){return this.m_clickEvent;},DeserializeMin:function(deserializer){arguments.callee.$.DeserializeMin.call(this,deserializer);this.m_key=deserializer.GetMember();this.m_img=deserializer.GetObjectMin(D2L.Images.Image);if(this.m_img===undefined){this.m_img=null;}
this.m_imgDisabled=deserializer.GetObjectMin(D2L.Images.Image);if(this.m_imgDisabled===undefined){this.m_imgDisabled=null;}
this.m_itemIsDisplayed=deserializer.GetBoolean();this.m_isEnabled=deserializer.GetBoolean();this.m_hasSeparator=deserializer.GetBoolean();this.m_text=deserializer.GetObjectMin(D2L.LP.Text.IText);if(this.Children().length===0){this.m_onClick=new Function(deserializer.GetMember());}},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);this.m_key=deserializer.GetMember('Key');if(deserializer.HasMember('Img')){this.m_img=deserializer.GetObject('Img',D2L.Images.Image);}
if(deserializer.HasMember('ImgDisabled')){this.m_imgDisabled=deserializer.GetObject('ImgDisabled',D2L.Images.Image);}
this.m_itemIsDisplayed=deserializer.GetMember('IsDisplayed');this.m_isEnabled=deserializer.GetMember('IsEnabled');this.m_hasSeparator=deserializer.GetMember('HasSeparator');this.m_text=deserializer.GetObject('Text',D2L.LP.Text.IText);if(deserializer.HasMember('OnClick')){this.m_onClick=new Function(deserializer.GetMember('OnClick'));}},GetKey:function(){return this.m_key;},GetStructure:function(){if(this.m_structure===null){var parent=this;while(parent.Parent()!==null){parent=parent.Parent();}
this.m_structure=parent;}
return this.m_structure;},GetText:function(){return this.m_text;},HasSeparator:function(){return this.m_hasSeparator;},ImageChangeEvent:function(){return this.m_imageChangeEvent;},ItemIsDisplayed:function(){return this.m_itemIsDisplayed;},ItemIsDisplayedChangeEvent:function(){return this.m_itemIsDisplayedChangeEvent;},IsEnabled:function(){return this.m_isEnabled;},IsEnabledChangeEvent:function(){return this.m_isEnabledChangeEvent;},SetKey:function(key){this.m_key=key;},SetImage:function(img,imgDisabled){if(imgDisabled===undefined){imgDisabled=null;}
if(img!==null){this.m_img=img;this.ImageChangeEvent().Trigger(img);}
if(imgDisabled!==null){this.SetImageDisabled(imgDisabled);}},SetImageDisabled:function(imgDisabled){if(imgDisabled!==null){this.m_imgDisabled=imgDisabled;}},SetImageInfo:function(imgInfo){this.SetImage(imgInfo);},SetImageInfoDisabled:function(imgInfoDisabled){this.SetImageDisabled(imgInfoDisabled);},SetItemIsDisplayed:function(itemIsDisplayed){if(itemIsDisplayed==this.m_itemIsDisplayed){return;}
this.m_itemIsDisplayed=itemIsDisplayed;this.ItemIsDisplayedChangeEvent().Trigger(itemIsDisplayed);},SetIsEnabled:function(isEnabled){if(isEnabled==this.IsEnabled()){return;}
this.m_isEnabled=isEnabled;this.IsEnabledChangeEvent().Trigger(isEnabled);},SetOnClick:function(onClick){if(onClick){if(this.m_navInfo===null){this.m_navInfo=new D2L.NavInfo();}
this.m_navInfo.SetOnClick(onClick);this.SetNav(this.m_navInfo);}},SetNav:function(navInfo){if(navInfo){this.m_navInfo=navInfo;var navStruct=this.m_navInfo.SetupHrefOnClick(this,false);this.m_onClick=navStruct.OnClick;}},SetHasSeparator:function(hasSeparator){this.m_hasSeparator=hasSeparator;},SetShowSeparator:function(showSeparator){this.m_showSeparator=showSeparator;},SetText:function(text){this.m_text=text;this.TextChangeEvent().Trigger(text);},TextChangeEvent:function(){return this.m_textChangeEvent;}});

D2L.Control.ContextMenuPlaceHolder=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_text=null;this.m_alt=null;this.m_hoverEvent=new D2L.EventHandler();this.m_isOffScreen=false;this.m_subject=null;this.m_hasText=false;this.m_hasImage=false;this.m_img=null;this.m_imgDrop=null;this.m_posDomNode=null;this.m_structure=null;this.m_key='';this.m_float=D2L.Style.Float.None;this.m_params=new D2L.Util.Dictionary();this.m_showEvent=new D2L.EventHandler();this.m_text=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var structureId=deserializer.GetObjectMin(D2L.Control.Id);this.SetStructure(UI.GetControl(structureId.ID(),structureId.SID()));var me=this;this.m_hasText=deserializer.GetBoolean();this.m_hasImage=deserializer.GetBoolean();this.m_key=deserializer.GetMember();this.m_float=deserializer.GetMember();this.m_params=deserializer.GetObject(D2L.Util.Dictionary);var onShow=deserializer.GetMember();if(onShow.length>0&&window[onShow]!==undefined){this.ShowEvent().RegisterMethod(function(){window[onShow].call(onShow,me);});}
var domNode=this.GetDomNode();if(domNode===null){this.m_hasDomBeenBuilt=false;return;}
this.m_imgDrop=this.GetDomNode().childNodes[this.GetDomNode().childNodes.length-1];if(this.m_hasImage){this.m_img=this.GetDomNode().firstChild;}},HoverEvent:function(){return this.m_hoverEvent;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('a'));domNode.className='dcm';if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Firefox&&UI.GetBrowserInfo().MajorVersion<=2){domNode.style.fontSize='7px';}
domNode.tabIndex=0;if(this.m_isOffScreen){domNode.style.position='absolute';domNode.style.left='-1000px';domNode.style.top='-1000px';}
if(this.m_text!==null){var domText=this.GetUI().CreateElement('span');domNode.appendChild(domText);this.m_text.AssignHtml(domText,'innerHTML',true);}
this.m_imgDrop=this.GetUI().CreateElement('img');this.m_imgDrop.className='dcm_d';D2L.Images.ImageTerm.Assign('Framework.ContextMenu.dropArrow',this.m_imgDrop,false);domNode.appendChild(this.m_imgDrop);this.RenderAlt();this.RenderFloat();var me=this;D2L.Control.ContextMenuPlaceHolder.InstallEvents(domNode,function(){return me;});},Click:function(){if(this.m_structure===null){return;}
var me=this;if(this.m_structure.GetOpener()!==null&&this.m_structure.GetOpener()!=this){this.m_structure.Hide();}
if(!this.m_structure.IsDisplayed()){this.Show().Register(function(){setTimeout(function(){me.m_structure.GetDomNode().focus();});});}else{this.m_structure.Hide();}},Focus:function(){if(this.IsRendered()){try{this.GetDomNode().focus();}catch(e){}}},GetDropHeight:function(){var dr=new D2L.Util.DelayedReturn();this.m_structure.SetPosition(-1000,-1000);this.m_structure.SetAnimationMode(D2L.Style.AnimationMode.None);var me=this;this.m_structure.Show(this,this.GetUI().GetBodyElement().lastChild).Register(function(){var height=D2L.Util.Dom.GetHeightHelper(me.m_structure.GetDomNode());me.m_structure.Hide();me.m_structure.SetPosition(0,0);me.m_structure.SetAnimationMode(D2L.Style.AnimationMode.Slide);dr.Trigger(height);});return dr;},GetFloat:function(){return this.m_float;},GetKey:function(){return this.m_key;},GetParam:function(name,defaultValue){var result=this.m_params.Get(name);if(result===undefined){result=defaultValue;}
return result;},GetPositionInfo:function(){var dr=new D2L.Util.DelayedReturn();var downOffset=1;var upOffset=1;var leftOffset=0;if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Firefox){upOffset=2;downOffset=0;if(this.m_hasText||this.m_isOffScreen){upOffset=1;downOffset=1;}
if(!this.m_hasText&&this.GetFloat()!=D2L.Style.Float.None){leftOffset=1;}}
var domNode=this.m_posDomNode!==null?this.m_posDomNode:this.GetDomNode();var dropWidth=D2L.Control.ContextMenuItemList.WIDTH;var xy=FindPosXY(domNode);var me=this;var GetPosition=function(width,height,dropHeight){var left=xy[0]
var right=width-xy[0];var top=xy[1];var bottom=height-xy[1]-domNode.offsetHeight;var x=xy[0]+leftOffset;var y=xy[1]+domNode.offsetHeight-downOffset;var mode=D2L.Style.AnimationMode.None;var success=true;if(bottom-dropHeight>0&&right-dropWidth>0){mode=D2L.Style.AnimationMode.Slide;}else if(bottom-dropHeight>0&&left-dropWidth>0){x=xy[0]-dropWidth+domNode.offsetWidth+leftOffset;}else if(top-dropHeight>0&&right-dropWidth>0){y=xy[1]-dropHeight+upOffset;}else if(top-dropHeight>0&&left-dropWidth>0){x=xy[0]-dropWidth+domNode.offsetWidth+leftOffset;y=xy[1]-dropHeight+upOffset;}else{success=false;}
return{x:x,y:y,mode:mode,success:success};};this.GetDropHeight().Register(function(dropHeight){var position=GetPosition(me.GetUI().GetWindowWidth(),me.GetUI().GetWindowHeight(),dropHeight);if(!position.success){position=GetPosition(me.GetUI().GetPageWidth(),me.GetUI().GetPageHeight(),dropHeight);}
dr.Trigger(position);});return dr;},GetStructure:function(){return this.m_structure;},GetText:function(){return this.m_text;},HasParam:function(name){return this.m_params.ContainsKey(name);},RenderAlt:function(){if(!this.IsRendered()){return;}
var alt=this.m_alt;if(alt===null){alt=new D2L.LP.Text.LangTerm('Framework.ContextMenu.altDefaultTitleSubject');}
var me=this;var DoAssign=function(){alt.AssignText(me.GetDomNode(),'title');alt.AssignText(me.m_imgDrop,'alt');};if(this.m_subject!==null){this.m_subject.GetText().Register(function(subject){alt.SetSubject(subject);DoAssign();});}else{DoAssign();}},RenderFloat:function(){if(!this.IsRendered()){return;}
var f='none';if(this.GetFloat()==D2L.Style.Float.Left){f='left';}else if(this.GetFloat()==D2L.Style.Float.Right){f='right';}
if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){this.GetDomNode().style.styleFloat=f;}else{this.GetDomNode().style.cssFloat=f;}},SetParam:function(name,value){this.m_params.Add(name,value);},SetStructure:function(structure){this.m_structure=structure;},SetText:function(text){this.m_text=text;},Show:function(){if(this.m_structure===null){return;}
var dr=new D2L.Util.DelayedReturn();var me=this;this.GetPositionInfo().Register(function(posInfo){me.m_structure.SetPosition(posInfo.x,posInfo.y);me.m_structure.SetAnimationMode(posInfo.mode);me.ShowEvent().Trigger(me);var dr2=null;if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion==6){dr2=me.m_structure.Show(me,UI.GetBodyElement().lastChild);}else{dr2=me.m_structure.Show(me,me.GetDomNode());}
dr2.Register(function(){dr.Trigger();});});return dr;},ShowEvent:function(){return this.m_showEvent;},SetAlt:function(alt){this.m_alt=alt;this.RenderAlt();},SetFloat:function(floatVal){this.m_float=floatVal;this.RenderFloat();},SetKey:function(key){this.m_key=key;},SetSubject:function(subject){this.m_subject=D2L.LP.Text.IText.Normalize(subject);this.RenderAlt();}});D2L.Control.ContextMenuPlaceHolder.InstallEvents=function(domNode,GetControl){var hasRegistered=false;var isStructureDisplayed=false;var isOver=false;var hasFocus=false;var over=function(evt){if(!hasRegistered){hasRegistered=true;var me=GetControl();var structure=me.GetStructure();var handleDisplayChange=function(isDisplayed){if(structure.GetOpener()==me){isStructureDisplayed=isDisplayed;}else{isStructureDisplayed=false;}
var isHover=(isOver||hasFocus);domNode.className=isHover?'dcm dcm_h':'dcm';me.HoverEvent().Trigger(isHover);};structure.IsDisplayedChangeEvent().RegisterMethod(handleDisplayChange);handleDisplayChange(structure.IsDisplayed());}
domNode.className='dcm dcm_h';GetControl().HoverEvent().Trigger(true);isOver=true;};var out=function(evt){isOver=false;if(!isStructureDisplayed&&!hasFocus){domNode.className='dcm';GetControl().HoverEvent().Trigger(false);}};UI.AttachObject(domNode,'onmouseover',over);UI.AttachObject(domNode,'onfocus',function(evt){hasFocus=true;over(evt);});UI.AttachObject(domNode,'onmouseout',out);UI.AttachObject(domNode,'onblur',function(evt){hasFocus=false;out(evt);});UI.AttachObject(domNode,'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);WindowEventManager.Click.Trigger(evt);GetControl().Click();return false;});UI.GetWindowEventManager().HideContextMenus.RegisterMethod(function(evt){if(isStructureDisplayed){GetControl().Click();}});UI.GetWindowEventManager().InstallKpel(domNode,function(obj,evt){if(evt.GetKey()==D2L.KeyPressEvent.Key.Enter){WindowEventManager.Click.Trigger(evt);GetControl().Click();}});};

D2L.Control.ContextMenuStructure=D2L.Control.ContextMenuItemList.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_opener=null;this.m_loadCallback=null;this.m_isLoaded=true;this.m_key='';this.m_selectItemEvent=new D2L.EventHandler();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);var loadCallback=deserializer.GetMember();if(loadCallback.length>0&&window[loadCallback]!==undefined){this.m_loadCallback=window[loadCallback];this.m_isLoaded=false;}
this.m_key=deserializer.GetMember();var onSelectItem=deserializer.GetMember();if(onSelectItem.length>0&&window[onSelectItem]!==undefined){this.SelectItemEvent().RegisterMethod(function(item){window[onSelectItem](item);});}},BuildDom:function(){if(this.IsRendered()){return;}
var me=this;WindowEventManager.KeyPress.RegisterMethod(function(evt){return me.HandleKeyPress(evt);});arguments.callee.$.BuildDom.call(this);},GetOpener:function(){return this.m_opener;},GetKey:function(){return this.m_key;},HandleKeyPress:function(evt){if(!this.IsDisplayed()){return;}
var structure=this.GetExpandedStructure();if(evt.GetKey()==D2L.KeyPressEvent.Key.ArrowDown||evt.GetKey()==D2L.KeyPressEvent.Key.ArrowUp){var direction=(evt.GetKey()==D2L.KeyPressEvent.Key.ArrowDown)?1:-1;var originalIndex=structure.m_selectedItemIndex;var newIndex=originalIndex;var maxTries=structure.Children().length;var numTries=0;while(true){if(numTries==maxTries){break;}
newIndex=newIndex+direction;if(newIndex<0){newIndex=structure.Children().length-1;}else if(newIndex==structure.Children().length){newIndex=0;}
if(structure.Children()[newIndex].ItemIsDisplayed()){break;}
numTries++;}
if(newIndex!=originalIndex){structure.SelectItemIndex(newIndex,false);}
evt.Cancel();return false;}else if(evt.GetKey()==D2L.KeyPressEvent.Key.ArrowRight){var selectedItem=structure.GetSelectedItem();if(selectedItem!==null&&selectedItem.IsEnabled()&&selectedItem.Children().length>0){structure.ExpandItemIndex(structure.m_selectedItemIndex,true);evt.Cancel();}}else if(evt.GetKey()==D2L.KeyPressEvent.Key.ArrowLeft){if(structure.Parent()!==null){structure.Hide();structure.Parent().Focus();evt.Cancel();}}else if(evt.GetKey()==D2L.KeyPressEvent.Key.Escape){structure.Hide();if(structure.Parent()!==null){structure.Parent().Focus();}else if(this.m_opener!==null){this.m_opener.Focus();}}else if(evt.GetKey()==D2L.KeyPressEvent.Key.Enter){var item=structure.GetSelectedItem();if(item!==null&&item.IsEnabled()){if(item.Children().length===0){structure.ClickItemIndex(structure.m_selectedItemIndex);}else{structure.ExpandItemIndex(structure.m_selectedItemIndex,true);}}}},SelectItemEvent:function(){return this.m_selectItemEvent;},SetKey:function(key){this.m_key=key;},Show:function(opener,insertAfter){var dr=new D2L.Util.DelayedReturn();this.m_opener=opener;if(this.m_isLoaded){arguments.callee.$.Show.call(this,insertAfter);dr.Trigger();}else{var me=this;var args=arguments;var result=this.m_loadCallback(this);if(result!==undefined){result.Register(function(items){for(var i=0;i<items.length;i++){me.AppendChild(items[i]);}
me.m_isLoaded=true;me.Show(opener,insertAfter);dr.Trigger();});}else{me.m_isLoaded=true;dr=me.Show(opener,insertAfter);}}
return dr;}});

D2L.Control.DataGrid=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_actions=null;this.m_addRowsEvent=new D2L.EventHandler();this.m_allRowsSelected=false;this.m_clickRowEvent=new D2L.EventHandler();this.m_cellFormatEvent=new D2L.EventHandler();this.m_columns=[];this.m_context=null;this.m_count=0;this.m_deleteRowsEvent=new D2L.EventHandler();this.m_dragDropInfo=null;this.m_dragDropMode=D2L.DragDrop.Modes.None;this.m_emptyText='';this.m_entitySourceRpc='';this.m_entitySourceRpcSrc='';this.m_isReloading=false;this.m_loadEvent=new D2L.EventHandler();this.m_mouseOutRowEvent=new D2L.EventHandler();this.m_mouseOverRowEvent=new D2L.EventHandler();this.m_newRowsSelected=false;this.m_newRowsCut=false;this.m_numSelectedRows=0;this.m_numRows=0;this.m_paging=null;this.m_pagingType=D2L.Control.DataGrid.PagingTypes.Numeric;this.m_primaryColumnKey='';this.m_reloadBeginEvent=new D2L.EventHandler();this.m_reloadEndEvent=new D2L.EventHandler();this.m_reloadResponseEvent=new D2L.EventHandler();this.m_rowFormatPlugins=[];this.m_rowHeaderColumnKey='';this.m_rowSelectionMode=D2L.Control.DataGrid.RowSelectionModes.None;this.m_rows=[];this.m_rpcDr=null;this.m_rpcInProgress=false;this.m_selectRowEvent=new D2L.EventHandler();this.m_selectAllRowsEvent=new D2L.EventHandler();this.m_selectedRowCountChangeEvent=new D2L.EventHandler();this.m_sort=null;this.m_sortEvent=new D2L.EventHandler();this.m_sorting=[];this.m_summary='';this.m_unSelectRowEvent=new D2L.EventHandler();this.m_unSelectAllRowsEvent=new D2L.EventHandler();this.m_yuiDataTable=null;},AddRow:function(row,location){this.AddRows([row],location,true);},AddRows:function(rows,location,doTriggerAddEvent){if(location===undefined){location=D2L.Control.DataGrid.RowInsertionLocations.Bottom;}
if(doTriggerAddEvent===undefined){doTriggerAddEvent=true;}
var rowData=[];for(var i=0;i<rows.length;i++){var existing=this.GetRow(rows[i].GetRowKey());if(existing!==null){existing.Replace(rows[i]);rows[i]=existing;}else{rows[i].Init(this);this.m_rows.push(rows[i]);rowData.push(rows[i].m_data);}}
var index=undefined;if(location==D2L.Control.DataGrid.RowInsertionLocations.Top){index=0;}
if(rowData.length>0){this.m_yuiDataTable.addRows(rowData,index);}
if(this.m_newRowsSelected||this.m_newRowsCut){for(var i=0;i<rows.length;i++){if(this.m_newRowsSelected){rows[i].SetIsSelected(true,false);}
if(this.m_newRowsCut){rows[i].SetIsCut(true);}}}
if(this.m_newRowsSelected){this.SetSelectedRowCount(this.GetSelectedRowCount()+rows.length);}
if(doTriggerAddEvent){this.AddRowsEvent().Trigger(rows);}},AddRowsEvent:function(){return this.m_addRowsEvent;},ClickRowEvent:function(){return this.m_clickRowEvent;},CellFormatEvent:function(){return this.m_cellFormatEvent;},CutRows:function(rows,newRowsCut){if(newRowsCut===undefined){newRowsCut=false;}
this.UnCutAllRows();for(var i=0;i<rows.length;i++){rows[i].SetIsCut(true);}
this.m_newRowsCut=newRowsCut;},UnCutAllRows:function(){for(var i=0;i<this.m_rows.length;i++){this.m_rows[i].SetIsCut(false);}},CutSelectedRows:function(){var selectedRows=this.GetSelectionInfo();var rows=selectedRows.GetRows();var cutRows=[];var newRowsCut=false;if(selectedRows.GetSelectionFilterType()==D2L.LP.LayeredArch.SelectionFilterTypes.All){cutRows=this.m_rows;newRowsCut=true;}else if(selectedRows.GetSelectionFilterType()==D2L.LP.LayeredArch.SelectionFilterTypes.AllExcept){cutRows=this.GetRowsExceptHelper(rows);}else if(selectedRows.GetSelectionFilterType()==D2L.LP.LayeredArch.SelectionFilterTypes.Some){cutRows=rows;}
this.CutRows(cutRows,newRowsCut);},DeleteRow:function(row,doTriggerDeleteEvent){if(doTriggerDeleteEvent===undefined){doTriggerDeleteEvent=true;}
var index=-1;for(var i=0;i<this.m_rows.length;i++){if(this.m_rows[i]==row){index=i;break;}}
this.m_rows.splice(index,1);if(row.IsSelected()){this.SetSelectedRowCount(this.GetSelectedRowCount()-1);}
var record=row.GetYuiRecord();if(record!==null){var allColumns=this.m_context.GetColumns();for(var columnKey in allColumns){record.setData(columnKey,null);}
this.m_yuiDataTable.deleteRow(record.getId());}
if(doTriggerDeleteEvent){this.DeleteRowsEvent().Trigger([row]);}},DeleteRows:function(rows,doTriggerDeleteEvent){if(doTriggerDeleteEvent===undefined){doTriggerDeleteEvent=true;}
var dRows=[];for(var i=rows.length-1;i>-1;i--){dRows.push(rows[i]);this.DeleteRow(rows[i],false);}
if(doTriggerDeleteEvent){this.DeleteRowsEvent().Trigger(dRows);}},DeleteRowsEvent:function(){return this.m_deleteRowsEvent;},DeleteSelectedRows:function(){var selectedRows=this.GetSelectionInfo();var rows=selectedRows.GetRows();var deleteRows=[];if(selectedRows.GetSelectionFilterType()==D2L.LP.LayeredArch.SelectionFilterTypes.All){deleteRows=this.m_rows;}else if(selectedRows.GetSelectionFilterType()==D2L.LP.LayeredArch.SelectionFilterTypes.AllExcept){deleteRows=this.GetRowsExceptHelper(rows);}else if(selectedRows.GetSelectionFilterType()==D2L.LP.LayeredArch.SelectionFilterTypes.Some){deleteRows=rows;}
this.DeleteRows(deleteRows,true);},Focus:function(){if(this.m_yuiDataTable!==null){this.m_yuiDataTable.focus();}},GetActions:function(){return this.m_actions;},GetDragDropInfo:function(){return this.m_dragDropInfo;},GetDragDropMode:function(){return this.m_dragDropMode;},GetNextYuiRecordId:function(){var id='yui-rec'+this.m_count;this.m_count++;return id;},GetNumRows:function(){return this.m_numRows;},GetPaging:function(){return this.m_paging;},GetPagingType:function(){return this.m_pagingType;},GetParameter:function(key){return this.GetContext().GetParameter(key);},GetRow:function(rowKey){for(var i=0;i<this.m_rows.length;i++){if(this.m_rows[i].GetRowKey()==rowKey){return this.m_rows[i];}}
return null;},GetRows:function(rowKeys){var rows=[];for(var i=0;i<rowKeys.length;i++){for(var j=0;j<this.m_rows.length;j++){if(rowKeys[i]==this.m_rows[j].GetRowKey()){rows.push(this.m_rows[j]);break;}}}
return rows;},GetRowsExceptHelper:function(exceptRows){var rows=[];for(var i=0;i<this.m_rows.length;i++){var found=false;for(var j=0;j<exceptRows.length;j++){if(this.m_rows[i].GetRowKey()==exceptRows[j].GetRowKey()){found=true;break;}}
if(!found){rows.push(this.m_rows[i]);}}
return rows;},GetRowCount:function(){return this.m_rows.length;},GetRowById:function(id){for(var i=0;i<this.m_rows.length;i++){if(this.m_rows[i].GetId()==id){return this.m_rows[i];}}
return null;},GetContext:function(){return this.m_context;},GetSelectionInfo:function(){var type=D2L.LP.LayeredArch.SelectionFilterTypes.None;var rows=[];if(this.GetRowSelectionMode()==D2L.Control.DataGrid.RowSelectionModes.Multiple){if(this.m_pagingType!=D2L.Control.DataGrid.PagingTypes.Numeric){if(this.m_allRowsSelected){type=D2L.LP.LayeredArch.SelectionFilterTypes.All;}else if(this.m_newRowsSelected){type=D2L.LP.LayeredArch.SelectionFilterTypes.AllExcept;for(var i=0;i<this.m_rows.length;i++){if(!this.m_rows[i].IsSelected()){rows.push(this.m_rows[i]);}}}}
if(type==D2L.LP.LayeredArch.SelectionFilterTypes.None){for(var i=0;i<this.m_rows.length;i++){if(this.m_rows[i].IsSelected()){rows.push(this.m_rows[i]);}}
if(rows.length>0){type=D2L.LP.LayeredArch.SelectionFilterTypes.Some;}}}
return new D2L.Control.DataGrid.RowSelectionInfo(type,rows);},GetSelectedRowCount:function(){return this.m_numSelectedRows;},GetRowSelectionMode:function(){return this.m_rowSelectionMode;},GetSortBeforePrimary:function(sortField){for(var i=0;i<this.m_sorting.length;i++){if(this.m_sorting[i].GetSortField()==sortField){return this.m_sorting[i];}}
return null;},GetSortPrimary:function(){return this.m_sort;},GetYuiDataTableConfig:function(sortDesc,sortAsc){var config={};var me=this;var sort=this.GetSortPrimary();if(sort!==null){var yahooSortDir=YAHOO.widget.DataTable.CLASS_ASC;if(!sort.IsAscending()){yahooSortDir=YAHOO.widget.DataTable.CLASS_DESC;}
config['sortedBy']={key:sort.GetSortField(),dir:yahooSortDir};}
config['selcetionMode']='single';config['MSG_EMPTY']=this.m_emptyText;config['MSG_SORTDESC']=sortDesc;config['MSG_SORTASC']=sortAsc;config['summary']=this.m_summary;if(this.m_rowFormatPlugins.length>0){config['formatRow']=function(domNode,record){var row=me.GetRowById(record.getId());row.m_domNode=domNode;for(var i=0;i<me.m_rowFormatPlugins.length;i++){me.m_rowFormatPlugins[i].call(me.m_rowFormatPlugins[i],row);}
return true;};}
return config;},IsEmpty:function(){return(this.m_rows.length===0);},InitColumns:function(columns,fieldDefs){for(var i=0;i<columns.length;i++){columns[i].Init(this);this.m_context.AddColumn(columns[i].GetColumnKey(),columns[i]);fieldDefs.push(columns[i].ToYUIField());this.InitColumns(columns[i].GetColumns(),fieldDefs);}},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this);this.m_rowSelectionMode=deserializer.GetMember('RowSelectionMode');this.m_dragDropMode=deserializer.GetMember('DragDropMode');this.m_columns=deserializer.GetObjectArray('Columns',D2L.Control.DataGrid.Column);this.m_primaryColumnKey=deserializer.GetMember('PrimaryColumnKey');this.m_entitySourceRpc=deserializer.GetMember('EntitySourceRpc');this.m_entitySourceRpcSrc=deserializer.GetMember('EntitySourceRpcSrc');if(deserializer.HasMember('ActionsControlId')){var actionsControlId=deserializer.GetObject('ActionsControlId');this.m_actions=UI.GetControl(actionsControlId.ID(),actionsControlId.SID());}
this.m_emptyText=deserializer.GetMember('EmptyText');var sortDesc=deserializer.GetMember('SortDesc');var sortAsc=deserializer.GetMember('SortAsc');this.m_summary=deserializer.GetMember('Summary');this.m_rowHeaderColumnKey=deserializer.GetMember('RowHeaderColumnKey');this.m_sort=deserializer.GetObject('DefaultSort',D2L.LP.LayeredArch.SortingInfo);this.m_sorting=deserializer.GetObjectArray('Sorting',D2L.LP.LayeredArch.SortingInfo);if(deserializer.HasMember('DragDropSettingsControlID')){var dragDropSettingsControlId=deserializer.GetObject('DragDropSettingsControlID',D2L.Control.Id)
this.m_dragDropInfo=UI.GetControl(dragDropSettingsControlId.ID(),dragDropSettingsControlId.SID()).GetDragDropInfo();}
var response=deserializer.GetObject('RpcResponse',D2L.Control.DataGrid.RpcResponse);this.m_context=response.GetContext();this.m_rows=response.GetRows();this.m_pagingType=deserializer.GetMember('PagingType');if(this.m_pagingType!==D2L.Control.DataGrid.PagingTypes.None){var pageSize=deserializer.GetMember('PageSize');var pageSizeLimit=deserializer.GetMember('PageSizeLimit');this.m_paging=new D2L.Control.Paging();this.m_paging.SetPageSize(pageSize);this.m_paging.SetPageSizeLimit(pageSizeLimit);this.m_paging.SetTotalObjectCount(response.GetTotalEntityCount());}
if(this.GetRowSelectionMode()!=D2L.Control.DataGrid.RowSelectionModes.None){this.m_columns.splice(0,0,new D2L.Control.DataGrid.SelectionColumn(this.GetRowSelectionMode()));}
if(this.GetDragDropMode()==D2L.DragDrop.Modes.Draggable||this.GetDragDropMode()==D2L.DragDrop.Modes.DraggableDroppable){this.m_columns.splice(0,0,new D2L.Control.DataGrid.DragColumn());}
var renderer=new D2L.Control.DataGrid.Renderer(this);if(D2L.Util.Aria.IsEnabled()){var ariaController=new D2L.Control.DataGrid.AriaController(this);}
if(this.GetDragDropMode()!=D2L.DragDrop.Modes.None){var dragDropController=new D2L.Control.DataGrid.DragDropController(this);}
var fieldDefs=[];this.InitColumns(this.m_columns,fieldDefs);var colDefs=[];for(var i=0;i<this.m_columns.length;i++){colDefs.push(this.m_columns[i].ToYUIColumn());}
var dsRows=[];for(var i=0;i<this.m_rows.length;i++){this.m_rows[i].Init(this);dsRows.push(this.m_rows[i].m_data);}
var dataSource=new YAHOO.util.LocalDataSource();dataSource.responseType=YAHOO.util.XHRDataSource.TYPE_JSARRAY;dataSource.responseSchema={fields:fieldDefs};this.m_yuiDataTable=new YAHOO.widget.DataTable(this.GetMappedId()+'_c',colDefs,dataSource,this.GetYuiDataTableConfig(sortDesc,sortAsc));renderer.InstallYuiEvents(this.m_yuiDataTable);this.InstallEvents();if(dsRows.length>0){this.m_yuiDataTable.addRows(dsRows);}
this.LoadEvent().Trigger();},InstallEvents:function(){var me=this;var paging=this.GetPaging();if(this.m_pagingType==D2L.Control.DataGrid.PagingTypes.Scroll){this.SetNumRows(paging.GetTotalObjectCount(),false);}else{this.SetNumRows(this.GetRowCount(),false);}
if(this.m_pagingType==D2L.Control.DataGrid.PagingTypes.Numeric){paging.PageNumberChangeEvent().RegisterMethod(function(pageNumber){me.Reload();});paging.PageSizeChangeEvent().RegisterMethod(function(pageSize){me.Reload();});}else if(this.m_pagingType==D2L.Control.DataGrid.PagingTypes.Scroll){paging.TotalObjectCountChangeEvent().RegisterMethod(function(total){me.SetNumRows(total,true);});}
this.m_yuiDataTable.subscribe('sortedByChange',function(event){var sortField=event.newValue.key;var isAscending=event.newValue.dir!==YAHOO.widget.DataTable.CLASS_DESC;if(me.m_sort===null){me.m_sort=new D2L.LP.LayeredArch.SortingInfo(sortField,isAscending);}else{me.m_sort.SetSortField(sortField);me.m_sort.SetIsAscending(isAscending);}
me.SortEvent().Trigger(me.GetSortPrimary());if(paging!==null){paging.Reset();}
me.Reload();});this.SelectRowEvent().RegisterMethod(function(row){me.SetSelectedRowCount(me.GetSelectedRowCount()+1,true);});this.SelectAllRowsEvent().RegisterMethod(function(){me.m_allRowsSelected=true;me.m_newRowsSelected=true;me.SetSelectedRowCount(me.GetNumRows(),false);});this.UnSelectAllRowsEvent().RegisterMethod(function(){me.SetSelectedRowCount(0,false);me.m_allRowsSelected=false;me.m_newRowsSelected=false;me.m_newRowsCut=false;});this.UnSelectRowEvent().RegisterMethod(function(){me.SetSelectedRowCount(me.GetSelectedRowCount()-1,false);me.m_allRowsSelected=false;me.m_newRowsSelected=false;});this.ReloadBeginEvent().RegisterMethod(function(){me.SetSelectedRowCount(0,false);me.m_allRowsSelected=false;me.m_newRowsSelected=false;me.m_newRowsCut=false;if(me.m_pagingType==D2L.Control.DataGrid.PagingTypes.Scroll){paging.Reset();}});this.ReloadEndEvent().RegisterMethod(function(){me.SetSelectedRowCount(0,false);me.m_allRowsSelected=false;me.m_newRowsSelected=false;me.m_newRowsCut=false;if(me.m_pagingType!=D2L.Control.DataGrid.PagingTypes.Scroll){me.SetNumRows(me.GetRowCount(),false);}});this.AddRowsEvent().RegisterMethod(function(rows){me.SetNumRows(me.GetNumRows()+rows.length,true);});this.DeleteRowsEvent().RegisterMethod(function(rows){me.SetNumRows(me.GetNumRows()-rows.length,true);});},IsReloading:function(){return this.m_isReloading;},InvokeRpc:function(){var me=this;if(this.m_rpcInProgress){var dr=new D2L.Util.DelayedReturn();this.m_rpcDr.Register(function(){me.InvokeRpc().Register(function(result){dr.Trigger(result);});});return dr;}
this.m_rpcInProgress=true;this.m_rpcDr=new D2L.Util.DelayedReturn();var rpcCallback=function(rpcResponse){me.m_rpcInProgress=false;if(rpcResponse.GetType()==D2L.Rpc.ResponseType.Success){me.m_rpcDr.Trigger(rpcResponse.GetResult(D2L.Control.DataGrid.RpcResponse));}else{UI.Error(new D2L.LP.Text.LangTerm(D2L.Control.DataGrid.LANG_ERR_DATA_RETRIEVAL_PRIMARY),new D2L.LP.Text.LangTerm(D2L.Control.DataGrid.LANG_ERR_DATA_RETRIEVAL_SECONDARY),me);}};var sorting=[];for(var i=0;i<this.m_sorting.length;i++){sorting.push(this.m_sorting[i]);}
if(this.m_sort!==null){sorting.push(this.m_sort);}
var request=new D2L.Control.DataGrid.RpcRequest(this.m_context);request.SetRpc(this.m_entitySourceRpc);request.SetRpcSrc(this.m_entitySourceRpcSrc);request.SetSorting(sorting);if(this.GetPagingType()!==D2L.Control.DataGrid.PagingTypes.None){request.SetPaging(new D2L.LP.LayeredArch.PagingInfo(this.m_paging.GetPageSize(),this.m_paging.GetPageNumber()));}
setTimeout(function(){D2L.Rpc.Create('Reload',rpcCallback,'/d2l/common/rpc/dataGrid/dataGrid.d2l').Call(request)},D2L.Control.DataGrid.ReloadLatency);return this.m_rpcDr;},LoadEvent:function(){return this.m_loadEvent;},MouseOutRowEvent:function(){return this.m_mouseOutRowEvent;},MouseOverRowEvent:function(){return this.m_mouseOverRowEvent;},RegisterRowFormatPlugin:function(callback){this.m_rowFormatPlugins.push(callback);},Reload:function(){this.m_isReloading=true;this.ReloadBeginEvent().Trigger(this);var me=this;this.InvokeRpc().Register(function(response){me.ReloadResponseEvent().Trigger(response);me.m_context.m_parameters=response.GetContext().m_parameters;me.DeleteRows(me.m_rows,false);me.AddRows(response.GetRows(),D2L.Control.DataGrid.RowInsertionLocations.Bottom,false);if(me.m_paging!==null){me.m_paging.SetTotalObjectCount(response.GetTotalEntityCount());}
me.m_isReloading=false;me.ReloadEndEvent().Trigger(me);});},ReloadBeginEvent:function(){return this.m_reloadBeginEvent;},ReloadEndEvent:function(){return this.m_reloadEndEvent;},ReloadResponseEvent:function(){return this.m_reloadResponseEvent;},RemoveParameter:function(key){this.GetContext().RemoveParameter(key);},SelectAllRows:function(){if(this.GetRowSelectionMode()!=D2L.Control.DataGrid.RowSelectionModes.Multiple){return;}
for(var i=0;i<this.m_rows.length;i++){this.m_rows[i].SetIsSelected(true,false);}
this.SelectAllRowsEvent().Trigger();},SelectAllRowsEvent:function(){return this.m_selectAllRowsEvent;},SelectedRowCountChangeEvent:function(){return this.m_selectedRowCountChangeEvent;},SelectRowEvent:function(){return this.m_selectRowEvent;},SetNumRows:function(numRows,doUpdate){this.m_numRows=numRows;if(doUpdate){if((this.GetRowSelectionMode()!=D2L.Control.DataGrid.RowSelectionModes.None)&&(this.GetSelectedRowCount()==numRows)&&this.GetSelectedRowCount()>0){this.SelectAllRowsEvent().Trigger();}}},SetSelectedRowCount:function(numSelectedRows,doUpdate){if(numSelectedRows<0){numSelectedRows=0;}
this.m_numSelectedRows=numSelectedRows;if(doUpdate&&(this.GetRowSelectionMode()!=D2L.Control.DataGrid.RowSelectionModes.None)&&(this.GetSelectedRowCount()==this.GetNumRows())&&this.GetSelectedRowCount()>0){this.SelectAllRowsEvent().Trigger();}
this.SelectedRowCountChangeEvent().Trigger(numSelectedRows);},SetParameter:function(key,value){this.GetContext().SetParameter(key,value);},SortEvent:function(){return this.m_sortEvent;},UnSelectAllRows:function(){if(this.GetRowSelectionMode()!=D2L.Control.DataGrid.RowSelectionModes.Multiple){return;}
for(var i=0;i<this.m_rows.length;i++){this.m_rows[i].SetIsSelected(false,false);}
this.UnSelectAllRowsEvent().Trigger();},UnSelectAllRowsEvent:function(){return this.m_unSelectAllRowsEvent;},UnSelectRowEvent:function(){return this.m_unSelectRowEvent;}});D2L.Control.DataGrid.DefaultDragGhostRenderer=function(){var ghostImage=new D2L.Control.Image();ghostImage.SetImage(new D2L.Language.ImageTerm('Framework.DataGrid.infDragMultiGhost'));return ghostImage;};D2L.Control.DataGrid.HandleStartDrag=function(drag){var row=drag.GetControl();var dGrid=row.GetDataGrid();if(dGrid.GetRowSelectionMode()==D2L.Control.DataGrid.RowSelectionModes.Multiple){row.SetIsSelected(true);drag.GetCustomGhostControl().SetText(new D2L.LP.Text.PlainText('('+dGrid.GetSelectedRowCount()+')'));}};D2L.Control.DataGrid.ReloadLatency=0;D2L.Control.DataGrid.AriaLoggingIsEnabled=true;

D2L.Control.DataGrid.AriaController=D2L.Class.extend({Construct:function(dataGrid){arguments.callee.$.Construct.call(this);this.m_dataGrid=dataGrid;this.m_tableEl=null;this.Init();},AddAriaMessage:function(message){if(D2L.Control.DataGrid.AriaLoggingIsEnabled){this.m_dataGrid.GetUI().GetMessageArea().AddAriaMessage(message);}},GetTableEl:function(){if(this.m_tableEl===null){this.m_tableEl=this.GetYuiDataTable().getTableEl();}
return this.m_tableEl;},GetYuiDataTable:function(){return this.m_dataGrid.m_yuiDataTable;},Init:function(){var me=this;this.m_dataGrid.LoadEvent().RegisterMethod(function(){me.OnLoad();});this.m_dataGrid.RegisterRowFormatPlugin(function(row){D2L.Util.Aria.SetRole(row.GetDomNode(),'row');});this.m_dataGrid.CellFormatEvent().RegisterMethod(function(cell,column){if(column.GetColumnKey()==me.m_dataGrid.m_rowHeaderColumnKey){D2L.Util.Aria.SetRole(cell,'rowheader');}else{D2L.Util.Aria.SetRole(cell,'gridcell');}});var isSorting=true;this.m_dataGrid.ReloadBeginEvent().RegisterMethod(function(){var msg=isSorting?'Framework.DataGrid.altApplyingSort':'Framework.DataGrid.lblLoading';me.AddAriaMessage(new D2L.LP.Text.LangTerm(msg));});this.m_dataGrid.ReloadResponseEvent().RegisterMethod(function(){D2L.Util.Aria.SetAttribute(me.GetTableEl(),'busy','true');var msg=isSorting?'Framework.DataGrid.altSortAppliedSuccessfully':'Framework.DataGrid.altLoadedSuccessfully';isSorting=false;me.AddAriaMessage(new D2L.LP.Text.LangTerm(msg));});this.m_dataGrid.ReloadEndEvent().RegisterMethod(function(){D2L.Util.Aria.SetAttribute(me.GetTableEl(),'busy','false');});this.m_dataGrid.SortEvent().RegisterMethod(function(){isSorting=true;});},OnLoad:function(){var tableEl=this.GetTableEl();D2L.Util.Aria.SetRole(tableEl,'grid');D2L.Util.Aria.SetAttribute(tableEl,'live','polite');D2L.Util.Aria.SetAttribute(tableEl,'relevant','additions');var theadRow=this.GetYuiDataTable().getTheadEl().firstChild;D2L.Util.Aria.SetRole(theadRow,'row');for(var i=0;i<theadRow.childNodes.length;i++){D2L.Util.Aria.SetRole(theadRow.childNodes[i],'columnheader');}}});

D2L.Control.DataGrid.Column=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_columnKey='';this.m_isResizable=false;this.m_isSortable=false;this.m_label='';this.m_columns=[];this.m_renderer=new D2L.Control.DataGrid.ColumnRenderer();this.m_dataGrid=null;this.m_yuiColumn=null;},Deserialize:function(deserializer){this.m_columnKey=deserializer.GetMember('ColumnKey');this.m_isResizable=deserializer.GetMember('IsResizable');this.m_isSortable=deserializer.GetMember('IsSortable');this.m_label=deserializer.GetMember('Label');this.m_columns=deserializer.GetObjectArray('Columns',D2L.Control.DataGrid.Column);this.m_renderer=deserializer.GetObject('Renderer');},GetColumns:function(){return this.m_columns;},GetLabel:function(){return this.m_label;},GetFormatter:function(){var me=this;return function(cell,record,column,data){data.m_liner=cell;data.m_cell=cell.parentNode;var row=me.m_dataGrid.GetRowById(record.getId());var control=me.m_renderer.Render(data,row,me);if(control!==undefined&&control!==null){if(control.AppendTo!==undefined){control.AppendTo(cell);}else if(D2L.Util.Html.IsDomNode(control)){cell.appendChild(control);}}
me.m_dataGrid.CellFormatEvent().Trigger(data.m_cell,me);};},GetRenderer:function(){return this.m_renderer;},GetColumnKey:function(){return this.m_columnKey;},GetYuiColumn:function(){if(this.m_yuiColumn===null){this.m_yuiColumn=this.m_dataGrid.m_yuiDataTable.getColumn(this.GetColumnKey());}
return this.m_yuiColumn;},Init:function(dataGrid){this.m_dataGrid=dataGrid;},IsSortable:function(){return this.m_isSortable;},IsResizable:function(){return this.m_isResizable;},Serialize:function(serializer){serializer.AddMember('ColumnKey',this.GetColumnKey());},ToYUIColumn:function(){var me=this;var key=this.GetColumnKey();var obj={};obj['key']=key;obj['label']=this.m_label;obj['formatter']=this.GetFormatter();obj['sortable']=this.IsSortable();obj['className']='d_dg_col_'+key;obj['resizeable']=this.IsResizable();if(this.m_columns.length>0){obj['children']=[];for(var i=0;i<this.m_columns.length;i++){obj['children'].push(this.m_columns[i].ToYUIColumn());}}
return obj;},ToYUIField:function(){return{'key':this.GetColumnKey()};}});D2L.Control.DataGrid.SelectionColumn=D2L.Control.DataGrid.Column.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_columnKey=D2L.Control.DataGrid.SELECTION_COLUMN_KEY;this.m_renderer=new D2L.Control.DataGrid.SelectionColumnRenderer();}});D2L.Control.DataGrid.DragColumn=D2L.Control.DataGrid.Column.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_columnKey=D2L.Control.DataGrid.DRAG_COLUMN_KEY;this.m_renderer=new D2L.Control.DataGrid.DragColumnRenderer();}});

D2L.Control.DataGrid.Context=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_columns={};this.m_parameters=new D2L.Util.Dictionary();},AddColumn:function(columnKey,column){this.m_columns[columnKey]=column;},Deserialize:function(deserializer){var params=deserializer.GetDictionary('Parameters');for(var key in params){this.m_parameters.Add(key,params[key]);}},GetColumns:function(){return this.m_columns;},GetColumn:function(columnKey){if(this.m_columns[columnKey]!==undefined){return this.m_columns[columnKey];}
return null;},GetParameter:function(key){return this.m_parameters.Get(key);},RemoveParameter:function(key){this.m_parameters.Remove(key);},Serialize:function(serializer){var actualColumns={};for(var key in this.m_columns){if(key!=D2L.Control.DataGrid.SELECTION_COLUMN_KEY&&key!=D2L.Control.DataGrid.DRAG_COLUMN_KEY){actualColumns[key]=this.m_columns[key];}}
serializer.AddMember('Parameters',this.m_parameters);serializer.AddMember('Columns',actualColumns);},SetParameter:function(key,value){this.m_parameters.Add(key,value);}});

D2L.Control.DataGrid.DragDropController=D2L.Class.extend({Construct:function(dataGrid){arguments.callee.$.Construct.call(this);this.m_dataGrid=dataGrid;var me=this;dataGrid.RegisterRowFormatPlugin(function(row){me.Install(row);});},Install:function(row){var ddObject;var dataGrid=this.m_dataGrid;var calculatedMode=dataGrid.GetDragDropMode();if(calculatedMode==D2L.DragDrop.Modes.DraggableDroppable){if(row.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.Droppable;}
if(row.IsDroppabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.Draggable;}
if(row.IsDroppabilityOverridden()&&row.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}}
if(dataGrid.GetDragDropMode()==D2L.DragDrop.Modes.Draggable&&row.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}
if(dataGrid.GetDragDropMode()==D2L.DragDrop.Modes.Droppable&&row.IsDroppabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}
var rowTr=row.GetDomNode();var cell=rowTr.cells[0];setTimeout(function(){if(calculatedMode==D2L.DragDrop.Modes.DraggableDroppable){ddObject=new D2L.DragDrop.DraggableDroppable(row,rowTr);ddObject.SetHandle(cell);}
if(calculatedMode==D2L.DragDrop.Modes.Draggable){ddObject=new D2L.DragDrop.Draggable(row,rowTr);ddObject.SetHandle(cell);}
if(calculatedMode==D2L.DragDrop.Modes.Droppable){ddObject=new D2L.DragDrop.Droppable(row,rowTr);}
if(dataGrid.GetDragDropInfo()){D2L.DragDrop.SetDragDropInfo(ddObject,dataGrid.GetDragDropInfo());}
ddObject.SetCustomGhostRenderer(D2L.Control.DataGrid.DefaultDragGhostRenderer);ddObject.OnStartDrag.RegisterMethod(function(){D2L.Control.DataGrid.HandleStartDrag(ddObject);});},0);}});

D2L.Control.DataGrid.SELECTION_COLUMN_KEY='d_selection';D2L.Control.DataGrid.DRAG_COLUMN_KEY='d_drag';D2L.Control.DataGrid.LANG_SELECT_ALL_ROWS='Framework.DataGrid.altSelectAllRows';D2L.Control.DataGrid.LANG_LOADING='Framework.DataGrid.lblLoading';D2L.Control.DataGrid.LANG_ERR_DATA_RETRIEVAL_PRIMARY='Framework.DataGrid.lblErrorRetrievingDataPrimary';D2L.Control.DataGrid.LANG_ERR_DATA_RETRIEVAL_SECONDARY='Framework.DataGrid.lblErrorRetrievingDataSecondary';D2L.Control.DataGrid.RowSelectionModes={None:0,Multiple:1,Single:2};D2L.Control.DataGrid.PagingTypes={None:0,Numeric:1,Scroll:2};D2L.Control.DataGrid.RowInsertionLocations={Top:0,Bottom:1};

D2L.Control.DataGrid.Renderer=D2L.Class.extend({Construct:function(dataGrid){arguments.callee.$.Construct.call(this);this.m_actionContainer=null;this.m_actionContainerIsEnabled=false;this.m_actionContainerIsVisible=false;this.m_dataGrid=dataGrid;this.m_isScrollLoading=false;this.m_loadNextPage=null;this.m_scrollPagingContainer=null;this.m_scrollPagingLink=null;this.m_scrollPagingLoading=null;this.m_scrollPagingIsEnabled=true;this.m_selectAllCb=null;this.m_shim=null;this.m_shimMsg=null;this.InstallDataGridEvents();this.Init();},ActionContainerIsVisible:function(){return this.GetDataGrid().GetRowSelectionMode()==D2L.Control.DataGrid.RowSelectionModes.Multiple;},AdjustColumnSizes:function(){var dataGrid=this.GetDataGrid();var yuiDataTable=dataGrid.m_yuiDataTable;var totalWidth=this.GetDomNode().offsetWidth;var column=yuiDataTable.getColumn(D2L.Control.DataGrid.SELECTION_COLUMN_KEY);if(column!==null){column.getThEl().style.width='22px';}
var dragColumn=yuiDataTable.getColumn(D2L.Control.DataGrid.DRAG_COLUMN_KEY);if(dragColumn!==null){dragColumn.getThEl().style.width='16px';}
if(dataGrid.m_primaryColumnKey.length>0){var column=yuiDataTable.getColumn(dataGrid.m_primaryColumnKey);if(column!==null){column.getThEl().style.width='50%';}}else{var columns=yuiDataTable.getColumnSet().flat;var avg=Math.round(100/columns.length);for(var i=0;i<columns.length;i++){columns[i].getThEl().style.width=avg+'%';}}},BuildActionContainer:function(){var dataGrid=this.GetDataGrid();if(dataGrid.GetRowSelectionMode()!=D2L.Control.DataGrid.RowSelectionModes.Multiple&&dataGrid.GetPagingType()!=D2L.Control.DataGrid.PagingTypes.Numeric){return;}
var me=this;this.m_actionContainer=this.CreateElement('div');this.m_actionContainer.className='d_dg_ac';if(this.GetDataGrid().GetRowSelectionMode()==D2L.Control.DataGrid.RowSelectionModes.Multiple){var cbContainer=this.CreateElement('span');cbContainer.className='d_dg_cb';this.m_actionContainer.appendChild(cbContainer);this.m_selectAllCb=new D2L.Control.Checkbox();this.m_selectAllCb.SetText(new D2L.LP.Text.LangTerm(D2L.Control.DataGrid.LANG_SELECT_ALL_ROWS));this.m_selectAllCb.SetShowText(false);this.m_selectAllCb.SetOnClick(function(){if(this.IsChecked()){me.GetDataGrid().SelectAllRows();}else{me.GetDataGrid().UnSelectAllRows();}});this.m_selectAllCb.AppendTo(cbContainer);}
if(dataGrid.GetActions()!==null){dataGrid.GetActions().AppendTo(this.m_actionContainer);}
if(dataGrid.GetPagingType()==D2L.Control.DataGrid.PagingTypes.Numeric){var pagingContainer=this.CreateElement('span');pagingContainer.className='d_dg_pn';this.m_actionContainer.appendChild(pagingContainer);var paging=dataGrid.GetPaging();var pagingRenderer=new D2L.Control.Paging.NumericRenderer(paging);paging.AppendTo(pagingContainer);}
var clear=this.CreateElement('span');clear.className='clear';this.m_actionContainer.appendChild(clear);this.GetDomNode().appendChild(this.m_actionContainer);},BuildScrollPaging:function(){var dataGrid=this.GetDataGrid();if(dataGrid.GetPagingType()!=D2L.Control.DataGrid.PagingTypes.Scroll){return;}
this.m_scrollPagingContainer=UI.CreateElement('div');this.m_scrollPagingContainer.className='d_dg_ps';var me=this;var ni=new D2L.NavInfo();ni.SetOnClick(function(){me.ScrollLoad();});this.m_scrollPagingLink=new D2L.Control.Link();this.m_scrollPagingLink.SetText(new D2L.LP.Text.LangTerm('Framework.DataGrid.lblLoadNextPage'));this.m_scrollPagingLink.SetNav(ni);this.m_scrollPagingLink.AppendTo(this.m_scrollPagingContainer);this.m_scrollPagingLoading=new D2L.Control.TextBlock();this.m_scrollPagingLoading.SetText(new D2L.LP.Text.LangTerm('Framework.DataGrid.lblLoading'));this.m_scrollPagingLoading.SetIsDisplayed(false);this.m_scrollPagingLoading.AppendTo(this.m_scrollPagingContainer);this.GetDomNode().appendChild(this.m_scrollPagingContainer);},BuildYuiContainer:function(){var c=this.CreateElement('div');c.id=this.GetDataGrid().GetMappedId()+'_c';this.GetDomNode().appendChild(c);},CreateElement:function(tag){return this.GetDataGrid().CreateElement(tag);},GetDataGrid:function(){return this.m_dataGrid;},GetDomNode:function(){return this.GetDataGrid().GetDomNode();},HandleScroll:function(){if(this.m_isScrollLoading||!this.m_scrollPagingIsEnabled){return;}
var dataGrid=this.GetDataGrid();var paging=dataGrid.GetPaging();var numRows=dataGrid.GetRowCount();if(numRows>=paging.GetTotalObjectCount()){this.SetScrollLoadingIsEnabled(false);return;}
var yCoord=FindPosY(this.m_scrollPagingContainer);var horizon=UI.GetScrollTop()+UI.GetWindowHeight();var distance=yCoord-horizon;var base=UI.GetRelativeFontSizeManager().GetBaseFontSize();var distanceEm=D2L.Style.Utility.PixelToEm(base,distance);if(distanceEm<60){this.ScrollLoad();}},Init:function(){var dataGrid=this.GetDataGrid();this.BuildActionContainer();this.SetActionContainerIsVisible(dataGrid.GetRowSelectionMode()==D2L.Control.DataGrid.RowSelectionModes.Multiple||dataGrid.GetPagingType()==D2L.Control.DataGrid.PagingTypes.Numeric);this.SetActionContainerIsEnabled(!dataGrid.IsEmpty());this.BuildYuiContainer();this.BuildScrollPaging();},InstallDataGridEvents:function(){var dataGrid=this.GetDataGrid();var paging=dataGrid.GetPaging();var me=this;dataGrid.AddRowsEvent().RegisterMethod(function(rows){me.SetActionContainerIsEnabled(!dataGrid.IsEmpty());});dataGrid.DeleteRowsEvent().RegisterMethod(function(rows){me.SetActionContainerIsEnabled(!dataGrid.IsEmpty());});dataGrid.ReloadBeginEvent().RegisterMethod(function(){me.SetActionContainerIsEnabled(false);dataGrid.GetUI().GetShimController().Shim(dataGrid,true);});dataGrid.ReloadEndEvent().RegisterMethod(function(){dataGrid.GetUI().GetShimController().ClearShims();me.SetActionContainerIsEnabled(!dataGrid.IsEmpty());me.AdjustColumnSizes();});if(dataGrid.GetPagingType()==D2L.Control.DataGrid.PagingTypes.Scroll){dataGrid.ReloadEndEvent().RegisterMethod(function(){me.SetScrollLoadingIsEnabled(true);me.HandleScroll();});dataGrid.LoadEvent().RegisterMethod(function(){me.HandleScroll();});}
if(dataGrid.GetRowSelectionMode()==D2L.Control.DataGrid.RowSelectionModes.Multiple){dataGrid.UnSelectRowEvent().RegisterMethod(function(row){me.m_selectAllCb.SetIsChecked(false);});dataGrid.SelectAllRowsEvent().RegisterMethod(function(){me.m_selectAllCb.SetIsChecked(true);});dataGrid.UnSelectAllRowsEvent().RegisterMethod(function(){me.m_selectAllCb.SetIsChecked(false);});dataGrid.ReloadBeginEvent().RegisterMethod(function(){me.m_selectAllCb.SetIsChecked(false);});}
dataGrid.LoadEvent().RegisterMethod(function(){me.InstallScrollListener();me.AdjustColumnSizes();});},InstallScrollListener:function(){var dataGrid=this.GetDataGrid();var childHeight=dataGrid.GetDomNode().offsetWidth;var node=dataGrid.GetDomNode().parentNode;var found=false;while(node.parentNode){if(node.className=='dsl_p_m'){break;}
node=node.parentNode;}
var me=this;YAHOO.util.Event.addListener(node,'scroll',function(evt){if(dataGrid.GetPagingType()==D2L.Control.DataGrid.PagingTypes.Scroll){me.HandleScroll();}
UI.GetWindowEventManager().HideContextMenus.Trigger();});},InstallYuiEvents:function(yuiDataTable){var dataGrid=this.GetDataGrid();var getRow=function(target){var record=yuiDataTable.getRecord(target);return dataGrid.GetRowById(record.getId());};yuiDataTable.subscribe('rowMouseoverEvent',function(args){dataGrid.MouseOverRowEvent().Trigger(getRow(args.target),args.event);});yuiDataTable.subscribe('rowMouseoutEvent',function(args){dataGrid.MouseOutRowEvent().Trigger(getRow(args.target),args.event);});yuiDataTable.subscribe('rowClickEvent',function(args){dataGrid.ClickRowEvent().Trigger(getRow(args.target));});yuiDataTable.subscribe('cellFormatEvent',function(args){var td=args.el.parentNode;var record=args.record;var column=args.column;var rowHeaderId=record.getId()+'-rowhead';if(column.getKey()==dataGrid.m_rowHeaderColumnKey){td.id=rowHeaderId;td.scope='row';}else if(dataGrid.m_rowHeaderColumnKey.length>0){td.headers+=' '+rowHeaderId;}});},ScrollLoad:function(){var dataGrid=this.GetDataGrid();if(this.m_isScrollLoading||!this.m_scrollPagingIsEnabled||dataGrid.IsReloading()){return;}
var paging=dataGrid.GetPaging();this.m_isScrollLoading=true;paging.SetPageNumber(paging.GetPageNumber()+1);this.m_scrollPagingLink.SetIsDisplayed(false);this.m_scrollPagingLoading.SetIsDisplayed(true);var me=this;dataGrid.InvokeRpc().Register(function(result){var rows=result.GetRows();if(rows.length>0){dataGrid.AddRows(rows,D2L.Control.DataGrid.RowInsertionLocations.Bottom,false);me.SetActionContainerIsEnabled(!dataGrid.IsEmpty());}else{me.SetScrollLoadingIsEnabled(false);}
me.m_scrollPagingLink.SetIsDisplayed(true);me.m_scrollPagingLoading.SetIsDisplayed(false);me.m_isScrollLoading=false;me.HandleScroll();});},SetActionContainerIsEnabled:function(isEnabled){if(isEnabled==this.m_actionContainerIsEnabled){return;}
this.m_actionContainerIsEnabled=isEnabled;if(this.m_selectAllCb!==null){this.m_selectAllCb.SetIsEnabled(isEnabled);}
var actions=this.GetDataGrid().GetActions();if(actions!==null){actions.SetIsEnabled(isEnabled);}},SetActionContainerIsVisible:function(isVisible){if(isVisible==this.m_actionContainerIsVisible){return;}
this.m_actionContainerIsVisible=isVisible;if(this.m_actionContainer!==null){this.m_actionContainer.style.display=isVisible?'block':'none';}},SetScrollLoadingIsEnabled:function(isEnabled){if(this.m_scrollPagingIsEnabled==isEnabled){return;}
this.m_scrollPagingIsEnabled=isEnabled;if(this.m_scrollPagingContainer!==null){this.m_scrollPagingContainer.style.display=isEnabled?'block':'none';}}});

D2L.Control.DataGrid.Row=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_data={};this.m_dataGrid=null;this.m_ddObject=null;this.m_domNode=null;this.m_id='';this.m_isCut=false;this.m_isCutChangeEvent=new D2L.EventHandler();this.m_keyChangeEvent=new D2L.EventHandler();this.m_overrideDraggability=false;this.m_overrideDroppability=false;this.m_parameters=new D2L.Util.Dictionary();this.m_rowKey='';this.m_selectionHoverState=false;this.m_subject='';this.m_tempData=null;this.m_yuiRecord=null;},Deserialize:function(deserializer){this.m_rowKey=deserializer.GetMember('RowKey');this.m_subject=deserializer.GetMember('Subject');this.m_tempData=deserializer.GetObjectArray('Data');var params=deserializer.GetDictionary('Parameters');for(var key in params){this.m_parameters.Add(key,params[key]);}
if(deserializer.HasMember('OverrideDraggability')){this.m_overrideDraggability=deserializer.GetMember('OverrideDraggability');}
if(deserializer.HasMember('OverrideDroppability')){this.m_overrideDroppability=deserializer.GetMember('OverrideDroppability');}},GetColumnData:function(columnKey){if(this.m_data[columnKey]!==undefined){return this.m_data[columnKey];}
return null;},GetDataGrid:function(){return this.m_dataGrid;},GetDomNode:function(){return this.m_domNode;},GetDragDropObject:function(){return this.m_ddObject;},GetId:function(){return this.m_id;},GetParameter:function(name){return this.m_parameters.Get(name);},GetRowKey:function(){return this.m_rowKey;},GetSubject:function(){return this.m_subject;},GetYuiRecord:function(){if(this.m_yuiRecord===null){this.m_yuiRecord=this.m_dataGrid.m_yuiDataTable.getRecord(this.m_id);}
return this.m_yuiRecord;},Init:function(dataGrid){this.m_dataGrid=dataGrid;this.m_id=dataGrid.GetNextYuiRecordId();var columns=this.m_dataGrid.GetContext().GetColumns();var i=0;for(var columnKey in columns){var column=columns[columnKey];if(columnKey==D2L.Control.DataGrid.DRAG_COLUMN_KEY){var data=new D2L.Control.DataGrid.DragColumnRendererData();data.SetDragDropInfo(dataGrid.GetDragDropInfo());data.SetDragDropMode(dataGrid.GetDragDropMode());this.m_data[D2L.Control.DataGrid.DRAG_COLUMN_KEY]=data;}else if(columnKey==D2L.Control.DataGrid.SELECTION_COLUMN_KEY){var text=new D2L.LP.Text.LangTerm('Framework.DataGrid.altSelectRow');text.SetSubject(this.GetSubject());var data=new D2L.Control.DataGrid.SelectionColumnRendererData();data.SetFieldName(dataGrid.GetMappedId()+'_s');data.SetText(text);data.SetShowText(false);data.SetValue(this.GetRowKey());this.m_data[D2L.Control.DataGrid.SELECTION_COLUMN_KEY]=data;}else{if(this.m_tempData[i]===null){this.m_tempData[i]=new D2L.Control.DataGrid.ColumnRendererData('');}
this.m_data[columnKey]=this.m_tempData[i];i++;}}},IsCut:function(){return this.m_isCut;},IsCutChangeEvent:function(){return this.m_isCutChangeEvent;},IsDraggabilityOverridden:function(){return this.m_overrideDraggability;},IsDroppabilityOverridden:function(){return this.m_overrideDroppability;},IsSelected:function(){return this.m_dataGrid.m_yuiDataTable.isSelected(this.GetYuiRecord());},KeyChangeEvent:function(){return this.m_keyChangeEvent;},RemoveColumnData:function(data){var liner=data.GetLiner();if(liner!==null){while(liner.childNodes.length>0){liner.removeChild(liner.firstChild);}}},RenderColumn:function(columnKey){var column=this.m_dataGrid.GetContext().GetColumn(columnKey);var data=this.m_data[columnKey];if(column===null||data===undefined){return;}
this.RemoveColumnData(data);this.m_dataGrid.m_yuiDataTable.updateCell(this.GetYuiRecord(),column.GetYuiColumn(),this.m_data[columnKey]);},Replace:function(row){var columns=this.m_dataGrid.GetContext().GetColumns();var i=0;for(var columnKey in columns){if(columnKey!=D2L.Control.DataGrid.DRAG_COLUMN_KEY&&columnKey!=D2L.Control.DataGrid.SELECTION_COLUMN_KEY){this.RemoveColumnData(this.m_data[columnKey]);this.SetColumnData(columnKey,row.m_tempData[i]);this.RenderColumn(columnKey);i++;}}
this.m_subject=row.m_subject;this.m_parameters=row.m_parameters;},SetColumnData:function(columnKey,data){this.m_data[columnKey]=data;},SetIsCut:function(isCut){if(isCut==this.m_isCut){return;}
this.m_isCut=isCut;this.IsCutChangeEvent().Trigger(this);},SetRowKey:function(rowKey){this.m_rowKey=rowKey;if(this.m_data[D2L.Control.DataGrid.SELECTION_COLUMN_KEY]!==undefined){this.m_data[D2L.Control.DataGrid.SELECTION_COLUMN_KEY].SetValue(rowKey);}
this.KeyChangeEvent().Trigger(rowKey);},SetSelectionHoverState:function(selectionHoverState){if(selectionHoverState==this.m_selectionHoverState){return;}
this.m_selectionHoverState=selectionHoverState;if(selectionHoverState){this.m_dataGrid.m_yuiDataTable.highlightRow(this.GetYuiRecord());}else{this.m_dataGrid.m_yuiDataTable.unhighlightRow(this.GetYuiRecord());}},SetIsSelected:function(isSelected,doTriggerEvent){if(doTriggerEvent===undefined){doTriggerEvent=true;}
if(isSelected==this.IsSelected()){return;}
if(isSelected){this.m_dataGrid.m_yuiDataTable.selectRow(this.GetYuiRecord());}else{this.m_dataGrid.m_yuiDataTable.unselectRow(this.GetYuiRecord());}
var data=this.GetColumnData(D2L.Control.DataGrid.SELECTION_COLUMN_KEY);if(data!==null){data.SetIsChecked(isSelected);}
if(this.m_dataGrid!==null&&doTriggerEvent){if(isSelected){this.m_dataGrid.SelectRowEvent().Trigger(this);}else{this.m_dataGrid.UnSelectRowEvent().Trigger(this);}}},SetParameter:function(name,value){this.m_parameters.Add(name,value);}});

D2L.Control.DataGrid.RowSelectionInfo=D2L.Class.extend({Construct:function(type,rows){arguments.callee.$.Construct.call(this);this.m_type=type;this.m_rows=rows;},Serialize:function(serializer){serializer.AddMember('SelectionFilterType',this.m_type);serializer.AddMember('RowKeys',this.GetRowKeys());},GetRows:function(){return this.m_rows;},GetRowKeys:function(){var keys=[];for(var i=0;i<this.m_rows.length;i++){keys.push(this.m_rows[i].GetRowKey());}
return keys;},GetSelectionFilterType:function(){return this.m_type;}});

D2L.Control.DataGrid.RpcRequest=D2L.Class.extend({Construct:function(dataGridContext){arguments.callee.$.Construct.call(this);this.m_rpc='';this.m_rpcSrc='';this.m_paging=null;this.m_dataGridContext=dataGridContext;this.m_sorting=[];},Serialize:function(serializer){serializer.AddMember('Paging',this.m_paging);serializer.AddMember('DataGridContext',this.m_dataGridContext);serializer.AddMember('Rpc',this.m_rpc);serializer.AddMember('RpcSrc',this.m_rpcSrc);serializer.AddMember('Sorting',this.m_sorting);},SetPaging:function(paging){this.m_paging=paging;},SetRpc:function(rpc){this.m_rpc=rpc;},SetRpcSrc:function(rpcSrc){this.m_rpcSrc=rpcSrc;},SetSorting:function(sorting){this.m_sorting=sorting;}});

D2L.Control.DataGrid.RpcResponse=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_rows=[];this.m_pageCount=1;this.m_entityCount=0;this.m_totalEntityCount=0;this.m_context=null;},Deserialize:function(deserializer){this.m_rows=deserializer.GetObjectArray('Rows',D2L.Control.DataGrid.Row);this.m_pageCount=deserializer.GetMember('PageCount');this.m_entityCount=deserializer.GetMember('EntityCount');this.m_totalEntityCount=deserializer.GetMember('TotalEntityCount');this.m_context=deserializer.GetObject('DataGridContext');},GetEntityCount:function(){return this.m_entityCount;},GetTotalEntityCount:function(){return this.m_totalEntityCount;},GetPageCount:function(){return this.m_pageCount;},GetContext:function(){return this.m_context;},GetRows:function(){return this.m_rows;}});

D2L.Control.DataGrid.ColumnRenderer=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Deserialize:function(deserializer){},Render:function(data,row,column){if(data==undefined||data==null){data='';}
if(data.GetDataValue!==undefined){data=data.GetDataValue();}
return new D2L.Control.TextBlock(new D2L.LP.Text.PlainText(data));}});

D2L.Control.DataGrid.ColumnRendererData=D2L.Class.extend({Construct:function(dataValue){if(dataValue===undefined){dataValue=null;}
arguments.callee.$.Construct.call(this);this.m_cell=null;this.m_liner=null;this.m_dataValue=dataValue;this.m_validator=null;},Deserialize:function(deserializer){this.m_dataValue=deserializer.GetMember('Value','');if(deserializer.HasMember('ValidatorControlId')){var controlId=deserializer.GetObject('ValidatorControlId',D2L.Control.Id);this.m_validator=UI.GetControl(controlId.ID(),controlId.SID());}},GetCell:function(){return this.m_cell;},GetDataValue:function(){return this.m_dataValue;},GetLiner:function(){return this.m_liner;},GetValidator:function(){return this.m_validator;},SetDataValue:function(dataValue){this.m_dataValue=dataValue;}});

D2L.Control.DataGrid.TextColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Render:function(data,row){var tb=new D2L.Control.TextBlock(data.GetText());var image=this.RenderImage(data,row);if(image!==null){var c=UI.CreateElement('span');c.appendChild(image);tb.AppendTo(c);return c;}else{return tb;}},RenderImage:function(data,row){var image=data.GetImage();if(image===null){return null;}
var img=UI.CreateElement('img');img.alt='';img.className='di_i';image.Assign(img);var cut=function(isCut){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){img.style.filter=isCut?'progid:DXImageTransform.Microsoft.Alpha(opacity=50)':'progid:DXImageTransform.Microsoft.Alpha(opacity=100)';}else{img.style.opacity=isCut?'0.5':'1';}};cut(row.IsCut());row.IsCutChangeEvent().RegisterMethod(function(){cut(row.IsCut());});return img;}});D2L.Control.DataGrid.TextColumnRendererData=D2L.Control.DataGrid.ColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this,'');this.m_image=null;this.m_text=new D2L.LP.Text.PlainText();},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);this.m_text=deserializer.GetObject('Text');if(deserializer.HasMember('Image')){this.m_image=deserializer.GetObject('Image');}},GetImage:function(){return this.m_image;},GetText:function(){return this.m_text;},SetText:function(text){this.m_text=text;}});

D2L.Control.DataGrid.LinkColumnRenderer=D2L.Control.DataGrid.TextColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Render:function(data,row){var link=this.RenderLink(data);var image=this.RenderImage(data,row);if(image!==null){var c=UI.CreateElement('span');c.appendChild(image);link.AppendTo(c);return c;}else{return link;}},RenderLink:function(data){var link=new D2L.Control.Link();link.SetNav(data.m_navInfo);link.SetText(data.GetText());if(data.GetAlt()!=null){link.SetAlt(data.GetAlt());}
data.m_link=link;return link;}});D2L.Control.DataGrid.LinkColumnRendererData=D2L.Control.DataGrid.TextColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_alt=null;this.m_link=null;this.m_navInfo=new D2L.NavInfo();},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);this.m_navInfo=deserializer.GetObject('NavInfo',D2L.NavInfo);if(deserializer.HasMember('Alt')){this.m_alt=new D2L.LP.Text.PlainText(deserializer.GetMember('Alt'));}},GetAlt:function(){return this.m_alt;},SetNav:function(navInfo){this.m_navInfo=navInfo;if(this.m_link!==null){this.m_link.SetNav(this.m_navInfo);}},SetText:function(text){arguments.callee.$.SetText.call(this,text);if(this.m_link!==null){this.m_link.SetText(text);}}});

D2L.Control.DataGrid.CheckboxColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_onClick=null;this.m_text=null;},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);var onClick=deserializer.GetMember('OnClick','');if(onClick.length>0&&window[onClick]!==undefined){this.m_onClick=window[onClick];}
if(deserializer.HasMember('Text')){this.m_text=deserializer.GetObject('Text');}},Render:function(data,row,column){var text=this.m_text;if(text===null){text=new D2L.LP.Text.SmlText('{subjectone} {subjecttwo}');}
text.SetSubject(row.GetSubject());text.SetSubjectTwo(column.GetLabel());var me=this;var cb=new D2L.Control.Checkbox();cb.SetIsChecked(data.IsChecked());cb.SetText(text);cb.SetShowText(false);cb.SetIsEnabled(data.GetIsEnabled());cb.SetOnClick(function(){if(me.m_onClick!==null){me.m_onClick.call(me.m_onClick,row,this.IsChecked());}
data.SetIsChecked(this.IsChecked(),false);});data.IsCheckedChangeEvent().Register(function(isChecked){cb.SetIsChecked(isChecked);});return cb;}});D2L.Control.DataGrid.CheckboxColumnRendererData=D2L.Control.DataGrid.ColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isCheckedChangeEvent=new D2L.EventHandler();this.m_isEnabled=true;},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);this.m_isEnabled=deserializer.GetMember('IsEnabled');},IsChecked:function(){return this.GetDataValue();},IsCheckedChangeEvent:function(){return this.m_isCheckedChangeEvent;},SetIsChecked:function(isChecked,doTriggerChange){if(doTriggerChange===undefined){doTriggerChange=true;}
if(isChecked!==this.m_isChecked){this.SetDataValue(isChecked);if(doTriggerChange){this.IsCheckedChangeEvent().Trigger(isChecked);}}},GetIsEnabled:function(){return this.m_isEnabled;}});

D2L.Control.DataGrid.ContextMenuColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_linkColumnRenderer=new D2L.Control.DataGrid.LinkColumnRenderer();},Render:function(data,row,column){var me=this;var liner=data.GetLiner();liner.style.padding='2px';var cmp=this.RenderContextMenuPlaceHolder(data,row,liner);data.m_editInPlace=this.RenderEditInPlace(data,cmp,column.GetLabel());if(data.m_editInPlace!==null){data.m_editInPlace.AppendTo(liner);}
var div=UI.CreateElement('div');div.className='d_dg_cm';if(data.m_editInPlace!==null){data.m_editInPlace.AppendChild(div);}
var divInner=UI.CreateElement('div');divInner.className='d_dg_cm_inner';div.appendChild(divInner);cmp.AppendTo(divInner);var cms=data.GetStructure();if(cms!==null){cms.SetAnimationMode(D2L.Style.AnimationMode.None)
cmp.SetStructure(cms);cmp.m_posDomNode=div;}
var image=this.m_linkColumnRenderer.RenderImage(data,row);if(image!==null){divInner.appendChild(image);}
var link=this.m_linkColumnRenderer.RenderLink(data);link.AppendTo(divInner);for(var i=0;i<data.m_statusIcons.length;i++){var status=UI.CreateElement('img');data.m_statusIcons[i].m_icon.Assign(status);status.alt=data.m_statusIcons[i].m_alt;status.title=data.m_statusIcons[i].m_alt;status.style.marginLeft='4px';divInner.appendChild(status);}
var cell=data.GetCell();var isHover=false;var padding=0;var focus=function(){div.className='d_dg_cm d_dg_cm_hover';var diff=(cell.offsetHeight)-(div.offsetHeight+4);var top=Math.ceil(diff/2)-1;if(top<0){top=0;}
var bottom=Math.floor(diff/2);if(bottom<0){bottom=0;}
div.style.paddingTop=top+'px';div.style.paddingBottom=bottom+'px';};var blur=function(){div.style.paddingTop='0';div.style.paddingBottom='0';div.className='d_dg_cm';};this.AttachObject(cell,'onmouseover',function(evt){D2L.Util.Dom.CancelBubble(evt);focus();});this.AttachObject(cell,'onmouseout',function(evt){D2L.Util.Dom.CancelBubble(evt);if(!isHover){blur();}});this.AttachObject(cell,'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);WindowEventManager.Click.Trigger(evt);cmp.Focus();cmp.Click(evt);return false;});cmp.HoverEvent().RegisterMethod(function(cmpIsHover){isHover=cmpIsHover;if(isHover){focus();}else{blur();}});if(data.m_editInPlace!==null){return data.m_editInPlace;}else{return div;}},RenderContextMenuPlaceHolder:function(data,row,liner){var me=this;var cmp=new D2L.Control.ContextMenuPlaceHolder();cmp.SetKey(row.GetRowKey());cmp.SetSubject(data.GetText());cmp.m_isOffScreen=true;row.KeyChangeEvent().RegisterMethod(function(newRowKey){cmp.SetKey(newRowKey);});return cmp;},RenderEditInPlace:function(data,cmp,columnLabel){if(!data.IsEditable()){return null;}
var eip=new D2L.Control.EditInPlace();if(data.GetValidator()!==null){eip.SetValidator(data.GetValidator(),columnLabel);}
eip.SetEditorType(D2L.Control.EditInPlace.EditorTypes.Edit);eip.SetIsManual(true);eip.SetValueCallback(function(){return data.GetText();});eip.CancelEvent().RegisterMethod(function(){cmp.Focus();});eip.FinishEvent().RegisterMethod(function(value){data.SetText(new D2L.LP.Text.PlainText(value));cmp.Focus();});return eip;}});D2L.Control.DataGrid.ContextMenuColumnRendererData=D2L.Control.DataGrid.LinkColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_editInPlace=null;this.m_isEditable=false;this.m_statusIcons=[];this.m_structureControlId=null;},Deserialize:function(deserializer){this.m_isEditable=deserializer.GetMember('IsEditable');this.m_structureControlId=deserializer.GetObject('StructureControlId',D2L.Control.Id);if(deserializer.HasMember('StatusIcons')){this.m_statusIcons=deserializer.GetObjectArray('StatusIcons');}
arguments.callee.$.Deserialize.call(this,deserializer);},GetEditInPlace:function(){if(!this.IsEditable()){return null;}
return this.m_editInPlace;},GetStructure:function(){if(this.m_structureControlId!==null){return UI.GetControl(this.m_structureControlId.ID(),this.m_structureControlId.SID());}
return null;},IsEditable:function(){return this.m_isEditable;}});D2L.Control.DataGrid.ContextMenuStatusIcon=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_icon=null;this.m_alt='';},Deserialize:function(deserializer){this.m_icon=deserializer.GetObject('Icon');this.m_alt=deserializer.GetMember('Alt');}});

D2L.Control.DataGrid.DateTimeColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Render:function(data){return new D2L.Control.TextBlock(new D2L.LP.Text.PlainText(data.GetDateString()));}});D2L.Control.DataGrid.DateTimeColumnRendererData=D2L.Control.DataGrid.ColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this,0);this.m_localDateTime='';},Deserialize:function(deserializer){this.m_localDateTime=deserializer.GetMember('LocalDateTime');arguments.callee.$.Deserialize.call(this,deserializer);},GetDateString:function(){return this.m_localDateTime;}});

D2L.Control.DataGrid.DragColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Render:function(data,row){var liner=data.GetLiner();liner.style.padding='1px';if(row.IsDraggabilityOverridden()){var container=new D2L.Control.Container();return container;}else{var dragHandle=new D2L.Control.Image();dragHandle.SetHasDefaultPadding(false);dragHandle.SetImage(new D2L.Language.ImageTerm('Framework.DataGrid.actDrag'));var altLang=new D2L.LP.Text.LangTerm('Framework.DataGrid.altDrag');altLang.SetSubject(row.GetSubject());dragHandle.SetAlt(altLang);return dragHandle;}}});D2L.Control.DataGrid.DragColumnRendererData=D2L.Control.DataGrid.ColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this,false);this.m_ddInfo=null;this.m_dragDropMode=null;},GetDragDropInfo:function(){return this.m_ddInfo;},GetDragDropMode:function(){return this.m_dragDropMode;},SetDragDropInfo:function(value){this.m_ddInfo=value;},SetDragDropMode:function(value){this.m_dragDropMode=value;}});

D2L.Control.DataGrid.FileSizeColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Render:function(data){if(data.GetDataValue()>-1){return new D2L.Control.TextBlock(new D2L.LP.Text.PlainText(Culture.FormatFileSize(data.GetDataValue())));}}});

D2L.Control.DataGrid.ImageColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Render:function(data){var image=new D2L.Control.Image();image.SetImage(data.GetImage());image.SetAlt(data.GetAlt());return image;}});D2L.Control.DataGrid.ImageColumnRendererData=D2L.Control.DataGrid.ColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this,'');this.m_alt=new D2L.LP.Text.PlainText('');this.m_image=null;},Deserialize:function(deserializer){this.m_alt=new D2L.LP.Text.PlainText(deserializer.GetMember('Alt'));this.m_image=deserializer.GetObject('Image');},GetAlt:function(){return this.m_alt;},GetImage:function(){return this.m_image;}});

D2L.Control.DataGrid.SelectionColumnRenderer=D2L.Control.DataGrid.ColumnRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Render:function(data,row){var cb=new D2L.Control.Checkbox();cb.SetValue(data.GetValue());cb.SetText(data.GetText());cb.SetShowText(data.GetShowText());cb.SetFieldName(data.GetFieldName());cb.SetIsChecked(data.IsChecked());cb.SetOnClick(function(){row.SetIsSelected(this.IsChecked());});data.m_checkbox=cb;return cb;}});D2L.Control.DataGrid.SelectionColumnRendererData=D2L.Control.DataGrid.ColumnRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this,false);this.m_value=0;this.m_text=null;this.m_showText=true;this.m_fieldName='';this.m_checkbox=null;},GetFieldName:function(){return this.m_fieldName;},GetShowText:function(){return this.m_showText;},GetText:function(){return this.m_text;},GetValue:function(){return this.m_value;},IsChecked:function(){return this.GetDataValue();},SetFieldName:function(fieldName){this.m_fieldName=fieldName;},SetIsChecked:function(isChecked){this.SetDataValue(isChecked);if(this.m_checkbox!==null){this.m_checkbox.SetIsChecked(isChecked);}},SetShowText:function(showText){this.m_showText=showText;},SetText:function(text){this.m_text=text;},SetValue:function(value){this.m_value=value;}});

D2L.Control.DataList=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_addItemsEvent=new D2L.EventHandler();this.m_clickItemEvent=new D2L.EventHandler();this.m_controlRenderer=null;this.m_deleteItemsEvent=new D2L.EventHandler();this.m_dragDropInfo=null;this.m_dragDropMode=D2L.DragDrop.Modes.None;this.m_emptyText='';this.m_entitySourceRpc='';this.m_entitySourceRpcSrc='';this.m_isDataLoadDelayed=false;this.m_isItemClickEnabled=false;this.m_isLayoutToggleDisplayed=true;this.m_isPagingDisplayed=true;this.m_isReloading=false;this.m_items=[];this.m_itemRenderer=new D2L.Control.DataList.ItemRenderer();this.m_itemsRenderedEvent=new D2L.EventHandler();this.m_loadEvent=new D2L.EventHandler();this.m_layoutTypeChangedEvent=new D2L.EventHandler();this.m_layoutType=D2L.Control.DataList.LayoutTypes.List;this.m_mouseOutItemEvent=new D2L.EventHandler();this.m_mouseOverItemEvent=new D2L.EventHandler();this.m_paging=null;this.m_pagingType=D2L.Control.DataList.PagingTypes.Numeric;this.m_parameters=new D2L.Util.Dictionary();this.m_reloadBeginEvent=new D2L.EventHandler();this.m_reloadEndEvent=new D2L.EventHandler();this.m_selectionControl=D2L.Control.DataList.SelectionControls.Input;this.m_selectionMode=D2L.Control.DataList.SelectionModes.None;this.m_selectedItem=null;this.m_selectItemEvent=new D2L.EventHandler();this.m_sortEvent=new D2L.EventHandler();this.m_sorting=null;this.m_summary='';this.m_unSelectItemEvent=new D2L.EventHandler();},AddItem:function(item){this.AddItems([item]);},AddItems:function(items,doTriggerAddEvent){D2L.Debug.Debug('DataList.AddItems');if(doTriggerAddEvent===undefined){doTriggerAddEvent=true;}
for(var i=0;i<items.length;i++){items[i].Init(this);this.m_items.push(items[i]);if(items[i].IsSelected()&&this.m_selectionMode==D2L.Control.DataList.SelectionModes.Single){this.m_selectedItem=this.m_items[this.m_items.length-1];}}
this.m_controlRenderer.RenderItems(items);if(doTriggerAddEvent){this.AddItemsEvent().Trigger(items);}},AddItemsEvent:function(){return this.m_addItemsEvent;},ClickItemEvent:function(){if(this.m_isItemClickEnabled){return this.m_clickItemEvent;}else{UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('ClickItemEvent model is disabled '+'on this instance of the DataList.'),true);return null;}},DeleteItem:function(item,doTriggerDeleteEvent){if(doTriggerDeleteEvent===undefined){doTriggerDeleteEvent=true;}
var index=-1;for(var i=0;i<this.m_items.length;i++){if(this.m_items[i]==item){index=i;break;}}
this.m_items.splice(index,1);if((item.IsSelected())&&(this.m_selectionMode==D2L.Control.DataList.SelectionModes.Single)&&(this.m_selectedItem==item)){this.m_selectedItem=null;}
this.m_controlRenderer.RemoveItem(item);if(doTriggerDeleteEvent){this.DeleteItemsEvent().Trigger([item]);}},DeleteItems:function(items,doTriggerDeleteEvent){D2L.Debug.Debug('DataList.DeleteItems');if(doTriggerDeleteEvent===undefined){doTriggerDeleteEvent=true;}
var dItems=[];for(var i=items.length-1;i>-1;i--){dItems.push(items[i]);this.DeleteItem(items[i],false);}
if(doTriggerDeleteEvent){this.DeleteItemsEvent().Trigger(dItems);}},DeleteItemsEvent:function(){return this.m_deleteItemsEvent;},GetDragDropInfo:function(){return this.m_dragDropInfo;},GetDragDropMode:function(){return this.m_dragDropMode;},GetEmptyText:function(){return this.m_emptyText;},GetItemRenderer:function(){return this.m_itemRenderer;},GetItem:function(itemKey){for(var i=0;i<this.m_items.length;i++){if(this.m_items[i].GetKey()==itemKey){return this.m_items[i];}}
return null;},GetItems:function(){return this.m_items;},GetItemsNode:function(){return this.m_controlRenderer.GetItemsNode();},GetItemCount:function(){return this.m_items.length;},GetLayoutType:function(){return this.m_layoutType;},GetPaging:function(){return this.m_paging;},GetPagingType:function(){return this.m_pagingType;},GetParameter:function(name){return this.m_parameters.Get(name);},GetParameters:function(){return this.m_parameters;},GetSelectionControl:function(){return this.m_selectionControl;},GetSelectionMode:function(){return this.m_selectionMode;},GetSelectedItem:function(){if(this.m_selectionMode==D2L.Control.DataList.SelectionModes.None||this.m_selectionMode==D2L.Control.DataList.SelectionModes.Multiple){return null;}else{return this.m_selectedItem;}},GetSelectedItemCount:function(){var itemCount=0;if(this.m_selectionMode!=D2L.Control.DataList.SelectionModes.None){if(this.m_selectionMode==D2L.Control.DataList.SelectionModes.Single){if(this.m_selectedItem!=null){itemCount=1;}}else{for(var i=0;i<this.m_items.length;i++){if(this.m_items[i].IsSelected()){itemCount+=1;}}}}
return itemCount;},GetSelectedItems:function(){var items=[];if(this.m_selectionMode==D2L.Control.DataList.SelectionModes.Single){if(this.m_selectedItem!=null){items.push(this.m_selectedItem);}}else if(this.m_selectionMode==D2L.Control.DataList.SelectionModes.Multiple){for(var i=0;i<this.m_items.length;i++){if(this.m_items[i].IsSelected()){items.push(this.m_items[i]);}}}
return items;},GetSortingInfo:function(){return this.m_sorting;},GetSummary:function(){return this.m_summary;},InstallEvents:function(){var me=this;var paging=this.m_paging;if(this.m_pagingType==D2L.Control.DataList.PagingTypes.Numeric){paging.PageNumberChangeEvent().RegisterMethod(function(pageNumber){me.Reload();});paging.PageSizeChangeEvent().RegisterMethod(function(pageSize){me.Reload();});}},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this);this.m_entitySourceRpc=deserializer.GetMember('EntitySourceRpc');this.m_entitySourceRpcSrc=deserializer.GetMember('EntitySourceRpcSrc');this.m_summary=deserializer.GetObject('Summary');this.m_emptyText=deserializer.GetMember('EmptyText');this.m_isItemClickEnabled=deserializer.GetMember('IsItemClickEnabled');this.m_isDataLoadDelayed=deserializer.GetMember('IsDataLoadDelayed');this.m_selectionMode=deserializer.GetMember('SelectionMode');this.m_selectionControl=deserializer.GetMember('SelectionControlType');this.m_isLayoutToggleDisplayed=deserializer.GetMember('IsLayoutToggleDisplayed');this.m_layoutType=deserializer.GetMember('LayoutType');this.m_sorting=deserializer.GetObjectArray('Sorting',D2L.LP.LayeredArch.SortingInfo);var itemRendererJsClass=deserializer.GetMember('ItemRendererJsClass');this.m_itemRenderer=deserializer.GetObject('ItemRenderer',itemRendererJsClass);this.m_itemRenderer.Init(this);var rpcResponse=deserializer.GetObject('RpcResponse',D2L.Control.DataList.RpcResponse);this.m_items=rpcResponse.GetItems();for(var i=0;i<this.m_items.length;i++){this.m_items[i].Init(this);if(this.m_items[i].IsSelected()&&this.m_selectionMode==D2L.Control.DataList.SelectionModes.None){this.m_selectedItem=this.m_items[i];}}
var parameters=deserializer.GetDictionary('Parameters');for(var key in parameters){this.m_parameters.Add(key,parameters[key]);}
this.m_isPagingDisplayed=deserializer.GetMember('IsPagingDisplayed');this.m_pagingType=deserializer.GetMember('PagingType');var pageSize=deserializer.GetMember('PagingSize');var pageSizeLimit=deserializer.GetMember('PageSizeLimit');if(this.m_pagingType!==D2L.Control.DataList.PagingTypes.None){this.m_paging=new D2L.Control.Paging();this.m_paging.SetPageSize(pageSize);this.m_paging.SetPageSizeLimit(pageSizeLimit);this.m_paging.SetTotalObjectCount(rpcResponse.GetTotalEntityCount());}
this.m_dragDropMode=deserializer.GetMember('DragDropMode');if(deserializer.HasMember('DragDropSettingsControlID')){var dragDropSettingsControlId=deserializer.GetObject('DragDropSettingsControlID',D2L.Control.Id)
this.m_dragDropInfo=UI.GetControl(dragDropSettingsControlId.ID(),dragDropSettingsControlId.SID()).GetDragDropInfo();}
this.m_controlRenderer=new D2L.Control.DataList.Renderer(this);this.m_controlRenderer.RenderItems(this.m_items);if(D2L.Util.Aria.IsEnabled()){var ariaController=new D2L.Control.DataList.AriaController(this);}
this.InstallEvents();this.LoadEvent().Trigger();},InvokeRpc:function(){var dr=new D2L.Util.DelayedReturn();var me=this;var rpcCallback=function(rpcResponse){if(rpcResponse.GetType()==D2L.Rpc.ResponseType.Success){dr.Trigger(rpcResponse.GetResult(D2L.Control.DataList.RpcResponse));}else{UI.Error(new D2L.LP.Text.LangTerm(D2L.Control.DataList.LANG_ERR_DATA_RETRIEVAL_PRIMARY),new D2L.LP.Text.LangTerm(D2L.Control.DataList.LANG_ERR_DATA_RETRIEVAL_SECONDARY),me);}};var rpcRequest=new D2L.Control.DataList.RpcRequest();rpcRequest.SetRpc(this.m_entitySourceRpc);rpcRequest.SetRpcSrc(this.m_entitySourceRpcSrc);rpcRequest.SetSorting(this.m_sorting);if(this.GetPagingType()!==D2L.Control.DataList.PagingTypes.None){rpcRequest.SetPaging(new D2L.LP.LayeredArch.PagingInfo(this.m_paging.GetPageSize(),this.m_paging.GetPageNumber()));}
rpcRequest.SetParameters(this.m_parameters);setTimeout(function(){D2L.Rpc.Create('Reload',rpcCallback,'/d2l/common/rpc/dataList/dataList.d2l').Call(rpcRequest)},0);return dr;},IsEmpty:function(){return(this.m_items.length===0);},IsItemClickEnabled:function(){return this.m_isItemClickEnabled;},IsDataLoadDelayed:function(){return this.m_isDataLoadDelayed;},IsLayoutToggleDisplayed:function(){return this.m_isLayoutToggleDisplayed;},IsPagingDisplayed:function(){return this.m_isPagingDisplayed;},IsReloading:function(){return this.m_isReloading;},IsChangeSelectionAllowed:function(item){if((this.m_selectionMode>D2L.Control.DataList.SelectionModes.None)&&(item!=null)&&(item.IsEnabled())){if(this.m_selectionMode==D2L.Control.DataList.SelectionModes.Single){return((this.m_selectedItem==null)||(this.m_selectedItem.IsEnabled()));}else{return true;}}else{return false;}},ItemsRenderedEvent:function(items){return this.m_itemsRenderedEvent;},LayoutTypeChangedEvent:function(){return this.m_layoutTypeChangedEvent;},LoadEvent:function(){return this.m_loadEvent;},MoveItem:function(item,index){if(this.m_items.length>1&&item!=null&&index!=null){index=parseInt(index);if(!isNaN(index)&&this.m_items.length>index){var newItemIndex=-1;var items=[];for(var i=0;i<this.m_items.length;i++){if(this.m_items[i]!=item){newItemIndex+=1;if(newItemIndex==index){newItemIndex+=1;items.push(item);}
items.push(this.m_items[i]);}}
if(index==(this.m_items.length-1)){items.push(item);}
this.m_items=items;if(index<(this.m_items.length-1)){this.m_controlRenderer.MoveItemBefore(item,this.m_items[index+1]);}else{this.m_controlRenderer.MoveItemBefore(item);}}}},MouseOutItemEvent:function(){return this.m_mouseOutItemEvent;},MouseOverItemEvent:function(){return this.m_mouseOverItemEvent;},Reload:function(){this.m_isReloading=true;this.ReloadBeginEvent().Trigger(this);var me=this;this.InvokeRpc().Register(function(rpcResponse){me.m_parameters=rpcResponse.GetParameters();me.DeleteItems(me.m_items,false);me.AddItems(rpcResponse.GetItems(),false);if(me.m_paging!==null){me.m_paging.SetTotalObjectCount(rpcResponse.GetTotalEntityCount());}
me.m_isReloading=false;me.ReloadEndEvent().Trigger(me);});},ReloadBeginEvent:function(){return this.m_reloadBeginEvent;},ReloadEndEvent:function(){return this.m_reloadEndEvent;},RemoveParameter:function(name){this.m_parameters.Remove(name);},SelectItemEvent:function(){return this.m_selectItemEvent;},SelectItem:function(item,doTriggerSelectEvent){if(doTriggerSelectEvent===undefined){doTriggerSelectEvent=true;}
if(this.m_selectionMode==D2L.Control.DataList.SelectionModes.Single){if(this.m_selectedItem!=null&&this.m_selectedItem!=item){this.m_selectedItem.SetIsSelected(false);}
this.m_selectedItem=item;}else{this.m_selectedItem=null;}
if(doTriggerSelectEvent){this.SelectItemEvent().Trigger(item);}},SetSelectedItem:function(item){if(item!=null){item.SetIsSelected(true);}else{item=this.m_selectedItem;if(item!=null){item.SetIsSelected(false);}}},SetSortingInfo:function(sortingInfo){if(this.m_sorting!==sortingInfo){this.m_sorting=sortingInfo;this.m_sortEvent.Trigger();this.Reload();}},SetLayoutType:function(layoutType){if(layoutType!=D2L.Control.DataList.LayoutTypes.Tiles){layoutType=D2L.Control.DataList.LayoutTypes.List;}
if(this.m_layoutType!=layoutType){this.m_layoutType=layoutType;this.m_layoutTypeChangedEvent.Trigger(layoutType);}},SetParameter:function(name,value){this.m_parameters.Add(name,value);},SetSummary:function(summary){this.m_summary=summary;if(this.m_controlRenderer!=null){this.m_controlRenderer.SetSummary(summary);}},UnSelectItem:function(item,doTriggerUnSelectEvent){if(doTriggerUnSelectEvent===undefined){doTriggerUnSelectEvent=true;}
if(this.m_selectedItem==item){this.m_selectedItem=null;}
if(doTriggerUnSelectEvent){this.UnSelectItemEvent().Trigger(item);}},UnSelectItemEvent:function(){return this.m_unSelectItemEvent;}});D2L.Control.DataList.DefaultDragGhostRenderer=function(){var ghost=UI.CreateElement('ul');ghost.className='ddl_sc';return ghost;};D2L.Control.DataList.DragDropSelectionState=[];D2L.Control.DataList.HandleStartDrag=function(drag){var item=drag.GetControl();var dataList=item.GetDataList();var ghost=drag.GetCustomGhostControl();ghost.innerHTML='';if(dataList.GetLayoutType()==D2L.Control.DataList.LayoutTypes.List){ghost.style.width=dataList.GetDomNode().offsetWidth+"px";}
if(dataList.GetSelectionMode()!=D2L.Control.DataList.SelectionModes.None){D2L.Control.DataList.DragDropSelectionState=[];var selectedItems=dataList.GetSelectedItems();for(var i=0;i<selectedItems.length;i++){D2L.Control.DataList.DragDropSelectionState.push(selectedItems[i]);if(!item.IsSelected()&&selectedItems[i]!=item){selectedItems[i].SetIsSelected(false);}}
item.SetIsSelected(true);var selectedItems=dataList.GetSelectedItems();for(var i=0;i<selectedItems.length;i++){var item=selectedItems[i];var clone=item.GetNode().cloneNode(true);ghost.appendChild(clone);}}else{var clone=item.GetNode().cloneNode(true);ghost.style.width=item.GetNode().offsetWidth+'px';ghost.appendChild(clone);}};D2L.Control.DataList.HandleEndDrag=function(drag){var item=drag.GetControl();var dataList=item.GetDataList();if(dataList.GetSelectionMode()!=D2L.Control.DataList.SelectionModes.None){var selectedItems=dataList.GetSelectedItems();if(drag.GetDropIsValid()){for(var i=0;i<selectedItems.length;i++){selectedItems[i].SetIsSelected(false);}}else{var itemWasOriginallyChecked=false;for(var i=0;i<D2L.Control.DataList.DragDropSelectionState.length;i++){var itemState=D2L.Control.DataList.DragDropSelectionState[i];itemState.SetIsSelected(true);if(itemState==item){itemWasOriginallyChecked=true;}}
if(!itemWasOriginallyChecked){item.SetIsSelected(false);}}}};

D2L.Control.DataList.AriaController=D2L.Class.extend({Construct:function(dataList){arguments.callee.$.Construct.call(this);this.m_dataList=dataList;this.Init();},AddAriaMessage:function(message){this.m_dataList.GetUI().GetMessageArea().AddAriaMessage(message);},Init:function(){var me=this;this.m_dataList.LoadEvent().RegisterMethod(function(){me.RenderItems(me.m_dataList.GetItems());});this.m_dataList.ItemsRenderedEvent().RegisterMethod(function(items){me.RenderItems(items);});this.m_dataList.SelectItemEvent().RegisterMethod(function(item){var msg='Framework.DataList.lblItemSelected';me.AddAriaMessage(new D2L.LP.Text.LangTerm(msg));var items=[];items.push(item);me.RenderItems(items);});this.m_dataList.UnSelectItemEvent().RegisterMethod(function(item){var items=[];items.push(item);me.RenderItems(items);});},RenderItems:function(items){var me=this;if(me.m_dataList.GetSelectionControl()==D2L.Control.DataList.SelectionControls.Item){var role='';if(me.m_dataList.GetSelectionMode()==D2L.Control.DataList.SelectionModes.Multiple){role='checkbox';}
else if(me.m_dataList.GetSelectionMode()==D2L.Control.DataList.SelectionModes.Single){role='radio';D2L.Util.Aria.SetRole(me.m_dataList.GetItemsNode(),'radiogroup');}
for(var i=0;i<items.length;i++){D2L.Util.Aria.SetRole(items[i].GetAnchorNode(),role);if(items[i].IsSelected()){D2L.Util.Aria.SetAttribute(items[i].GetAnchorNode(),'checked',true);}
else{D2L.Util.Aria.SetAttribute(items[i].GetAnchorNode(),'checked',false);}
if(items[i].IsEnabled()){D2L.Util.Aria.SetAttribute(items[i].GetAnchorNode(),'disabled',false);}
else{D2L.Util.Aria.SetAttribute(items[i].GetAnchorNode(),'disabled',true);}}}}});

D2L.Control.DataList.Renderer=D2L.Class.extend({Construct:function(dataList){arguments.callee.$.Construct.call(this);this.m_actionContainer=null;this.m_dataList=dataList;this.m_emptyMsgContainer=null;this.m_itemsNode=null;this.m_listItemWidthEm=0;this.m_listItemHeightEm=0;this.m_selectedMsg='';this.m_selectInstructionMsg='';this.m_summaryNode=null;this.m_tileItemHeightEm=0;this.m_tileItemWidthEm=0;this.m_unSelectedMsg='';this.Init();},ApplyItemStyle:function(item,itemStyle){var itemNode=item.GetNode();var dataList=item.GetDataList();if(itemNode!==null&&itemStyle!==null){itemNode.style.backgroundColor=itemStyle.GetBackgroundColor();var itemPadding=itemStyle.GetPadding();if(dataList.GetDragDropMode()==D2L.DragDrop.Modes.Draggable||dataList.GetDragDropMode()==D2L.DragDrop.Modes.DraggableDroppable){var minTopPaddingForDragPx=6;var minTopPaddingForDragEm=D2L.Style.Utility.PixelToEm(UI.GetRelativeFontSizeManager().GetBaseFontSize(),minTopPaddingForDragPx)
var paddings=[itemPadding.GetTop(),itemPadding.GetLeft()];for(var i=0;i<paddings.length;i++){var pad=paddings[i];if(pad.GetUnitType()==D2L.Style.Spacing.UnitType.Pixel&&pad.GetValue()<minTopPaddingForDragPx){pad.SetValue(minTopPaddingForDragPx);}
if(pad.GetUnitType()==D2L.Style.Spacing.UnitType.Em&&pad.GetValue()<minTopPaddingForDragEm){pad.SetValue(minTopPaddingForDragEm);}}}
itemNode.firstChild.style.padding=itemPadding.ToCss();itemNode.style.margin=itemStyle.GetSpacing().ToCss();itemNode.style.border=itemStyle.GetBorder().ToCss();if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Safari){itemNode.style.WebkitBorderRadius=itemStyle.GetBorderRadius()+'px';}else if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Firefox){itemNode.style.MozBorderRadius=itemStyle.GetBorderRadius()+'px';}}},BuildActionContainer:function(){var dataList=this.GetDataList();if((dataList.IsPagingDisplayed()&&dataList.GetPagingType()!=D2L.Control.DataList.PagingTypes.None)||dataList.IsLayoutToggleDisplayed()){this.m_actionContainer=this.CreateElement('div');this.m_actionContainer.className='ddl_ac';if(dataList.IsLayoutToggleDisplayed()){var toggleContainer=this.CreateElement('div');toggleContainer.className='ddl_tc';this.m_actionContainer.appendChild(toggleContainer);var toggle=this.CreateLayoutToggle();toggle.AppendTo(toggleContainer);}
if(dataList.GetPagingType()==D2L.Control.DataList.PagingTypes.Numeric){var pagingContainer=this.CreateElement('span');pagingContainer.className='ddl_pc';this.m_actionContainer.appendChild(pagingContainer);var paging=dataList.GetPaging();var pagingRenderer=new D2L.Control.Paging.NumericRenderer(paging);paging.AppendTo(pagingContainer);}
var clear=this.CreateElement('div');clear.className='clear';this.m_actionContainer.appendChild(clear);this.GetDomNode().appendChild(this.m_actionContainer);}},BuildEmptyMessageContainer:function(){this.m_emptyMsgContainer=this.CreateElement('div');this.m_emptyMsgContainer.className='ddl_ec';this.m_emptyMsgContainer.style.display='none';this.m_emptyMsgContainer.innerHTML=D2L.Util.Html.Encode(this.GetDataList().GetEmptyText());this.GetDomNode().appendChild(this.m_emptyMsgContainer);},BuildItemsContainer:function(){this.m_itemsNode=this.CreateElement('ul');this.m_itemsNode.id=this.GetDataList().GetMappedId()+'_c';this.m_itemsNode.className=this.GetItemsNodeClassName(this.GetDataList().GetLayoutType());this.GetDomNode().appendChild(this.m_itemsNode);},CalculateItemHeight:function(baseFontSize,heightPx){return D2L.Style.Utility.PixelToEm(baseFontSize,heightPx);},CalculateItemWidth:function(baseFontSize,widthPx){var dataList=this.GetDataList();var widthEm=0;if((dataList.GetSelectionMode()!=D2L.Control.DataList.SelectionModes.None)&&(dataList.GetSelectionControl()==D2L.Control.DataList.SelectionControls.Input)){widthEm=D2L.Style.Utility.PixelToEm(baseFontSize,widthPx-20);}else{widthEm=D2L.Style.Utility.PixelToEm(baseFontSize,widthPx);}
return widthEm;},CreateElement:function(tag){return this.m_dataList.CreateElement(tag);},CreateLayoutToggle:function(){var me=this;var dataList=this.GetDataList();var layoutType=dataList.GetLayoutType();var toggle=new D2L.Control.Selector();toggle.SetSummary(new D2L.LP.Text.LangTerm('Framework.DataList.lblLayoutToggleSummary'));toggle.SetIsRequired(true);toggle.SetOrientation(D2L.Control.Selector.Orientation.Horizontal);toggle.SetSelectionMode(D2L.Control.Selector.SelectionModes.Single);var item=new D2L.Control.Selector.Item();item.SetKey(D2L.Control.DataList.LayoutTypes.List);item.SetTitle(new D2L.LP.Text.LangTerm('Framework.DataList.lblLayoutList'));item.SetImage(new D2L.Images.ImageTerm('Framework.DataList.actLayoutList'));toggle.AddItem(item);if(layoutType==D2L.Control.DataList.LayoutTypes.List){toggle.SetSelectedItem(item);}
item.SelectEvent().RegisterMethod(function(){me.SelectListLayoutHandler();});item=new D2L.Control.Selector.Item();item.SetKey(D2L.Control.DataList.LayoutTypes.Tiles);item.SetTitle(new D2L.LP.Text.LangTerm('Framework.DataList.lblLayoutTiles'));item.SetImage(new D2L.Images.ImageTerm('Framework.DataList.actLayoutTiles'));toggle.AddItem(item);if(layoutType==D2L.Control.DataList.LayoutTypes.Tiles){toggle.SetSelectedItem(item);}
item.SelectEvent().RegisterMethod(function(){me.SelectTilesLayoutHandler();});return toggle;},DisplayContentContainer:function(){if(this.GetDataList().GetItemCount()>0){this.m_itemsNode.display='';this.m_emptyMsgContainer.style.display='none';}else{this.m_itemsNode.display='none';this.m_emptyMsgContainer.style.display='';}},GetDataList:function(){return this.m_dataList;},GetDomNode:function(){return this.m_dataList.GetDomNode();},GetItemsNode:function(){return this.m_itemsNode;},GetItemsNodeClassName:function(layoutType){if(layoutType==D2L.Control.DataList.LayoutTypes.Tiles){return'ddl_fc';}else{return'ddl_sc';}},Init:function(){var dataList=this.GetDataList();var me=this;dataList.LayoutTypeChangedEvent().RegisterMethod(function(layoutType){me.SetLayoutType(layoutType);});dataList.SelectItemEvent().RegisterMethod(function(item){me.RenderItemStyle(null,null,item);me.RenderItemText(item);});dataList.UnSelectItemEvent().RegisterMethod(function(item){me.RenderItemStyle(null,null,item);me.RenderItemText(item);});dataList.MouseOutItemEvent().RegisterMethod(function(item){me.RenderItemStyle(null,null,item);});dataList.MouseOverItemEvent().RegisterMethod(function(item){me.RenderMouseOverItemStyle(item);});dataList.AddItemsEvent().RegisterMethod(function(items){me.DisplayContentContainer();});dataList.DeleteItemsEvent().RegisterMethod(function(items){me.DisplayContentContainer();});dataList.LoadEvent().RegisterMethod(function(){me.DisplayContentContainer();});dataList.ReloadBeginEvent().RegisterMethod(function(){dataList.GetUI().GetShimController().Shim(dataList,true);});dataList.ReloadEndEvent().RegisterMethod(function(){dataList.GetUI().GetShimController().ClearShims();me.DisplayContentContainer();});this.m_selectedMsg=new D2L.LP.Text.LangTerm('Framework.DataList.lblItemIsSelected');this.m_unSelectedMsg=new D2L.LP.Text.LangTerm('Framework.DataList.lblItemIsNotSelected');this.RenderSummary();this.BuildActionContainer();this.BuildEmptyMessageContainer();this.BuildItemsContainer();var baseFontSize=UI.GetRelativeFontSizeManager().GetBaseFontSize();var renderer=dataList.GetItemRenderer();this.m_tileItemWidthEm=this.CalculateItemWidth(baseFontSize,renderer.GetTileItemWidth());this.m_tileItemHeightEm=this.CalculateItemHeight(baseFontSize,renderer.GetTileItemHeight());this.m_listItemWidthEm=this.CalculateItemWidth(baseFontSize,renderer.GetListItemWidth());this.m_listItemHeightEm=this.CalculateItemHeight(baseFontSize,renderer.GetListItemHeight());},InstallItemBlur:function(dataList,item,itemNode){item.AttachObject(itemNode,'onblur',function(){item.SetHasFocus(false);dataList.MouseOutItemEvent().Trigger(item);});},InstallItemClick:function(dataList,item,itemNode){item.AttachObject(itemNode,'onclick',function(){dataList.ClickItemEvent().Trigger(item);});},InstallItemDragDrop:function(dataList,item,itemNode){var ddObject;var calculatedMode=item.GetDragDropMode();if(calculatedMode!=D2L.DragDrop.Modes.None){setTimeout(function(){if(calculatedMode==D2L.DragDrop.Modes.DraggableDroppable){ddObject=new D2L.DragDrop.DraggableDroppable(item,itemNode);itemNode.className=itemNode.className+' draggable';}
if(calculatedMode==D2L.DragDrop.Modes.Draggable){ddObject=new D2L.DragDrop.Draggable(item,itemNode);itemNode.className=itemNode.className+' draggable';}
if(calculatedMode==D2L.DragDrop.Modes.Droppable){ddObject=new D2L.DragDrop.Droppable(item,itemNode);}
if(dataList.GetDragDropInfo()){D2L.DragDrop.SetDragDropInfo(ddObject,dataList.GetDragDropInfo());}
ddObject.SetCustomGhostRenderer(D2L.Control.DataList.DefaultDragGhostRenderer);ddObject.OnStartDrag.RegisterMethod(function(){D2L.Control.DataList.HandleStartDrag(ddObject);});ddObject.OnEndDrag.RegisterMethod(function(){D2L.Control.DataList.HandleEndDrag(ddObject);});},0);}},InstallItemFocus:function(dataList,item,itemNode){item.AttachObject(itemNode,'onfocus',function(){item.SetHasFocus(true);dataList.MouseOverItemEvent().Trigger(item);});},InstallItemMouseOver:function(dataList,item,itemNode){item.AttachObject(itemNode,'onmouseover',function(){dataList.MouseOverItemEvent().Trigger(item);});},InstallItemMouseOut:function(dataList,item,itemNode){item.AttachObject(itemNode,'onmouseout',function(){dataList.MouseOutItemEvent().Trigger(item);});},InstallItemSelect:function(dataList,item,itemNode){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Firefox){item.AttachObject(itemNode,'onkeydown',function(evt){if(evt.keyCode==32){evt.preventDefault();}});}
item.AttachObject(itemNode,'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);item.ToggleSelected();});},MoveItemBefore:function(item,beforeItem){if(this.m_itemsNode!=null&&item!=null&&item.GetNode()!=null){var itemNode=item.GetNode();if(beforeItem!=null&&beforeItem.GetNode()!=null){this.m_itemsNode.insertBefore(itemNode,beforeItem.GetNode());}else{this.m_itemsNode.appendChild(itemNode);}}},RenderMouseOverItemStyle:function(item){if(item.IsEnabled()&&!item.IsSelected()){var itemRenderer=this.GetDataList().GetItemRenderer();var layoutType=this.GetDataList().GetLayoutType();this.ApplyItemStyle(item,itemRenderer.GetMouseOverItemStyle(layoutType));}},RenderItemStyle:function(layoutType,itemRenderer,item){if(itemRenderer==null){itemRenderer=this.GetDataList().GetItemRenderer();}
if(layoutType==null){layoutType=this.GetDataList().GetLayoutType();}
var itemStyle=null;if(item.IsEnabled()){if(item.IsSelected()){itemStyle=itemRenderer.GetSelectedItemStyle(layoutType);}else{if(item.HasFocus()){itemStyle=itemRenderer.GetMouseOverItemStyle(layoutType);}else{itemStyle=itemRenderer.GetItemStyle(layoutType);}}}else{itemStyle=itemRenderer.GetDisabledItemStyle(layoutType);}
var itemSelectionNode=item.GetSelectionNode();if(itemSelectionNode!=null){itemSelectionNode.checked=item.IsSelected();}
this.ApplyItemStyle(item,itemStyle);},RenderItems:function(items){var dataList=this.GetDataList();var itemRenderer=dataList.GetItemRenderer();var layoutType=dataList.GetLayoutType();var selectionMode=dataList.GetSelectionMode();var selectionControl=dataList.GetSelectionControl();var isItemClickEnabled=dataList.IsItemClickEnabled();var item=null;var itemTitle=null;var itemNode=null;var itemAnchorNode=null;var itemBlockNode=null;var itemMarginNode=null;var itemContentNode=null;var itemSummaryNode=null;var itemCheckboxNode=null;var itemControl=null;for(var i=0;i<items.length;i++){item=items[i];itemTitle=item.GetData().GetTitle();itemNode=dataList.CreateElement('li');itemTitle.AssignText(itemNode,'title');item.SetNode(itemNode);itemAnchorNode=dataList.CreateElement('a');itemTitle.AssignText(itemAnchorNode,'title');itemAnchorNode.className='ddl_li_c';itemMarginNode=dataList.CreateElement('div');itemMarginNode.className='ddl_li_m';itemAnchorNode.appendChild(itemMarginNode);if((selectionMode!=D2L.Control.DataList.SelectionModes.None)&&(selectionControl!=D2L.Control.DataList.SelectionControls.Custom)){var selectionNode=null;if(selectionControl==D2L.Control.DataList.SelectionControls.Input){if(selectionMode==D2L.Control.DataList.SelectionModes.Multiple){selectionNode=this.RenderCheckboxSelection(dataList,item);itemMarginNode.appendChild(selectionNode);}else if(selectionMode==D2L.Control.DataList.SelectionModes.Single){selectionNode=this.RenderRadioButtonSelection(dataList,item);itemMarginNode.appendChild(selectionNode);}
if(isItemClickEnabled){itemAnchorNode.href='javascript://';}}else{if((item.IsEnabled()&&item.IsSelectable())||isItemClickEnabled){itemAnchorNode.href='javascript://';}
selectionNode=itemAnchorNode;if(item.IsSelectable()){itemSummaryNode=dataList.CreateElement('span');itemSummaryNode.className='dsr';item.SetSummaryNode(itemSummaryNode);}}
if(item.IsEnabled()&&item.IsSelectable()){this.InstallItemSelect(dataList,item,selectionNode);}}
if(item.IsEnabled()){if(isItemClickEnabled){this.InstallItemClick(dataList,item,itemAnchorNode);}
if(dataList.GetDragDropMode()!=D2L.DragDrop.Modes.None){this.InstallItemDragDrop(dataList,item,itemNode);}
this.InstallItemMouseOver(dataList,item,itemNode);this.InstallItemMouseOut(dataList,item,itemNode);this.InstallItemBlur(dataList,item,itemAnchorNode);this.InstallItemFocus(dataList,item,itemAnchorNode);if(selectionNode!=null){this.InstallItemBlur(dataList,item,selectionNode);this.InstallItemFocus(dataList,item,selectionNode);}}
itemBlockNode=dataList.CreateElement('div');itemBlockNode.className='ddl_li_b';itemTitle.AssignText(itemBlockNode,'title');itemAnchorNode.appendChild(itemBlockNode);itemControl=itemRenderer.Render(item);item.SetControl(itemControl);if(D2L.Util.IsD2LControl(itemControl)){itemControl.AppendTo(itemBlockNode);}else{itemBlockNode.appendChild(itemControl);}
var clearNode=dataList.CreateElement('span');clearNode.className='clear';itemAnchorNode.appendChild(clearNode);if(itemSummaryNode!=null){itemAnchorNode.appendChild(itemSummaryNode);}
if(layoutType==D2L.Control.DataList.LayoutTypes.Tiles){if(itemRenderer.GetTileItemWidth()>0){itemBlockNode.style.width=this.m_tileItemWidthEm+'em';}
if(itemRenderer.GetTileItemHeight()>0){itemMarginNode.style.height=this.m_tileItemHeightEm+'em';itemAnchorNode.style.minHeight=this.m_tileItemHeightEm+'em';}}else{if(itemRenderer.GetListItemHeight()>0){itemMarginNode.style.height=this.m_listItemHeightEm+'em';itemAnchorNode.style.minHeight=this.m_listItemHeightEm+'em';}}
itemNode.appendChild(itemAnchorNode);item.SetAnchorNode(itemAnchorNode);this.m_itemsNode.appendChild(itemNode);this.RenderItemStyle(layoutType,itemRenderer,item);this.RenderItemText(item);}
dataList.ItemsRenderedEvent().Trigger(items);},RenderCheckboxSelection:function(dataList,item){var checkboxNode=dataList.CreateElement('input');item.SetSelectionNode(checkboxNode);checkboxNode.type='checkbox';item.GetData().GetTitle().AssignText(checkboxNode,'title');if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<8){checkboxNode.defaultChecked=item.IsSelected();}
checkboxNode.checked=item.IsSelected();checkboxNode.disabled=!item.IsEnabled();if(!item.IsSelectable()){checkboxNode.style.visibility='hidden';}
return checkboxNode;},RenderRadioButtonSelection:function(dataList,item){var radioButtonNode=dataList.CreateElement('input');item.SetSelectionNode(radioButtonNode);radioButtonNode.type='radio';radioButtonNode.name=dataList.GetMappedId();item.GetData().GetTitle().AssignText(radioButtonNode,'title');if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<8){radioButtonNode.defaultChecked=item.IsSelected();}
radioButtonNode.checked=item.IsSelected();radioButtonNode.disabled=!item.IsEnabled();if(!item.IsSelectable()){radioButtonNode.style.visibility='hidden';}
return radioButtonNode;},RenderItemText:function(item){var dataList=this.GetDataList();var itemSummaryNode=item.GetSummaryNode();var selectionMode=dataList.GetSelectionMode();var selectionControl=dataList.GetSelectionControl();if(itemSummaryNode!=null){var summary='';if(item.IsSelected()){summary=this.m_selectedMsg;}else{summary=this.m_unSelectedMsg;}
summary.AssignText(itemSummaryNode,'innerHTML');}},RenderSummary:function(){this.m_summaryNode=this.CreateElement('span');this.m_summaryNode.className='dsr';this.GetDataList().GetSummary().AssignText(this.m_summaryNode,'innerHTML');this.GetDomNode().appendChild(this.m_summaryNode);},RemoveItem:function(item){var itemNode=item.GetNode();D2L.Util.Purge(itemNode);item.Cleanup();this.m_itemsNode.removeChild(itemNode);},SelectListLayoutHandler:function(){this.GetDataList().SetLayoutType(D2L.Control.DataList.LayoutTypes.List);},SelectTilesLayoutHandler:function(){this.GetDataList().SetLayoutType(D2L.Control.DataList.LayoutTypes.Tiles);},DiscardElement:function(element){if(element!=null){var garbageBin=document.getElementById('IELeakGarbageBin');if(!garbageBin){garbageBin=document.createElement('div');garbageBin.id='IELeakGarbageBin';garbageBin.style.display='none';document.body.appendChild(garbageBin);}
garbageBin.appendChild(element);garbageBin.innerHTML='';}},SetLayoutType:function(layoutType){var dataList=this.GetDataList();var rerenderRequired=(dataList.GetItemRenderer().IsLayoutTypeSensitive()&&this.m_itemsNode.hasChildNodes());var items=dataList.GetItems();if(rerenderRequired){for(var i=0;i<items.length;i++){this.RemoveItem(items[i]);}}
this.m_itemsNode.className=this.GetItemsNodeClassName(layoutType);if(rerenderRequired){this.RenderItems(items);}else{if(this.m_tileItemWidthEm>0){var applyDimensions=function(heightEm,widthEm){for(var i=0;i<items.length;i++){items[i].GetNode().firstChild.childNodes[0].style.height=heightEm;items[i].GetNode().firstChild.style.minHeight=heightEm;items[i].GetNode().firstChild.childNodes[1].style.width=widthEm;}};if(layoutType==D2L.Control.DataList.LayoutTypes.Tiles){applyDimensions(this.m_tileItemHeightEm+'em',this.m_tileItemWidthEm+'em');}else{applyDimensions(this.m_listItemHeightEm+'em','');}}}},SetSummary:function(summary){if(this.m_summaryNode!=null){summary.AssignText(this.m_summaryNode,'innerHTML');}}});

D2L.Control.DataList.LANG_ERR_DATA_RETRIEVAL_PRIMARY='Framework.DataList.lblErrorRetrievingDataPrimary';D2L.Control.DataList.LANG_ERR_DATA_RETRIEVAL_SECONDARY='Framework.DataList.lblErrorRetrievingDataSecondary';D2L.Control.DataList.LayoutTypes={List:0,Tiles:1};D2L.Control.DataList.PagingTypes={None:0,Numeric:1};D2L.Control.DataList.SelectionModes={None:0,Multiple:1,Single:2};D2L.Control.DataList.SelectionControls={Input:0,Item:1,Custom:2};

D2L.Control.DataList.Item=D2L.Class.extend({Construct:function(key,data){arguments.callee.$.Construct.call(this);this.m_anchorNode=null;this.m_selectionNode=null;this.m_control=null;if(data===undefined){data=null;}
this.m_data=data;this.m_dataList=null;this.m_hasFocus=false;this.m_isEnabled=true;this.m_isSelectable=true;this.m_isSelected=false;if(key===undefined){key='';}
this.m_key=key;this.m_node=null;this.m_overrideDraggability=false;this.m_overrideDroppability=false;this.m_parameters=new D2L.Util.Dictionary();this.m_selectionChangedEvent=new D2L.EventHandler();this.m_summaryNode=null;this.m_tempData=null;},Cleanup:function(){this.m_selectionNode=null;this.m_node=null;this.m_summaryNode=null;this.m_control=null;},Deserialize:function(deserializer){this.m_key=deserializer.GetMember('Key');this.m_isEnabled=deserializer.GetMember('IsEnabled');this.m_isSelectable=deserializer.GetMember('IsSelectable');if(this.m_isSelectable){this.m_isSelected=deserializer.GetMember('IsSelected');}else{this.m_isSelected=false;}
this.m_tempData=deserializer.GetObject('Data');var parameters=deserializer.GetDictionary('Parameters');for(var key in parameters){this.m_parameters.Add(key,parameters[key]);}
if(deserializer.HasMember("OverrideDraggability")){this.m_overrideDraggability=deserializer.HasMember("OverrideDraggability");}
if(deserializer.HasMember("OverrideDroppability")){this.m_overrideDroppability=deserializer.HasMember("OverrideDroppability");}},GetAnchorNode:function(){return this.m_anchorNode;},GetControl:function(){return this.m_control;},GetData:function(){return this.m_data;},GetDataList:function(){return this.m_dataList;},GetDragDropMode:function(){var item=this;var dataList=this.GetDataList();var calculatedMode=dataList.GetDragDropMode();if(calculatedMode==D2L.DragDrop.Modes.DraggableDroppable){if(item.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.Droppable;}
if(item.IsDroppabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.Draggable;}
if(item.IsDroppabilityOverridden()&&item.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}}
if(dataList.GetDragDropMode()==D2L.DragDrop.Modes.Draggable&&item.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}
if(dataList.GetDragDropMode()==D2L.DragDrop.Modes.Droppable&&item.IsDroppabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}
return calculatedMode;},GetKey:function(){return this.m_key;},GetNode:function(){return this.m_node;},GetParameter:function(name){return this.m_parameters.Get(name);},GetSelectionNode:function(){return this.m_selectionNode;},GetSummaryNode:function(){return this.m_summaryNode;},HasFocus:function(){return this.m_hasFocus;},Init:function(dataList){this.m_dataList=dataList;if(this.m_data==null){var dataClass=this.m_dataList.GetItemRenderer().GetDataClass();this.m_data=D2L.Serialization.JsonDeserializer.Deserialize(this.m_tempData,dataClass);}
this.m_tempData=null;},IsDraggabilityOverridden:function(){return this.m_overrideDraggability;},IsDroppabilityOverridden:function(){return this.m_overrideDroppability;},IsEnabled:function(){return this.m_isEnabled;},IsSelectable:function(){if((this.m_dataList!=null)&&(this.m_dataList.GetSelectionMode()==D2L.Control.DataList.SelectionModes.None)){return false;}else{return this.m_isSelectable;}},IsSelected:function(){return this.m_isSelected;},SelectionChangedEvent:function(){return this.m_selectionChangedEvent;},SetAnchorNode:function(anchorNode){this.m_anchorNode=anchorNode;},SetSelectionNode:function(selectionNode){this.m_selectionNode=selectionNode;},SetControl:function(control){this.m_control=control;},SetHasFocus:function(hasFocus){this.m_hasFocus=hasFocus;},SetIsSelected:function(isSelected,doTriggerSelectEvent){if(this.IsSelectable()){if(this.m_dataList!=null){if(this.m_dataList.IsChangeSelectionAllowed(this)){if(doTriggerSelectEvent===undefined){doTriggerSelectEvent=true;}
if((this.m_isSelected!=isSelected)&&(doTriggerSelectEvent)){this.m_isSelected=isSelected;this.SelectionChangedEvent().Trigger(this);}else{this.m_isSelected=isSelected;}
if(isSelected){this.m_dataList.SelectItem(this,doTriggerSelectEvent);}else{this.m_dataList.UnSelectItem(this,doTriggerSelectEvent);}}}else{this.m_isSelected=isSelected;}}},SetNode:function(node){this.m_node=node;},SetParameter:function(name,value){this.m_parameters.Add(name,value);},SetSummaryNode:function(summaryNode){this.m_summaryNode=summaryNode;},ToggleSelected:function(){this.SetIsSelected(!this.m_isSelected);}});

D2L.Control.DataList.ItemStyle=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_backgroundColor='';this.m_border=new D2L.Style.BorderInfo(D2L.Style.BorderStyle.None,'',0);this.m_borderRadius=0;this.m_padding=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Padding,D2L.Style.Spacing.UnitType.Em,0);this.m_spacing=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing,D2L.Style.Spacing.UnitType.Em,0);},GetBackgroundColor:function(){return this.m_backgroundColor;},GetBorder:function(){return this.m_border;},GetBorderRadius:function(){return this.m_borderRadius;},GetPadding:function(){return this.m_padding;},GetSpacing:function(){return this.m_spacing;},SetBackgroundColor:function(backgroundColor){this.m_backgroundColor=backgroundColor;},SetBorder:function(border){this.m_border=border;},SetBorderRadius:function(borderRadius){this.m_borderRadius=borderRadius;},SetPadding:function(padding){this.m_padding=padding;},SetSpacing:function(spacing){this.m_spacing=spacing;}});

D2L.Control.DataList.RpcRequest=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_rpc='';this.m_rpcSrc='';this.m_paging=null;this.m_parameters={};this.m_sorting=[];},Serialize:function(serializer){serializer.AddMember('Rpc',this.m_rpc);serializer.AddMember('RpcSrc',this.m_rpcSrc);serializer.AddMember('Paging',this.m_paging);serializer.AddMember('Parameters',this.m_parameters);serializer.AddMember('Sorting',this.m_sorting);},SetPaging:function(paging){this.m_paging=paging;},SetParameters:function(parameters){this.m_parameters=parameters;},SetRpc:function(rpc){this.m_rpc=rpc;},SetRpcSrc:function(rpcSrc){this.m_rpcSrc=rpcSrc;},SetSorting:function(sorting){this.m_sorting=sorting;}});

D2L.Control.DataList.RpcResponse=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_items=[];this.m_pageCount=1;this.m_entityCount=0;this.m_totalEntityCount=0;this.m_parameters=new D2L.Util.Dictionary();},Deserialize:function(deserializer){this.m_items=deserializer.GetObjectArray('Items',D2L.Control.DataList.Item);this.m_pageCount=deserializer.GetMember('PageCount');this.m_entityCount=deserializer.GetMember('EntityCount');this.m_totalEntityCount=deserializer.GetMember('TotalEntityCount');var parameters=deserializer.GetDictionary('Parameters');for(var key in parameters){this.m_parameters.Add(key,parameters[key]);}},GetEntityCount:function(){return this.m_entityCount;},GetItems:function(){return this.m_items;},GetPageCount:function(){return this.m_pageCount;},GetParameters:function(){return this.m_parameters;},GetTotalEntityCount:function(){return this.m_totalEntityCount;}});

D2L.Control.DataList.ItemRenderer=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_dataClass=undefined;this.m_isLayoutTypeSensitive=false;this.m_tileItemWidth=0;this.m_tileItemHeight=0;this.m_listItemWidth=0;this.m_listItemHeight=0;this.m_itemStyle=new D2L.Control.DataList.ItemStyle();this.m_itemStyle.SetBackgroundColor('#dcdcdc');this.m_itemStyle.SetBorder(new D2L.Style.BorderInfo(D2L.Style.BorderStyle.Solid,'#bbbbbb',1));this.m_itemStyle.SetBorderRadius(3);this.m_itemStyle.SetPadding(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Padding,D2L.Style.Spacing.UnitType.Em,0.3));this.m_itemStyle.SetSpacing(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing,D2L.Style.Spacing.UnitType.Em,0.3));this.m_selectedItemStyle=new D2L.Control.DataList.ItemStyle();this.m_selectedItemStyle.SetBackgroundColor('#ffffff');this.m_selectedItemStyle.SetBorder(new D2L.Style.BorderInfo(D2L.Style.BorderStyle.Solid,'#bbbbbb',1));this.m_selectedItemStyle.SetBorderRadius(3);this.m_selectedItemStyle.SetPadding(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Padding,D2L.Style.Spacing.UnitType.Em,0.3));this.m_selectedItemStyle.SetSpacing(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing,D2L.Style.Spacing.UnitType.Em,0.3));this.m_mouseOverItemStyle=new D2L.Control.DataList.ItemStyle();this.m_mouseOverItemStyle.SetBackgroundColor('#f5f5f5');this.m_mouseOverItemStyle.SetBorder(new D2L.Style.BorderInfo(D2L.Style.BorderStyle.Solid,'#bbbbbb',1));this.m_mouseOverItemStyle.SetBorderRadius(3);this.m_mouseOverItemStyle.SetPadding(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Padding,D2L.Style.Spacing.UnitType.Em,0.3));this.m_mouseOverItemStyle.SetSpacing(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing,D2L.Style.Spacing.UnitType.Em,0.3));this.m_disabledItemStyle=new D2L.Control.DataList.ItemStyle();this.m_disabledItemStyle.SetBackgroundColor('#dcdcdc');this.m_disabledItemStyle.SetBorder(new D2L.Style.BorderInfo(D2L.Style.BorderStyle.Solid,'#bbbbbb',1));this.m_disabledItemStyle.SetBorderRadius(3);this.m_disabledItemStyle.SetPadding(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Padding,D2L.Style.Spacing.UnitType.Em,0.3));this.m_disabledItemStyle.SetSpacing(new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing,D2L.Style.Spacing.UnitType.Em,0.3));},Deserialize:function(deserializer){this.m_tileItemWidth=deserializer.GetMember('TileItemWidth');this.m_tileItemHeight=deserializer.GetMember('TileItemHeight');this.m_listItemWidth=deserializer.GetMember('ListItemWidth');this.m_listItemHeight=deserializer.GetMember('ListItemHeight');},GetDataClass:function(){return this.m_dataClass;},GetDisabledItemStyle:function(layoutType){return this.m_disabledItemStyle;},GetFocusItemStyle:function(layoutType){return this.m_mouseOverItemStyle;},GetItemStyle:function(layoutType){return this.m_itemStyle;},GetListItemHeight:function(){return this.m_listItemHeight;},GetListItemWidth:function(){return this.m_listItemWidth;},GetMouseOverItemStyle:function(layoutType){return this.m_mouseOverItemStyle;},GetSelectedItemStyle:function(layoutType){return this.m_selectedItemStyle;},GetTileItemHeight:function(){return this.m_tileItemHeight;},GetTileItemWidth:function(){return this.m_tileItemWidth;},Init:function(dataList){},IsLayoutTypeSensitive:function(){return this.m_isLayoutTypeSensitive;},Render:function(dataItem){}});

D2L.Control.DataList.ItemRendererData=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_title='';},Deserialize:function(deserializer){this.m_title=deserializer.GetObject('Title');if(this.m_title==null){this.m_title=new D2L.LP.Text.PlainText('');}},GetTitle:function(){return this.m_title;}});

D2L.Control.DataList.TextItemRenderer=D2L.Control.DataList.ItemRenderer.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.baseFontSize=UI.GetRelativeFontSizeManager().GetBaseFontSize();},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);},GetDataClass:function(){return D2L.Control.DataList.TextItemRendererData;},Init:function(dataList){var me=this;dataList.SelectItemEvent().RegisterMethod(function(dataItem){me.SelectHandler(dataItem);});dataList.UnSelectItemEvent().RegisterMethod(function(dataItem){me.UnSelectHandler(dataItem);});},Render:function(dataItem){var data=dataItem.GetData();var dataList=dataItem.GetDataList();var layoutType=dataList.GetLayoutType();var node=dataList.CreateElement('div');node.className=this.GetContentCssClass(dataItem);var textNode=dataList.CreateElement('div');textNode.className='ddl_tr_c';var titleNode=dataList.CreateElement('div');titleNode.className='ddl_tr_t';data.GetTitle().AssignText(titleNode,'innerHTML');textNode.appendChild(titleNode);if(data.GetDescription()!=null){var descNode=dataList.CreateElement('div');descNode.className='ddl_tr_d';data.GetDescription().AssignText(descNode,'innerHTML');textNode.appendChild(descNode);}
var image=data.GetImage();if(image!=null){var marginNode=dataList.CreateElement('div');marginNode.className='ddl_tr_m';node.appendChild(marginNode);var imageControl=new D2L.Control.Image();if(image!=null){imageControl.SetImage(image);}
imageControl.AppendTo(marginNode);var paddingEm=D2L.Style.Utility.PixelToEm(this.baseFontSize,image.GetWidth()+6);textNode.style.paddingLeft=paddingEm+'em';}
node.appendChild(textNode);return node;},GetContentCssClass:function(dataItem){if(dataItem.IsEnabled()){if(dataItem.IsSelected()){return'ddl_trs';}else{return'ddl_tr';}}else{return'ddl_trd';}},SelectHandler:function(dataItem){dataItem.GetControl().className=this.GetContentCssClass(dataItem);},UnSelectHandler:function(dataItem){dataItem.GetControl().className=this.GetContentCssClass(dataItem);}});D2L.Control.DataList.TextItemRendererData=D2L.Control.DataList.ItemRendererData.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_description=null;this.m_img=null;this.m_imgDisabled=null;},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);this.m_description=deserializer.GetObject('Description');this.m_img=deserializer.GetObject('Img',D2L.Images.Image);if(this.m_img===undefined){this.m_img=null;}
this.m_imgDisabled=deserializer.GetObject('ImgDisabled',D2L.Images.Image);if(this.m_imgDisabled===undefined){this.m_imgDisabled=null;}},GetDescription:function(){return this.m_description;},GetDisabledImage:function(){return this.m_imgDisabled;},GetImage:function(){return this.m_img;}});

D2L.Control.DateTimeSelector=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.DateTimeSelector);this.m_calendarContainer=null;this.m_calendar=null;this.name='';this.m_name='';this.m_hasMinutes=true;this.m_hasNowButton=true;this.m_isEnabled=true;this.m_type=null;this.m_slMonth=null;this.m_slYear=null;this.m_slDay=null;this.m_slHour=null;this.m_slMinute=null;this.m_slAmPm=null;this.m_hiddenType=null;this.m_nowButton=null;this.m_calendarImg=null;this.m_use24HourClock=false;this.m_subject='';this.m_minuteInterval=1;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isEnabled=deserializer.GetBoolean();this.m_type=deserializer.GetMember();this.m_hasMinutes=deserializer.GetBoolean();this.m_hasNowButton=deserializer.GetBoolean();this.m_use24HourClock=deserializer.GetBoolean();this.m_name=deserializer.GetMember();this.m_subject=deserializer.GetMember();this.m_minuteInterval=deserializer.GetMember();this.name=this.m_name;if(this.m_type==D2L.Control.DateTimeSelector.Type.DateTime||this.m_type==D2L.Control.DateTimeSelector.Type.DateOnly){if(this.m_name.length>0){this.m_slMonth=UI.GetByName(this.m_name+'_m');this.m_slDay=UI.GetByName(this.m_name+'_d');this.m_slYear=UI.GetByName(this.m_name+'_y');}else{this.m_slMonth=UI.GetControl(this.GetMappedId()+'_m');this.m_slDay=UI.GetControl(this.GetMappedId()+'_d');this.m_slYear=UI.GetControl(this.GetMappedId()+'_y');}}
if(this.m_type==D2L.Control.DateTimeSelector.Type.DateTime||this.m_type==D2L.Control.DateTimeSelector.Type.TimeOnly){if(this.m_name.length>0){this.m_slHour=UI.GetByName(this.m_name+'_h');this.m_slMinute=UI.GetByName(this.m_name+'_mi');if(!this.m_use24HourClock){this.m_slAmPm=UI.GetByName(this.m_name+'_ampm');}}else{this.m_slHour=UI.GetControl(this.GetMappedId()+'_h');this.m_slMinute=UI.GetControl(this.GetMappedId()+'_mi');if(!this.m_use24HourClock){this.m_slAmPm=UI.GetControl(this.GetMappedId()+'_ampm');}}}
this.m_calendarImg=UI.GetControl(this.GetMappedId()+'_calImg');if(this.m_hasNowButton){if(this.m_name.length>0){this.m_nowButton=UI.GetByName(this.m_name+'_nbtn');}else{this.m_nowButton=UI.GetControl(this.GetMappedId()+'_nbtn');}}
if(this.m_name.length>0){this.m_hiddenType=UI.GetByName(this.m_name+'_tp');}else{this.m_hiddenType=UI.GetControl(this.GetMappedId()+'_tp');}},Focus:function(){this.m_slMonth.Focus();},HasMinutes:function(){return this.m_hasMinutes;},HasTime:function(){return(this.m_type==D2L.Control.DateTimeSelector.Type.DateTime||this.m_type==D2L.Control.DateTimeSelector.Type.TimeOnly);},GetDate:function(){var m=this.m_slMonth.GetSelectedValue()-1;var y=this.m_slYear.GetSelectedValue();var d=this.m_slDay.GetSelectedValue();var h=this.GetHour();var min=this.GetMinute();var dt=new D2L.DateTime();dt.SetDay(1);dt.SetMonth(0);dt.SetYear(2008);dt.SetDay(d);dt.SetMonth(m);dt.SetYear(y);if(h!==null){dt.SetHour(h);}else{dt.SetHour(0);}
if(min!==null){dt.SetMinute(min);}else{dt.SetMinute(0);}
return dt;},GetDay:function(){if(this.m_slDay){return parseInt(this.m_slDay.GetSelectedValue());}
return null;},GetHour:function(){if(this.m_slHour){var hour=parseInt(this.m_slHour.GetSelectedValue());if(!this.m_use24HourClock){var isAm=false;if(this.m_slAmPm){isAm=(this.m_slAmPm.GetSelectedValue()=='am');}
if(!isAm&&hour!=12){hour+=12;}else if(isAm&&hour==12){hour=0;}}
return hour;}
return null;},GetHour24:function(){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('DateTimeSelector.GetHour24() is '+'obsolete. Use GetHour() instead.'),true);return this.GetHour();},GetMinute:function(){if(this.m_slMinute){return parseInt(this.m_slMinute.GetSelectedValue());}else{return null;}},GetMonth:function(){if(this.m_slMonth){return parseInt(this.m_slMonth.GetSelectedValue());}else{return null;}},GetMultiEditValue:function(){var padInt=function(val,digits){var ret=val.toString();while(ret.length<digits){ret='0'+ret;}
return ret;};var ret="0001-01-01T00:00:00";if(this.IsEnabled()){ret=(this.GetYear())?this.GetYear():"0001";ret+="-";ret+=(this.GetMonth())?padInt(this.GetMonth(),2):"01";ret+="-";ret+=(this.GetDay())?padInt(this.GetDay(),2):"01";ret+="T";if(this.GetHour()!==null){ret+=padInt(this.GetHour(),2);}else{ret+="00";}
ret+=":";ret+=(this.GetMinute())?padInt(this.GetMinute(),2):"00";ret+=":00";}
return ret;},GetState:function(serializer){var dt=new Date();var year=this.GetYear();if(year===null){year=dt.getFullYear();}
var month=this.GetMonth();if(month===null){month=dt.getMonth();}
var day=this.GetDay();if(day===null){day=dt.getDay();}
var hour=this.GetHour();if(hour===null){hour=-1;}
var minute=this.GetMinute();if(minute===null){minute=-1;}
serializer.AddMember('Year',year);serializer.AddMember('Month',month);serializer.AddMember('Day',day);serializer.AddMember('Hour',hour);serializer.AddMember('Minute',minute);},GetYear:function(){if(this.m_slYear){return parseInt(this.m_slYear.GetSelectedValue());}else{return null;}},IsDateValid:function(){var validator=new D2L.Validation.DateValidator(this.GetYear(),this.GetMonth(),this.GetDay());return validator.Validate();},IsEnabled:function(){return this.m_isEnabled;},IsTimeOnly:function(){return(this.m_type==D2L.Control.DateTimeSelector.Type.TimeOnly);},Now:function(leaveTimeAlone){var now=D2L.Util.DateTime.Now();this.SetDate(D2L.Util.DateTime.ConvertToD2LDateTime(now),leaveTimeAlone);WindowEventManager.BC(this.GetDomNode(),null);},OpenDatePopup:function(){if(this.IsEnabled()){var firstYear=this.m_slYear.Children()[0].GetVal();var lastYear=this.m_slYear.Children()[this.m_slYear.Children().length-1].GetVal();var dWin=window.open("/d2l/common/datePicker/datePicker.d2l?cMonth="+this.GetMonth()+"&cYear="+this.GetYear()+"&updateme="+this.m_name+'&fy='+firstYear+'&ly='+lastYear,'selectDay','height=255,width=225,resizable=1');dWin.focus();}},SetDate:function(dt,leaveTimeAlone){if(leaveTimeAlone===undefined){leaveTimeAlone=false;}
this.SetMonth(dt.GetMonth());this.SetDay(dt.GetDay());this.SetYear(dt.GetYear());if(!leaveTimeAlone){this.SetHour(dt.GetHour());this.SetMinute(dt.GetMinute());}},SetDay:function(day){if(this.m_slDay){var tmp=this.m_slDay.GetOption(day);if(tmp){this.m_slDay.SelectOption(tmp,true);}}},SetHasMinutes:function(hasMinutes){this.m_hasMinutes=hasMinutes;if(this.m_slMinute){if(hasMinutes==false){this.m_slMinute.SetTitle(null);this.m_slMinute.Hide();var tmp=this.m_slMinute.GetOption(0);if(tmp){this.m_slMinute.SelectOption(tmp,false);}}else{var title=null;if(this.m_subject!=null&&this.m_subject!=''){title=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altMinuteSubject');title.SetSubject(this.m_subject);}else{title=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altMinute');}
this.m_slMinute.SetTitle(title);this.m_slMinute.Show();}}},SetHour:function(hour){if(this.m_slHour){hour=parseInt(hour);if(hour>-1&&hour<24){if(!this.m_use24HourClock){this.SetIsAmHelper(hour<12);if(hour===0){hour=12;}
if(hour>12){hour=hour-12;}}
var tmp=this.m_slHour.GetOption(hour);if(tmp){this.m_slHour.SelectOption(tmp,true);}}}},SetHour24:function(hour){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('DateTimeSelector.SetHour24() is '+'obsolete. Use SetHour() instead.'),true);this.SetHour(hour);},SetIsAmHelper:function(isAm){if(this.m_slAmPm){var tmp;if(isAm){tmp=this.m_slAmPm.GetOption('am');}else{tmp=this.m_slAmPm.GetOption('pm');}
if(tmp){this.m_slAmPm.SelectOption(tmp,true);}}},SetMinute:function(min){if(this.m_slMinute&&this.HasMinutes()){min=Math.round(min/this.m_minuteInterval)*this.m_minuteInterval;var tmp=this.m_slMinute.GetOption(min);if(tmp){this.m_slMinute.SelectOption(tmp,true);}}},SetMonth:function(month){if(this.m_slMonth){var tmp=this.m_slMonth.GetOption(month+1);if(tmp){this.m_slMonth.SelectOption(tmp,true);}}},SetIsEnabled:function(isEnabled){var m=this.m_slMonth;var y=this.m_slYear;var d=this.m_slDay;var mi=this.m_slMinute;var h=this.m_slHour;var ampm=this.m_slAmPm;if(m&&m.SetIsEnabled){m.SetIsEnabled(isEnabled);}
if(y&&y.SetIsEnabled){y.SetIsEnabled(isEnabled);}
if(d&&d.SetIsEnabled){d.SetIsEnabled(isEnabled);}
if(mi&&mi.SetIsEnabled){mi.SetIsEnabled(isEnabled);}
if(h&&h.SetIsEnabled){h.SetIsEnabled(isEnabled);}
if(ampm&&ampm.SetIsEnabled){ampm.SetIsEnabled(isEnabled);}
if(this.m_nowButton){this.m_nowButton.SetIsEnabled(isEnabled);}
if(this.m_calendarImg){this.m_calendarImg.SetIsEnabled(isEnabled);}
this.m_isEnabled=isEnabled;},SetType:function(type){if(this.m_type!=type){var dateRow=UI.GetById(this.GetMappedId()+'_dr');var timeRow=UI.GetById(this.GetMappedId()+'_tr');var dateNowCell=null;var timeNowCell=null;var dateTimeNowCell=null;if(this.m_hasNowButton){dateNowCell=UI.GetById(this.GetMappedId()+'_drn');timeNowCell=UI.GetById(this.GetMappedId()+'_trn');dateTimeNowCell=UI.GetById(this.GetMappedId()+'_ln');this.m_nowButton=this.m_nowButton.Remove();}
var slMonth=null;var slDay=null;var slYear=null;var slHour=null;var slMinute=null;var slAmPm=null;if(this.m_name.length>0){slMonth=UI.GetByName(this.m_name+'_m');slDay=UI.GetByName(this.m_name+'_d');slYear=UI.GetByName(this.m_name+'_y');slHour=UI.GetByName(this.m_name+'_h');slMinute=UI.GetByName(this.m_name+'_mi');slAmPm=UI.GetByName(this.m_name+'_ampm');}else{slMonth=UI.GetControl(this.GetMappedId()+'_m');slDay=UI.GetControl(this.GetMappedId()+'_d');slYear=UI.GetControl(this.GetMappedId()+'_y');slHour=UI.GetControl(this.GetMappedId()+'_h');slMinute=UI.GetControl(this.GetMappedId()+'_mi');slAmPm=UI.GetControl(this.GetMappedId()+'_ampm');}
var monthTitle=null;var yearTitle=null;var dayTitle=null;var hourTitle=null;var minuteTitle=null;var AmPmTitle=null;if(this.m_subject!=null&&this.m_subject!=''){monthTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altMonthSubject');monthTitle.SetSubject(this.m_subject);yearTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altYearSubject');yearTitle.SetSubject(this.m_subject);dayTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altDaySubject');dayTitle.SetSubject(this.m_subject);hourTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altHourSubject');hourTitle.SetSubject(this.m_subject);minuteTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altMinuteSubject');minuteTitle.SetSubject(this.m_subject);AmPmTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altAMPMSubject');AmPmTitle.SetSubject(this.m_subject);}else{monthTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altMonth');yearTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altYear');dayTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altDay');hourTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altHourSubject');minuteTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altMinuteSubject');AmPmTitle=new D2L.LP.Text.LangTerm('Framework.DateTimeSelector.altAMPMSubject');}
if(type==D2L.Control.DateTimeSelector.Type.DateOnly){this.m_slMonth=slMonth;this.m_slDay=slDay;this.m_slYear=slYear;this.m_slHour=null;this.m_slMinute=null;this.m_slAmPm=null;dateRow.style.display='';timeRow.style.display='none';if(dateTimeNowCell!=null&&timeNowCell!=null&&dateTimeNowCell!=null){this.m_nowButton.AppendTo(dateNowCell);dateNowCell.style.display='';timeNowCell.style.display='none';dateTimeNowCell.style.display='none';}
slHour.SetTitle(null);slMinute.SetTitle(null);if(!this.m_use24HourClock){slAmPm.SetTitle(null);}
slMonth.SetTitle(monthTitle);slDay.SetTitle(dayTitle);slYear.SetTitle(yearTitle);}
if(type==D2L.Control.DateTimeSelector.Type.TimeOnly){this.m_slMonth=null;this.m_slDay=null;this.m_slYear=null;this.m_slHour=slHour;this.m_slMinute=slMinute;this.m_slAmPm=slAmPm;dateRow.style.display='none';timeRow.style.display='';timeRow.firstChild.className='d_dt';if(dateTimeNowCell!=null&&timeNowCell!=null&&dateTimeNowCell!=null){dateNowCell.style.display='none';this.m_nowButton.AppendTo(timeNowCell);timeNowCell.style.display='';dateTimeNowCell.style.display='none';}
slMonth.SetTitle(null);slDay.SetTitle(null);slYear.SetTitle(null);slHour.SetTitle(hourTitle);if(this.HasMinutes()){slMinute.SetTitle(minuteTitle);}
if(!this.m_use24HourClock){slAmPm.SetTitle(AmPmTitle);}}
if(type==D2L.Control.DateTimeSelector.Type.DateTime){this.m_slMonth=slMonth;this.m_slDay=slDay;this.m_slYear=slYear;this.m_slHour=slHour;this.m_slMinute=slMinute;this.m_slAmPm=slAmPm;dateRow.style.display='';timeRow.style.display='';timeRow.firstChild.className='d_ddt';if(dateTimeNowCell!=null&&timeNowCell!=null&&dateTimeNowCell!=null){dateNowCell.style.display='none';timeNowCell.style.display='none';this.m_nowButton.AppendTo(dateTimeNowCell);dateTimeNowCell.style.display='';}
slMonth.SetTitle(monthTitle);slDay.SetTitle(dayTitle);slYear.SetTitle(yearTitle);slHour.SetTitle(hourTitle);if(this.HasMinutes()){slMinute.SetTitle(minuteTitle);}
if(!this.m_use24HourClock){slAmPm.SetTitle(AmPmTitle);}}
this.m_type=type;this.m_hiddenType.value=type;}},SetYear:function(year){if(this.m_slYear){var tmp=this.m_slYear.GetOption(year);if(tmp){this.m_slYear.SelectOption(tmp);}}},ShowCalendar:function(){if(this.IsEnabled()){var me=this;var calendarImage=UI.GetControl(this.GetMappedId()+'_calImg');if(this.m_calendarContainer==null){this.m_calendarContainer=new D2L.Control.Container.Floating();this.m_calendarContainer.SetBackgroundColour('#ffffff');this.m_calendarContainer.SetHasAutoHide(true);var border=new D2L.Style.BorderInfo();border.SetWidth(1);border.SetStyle(D2L.Style.BorderStyle.Solid);border.SetColour('#cccccc');this.m_calendarContainer.SetBorder(border);this.m_calendar=new D2L.Control.Calendar();var handleOnSelectDate=function(date){me.SetYear(date.GetYear());me.SetMonth(date.GetMonth()-1);me.SetDay(date.GetDay());me.m_calendarContainer.Hide();}
this.m_calendar.OnSelectDate.RegisterMethod(handleOnSelectDate);var firstYear=this.m_slYear.Children()[0].GetVal();var lastYear=this.m_slYear.Children()[this.m_slYear.Children().length-1].GetVal();this.m_calendar.SetNoEarlierThanDate(new D2L.Util.DateTime(firstYear,1,1));this.m_calendar.SetNoLaterThanDate(new D2L.Util.DateTime(lastYear,12,31));var posY=FindPosY(calendarImage.GetDomNode())+calendarImage.GetDomNode().offsetHeight+4;var posX=FindPosX(calendarImage.GetDomNode());this.m_calendarContainer.SetPosition(posX,posY);this.m_calendarContainer.AppendChild(this.m_calendar);}
var oldDate=this.GetDate();var selectedDate=new D2L.Util.DateTime(oldDate.GetYear(),oldDate.GetMonth()+1,oldDate.GetDay());this.m_calendar.SetSelectedDate(selectedDate,true,false);this.m_calendarContainer.Show(calendarImage.GetDomNode().parentNode);}}});D2L.DateTimeSelector=D2L.Control.DateTimeSelector;D2L.Control.DateTimeSelector.Type={DateTime:1,DateOnly:2,TimeOnly:3};

D2L.DialogBase=D2L.Control.extend({Construct:function(name,callback){arguments.callee.$.Construct.call(this,D2L.Control.Type.Dialog,true);if(name!==undefined){try{var oldDialog=UI.GetByName(name);if(oldDialog!=null&&oldDialog!=this){if(oldDialog.IsShown()){D2L.Dialog.BC(name,D2L.Dialog.ResponseType.Abort);}
oldDialog.Close();}}catch(e){}}
if(name===undefined||!name.isString){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Dialogs should always have a name'),true);name=UI.GetUniqueHtmlId();}
if(!UI.IsValidJsVariableName(name)){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.SmlText('Dialog Name "[0]" is not a valid '+'JavaScript name. Names can only contain letters, numbers '+'and underscore and must start with a letter',name),true);}
if(callback===undefined){callback=function(dr){dr.GetDialog().Close();};}
this.m_buttons=[];this.m_buttonTable=null;this.m_callback=null;this.m_callbackArguments=[];this.m_closeIconResponseType=D2L.Dialog.ResponseType.Abort;this.m_childrenNodePadding=0;this.m_footerText=new D2L.LP.Text.PlainText('');this.m_footerTextNode=null;this.m_height=null;this.m_icon=null;this.m_iconTerm=null;this.m_iframe=null;this.m_iframeWindow=null;this.m_ignoreMaxMinSizeOnResize=false;this.m_isLoaded=false;this.m_isShown=false;this.m_minHeight=125;this.m_minWidth=200;this.m_name=name;this.m_positiveButton=null;this.m_src='';this.m_srcCallbackName='';this.m_srcParams=[];this.m_srcWindow=null;this.m_title=new D2L.LP.Text.LangTerm('Standard.Misc.txtLoading');this.m_titleIsSet=false;this.m_width=400;this.m_opener=undefined;this.OnOpen=new D2L.EventHandler();this.OnResize=new D2L.EventHandler();this.SetCallback(callback);},BuildDom_Buttons:function(){this.m_buttonTable=this.CreateElement('table');if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.Safari){this.m_buttonTable.style.width='auto';}
this.m_buttonTable.className='ddial_b';this.m_buttonTable.style.display=(this.m_buttons.length>0)?'block':'none';var r=this.m_buttonTable.insertRow(-1);var c1=this.CreateCell(r);var c2=this.CreateCell(r);c2.align='center';c2.width='100%';var c3=this.CreateCell(r);c3.align='right';for(var i=0;i<this.m_buttons.length;i++){this.m_buttons[i].b.m_hasDomBeenBuilt=false;this.m_buttons[i].b.AppendTo(r.cells[this.m_buttons[i].p]);}},BuildDom_Frame:function(){this.m_loading=this.CreateElement('div');this.m_loading.className='ddial_l';var img=this.CreateElement('img');img.src='/d2l/img/LP/dialog/loading.gif';this.m_loading.appendChild(img);this.m_loading.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Standard.Misc.txtLoading')));this.IChildrenDomNode.appendChild(this.m_loading);var name=this.GetWindow()['UI'].GetUniqueHtmlId();if(this.IChildrenDomNode.insertAdjacentHTML){this.IChildrenDomNode.insertAdjacentHTML('beforeEnd','<iframe name=\''+name+'\' style=\'width:1px;height:1px;border:none;\' border=\'0\' frameborder=\'0\' src=\'/d2l/tools/blank.html\'></iframe>');this.m_iframe=this.IChildrenDomNode.childNodes[this.IChildrenDomNode.childNodes.length-1];}else{this.m_iframe=this.CreateElement('iframe');this.m_iframe.name=name;this.m_iframe.style.width='1px';this.m_iframe.style.height='1px';this.m_iframe.border=0;this.m_iframe.frameBorder=0;this.m_iframe.style.border='none';this.m_iframe.src='/d2l/tools/blank.html';this.IChildrenDomNode.appendChild(this.m_iframe);}
var me=this;var onIFrameLoad=function(){me.m_iframeWindow=me.m_iframe.contentWindow;var doLoad=false;try{if(me.m_iframeWindow&&me.m_iframeWindow.location.href.indexOf('/d2l/tools/blank.html')==-1){doLoad=true;}}catch(e){doLoad=false;}
if(D2L.Util.Url.IsExternal(me.m_src)||doLoad){me.HandleOnload();}};if(this.m_iframe.attachEvent){this.m_iframe.attachEvent("onload",onIFrameLoad);}else if(this.m_iframe.addEventListener){this.m_iframe.addEventListener("load",onIFrameLoad,false);}
this.m_iframeOnloadFunc=onIFrameLoad;this.GetTitle().AssignText(this.m_iframe,'title');},AddButton:function(type,responseParam,name){if(responseParam===undefined){responseParam='';}
var position;if(type==D2L.Control.Button.Type.Close||type==D2L.Control.Button.Type.Cancel){position=D2L.Dialog.ButtonPosition.Left;}else if(type==D2L.Control.Button.Type.Ok){position=D2L.Dialog.ButtonPosition.Middle;}else{position=D2L.Dialog.ButtonPosition.Right;}
var responseType
if(type==D2L.Control.Button.Type.Cancel||type==D2L.Control.Button.Type.Close){responseType=D2L.Dialog.ResponseType.Abort;}else if(type==D2L.Control.Button.Type.No){responseType=D2L.Dialog.ResponseType.Negative;}else{responseType=D2L.Dialog.ResponseType.Positive;}
return this.AddButtonHelper(D2L.Control.Button.GetTermForType(type),position,type,responseType,responseParam,name);},AddCustomButton:function(text,position,responseType,responseParam,id){return this.AddButtonHelper(text,position,D2L.Control.Button.Type.Custom,responseType,responseParam,id);},AddButtonHelper:function(text,position,type,responseType,responseParam,id){var b=this.GetButton(id);if(b!==null){this.RemoveButton(b);}
text=D2L.LP.Text.IText.Normalize(text,'D2L.DialogBase','AddButtonHelper','text');if(position===undefined){position=D2L.Dialog.ButtonPosition.Left;}
if(responseType===undefined){responseType=D2L.Dialog.ResponseType.Positive;}
if(responseParam===undefined){responseParam='';}
if(name===undefined){name=this.GetOpenerWindow()['UI'].GetUniqueHtmlId();}
var dialog=this;var button=new D2L.Control.Button(text);button.SetOnClick(function(){D2L.Dialog.BC(dialog.m_name,responseType,type,responseParam);});if(id!==undefined){button.SetControlId(id);}
if(responseType==D2L.Dialog.ResponseType.Positive&&this.m_positiveButton===null){this.m_positiveButton=button;}
this.m_buttons.push({'p':position,'b':button,'t':type,'d':false});if(this.m_hasDomBeenBuilt){button.AppendTo(this.m_buttonTable.rows[0].cells[position]);if(this.m_buttons.length==1){this.m_buttonTable.style.display='block';this.SetHeight(this.m_height);}}
return button;},CallCallback:function(response){if(this.IsClosed()&&response!=null&&response.GetType()!=D2L.Dialog.ResponseType.Abort){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Calling CallCallback on a closed '+'dialog can cause unexpected errors in IE. Please make sure '+'you are closing the dialog inside your outer callback '+'function instead of SrcCallback.'),true);}
var cb=this.GetCallback();var ret=response;if(cb){var cbRet=cb.apply(cb,[response].concat(this.m_callbackArguments));if(cbRet!==undefined){ret=cbRet;}}
if(this.m_delayedReturn){this.m_delayedReturn.Trigger(ret);}},CallSrcMethod:function(methodName,val){if(this.m_srcWindow&&!this.m_srcWindow.closed&&this.m_srcWindow[methodName]){return this.m_srcWindow[methodName](val);}else{return null;}},Close:function(){},GetButton:function(id){if(id!==undefined){id=id.toLowerCase();for(var i=0;i<this.m_buttons.length;i++){if(this.m_buttons[i].b.GetControlId().ID()==id){return this.m_buttons[i].b;}}}
return null;},GetCallback:function(){return this.m_callback;},GetContentHeight:function(){var h=0;if(this.IChildrenDomNode){h=this.IChildrenDomNode.offsetHeight;}
if(this.m_icon!=null&&this.m_icon.offsetHeight){if(this.m_icon.offsetHeight>h){h=this.m_icon.offsetHeight;}}
return h;},GetHeight:function(){if(this.IsShown()){return this.IDomNode.offsetHeight;}else{return this.m_height;}},GetWidth:function(){return this.m_width;},GetFooterText:function(){return this.m_footerText;},GetOpenerWindow:function(){},GetPositiveButton:function(){return this.m_positiveButton;},GetTitle:function(){return this.m_title;},HandleOnload:function(){if(!D2L.Util.Url.IsExternal(this.m_src)){if(this.m_iframeWindow){if(this.m_iframeWindow['UI']){this.m_iframeWindow['UI'].SetParentDialog(this);}
if(this.m_iframeWindow['d2l_Onload']){this.m_iframeWindow.d2l_Onload();}
if(!this.m_titleIsSet){var title=this.m_iframeWindow.document.title;this.m_iframe.title=title;this.SetTitle(new D2L.LP.Text.PlainText(title));}
this.AttachObject(this,'m_srcWindow',this.m_iframeWindow);}}
if(!this.m_isLoaded&&this.IsShown()){if(this.m_loading){this.m_loading.style.display='none';}
if(this.m_src.length>0){for(var i=0;i<this.m_buttons.length;i++){if(this.m_buttons[i].d){this.m_buttons[i].b.SetIsEnabled(true);}}}
this.m_isLoaded=true;this.SetHeight(this.m_height);if(this.m_iframe!=null){this.m_iframe.style.width='100%';}
this.OnOpen.Trigger();}
if(this.m_focusAnchor2){this.m_focusAnchor2.focus();}},HasCloseIcon:function(hasCloseIcon){},Hide:function(){},IsClosed:function(){return!this.IsShown();},IsResizable:function(){},IsShown:function(){return this.m_isShown},Open:function(opener){if(opener!==undefined){this.SetOpener(opener);}},RemoveButton:function(button){for(var i=0;i<this.m_buttons.length;i++){if(this.m_buttons[i].b==button){if(button.GetDomNode()&&button.IsRendered()){D2L.Util.Purge(button.GetDomNode());button.IDomNode.parentNode.removeChild(button.GetDomNode());}
this.m_buttons.splice(i,1);}}},RemoveButtons:function(){for(var i=0;i<this.m_buttons.length;i++){var button=this.m_buttons[i].b;if(button.GetDomNode()&&button.IsRendered()){D2L.Util.Purge(button.GetDomNode());button.IDomNode.parentNode.removeChild(button.GetDomNode());}}
this.m_buttons=[];},SetCallback:function(callback){this.m_callback=null;this.m_callbackArguments=[];if(callback&&callback.apply){this.m_callback=callback;for(var i=1;i<arguments.length;i++){this.m_callbackArguments.push(arguments[i]);}}},SetFooterText:function(footerText){},SetHasCloseIcon:function(hasCloseIcon){},SetHeight:function(height){if(height!==undefined&&height!==null){var windowHeight=this.GetOpenerWindow()['UI'].GetWindowHeight();if(height.isString){if(height.charAt(height.length-1)=='%'){height=(parseInt(height.substr(0,height.length-1),10)/100);if(height>1){height=1;}else if(height<0){height=0;}
height=Math.round(height*windowHeight);}else if(height.substr(height.length-2,2)=='px'){height=parseInt(height.substr(0,height.length-2));}else{height=parseInt(height);}}
if(this.IsShown()&&this.IDomNode&&this.IChildrenDomNode){var heightDiff=(parseInt(this.IDomNode.offsetHeight,10)-parseInt(this.GetContentHeight(),10));height=height-heightDiff;if(height<1){height=1;}
if(!this.m_ignoreMaxMinSizeOnResize){if(height+heightDiff<this.m_minHeight){height=this.m_minHeight-heightDiff;}}
if(!this.m_ignoreMaxMinSizeOnResize){if(height+heightDiff>windowHeight){height=windowHeight-heightDiff-10;}}
if(this.IChildrenDomNode!=null&&this.IChildrenDomNode.offsetHeight&&(parseInt(this.GetContentHeight(),10)!=height)){this.IChildrenDomNode.style.height=(height-(2*this.m_childrenNodePadding))+'px';}
if(this.m_iframe){this.IChildrenDomNode.childNodes[0].style.marginTop=(Math.round((height-32)/2))+'px';if(this.m_isLoaded){this.m_iframe.style.height=height+'px';}}
height=height+heightDiff;}else if(height<this.m_minHeight){height=this.m_minHeight;}}
this.m_height=height;},SetIcon:function(imageTerm){this.m_iconTerm=imageTerm;if(this.m_iconTerm!=null&&this.IsRendered()){if(this.m_icon==null){this.m_icon=this.CreateElement('img');var table=this.CreateElement('table');table.width='100%';table.height='100%';var r1=table.insertRow(-1);var c1=this.CreateCell(r1);c1.style.width='1%';c1.vAlign='top';this.m_icon=this.CreateElement('img');c1.appendChild(this.m_icon);var c2=this.CreateCell(r1);c2.vAlign='top';if(this.IChildrenDomNode&&this.IChildrenDomNode.parentNode){this.IChildrenDomNode.parentNode.insertBefore(table,this.IChildrenDomNode);c2.appendChild(this.IChildrenDomNode);}}
this.m_iconTerm.Assign(this.m_icon);this.m_icon.style.padding='7px';this.m_icon.style.paddingRight='0px';}},SetIsResizable:function(isResizable){},SetOpener:function(opener){this.m_opener=opener;},SetSize:function(width,height){this.SetWidth(width,false);this.SetHeight(height,false);this.OnResize.Trigger(this.GetWidth(),this.GetContentHeight());},SetSrc:function(src,callbackName){if(callbackName===undefined){callbackName='';}
if(src.indexOf('/d2l/')==-1&&!D2L.Util.Url.IsExternal(src)){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('\'Src\' of dialogs must be an '+'absolute path (e.g. /d2l/myProduct/myComponent/myPage.d2l), '+'not relative (e.g. myPage.d2l)'),true);var href=window.location.href;var start=href.indexOf('/d2l/');var end=href.lastIndexOf('/');var absolute=href.substring(start,end+1);src=absolute+src;}
this.m_src=src;this.m_srcCallbackName=callbackName;if(!D2L.Util.Url.IsExternal(this.m_src)){this.m_src+=(this.m_src.indexOf('?')<0)?'?':'&';this.m_src+='d2l_body_type='+D2L.UI.BodyType.Dialog;if(this.m_src.indexOf('ou=')<0){this.m_src+='&ou='+Global.OrgUnitId;}}},SetSrcParam:function(name,value){this.m_srcParams[name]=value;},SetTitle:function(title){this.m_titleIsSet=true;},SetWidth:function(width){var windowWidth=this.GetOpenerWindow()['UI'].GetWindowWidth();if(width.isString){if(width.charAt(width.length-1)=='%'){width=(parseInt(width.substr(0,width.length-1),10)/100);if(width>1){width=1;}else if(width<0){width=0;}
width=Math.round(width*windowWidth);}else if(width.substr(width.length-2,2)=='px'){width=parseInt(width.substr(0,width.length-2));}else{width=parseInt(width);}}
if(!this.m_ignoreMaxMinSizeOnResize){if(width>windowWidth){width=windowWidth-10;}}
if(!this.m_ignoreMaxMinSizeOnResize){if(width<this.m_minWidth){width=this.m_minWidth;}}
this.m_width=width;if(this.IDomNode){this.IDomNode.style.width=width+'px';}},SubmitToIFrame:function(body){if(this.m_iframe&&!this.m_isLoaded){for(var i=0;i<this.m_buttons.length;i++){if(this.m_buttons[i].b.IsEnabled()&&this.m_buttons[i].t!=D2L.Control.Button.Type.Cancel&&this.m_buttons[i].t!=D2L.Control.Button.Type.Close){this.m_buttons[i].d=true;this.m_buttons[i].b.SetIsEnabled(false);}}
if(!D2L.Util.Url.IsExternal(this.m_src)){var f=this.CreateElement('form');f.method='post';f.target=this.m_iframe.name;f.action=this.m_src;for(var name in this.m_srcParams){var input=this.CreateElement('input');input.type='hidden';input.name=name;input.value=this.m_srcParams[name];f.appendChild(input);}
body.appendChild(f);f.submit();D2L.Util.Purge(f);body.removeChild(f);}else{this.m_iframe.src=this.m_src;}}}});

D2L.NonModalDialog=D2L.DialogBase.extend({Construct:function(name,callback){arguments.callee.$.Construct.call(this,name,callback);this.m_ignoreMaxMinSizeOnResize=true;this.m_ignoreResizeEvents=true;this.m_isCloseFunctionCalled=false;this.m_popupWindow=null;this.m_resizeWindowOnSetSize=true;var win=window;while(win.parent!=win&&win.parent.UI){var frames=win.parent.document.getElementsByTagName('frame');if(frames&&frames.length>0){if(win.parent['UI'].GetBodyType()!=D2L.UI.BodyType.Dialog){break;}}
win=win.parent}
this.m_openerWindow=win;this.SetWindow(null);window[this.m_name]=this;},BuildDom_Footer:function(){var me=this;this.m_resizeBar=this.CreateElement('div');this.m_resizeBar.className='ddial_f';this.m_resizeBar.style.display='none';this.m_resizeBar.style.height='1.2em';this.m_resizeBar.appendChild(this.CreateTextNode(this.m_footerText));var me=this;this.GetFooterText().GetText().Register(function(txt){me.m_resizeBar.style.display=(txt.length>0)?'block':'none';me.SetHeight(me.m_height);});},BuildDom:function(){if(!this.m_hasDomBeenBuilt){arguments.callee.$.BuildDom.call(this);this.IDomNode=this.CreateElement('div');var inner=this.CreateElement('div');this.BuildDom_Buttons();this.BuildDom_Footer();this.IChildrenDomNode=this.CreateElement('div');this.IChildrenDomNode.className='ddial_c';if(this.m_src.length>0){this.BuildDom_Frame();}else{this.IChildrenDomNode.style.overflowY='auto';this.IChildrenDomNode.style.padding='10px';this.m_childrenNodePadding=10;}
inner.appendChild(this.IChildrenDomNode);inner.appendChild(this.m_buttonTable);this.IDomNode.appendChild(inner);this.IDomNode.appendChild(this.m_resizeBar);this.SetIcon(this.m_iconTerm);this.InstallEvents();}},Close:function(){var me=this;var iframeObj=this.m_iframe;this.ResetState();this.m_isCloseFunctionCalled=true;setTimeout(function(){var ClosePopupWindow=function(){if(me.m_popupWindow&&!me.m_popupWindow.closed){me.m_popupWindow.close();}
me.m_popupWindow=null;me.SetWindow(null);};try{if(iframeObj&&me.m_iframeOnloadFunc&&iframeObj.detachEvent){iframeObj.detachEvent('onload',me.m_iframeOnloadFunc);iframeObj.attachEvent('onload',ClosePopupWindow);iframeObj.src='/d2l/tools/blank.html';setTimeout(function(){try{iframeObj.detachEvent('onload',ClosePopupWindow);iframeObj.parentNode.removeChild(iframeObj);iframeObj=null;}catch(e){}},1000);}else{ClosePopupWindow();}}catch(e){}},0);},Dispose:function(){if(this.m_popupWindow&&!this.m_popupWindow.closed){this.m_popupWindow.close();}
this.ResetState();this.m_srcWindow=null;window[this.m_name]=null;this.m_popupWindow=null;arguments.callee.$.Dispose.call(this);},GetOpenerWindow:function(){return this.m_openerWindow;},HandlePopupOnLoad:function(){if(this.m_popupWindow===null){return;}
var win=this.m_popupWindow;this.SetWindow(win);this.m_delayedReturn=new D2L.Util.DelayedReturn();this.BuildDom();var body=this.m_popupWindow['UI'].GetById('d2l_body');var form=this.m_popupWindow['UI'].GetById('d2l_form');body.style.margin=0;this.AppendTo(form);this.SubmitToIFrame(body);this.m_isShown=true;if(this.m_titleIsSet){this.SetTitle(this.m_title);}
this.SetSize(this.m_width,this.m_height);var me=this;setTimeout(function(){me.SetSize(me.m_width,me.m_height);me.m_ignoreResizeEvents=false;},0);if(!this.m_iframe){this.OnOpen.Trigger();}else{setTimeout(function(){if(me.IsShown()&&!me.m_isLoaded){me.HandleOnload();}},20000);}
return this.m_delayedReturn;},HandlePopupOnUnload:function(){var win=this.m_popupWindow;if(win&&win.location.href.indexOf('blank.d2l')>=0){if(!this.m_isCloseFunctionCalled){D2L.Dialog.BC(this.m_name,this.m_closeIconResponseType);}
this.Close();}},ResetState:function(){this.m_buttonTable=null;this.m_iframe=null;this.m_iframeWindow=null;this.m_srcWindow=null;this.IDomNode=null;this.IChildrenDomNode=null;this.m_resizeBar=null;this.m_hasDomBeenBuilt=false;for(var i=0;i<this.m_buttons.length;i++){this.m_buttons[i].b.m_hasDomBeenBuilt=false;}
this.m_isLoaded=false;this.m_isCloseFunctionCalled=false;this.m_isShown=false;},HasCloseIcon:function(hasCloseIcon){return true;},InstallEvents:function(){var me=this;var handleResizeEvent=function(){try{if(!me.m_ignoreResizeEvents&&!me.m_popupWindow.closed&&me.m_popupWindow['UI']){var newWidth=me.m_popupWindow['UI'].GetWindowWidth();var newHeight=me.m_popupWindow['UI'].GetWindowHeight();me.m_resizeWindowOnSetSize=false;me.SetSize(newWidth,newHeight);me.m_resizeWindowOnSetSize=true;}}catch(e){}}
var onResizeTimer=function(){if(me.resizeTimer){clearTimeout(me.resizeTimer);}
me.resizeTimer=setTimeout(handleResizeEvent,100);}
if(this.GetWindow().document.addEventListener){this.GetWindow().addEventListener('resize',onResizeTimer,false);}else if(this.GetWindow().document.attachEvent){this.GetWindow().attachEvent('onresize',onResizeTimer);}},Open:function(opener){arguments.callee.$.Open.call(this,opener);if(this.m_popupWindow!=null&&!this.m_popupWindow.closed){this.m_popupWindow.focus();return;}
var winHeight=this.GetHeight();var winWidth=this.GetWidth();if(winHeight==null){winHeight=this.m_minHeight;}
var openerWin=this.GetOpenerWindow();var sx=null
if(openerWin.screenX){sx=openerWin.screenX;}else if(openerWin.screenLeft){sx=openerWin.screenLeft;}
var sy=null;if(openerWin.screenY){sy=openerWin.screenY+80;}else if(openerWin.screenTop){sy=openerWin.screenTop;}
var left=((openerWin['UI'].GetWindowWidth()-winWidth)/2)+sx;var top=((openerWin['UI'].GetWindowHeight()-winHeight)/2)+sy;var winFeatures='top='+top+', left='+left+', height='+winHeight+', width='+winWidth+', directories=no, toolbar=no, status=no, resizable=yes, location=no, scrollbars=no';var winQueryString='?d2l_body_type='+D2L.UI.BodyType.Frame+'&d2l_nonModalDialog_cb='+this.m_name+'&d2l_nonModalDialog_cbwin='+UI.windowId;this.m_popupWindow=window.open('/d2l/common/dialogs/nonModal/blank.d2l'+winQueryString,'_blank',winFeatures);var me=this;if(this.m_popupWindow){setTimeout(function(){me.m_popupWindow.focus();});}},SetFooterText:function(footerText){this.m_footerText=D2L.LP.Text.IText.Normalize(footerText,'D2L.NonModalDialog','SetFooterText','footerText');if(this.m_resizeBar&&this.IsShown()){if(this.m_resizeBar.firstChild){D2L.Util.Purge(this.m_resizeBar.firstChild);this.m_resizeBar.removeChild(this.m_resizeBar.firstChild);}
this.m_resizeBar.appendChild(this.CreateTextNode(this.m_footerText));var me=this;this.m_footerText.GetText().Register(function(txt){me.m_resizeBar.style.display=(txt.length>0)?'block':'none';me.SetHeight(me.m_height);});}},SetHeight:function(height){this.m_ignoreResizeEvents=true;arguments.callee.$.SetHeight.call(this,height);var newHeight=this.GetHeight();if(this.IsShown()&&this.m_resizeWindowOnSetSize){try{var heightDiff=newHeight-this.GetWindow()['UI'].GetWindowHeight();this.GetWindow().resizeBy(0,heightDiff);}catch(ex){}}
this.m_ignoreResizeEvents=false;},SetTitle:function(title){arguments.callee.$.SetTitle.call(this,title);this.m_title=D2L.LP.Text.IText.Normalize(title,'D2L.NonModalDialog','SetTitle','title');var me=this;if(this.IsShown()){this.m_title.GetText().Register(function(val){if(me.IsShown()){me.GetWindow().document.title=val;}});}},SetWidth:function(width){this.m_ignoreResizeEvents=true;arguments.callee.$.SetWidth.call(this,width);var newWidth=this.GetWidth()
if(this.IsShown()){this.IDomNode.style.width='100%';if(this.m_resizeWindowOnSetSize){try{var widthDiff=newWidth-this.GetWindow()['UI'].GetWindowWidth();this.GetWindow().resizeBy(widthDiff,0);}catch(ex){}}}
this.m_ignoreResizeEvents=false;}});

D2L.ModalDialog=D2L.DialogBase.extend({Construct:function(name,callback){arguments.callee.$.Construct.call(this,name,callback);this.m_hasCloseIcon=true;this.m_left=0;this.m_titleNode=null;this.m_top=0;var win=window;while(win.parent!=win&&win.parent.UI){var frames=win.parent.document.getElementsByTagName('frame');if(frames&&frames.length>0){if(win.parent['UI'].GetBodyType()!=D2L.UI.BodyType.Dialog){break;}}
win=win.parent}
this.SetWindow(win);window[this.m_name]=this;},Dispose:function(){this.Close();window[this.m_name]=null;arguments.callee.$.Dispose.call(this);},BuildDom:function(){if(this.m_hasDomBeenBuilt){return;}
arguments.callee.$.BuildDom.call(this);this.IDomNode=this.CreateElement('div');this.IDomNode.className='ddial_o';this.IDomNode.style.zIndex=this.GetWindow()['UI'].GetZIndex();var inner=this.CreateElement('div');inner.className='ddial_i';var titleBar=this.BuildDom_TitleBar();this.BuildDom_Buttons();var resizeBar=this.BuildDom_Footer();this.IChildrenDomNode=this.CreateElement('div');this.IChildrenDomNode.className='ddial_c';if(this.m_src.length>0){this.BuildDom_Frame();}else{this.IChildrenDomNode.style.overflow='auto';this.IChildrenDomNode.style.margin='10px';}
var replace='';if(this.GetTitle()){replace=this.GetTitle();}
var topAnchorTitle=new D2L.LP.Text.LangTerm('Framework.Dialog.altJumpBottom',replace);var bottomAnchorTitle=new D2L.LP.Text.LangTerm('Framework.Dialog.altJumpTop',replace);this.m_focusAnchor1=this.CreateElement('a');this.m_focusAnchor1.href='javascript://';this.m_focusAnchor1.appendChild(this.CreateTextNode(' '));topAnchorTitle.AssignText(this.m_focusAnchor1,'title');this.m_focusAnchor1.style.outline='none';inner.appendChild(this.m_focusAnchor1);inner.appendChild(titleBar);inner.appendChild(this.IChildrenDomNode);inner.appendChild(this.m_buttonTable);this.m_focusAnchor3=this.CreateElement('a');this.m_focusAnchor3.tabIndex=-1;this.m_focusAnchor3.appendChild(this.CreateTextNode(' '));this.m_focusAnchor3.title=' ';this.m_focusAnchor3.style.outline='none';inner.appendChild(this.m_focusAnchor3);this.m_focusAnchor4=this.CreateElement('a');this.m_focusAnchor4.href='javascript://';this.m_focusAnchor4.appendChild(this.CreateTextNode(' '));bottomAnchorTitle.AssignText(this.m_focusAnchor4,'title');this.m_focusAnchor4.style.outline='none';inner.appendChild(this.m_focusAnchor4);this.IDomNode.appendChild(inner);this.IDomNode.appendChild(resizeBar);this.SetIcon(this.m_iconTerm);this.InstallEvents();},BuildDom_TitleBar:function(){var me=this;var titleBar=this.CreateElement('div');titleBar.className=(this.m_src.length===0)?'ddial_t ddial_tbg':'ddial_t d_grad_160 cDark';var table=this.CreateElement('table');table.width='100%';var row=table.insertRow(-1);var c1=this.CreateCell(row);c1.width='100%';c1.style.cursor='move';D2L.Control.Behaviour.Drag.Install(this,c1);this.m_focusAnchor2=this.CreateElement('a');this.m_focusAnchor2.tabIndex=-1;this.m_focusAnchor2.style.outline='none';c1.appendChild(this.m_focusAnchor2);this.m_titleNode=this.CreateElement('h1');this.m_focusAnchor2.appendChild(this.m_titleNode);this.m_titleNode.appendChild(this.CreateTextNode(this.m_title));var c2=this.CreateCell(row);c2.style.paddingLeft='0';c2.align='right';this.m_closeAnchor=this.CreateElement('a');this.m_closeAnchor.href='javascript://';this.m_closeAnchor.style.display=(this.HasCloseIcon())?'block':'none';D2L.LP.Text.LangTerm.AssignText('Framework.Dialog.altCloseDialog',this.m_closeAnchor,'title');var closeImg=this.CreateElement('img');D2L.LP.Text.LangTerm.AssignText('Framework.Dialog.altCloseDialog',closeImg,'alt');closeImg.style.cursor='hand';closeImg.style.cursor='pointer';closeImg.src='/d2l/img/LP/dialog/x.gif';closeImg.width=16;closeImg.height=16;this.m_closeAnchor.appendChild(closeImg);c2.appendChild(this.m_closeAnchor);titleBar.appendChild(table);return titleBar;},BuildDom_Footer:function(){var me=this;var resizeBar=this.GetUI().CreateElement('div');resizeBar.className='ddial_f';var span=this.GetUI().CreateElement('span');span.appendChild(this.CreateTextNode(this.m_footerText));resizeBar.appendChild(span);var resizeImg=this.GetUI().CreateElement('div');resizeImg.className='ddial_fr';D2L.LP.Text.LangTerm.AssignText('Framework.Dialog.altResizeDialog',resizeImg,'title');resizeBar.appendChild(resizeImg);D2L.Control.Behaviour.Resize.Install(this,resizeImg,this.m_minWidth,this.m_minHeight);var clear=new D2L.Control.ClearFloat();clear.AppendTo(resizeBar);return resizeBar;},InstallEvents:function(){var me=this;if(this.m_closeAnchor){this.AttachObject(this.m_closeAnchor,'onclick',function(){me.Close(new D2L.Dialog.Response(me.m_closeIconResponseType));D2L.Dialog.BC(me.m_name,me.m_closeIconResponseType);});}
if(this.m_focusAnchor1&&this.m_focusAnchor2&&this.m_focusAnchor3&&this.m_focusAnchor4){this.AttachObject(this.m_focusAnchor1,'onfocus',function(){me.m_focusAnchor3.focus();});this.AttachObject(this.m_focusAnchor4,'onfocus',function(){me.m_focusAnchor2.focus();});}},Close:function(){if(this.IsClosed()){return;}
this.Hide();var me=this;var placeFocus=function(){if(me.m_opener!==undefined&&me.m_opener!==null){try{if(me.m_opener.Focus!==undefined){me.m_opener.Focus();}else if(me.m_opener.focus!==undefined){me.m_opener.focus();}}catch(e){}
me.m_opener=undefined;}};if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){try{var IEinput=this.CreateElement('input');var body=UI.GetById('d2l_body');IEinput.style.position='absolute';IEinput.style.height='0px';IEinput.style.width='0px';IEinput.style.top=this.GetWindow()['UI'].GetScrollTop()+'px';IEinput.style.left=this.GetWindow()['UI'].GetScrollLeft()+'px';body.appendChild(IEinput);IEinput.focus();D2L.Util.Purge(IEinput);body.removeChild(IEinput);}catch(e){}}
var remove=function(){if(me.m_iframe){me.m_isLoaded=false;me.m_loading.style.display='block';}
D2L.Util.Purge(me.GetDomNode());me.Remove();me.m_hasDomBeenBuilt=false;setTimeout(placeFocus,100);};setTimeout(remove,0);},GetOpenerWindow:function(){return this.GetWindow();},GetPosX:function(){if(this.IDomNode){return FindPosX(this.IDomNode);}else{return 0;}},GetPosY:function(){if(this.IDomNode){return FindPosY(this.IDomNode);}else{return 0;}},HasCloseIcon:function(){return this.m_hasCloseIcon;},Hide:function(){this.GetDomNode().style.left='-2000px';this.GetDomNode().style.top='-2000px';this.m_isShown=false;this.GetWindow().UI.GetShimController().ClearShims(1);},IsResizable:function(){return true;},SetHasCloseIcon:function(hasCloseIcon){this.m_hasCloseIcon=hasCloseIcon;if(this.m_closeImg){this.m_closeImg.style.display=(hasCloseIcon)?'block':'none';}},SetIsResizable:function(isResizable){},SetPos:function(x,y){this.SetPosX(x);this.SetPosY(y);},SetPosX:function(x){if(this.IDomNode){this.IDomNode.style.left=x+'px';}
this.m_left=x;},SetPosY:function(y){if(this.IDomNode){this.IDomNode.style.top=y+'px';}
this.m_top=y;},SetFooterText:function(footerText){this.m_footerText=D2L.LP.Text.IText.Normalize(footerText,'D2L.ModalDialog','SetFooterText');if(this.m_footerTextNode){if(this.m_footerTextNode.firstChild){D2L.Util.Purge(this.m_footerTextNode.firstChild);this.m_footerTextNode.removeChild(this.m_footerTextNode.firstChild);}
this.m_footerTextNode.appendChild(this.CreateTextNode(this.m_footerText));this.SetHeight(this.m_height);}},SetTitle:function(title){arguments.callee.$.SetTitle.call(this,title);this.m_title=D2L.LP.Text.IText.Normalize(title,'D2L.ModalDialog','SetTitle','title');if(this.m_titleNode){if(this.m_titleNode.firstChild){D2L.Util.Purge(this.m_titleNode.firstChild);this.m_titleNode.removeChild(this.m_titleNode.firstChild);}
this.m_titleNode.appendChild(this.CreateTextNode(this.m_title));}},Show:function(){this.m_isShown=true;this.SetSize(this.m_width,this.m_height);var left=this.GetWindow()['UI'].GetScrollLeft()+((this.GetWindow()['UI'].GetWindowWidth()-this.IDomNode.offsetWidth)/2);var top=this.GetWindow()['UI'].GetScrollTop()+((this.GetWindow()['UI'].GetWindowHeight()-this.IDomNode.offsetHeight)/2);this.SetPos(left,top);this.GetWindow().UI.GetShimController().Shim(this);},Open:function(opener){arguments.callee.$.Open.call(this,opener);this.m_delayedReturn=new D2L.Util.DelayedReturn();this.BuildDom();var body=this.GetWindow()['UI'].GetById('d2l_body');this.AppendTo(body);this.SubmitToIFrame(body);this.Show();var me=this;if(!this.m_iframe){if(this.m_focusAnchor2){this.m_focusAnchor2.focus();}
this.OnOpen.Trigger();}else{setTimeout(function(){if(me.IsShown()&&!me.m_isLoaded){me.HandleOnload();}},20000);}
return this.m_delayedReturn;}});

D2L.Dialog=D2L.ModalDialog;if(Global.Preferences.UseNonModalDialogs){D2L.Dialog=D2L.NonModalDialog;}
D2L.Dialog.BC=function(dialogName,responseType,buttonType,param){var dialog=UI.GetByName(dialogName);var r=new D2L.Dialog.Response(dialog,responseType,param);if(dialog.m_srcWindow&&!dialog.m_srcWindow.closed&&dialog.m_srcCallbackName.length>0&&dialog.m_srcWindow[dialog.m_srcCallbackName]){dialog.m_srcWindow[dialog.m_srcCallbackName](r);}else{dialog.CallCallback(r);}};D2L.Dialog.GetParent=function(){return UI.GetParentDialog();};D2L.Dialog.GetParentDialog=function(){return UI.GetParentDialogDelayed();};

D2L.Dialog.Prompt=D2L.Dialog.extend({Construct:function(name,callback,primaryMessage,secondaryMessage,autoClose){arguments.callee.$.Construct.call(this,name,callback);if(autoClose===undefined){autoClose=true;}
if(autoClose){var me=this;this.OnOpen.RegisterMethod(function(){me.m_delayedReturn.Register(function(){me.Close();});});}
this.m_primaryMessage=null;this.m_primaryMessageNode=null;this.m_primaryMessageSpan=null;this.m_secondaryMessage=null;this.m_secondaryMessageNode=null;this.m_secondaryMessageSpan=null;this.m_closeOnEnter=true;this.SetPrimaryMessage(primaryMessage);this.SetSecondaryMessage(secondaryMessage);this.SetHasCloseIcon(false);},BuildDom:function(){if(!this.m_hasDomBeenBuilt){arguments.callee.$.BuildDom.call(this);var c2=this.CreateElement('div');this.m_primaryMessageSpan=this.CreateElement('p');this.m_primaryMessageSpan.style.marginTop='0';this.m_primaryMessageSpan.style.fontWeight='bold';this.SetPrimaryMessage(this.m_primaryMessage);c2.appendChild(this.m_primaryMessageSpan);this.m_secondaryMessageSpan=this.CreateElement('p');this.m_secondaryMessageSpan.style.marginBottom='0';this.SetSecondaryMessage(this.m_secondaryMessage);c2.appendChild(this.m_secondaryMessageSpan);this.AppendChild(c2);}},InstallEvents:function(){arguments.callee.$.InstallEvents.call(this);if(this.m_focusAnchor2&&this.m_positiveButton&&this.m_closeOnEnter){var me=this;var handleKey=0;this.AttachObject(this.m_focusAnchor2,'onfocus',function(){if(handleKey==0){handleKey=1;}});this.AttachObject(this.m_focusAnchor2,'onblur',function(){handleKey=2;});UI.GetWindowEventManager().InstallKpel(this.m_focusAnchor2,function(obj,keyPressEvent){if(me.IsShown()&&me.m_closeOnEnter&&handleKey==1&&(keyPressEvent.GetKey()==D2L.KeyPressEvent.Key.Enter||keyPressEvent.GetCharacter()==' ')){me.m_positiveButton.Click();}});}},SetCloseOnEnter:function(closeOnEnter){this.m_closeOnEnter=closeOnEnter;},SetSrc:function(src,callbackName){arguments.callee.$.SetSrc.call(this,src,callbackName);if(D2L.Debug.IsEnabled()){alert('You can not set the source of a Prompt Dialog');}},SetPositiveButtonText:function(text){if(!this.m_positiveButton){this.m_positiveButton=this.AddCustomButton(text,D2L.Dialog.ButtonPosition.Middle,D2L.Dialog.ResponseType.Positive);}
this.m_positiveButton.SetText(text);},SetPrimaryMessage:function(primaryMessage){this.m_primaryMessage=D2L.LP.Text.IText.Normalize(primaryMessage,'D2L.Dialog.Prompt','SetPrimaryMessage','primaryMessage');if(this.m_primaryMessageSpan){D2L.Util.Purge(this.m_primaryMessageSpan);this.m_primaryMessage.AssignHtml(this.m_primaryMessageSpan,'innerHTML');var me=this;this.m_primaryMessage.GetHtml().Register(function(val){me.m_primaryMessageSpan.style.display=(val.length>0)?'block':'none';});}},SetSecondaryMessage:function(secondaryMessage){this.m_secondaryMessage=D2L.LP.Text.IText.Normalize(secondaryMessage,'D2L.Dialog.Prompt','SetSecondaryMessage','secondaryMessage');if(this.m_secondaryMessageSpan){D2L.Util.Purge(this.m_secondaryMessageSpan);this.m_secondaryMessage.AssignHtml(this.m_secondaryMessageSpan,'innerHTML');var me=this;this.m_secondaryMessage.GetHtml().Register(function(val){me.m_secondaryMessageSpan.style.display=(val.length>0)?'block':'none';});}}});

D2L.Dialog.Confirm=D2L.Dialog.Prompt.extend({Construct:function(name,callback,primaryMessage,secondaryMessage){arguments.callee.$.Construct.call(this,name,callback,primaryMessage,secondaryMessage);var me=this;this.SetPositiveButtonText(new D2L.LP.Text.LangTerm('Standard.Buttons.btnYes'));this.m_closeIconResponseType=D2L.Dialog.ResponseType.Negative;this.m_negativeButton=this.AddCustomButton(new D2L.LP.Text.LangTerm('Standard.Buttons.btnNo'),D2L.Dialog.ButtonPosition.Middle,D2L.Dialog.ResponseType.Negative);this.SetIcon(new D2L.Images.ImageTerm('Shared.Dialog.infConfirm'));this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titConfirmation'));},SetNegativeButtonText:function(text){this.m_negativeButton.SetText(text);}});

D2L.Dialog.ButtonType=D2L.Control.Button.Type;D2L.Dialog.ButtonPosition={Left:0,Middle:1,Right:2};D2L.Dialog.ResponseType={Abort:0,Positive:1,Negative:2};

D2L.Dialog.EquationEditor=D2L.Dialog.extend({Construct:function(callback){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback);this.SetSize('690','455');this.SetSrc('/d2l/common/dialogs/equation/equationEditor.d2l','GetMath');this.AddButton(D2L.Control.Button.Type.Cancel);this.AddButton(D2L.Control.Button.Type.Insert);}});

D2L.Dialog.Error=D2L.Dialog.Prompt.extend({Construct:function(name,primaryMessage,secondaryMessage){arguments.callee.$.Construct.call(this,name,undefined,primaryMessage,secondaryMessage);this.m_closeIconResponseType=D2L.Dialog.ResponseType.Positive;this.SetPositiveButtonText(new D2L.LP.Text.LangTerm('Standard.Buttons.btnOk'));this.SetIcon(new D2L.Images.ImageTerm('Shared.Dialog.infError'));this.SetHasCloseIcon(false);this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titError'));}});

D2L.Dialog.Prompt.ImageTextAlternative=D2L.Dialog.Prompt.extend({Construct:function(callback){var me=this;var ourCallback=function(response){if(me.m_input.value==''&&!me.m_decorativeInput.checked&&response.GetType()!=D2L.Dialog.ResponseType.Abort){me.GetWindow().UI.Error(new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.errPrimarySpecifyTextAlternative'),new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.errSecondarySpecifyTextAlternative'));}else{me.SetCallback(callback);me.CallCallback(response);}}
arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),ourCallback,new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.hdrTextAlternative'),new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.lblTextAlternativeDescription'),false);this.m_input=null;this.m_decorativeInput=null;this.SetPositiveButtonText(new D2L.LP.Text.LangTerm('Standard.Buttons.btnOk'));this.SetIcon(new D2L.Images.ImageTerm('Shared.Dialog.infInfo'));this.SetHasCloseIcon(false);this.SetTitle(new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.titProvideTextAlternative'));this.SetWidth(450);},BuildDom:function(){arguments.callee.$.BuildDom.call(this);var forId=this.GetWindow().UI.GetUniqueHtmlId();var label=this.CreateElement('label');label.htmlFor=forId;label.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.lblTextAlternative')));label.appendChild(this.CreateTextNode(' '));this.m_input=this.CreateElement('input');this.m_input.type='text';this.m_input.id=forId;this.m_input.className='d_edt';this.m_input.maxLength=80;this.m_input.style.width='50%';var decorativeForId=this.GetWindow().UI.GetUniqueHtmlId();var decorativeLabel=this.CreateElement('label');decorativeLabel.htmlFor=decorativeForId;decorativeLabel.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Framework.HtmlEditor2.lblImageDecorative')));this.m_decorativeInput=this.CreateElement('input');this.m_decorativeInput.type='checkbox';this.m_decorativeInput.id=decorativeForId;this.m_decorativeInput.className='d_chb';var me=this;var decorativeInputOnClick=function(){if(me.m_decorativeInput.checked){me.m_input.disabled=true;me.m_input.className='d_edt';}else{me.m_input.disabled=false;me.m_input.className='d_edt';}
return true;};this.AttachObject(this.m_decorativeInput,'onclick',decorativeInputOnClick);this.AppendChild(this.CreateElement('br'));this.AppendChild(label);this.AppendChild(this.m_input);this.AppendChild(this.CreateElement('br'));this.AppendChild(this.m_decorativeInput);this.AppendChild(this.CreateTextNode('&nbsp;'));this.AppendChild(decorativeLabel);},GetTextAlternative:function(){if(this.m_input){return this.m_input.value;}else{return'';}},IsDecorative:function(){if(this.m_decorativeInput){return this.m_decorativeInput.checked;}else{return false;}}});

D2L.Dialog.Info=D2L.Dialog.Prompt.extend({Construct:function(name,primaryMessage,secondaryMessage){arguments.callee.$.Construct.call(this,name,undefined,primaryMessage,secondaryMessage);this.m_closeIconResponseType=D2L.Dialog.ResponseType.Positive;this.SetPositiveButtonText(new D2L.LP.Text.LangTerm('Standard.Buttons.btnOk'));this.SetIcon(new D2L.Images.ImageTerm('Shared.Dialog.infInfo'));this.SetHasCloseIcon(false);this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titInformation'));}});

D2L.Dialog.Prompt.Input=D2L.Dialog.Prompt.extend({Construct:function(callback,primaryMessage,secondaryMessage,fieldName){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback,primaryMessage,secondaryMessage);this.m_fieldName=fieldName;this.SetPositiveButtonText(new D2L.LP.Text.LangTerm('Standard.Buttons.btnOk'));this.AddCustomButton(new D2L.LP.Text.LangTerm('Standard.Buttons.btnCancel'),D2L.Dialog.ButtonPosition.Middle,D2L.Dialog.ResponseType.Abort);this.SetIcon(new D2L.Images.ImageTerm('Shared.Dialog.infInfo'));this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titInputRequested'));},BuildDom:function(){arguments.callee.$.BuildDom.call(this);var forId=this.GetWindow().UI.GetUniqueHtmlId();var table=this.CreateElement('table');table.align='center';var tr=table.insertRow(-1);var td=tr.insertCell(-1);td.style.padding='3px';var label=this.CreateElement('label');label.htmlFor=forId;label.appendChild(this.CreateTextNode(this.m_fieldName));label.appendChild(this.CreateTextNode(':'));td.appendChild(label);td=tr.insertCell(-1);td.style.padding='3px';this.m_input=this.CreateElement('input');this.m_input.type='text';this.m_input.id=forId;this.m_input.className='d_edt';td.appendChild(this.m_input);this.AppendChild(table);},GetInputValue:function(){if(this.m_input){return this.m_input.value;}else{return'';}}});

D2L.Dialog.Native={};D2L.Dialog.Native.Prompt=D2L.DialogBase.extend({Construct:function(name,callback,primaryMessage,secondaryMessage){arguments.callee.$.Construct.call(this,name,callback);var win=window;while(win.parent!=win&&win.parent.UI){var frames=win.parent.document.getElementsByTagName('frame');if(frames&&frames.length>0){break;}
win=win.parent}
this.m_openerWindow=win;this.m_primaryMessage=null;this.m_secondaryMessage=null;this.SetPrimaryMessage(primaryMessage);this.SetSecondaryMessage(secondaryMessage);window[this.m_name]=this;},AddButton:function(type,responseParam,name){return null;},AddCustomButton:function(text,position,responseType,responseParam,id){return null;},CallCallback:function(response){if(this.IsClosed()&&response!=null&&response.GetType()!=D2L.Dialog.ResponseType.Abort){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Calling CallCallback on a closed '+'dialog can cause unexpected errors in IE. Please make sure '+'you are closing the dialog inside your outer callback '+'function instead of SrcCallback.'),true);}
var cb=this.GetCallback();var ret=response;if(cb){var cbRet=cb.apply(cb,[response].concat(this.m_callbackArguments));if(cbRet!==undefined){ret=cbRet;}}
if(this.m_delayedReturn){this.m_delayedReturn.Trigger(ret);}},Close:function(){},GetButton:function(id){var b=new D2L.Control.Button(new D2L.LP.Text.PlainText(' '));return b;},GetCallback:function(){return this.m_callback;},GetContentHeight:function(){return 0;},GetHeight:function(){return 0;},GetWidth:function(){return 0;},GetFooterText:function(){var f=new D2L.LP.Text.PlainText('');return f;},GetOpenerWindow:function(){return this.m_openerWindow;},GetPositiveButton:function(){var b=new D2L.Control.Button(new D2L.LP.Text.PlainText(' '));return b;},GetTitle:function(){var t=new D2L.LP.Text.PlainText('');return t;},HasCloseIcon:function(hasCloseIcon){return true;},Hide:function(){},IsClosed:function(){return!this.IsShown();},IsResizable:function(){return false;},IsShown:function(){return this.m_isShown;},Open:function(){},RemoveButton:function(button){},SetCallback:function(callback){this.m_callback=null;this.m_callbackArguments=[];if(callback&&callback.apply){this.m_callback=callback;for(var i=1;i<arguments.length;i++){this.m_callbackArguments.push(arguments[i]);}}},SetCloseOnEnter:function(closeOnEnter){},SetFooterText:function(footerText){},SetHasCloseIcon:function(hasCloseIcon){},SetHeight:function(height){},SetIcon:function(imageTerm){},SetIsResizable:function(isResizable){},SetPositiveButtonText:function(text){},SetPrimaryMessage:function(primaryMessage){this.m_primaryMessage=D2L.LP.Text.IText.Normalize(primaryMessage,'D2L.Dialog.Native.Prompt','SetPrimaryMessage','primaryMessage');},SetSecondaryMessage:function(secondaryMessage){this.m_secondaryMessage=D2L.LP.Text.IText.Normalize(secondaryMessage,'D2L.Dialog.Native.Prompt','SetSecondaryMessage','secondaryMessage');},SetSize:function(width,height){},SetSrc:function(src,callbackName){if(D2L.Debug.IsEnabled()){alert('You can not set the source of a Prompt Dialog');}},SetSrcParam:function(name,value){},SetTitle:function(title){},SetWidth:function(width){}});D2L.Dialog.Native.Alert=D2L.Dialog.Native.Prompt.extend({Construct:function(name,primaryMessage,secondaryMessage){arguments.callee.$.Construct.call(this,name,undefined,primaryMessage,secondaryMessage);this.m_closeIconResponseType=D2L.Dialog.ResponseType.Positive;},Open:function(){var me=this;this.m_isShown=true;this.m_primaryMessage.GetHtml().Register(function(primaryMessage){me.m_secondaryMessage.GetHtml().Register(function(secondaryMessage){var win=me.GetOpenerWindow();if(win){win.alert(primaryMessage+'\n\n'+secondaryMessage);var response=new D2L.Dialog.Response(me,D2L.Dialog.ResponseType.Positive);me.CallCallback(response);}
me.m_isShown=false;});});}});D2L.Dialog.Native.Error=D2L.Dialog.Native.Alert;D2L.Dialog.Native.Info=D2L.Dialog.Native.Alert;D2L.Dialog.Native.Warning=D2L.Dialog.Native.Alert;D2L.Dialog.Native.Confirm=D2L.Dialog.Native.Prompt.extend({Construct:function(name,callback,primaryMessage,secondaryMessage){arguments.callee.$.Construct.call(this,name,callback,primaryMessage,secondaryMessage);this.m_closeIconResponseType=D2L.Dialog.ResponseType.Negative;},Open:function(){var me=this;this.m_isShown=true;this.m_primaryMessage.GetHtml().Register(function(primaryMessage){me.m_secondaryMessage.GetHtml().Register(function(secondaryMessage){var win=me.GetOpenerWindow();if(win){var response=null;var ret=win.confirm(primaryMessage+'\n\n'+secondaryMessage);if(ret){response=new D2L.Dialog.Response(me,D2L.Dialog.ResponseType.Positive);}else{response=new D2L.Dialog.Response(me,D2L.Dialog.ResponseType.Negative);}
me.CallCallback(response);}
me.m_isShown=false;});});},SetNegativeButtonText:function(text){}});if(Global.Preferences.UseNonModalDialogs){D2L.Dialog.Error=D2L.Dialog.Native.Error;D2L.Dialog.Info=D2L.Dialog.Native.Info;D2L.Dialog.Warning=D2L.Dialog.Native.Warning;D2L.Dialog.Confirm=D2L.Dialog.Native.Confirm;}

D2L.Dialog.OrgUnitSelector=D2L.Dialog.extend({Construct:function(callback){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback)
this.SetTitle(new D2L.LP.Text.LangTerm('Framework.OrgUnitSelector.btnAddOrgUnits'));this.SetSize('650px','450px');this.SetSrc('/d2l/common/dialogs/orgUnitSelector/orgUnitSelector.d2l','SrcCallback');this.SetSrcParam('d','1');this.AddButton(D2L.Control.Button.Type.Cancel);var b=this.AddCustomButton(new D2L.LP.Text.LangTerm('Standard.Buttons.btnInsert'),D2L.Dialog.ButtonPosition.Right,D2L.Dialog.ResponseType.Positive);b.SetIsEnabled(false);this.SetAllowMultiple(true);this.SetDescendantOptions(D2L.OrgUnitSelector.DescendantOptions.UserChoice);this.SetOrgUnitOptions(D2L.OrgUnitSelector.OrgUnitOptions.DescendantsOnly);},SetAllowMultiple:function(allowMultiple){this.SetSrcParam('am',allowMultiple);if(!allowMultiple){this.SetTitle(new D2L.LP.Text.LangTerm('Framework.OrgUnitSelector.btnAddOrgUnit'));}else{this.SetTitle(new D2L.LP.Text.LangTerm('Framework.OrgUnitSelector.btnAddOrgUnits'));}},SetDescendantOptions:function(descendantOptions){this.SetSrcParam('dopts',descendantOptions);},SetOrgUnitOptions:function(orgUnitOptions){this.SetSrcParam('ouopts',orgUnitOptions);},SetDataSplit:function(ds){this.SetSrcParam('ds',ds);}});

D2L.Dialog.Processing=D2L.Dialog.extend({Construct:function(message){var callback=function(r){r.GetDialog().Close();};arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback);this.m_divProcessing=null;this.m_message=null;this.m_processBarVisibility=true;this.SetMessage(message);this.SetHeight('140px');this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titProcessing'));this.SetHasCloseIcon(false);},BuildDom:function(){arguments.callee.$.BuildDom.call(this);this.m_divMessage=this.CreateElement('div');this.m_divMessage.appendChild(this.CreateTextNode(''));this.AppendChild(this.m_divMessage);this.m_divProcessing=this.CreateElement('div');this.m_divProcessing.style.padding='1em';this.m_divProcessing.style.textAlign='center';this.m_divProcessing.style.display=(this.m_processBarVisibility)?'block':'none';var imgProcessing=new D2L.Control.Image();imgProcessing.SetImage(new D2L.Images.ImageTerm('Framework.Dialog.imgProcessing'));imgProcessing.AppendTo(this.m_divProcessing);this.AppendChild(this.m_divProcessing);this.SetMessage(this.m_message);},SetMessage:function(message){this.m_message=D2L.LP.Text.IText.Normalize(message,'D2L.Dialog.Processing','SetMessage','message');if(this.m_divMessage){this.m_message.AssignText(this.m_divMessage.firstChild,'data');}},SetProcessBarVisibility:function(isVisible){this.m_processBarVisibility=isVisible;if(this.m_divProcessing){this.m_divProcessing.style.display=(isVisible)?'block':'none';}}});

D2L.Dialog.ProgressBar=D2L.Dialog.extend({Construct:function(progressBar){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId());this.m_progressBar=progressBar;this.m_message=new D2L.LP.Text.PlainText('');this.m_domMessage=null;this.SetHasCloseIcon(false);this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titProcessing'));},BuildDom:function(){if(!this.m_hasDomBeenBuilt){arguments.callee.$.BuildDom.call(this);this.m_domMessage=this.CreateElement('p');this.m_domMessage.style.marginTop='0';this.AppendChild(this.m_domMessage);this.AppendChild(this.m_progressBar);this.Render_Message();}},GetProgressBar:function(){return this.m_progressBar;},SetMessage:function(message){this.m_message=D2L.LP.Text.IText.Normalize(message,'D2L.Dialog.ProgressBar','SetMessage','message');this.Render_Message();},Render_Message:function(){if(this.m_domMessage!==null){var me=this;this.m_message.GetText().Register(function(text){if(text.length>0){D2L.Util.Purge(me.m_domMessage);me.m_domMessage.innerHTML=D2L.Util.Html.Encode(text);me.m_domMessage.style.display='block';}else{me.m_domMessage.style.display='none';}});}}});

D2L.Dialog.QuickLink=D2L.Dialog.extend({Construct:function(callback,hasLinkOptions){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback);this.SetSize(525,400);this.SetSrc('/d2l/common/dialogs/quickLink/insertQuickLink.d2l','SrcCallback');if(hasLinkOptions){this.SetSrcParam('hasLinkOptions','1');}
this.AddButton(D2L.Control.Button.Type.Cancel);this.AddButton(D2L.Control.Button.Type.Insert);}});

D2L.Dialog.Response=D2L.Class.extend({Construct:function(dialog,type,param){arguments.callee.$.Construct.call(this);if(param===undefined){param='';}
this.m_type=type;this.m_param=param;this.m_dialog=dialog;this.m_data=[];},CallCallback:function(){this.GetDialog().CallCallback(this);},GetData:function(key){if(this.m_data[key]!==undefined){var Copy=function(val){var ret=val;if(isArray(val)){ret=[];for(var i=0;i<val.length;i++){ret.push(Copy(val[i]));}}else if(val!==undefined&&val!==null&&val.Serialize!==undefined&&val.Deserialize!==undefined&&val.ClassName!==undefined){ret=D2L.Serialization.JsonDeserializer.Deserialize(D2L.Serialization.JsonSerializer.Serialize(val));}
return ret;};return Copy(this.m_data[key]);}else{return null;}},GetDialog:function(){return this.m_dialog;},GetType:function(){return this.m_type;},GetParam:function(){return this.m_param;},SetData:function(key,value){this.m_data[key]=value;}});

D2L.Dialog.SaveConfirmation=D2L.Dialog.Prompt.extend({Construct:function(callback,primaryMessage,secondaryMessage){if(primaryMessage===undefined){primaryMessage=new D2L.LP.Text.LangTerm('Framework.Dialog.lblSaveConfirmationPrimary');}
if(secondaryMessage===undefined){secondaryMessage=new D2L.LP.Text.LangTerm('Framework.Dialog.lblSaveConfirmationSecondary');}
arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback,primaryMessage,secondaryMessage);this.SetPositiveButtonText(new D2L.LP.Text.LangTerm('Standard.Buttons.btnSave'));this.m_dontSaveButton=this.AddCustomButton(new D2L.LP.Text.LangTerm('Standard.Buttons.btnDontSave'),D2L.Dialog.ButtonPosition.Middle,D2L.Dialog.ResponseType.Negative);this.m_cancelButton=this.AddCustomButton(new D2L.LP.Text.LangTerm('Standard.Buttons.btnCancel'),D2L.Dialog.ButtonPosition.Middle,D2L.Dialog.ResponseType.Abort);this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titSaveChanges'));this.SetIcon(new D2L.Images.ImageTerm('Shared.Dialog.infSave'));this.SetCloseOnEnter(false);},GetSaveButton:function(){return this.m_positiveButton;},GetDontSaveButton:function(){return this.m_dontSaveButton;},GetCancelButton:function(){return this.m_cancelButton;}});

D2L.Dialog.SelectFile=D2L.Dialog.extend({Construct:function(callback){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback);this.m_areaFilters=['MyComputer','OuFiles'];this.m_selectedArea='';this.m_selectedAreaParam='';this.m_allowMultiple=true;this.m_askForImageDesc=false;this.m_forceSaveToCourseFiles=false;this.m_allowSaveToCourseFiles=false;this.m_uploadInlineHelpLangTerm='';this.m_maxFileSize=0;this.AddButton(D2L.Control.Button.Type.Cancel);this.SetSrc('/d2l/common/dialogs/file/main.d2l','DialogCallback');this.SetSize(600,420);var me=this;this.OnResize.RegisterMethod(function(width,height){me.CallSrcMethod('HandleResize',height);});},AddAreaFilter:function(area){area=area.toLowerCase();var found=false;for(var i=0;i<this.m_areaFilters.length;i++){if(this.m_areaFilters[i]==area){found=true;break;}}
if(!found){this.m_areaFilters.push(area);}},Close:function(){this.SetFooterText(new D2L.LP.Text.PlainText(''));if(this.m_positiveButton!==null){this.RemoveButton(this.m_positiveButton);this.m_positiveButton=null;}
arguments.callee.$.Close.call(this);},Open:function(opener){this.SetSrcParam('am',(this.m_allowMultiple?'1':'0'));this.SetSrcParam('fsc',(this.m_forceSaveToCourseFiles?'1':'0'));this.SetSrcParam('asc',(this.m_allowSaveToCourseFiles?'1':'0'));this.SetSrcParam('mfs',this.m_maxFileSize);this.SetSrcParam('afid',this.m_askForImageDesc);this.SetSrcParam('uih',this.m_uploadInlineHelpLangTerm);if(this.m_selectedArea.length>0){this.SetSrcParam('area',this.m_selectedArea);if(this.m_selectedAreaParam.length>0){this.SetSrcParam('sap',this.m_selectedAreaParam);}}
var paramVal='';var comma='';for(var i=0;i<this.m_areaFilters.length;i++){paramVal+=comma+this.m_areaFilters[i];comma=',';}
this.SetSrcParam('af',paramVal);return arguments.callee.$.Open.call(this,opener);},RemoveAreaFilter:function(area){area=area.toLowerCase();for(var i=0;i<this.m_areaFilters.length;i++){if(this.m_areaFilters[i]==area){this.m_areaFilters=this.m_areaFilters.splice(i);break;}}
if(area==this.m_selectedArea){this.m_selectedArea='';}},SetAllowMultiple:function(allowMultiple){this.m_allowMultiple=allowMultiple;},SetAreaFilters:function(areaFilters){this.m_areaFilters=areaFilters;},SetAskForImageDescription:function(askForImageDescription){this.m_askForImageDesc=askForImageDescription;},SetMaxFileSize:function(maxFileSize){this.m_maxFileSize=maxFileSize;},SetForceSaveToCourseFiles:function(bool){this.m_forceSaveToCourseFiles=bool;},SetAllowSaveToCourseFiles:function(bool){this.m_allowSaveToCourseFiles=bool;},SetUploadInlineHelpLangTerm:function(langTerm){this.m_uploadInlineHelpLangTerm=langTerm;},SetSelectedArea:function(selectedArea,param){if(selectedArea.length>0){this.AddAreaFilter(selectedArea);}
this.m_selectedArea=selectedArea;if(param!==undefined){this.m_selectedAreaParam=param;}},SetFileFilters:function(filters){if(!isArray(filters)){filters=[filters];}
var paramVal='';var comma='';for(var i=0;i<filters.length;i++){paramVal+=comma+filters[i];comma=',';}
this.SetSrcParam('f',paramVal);}});

D2L.Dialog.SelectPath=D2L.Dialog.extend({Construct:function(callback){arguments.callee.$.Construct.call(this,UI.GetUniqueHtmlId(),callback);this.m_allowSharedFilesPaths=true;this.m_initialPath='';this.m_restrictToCurrentOrgUnit=true;this.AddButton(D2L.Control.Button.Type.Cancel);this.AddCustomButton(new D2L.LP.Text.LangTerm('FrameworkWebPages.SelectPathDialog.titSelectPath'),D2L.Dialog.ButtonPosition.Right,D2L.Dialog.ResponseType.Positive);this.SetSize(400,400);this.SetTitle(new D2L.LP.Text.LangTerm('FrameworkWebPages.SelectPathDialog.titSelectPath'));this.SetFooterText(new D2L.LP.Text.LangTerm('FrameworkWebPages.SelectPathDialog.lblPleaseSelectPath'));this.SetSrc('/d2l/common/dialogs/selectPath/selectPath.d2l','SrcCallback');this.SetAllowSharedFilesPaths(true);this.SetRestrctToCurrentOrgUnit(true);},SetAllowSharedFilesPaths:function(allowSharedFilesPaths){this.m_allowSharedFilesPaths=allowSharedFilesPaths;this.SetSrcParam('asfp',(allowSharedFilesPaths?'1':'0'));},SetInitialPath:function(initialPath){this.m_initialPath=initialPath;this.SetSrcParam('initialPath',this.m_initialPath);},SetInstructions:function(instructions){this.m_instructions=instructions;this.SetSrcParam('instructions',this.m_instructions);},SetRestrctToCurrentOrgUnit:function(restrictToCurrentOrgUnit){this.m_restrictToCurrentOrgUnit=restrictToCurrentOrgUnit;this.SetSrcParam('r',(this.m_restrictToCurrentOrgUnit?'1':'0'));}});

D2L.Dialog.Warning=D2L.Dialog.Prompt.extend({Construct:function(name,primaryMessage,secondaryMessage){arguments.callee.$.Construct.call(this,name,undefined,primaryMessage,secondaryMessage);this.m_closeIconResponseType=D2L.Dialog.ResponseType.Positive;this.SetPositiveButtonText(new D2L.LP.Text.LangTerm('Standard.Buttons.btnOk'));this.SetIcon(new D2L.Images.ImageTerm('Shared.Dialog.infWarning'));this.SetHasCloseIcon(false);this.SetTitle(new D2L.LP.Text.LangTerm('Framework.Dialog.titWarning'));}});

D2L.Control.EditInPlace=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_cancelEvent=new D2L.EventHandler();this.m_editorType=D2L.Control.EditInPlace.EditorTypes.Edit;this.m_finishEvent=new D2L.EventHandler();this.m_isEdit=false;this.m_isManual=false;this.m_originalValue='';this.m_renderer=null;this.m_validationSubject='';this.m_validationValue='';this.m_validator=null;this.m_valueCallback=function(){return new D2L.LP.Text.PlainText();};},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('div'));this.IChildrenDomNode=this.GetUI().CreateElement('div');domNode.appendChild(this.IChildrenDomNode);},Cancel:function(){this.SetIsEdit(false);this.CancelEvent().Trigger();},CancelEvent:function(){return this.m_cancelEvent;},Finish:function(value){var me=this;if(value==this.m_originalValue){this.Cancel();return;}
var DoFinish=function(pass){me.m_validationValue='';if(pass){me.SetIsEdit(false);me.m_originalValue=value;me.FinishEvent().Trigger(value);}else{var failureText=me.m_validator.GetFailureText();if(me.m_validationSubject!==null){failureText.SetSubject(me.m_validationSubject);}
me.GetRenderer().ShowValidationMessage(failureText);me.GetRenderer().Focus();}};if(this.m_validator!==null){this.m_validationValue=value;var result=this.m_validator.ValidateObject(this);if(D2L.Util.IsDelayedReturn(result)){result.Register(function(pass){DoFinish(pass);});}else{DoFinish(result);}}else{DoFinish(true);}},GetEditorType:function(){return this.m_editorType;},GetRenderer:function(){if(this.m_renderer===null){if(this.m_editorType==D2L.Control.EditInPlace.EditorTypes.Edit){this.m_renderer=new D2L.Control.EditInPlace.EditRenderer(this);}
var me=this;this.m_renderer.CancelEvent().RegisterMethod(function(){me.Cancel();});this.m_renderer.FinishEvent().RegisterMethod(function(value){me.Finish(value);});this.m_renderer.AppendTo(this.GetDomNode());}
return this.m_renderer;},GetValue:function(){return new D2L.Util.DelayedReturn(this.GetValueNoDelay());},GetValueNoDelay:function(){return this.GetValidationValue();},GetOriginalValue:function(){return this.m_originalValue;},GetValidationValue:function(){return this.m_validationValue;},HasValue:function(){return new D2L.Util.DelayedReturn(this.HasValueNoDelay());},HasValueNoDelay:function(){return this.m_validationValue.length>0;},IsManual:function(){return this.m_isManual;},FinishEvent:function(){return this.m_finishEvent;},SetEditorType:function(editorType){this.m_editorType=editorType;},SetIsEdit:function(isEdit,doSelectExisting){if(isEdit==this.m_isEdit){return;}
if(doSelectExisting===undefined){doSelectExisting=false;}
this.m_isEdit=isEdit;if(isEdit){var childrenDom=this.ChildrenDomNode();var width=childrenDom.offsetWidth-4;childrenDom.style.display='none';var renderer=this.GetRenderer();if(this.IsManual()){renderer.SetSize(width);}
var me=this;var val=this.m_valueCallback.call(this.m_valueCallback);val.GetText().Register(function(txtVal){me.m_originalValue=txtVal;});renderer.SetValue(val);renderer.SetIsDisplayed(true);renderer.Focus(doSelectExisting);}else{this.GetRenderer().SetIsDisplayed(false);this.ChildrenDomNode().style.display='block';}},SetIsManual:function(isManual){this.m_isManual=isManual;},SetValidator:function(validator,validationSubject){if(validationSubject!==undefined&&validationSubject!==null){this.m_validationSubject=validationSubject;}
this.m_validator=validator;},SetValueCallback:function(valueCallback){if(valueCallback!==undefined&&valueCallback!==null){this.m_valueCallback=valueCallback;}else{this.m_valueCallback=function(){return new D2L.LP.Text.PlainText();};}}});D2L.Control.EditInPlace.EditorTypes={Edit:1};

D2L.Control.EditInPlace.EditRenderer=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_cancelEvent=new D2L.EventHandler();this.m_edit=new D2L.Control.Edit();this.m_finishEvent=new D2L.EventHandler();this.m_isDisplayed=false;this.m_errorMessage=null;},CancelEvent:function(){return this.m_cancelEvent;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var me=this;var domNode=this.SetDomNode(this.GetUI().CreateElement('div'));domNode.className='deip'
this.AttachObject(domNode,'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);});var finish=function(){if(me.m_isDisplayed){me.FinishEvent().Trigger(me.m_edit.GetTextAsString().trim());}};this.m_edit.KeyPressEvent().RegisterMethod(function(kpe){if(kpe.GetKey()==D2L.KeyPressEvent.Key.Enter){finish();return false;}else if(kpe.GetKey()==D2L.KeyPressEvent.Key.Escape){me.CancelEvent().Trigger();}else{me.RemoveError();}});this.m_edit.AppendTo(domNode);domNode.appendChild(this.GetUI().CreateElement('br'));var save=new D2L.Control.Button();save.SetText(D2L.Control.Button.GetTermForType(D2L.Control.Button.Type.Save));save.SetOnClick(function(){finish();});save.SetFloat(D2L.Style.Float.Left);save.AppendTo(domNode);var cancel=new D2L.Control.Button();cancel.SetText(D2L.Control.Button.GetTermForType(D2L.Control.Button.Type.Cancel));cancel.SetOnClick(function(){me.CancelEvent().Trigger();});cancel.SetFloat(D2L.Style.Float.Left);cancel.AppendTo(domNode);this.m_errorMessage=new D2L.Control.TextBlock();this.m_errorMessage.SetIsDisplayed(false);this.m_errorMessage.SetFloat(D2L.Style.Float.Right);this.m_errorMessage.AppendTo(domNode);var clear=new D2L.Control.ClearFloat();clear.AppendTo(domNode);},FinishEvent:function(){return this.m_finishEvent;},Focus:function(doSelectExisting){var me=this;setTimeout(function(){me.m_edit.Focus();if(doSelectExisting){me.m_edit.Select();}
me.GetUI().GetMessageArea().AddAriaMessage(new D2L.LP.Text.LangTerm('Framework.EditInPlace.altInstructions'));});},RemoveError:function(){this.GetDomNode().className='deip';this.m_errorMessage.SetIsDisplayed(false);},SetIsDisplayed:function(isDisplayed){this.RemoveError();this.m_isDisplayed=isDisplayed;this.GetDomNode().style.display=isDisplayed?'block':'none';},SetSize:function(width){this.m_edit.SetWidth(width);},SetValue:function(value){this.m_edit.SetText(value);},ShowValidationMessage:function(message){this.GetDomNode().className='deip deip_err';this.m_errorMessage.SetText(message);this.m_errorMessage.SetIsDisplayed(true);}});

D2L.Control.EmptyText=D2L.Control.extend({Construct:function(text){arguments.callee.$.Construct.call(this);if(text===undefined){text=new D2L.LP.Text.PlainText();}
this.m_text=text;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('div'));domNode.className='det';this.RenderText();},GetText:function(){return this.m_text;},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this,deserializer);this.m_float=deserializer.GetMember('Float',D2L.Style.Float.None);this.m_isDisplayed=deserializer.GetMember('IsDisplayed',true);this.m_isInline=deserializer.GetMember('IsInline',true);this.m_text=new D2L.LP.Text.PlainText(deserializer.GetMember('Text'));},RenderText:function(){if(this.IsRendered()){this.GetText().AssignHtml(this.GetDomNode(),'innerHTML');}},SetText:function(text){this.m_text=text;this.RenderText();}});

D2L.Control.Image=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Image);this.m_text=null;this.m_isEnabled=true;this.m_isDisplayed=true;this.m_onClick=null;this.m_textNode=null;this.m_hasDefaultPadding=true;this.m_img=null;this.m_imgDisabled=null;this.m_imgNode=null;this.m_alt=null;this.m_anchorNode=null;this.m_childSpan=null;this.m_navInfo=null;this.OnMouseOver=new D2L.EventHandler();this.OnMouseOut=new D2L.EventHandler();},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('span'));this.m_imgNode=this.CreateElement('img');if(this.HasDefaultPadding()){this.m_imgNode.className='di_i';}else{this.m_imgNode.className='di_in';}
this.m_imgNode.alt='';if((!this.m_img&&this.m_isEnabled)||(!this.m_imgDisabled&&!this.m_isEnabled)){this.m_imgNode.style.display='none';}
this.GetDomNode().insertBefore(this.m_imgNode,null);this.SetText(this.m_text);this.SetAlt(this.m_alt);this.SetIsEnabled(this.m_isEnabled);this.SetIsDisplayed(this.m_isDisplayed);this.SetNav(this.m_navInfo);var me=this;D2L.Control.Image.InstallEvents(this.GetDomNode(),function(){return me;});}},BuildAnchorNode:function(){if(!this.m_anchorNode&&this.m_imgNode){var anchor=this.CreateElement('a');if(!this.IsDisplayed()){anchor.style.display='none';}else{anchor.style.display='inline';}
if(this.m_isEnabled){anchor.className='di_l';}else{anchor.className='di_l di_l_d';}
if(this.m_imgNode){this.m_anchorNode=this.m_imgNode.parentNode.insertBefore(anchor,this.m_imgNode);if(this.GetDomNode()==this.m_imgNode){this.SetDomNode(this.m_anchorNode);}}
if(this.m_imgNode){this.m_anchorNode.parentNode.removeChild(this.m_imgNode);this.m_anchorNode.insertBefore(this.m_imgNode,null);}
if(this.m_textNode){this.m_anchorNode.parentNode.removeChild(this.m_textNode);this.m_anchorNode.insertBefore(this.m_textNode,null);}
if(this.m_childSpan){this.m_anchorNode.parentNode.removeChild(this.m_childSpan);this.m_anchorNode.insertBefore(this.m_childSpan,null);}}},BuildTextNode:function(){if(!this.m_textNode&&this.m_imgNode){var textSpan=this.CreateElement('span');if(!this.IsDisplayed()){textSpan.style.display='none';}else{textSpan.style.display='inline';}
if(this.m_isEnabled){textSpan.className='di_t';}else{textSpan.className='di_t di_t_d';}
this.m_textNode=this.m_imgNode.parentNode.insertBefore(textSpan,this.m_imgNode.nextSibling);}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_img=deserializer.GetObjectMin(D2L.Images.Image);this.m_imgDisabled=deserializer.GetObjectMin(D2L.Images.Image);this.m_isDisplayed=deserializer.GetBoolean();var hasChildren=deserializer.GetBoolean();var hasText=deserializer.GetBoolean();this.m_isEnabled=deserializer.GetBoolean();this.m_href=deserializer.GetMember();this.m_imgNode=this.GetDomNode();if(this.m_href.length>0){this.m_anchorNode=this.m_imgNode.parentNode;}
if(hasText){this.m_textNode=this.m_imgNode.nextSibling;if(this.m_textNode.textContent){this.m_text=new D2L.LP.Text.PlainText(this.m_textNode.textContent);}else{this.m_text=new D2L.LP.Text.PlainText(this.m_textNode.innerText);}}
if(hasChildren){if(this.m_textNode){this.m_childSpan=this.m_textNode.nextSibling;}else{this.m_childSpan=this.m_imgNode.nextSibling;}
this.SetIsDisplayed(this.m_isDisplayed);}
this.m_alt=new D2L.LP.Text.PlainText(this.m_imgNode.alt);},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;if(this.m_imgNode){if(isEnabled){if(this.m_img){this.m_img.Assign(this.m_imgNode);this.m_imgNode.style.display='inline';}
if(this.m_textNode){this.m_textNode.className='di_t';}
if(this.m_anchorNode){this.m_anchorNode.className='di_l';var href=this.GetWindow().document.createAttribute('href');href.value=this.m_href;this.m_anchorNode.attributes.setNamedItem(href);}}else{if(this.m_imgDisabled){this.m_imgDisabled.Assign(this.m_imgNode);this.m_imgNode.style.display='inline';}
if(this.m_textNode){this.m_textNode.className='di_t di_t_d';}
if(this.m_anchorNode){this.m_anchorNode.className='di_l di_l_d';if(this.m_anchorNode.attributes.getNamedItem('href')){this.m_anchorNode.attributes.removeNamedItem('href');}}}}},Focus:function(){if(this.m_anchorNode){this.m_anchorNode.focus();}},GetImage:function(){return this.m_img;},GetImageDisabled:function(){return this.m_imgDisabled;},GetOnClick:function(){if(this.m_navInfo!=null){return this.m_navInfo.GetOnClick();}else{return null;}},GetText:function(){return this.m_text;},GetAlt:function(){return this.m_alt;},HasDefaultPadding:function(){return this.m_hasDefaultPadding;},Hide:function(){if(this.IsDisplayed()){this.SetIsDisplayed(false);var e=new D2L.TransformEvent(this.IDomNode);e.Bubble();}},IsEnabled:function(){return this.m_isEnabled;},IsDisplayed:function(){return this.m_isDisplayed;},SetHasDefaultPadding:function(val){this.m_hasDefaultPadding=val;if(this.IsRendered()&&this.m_imgNode){if(val){this.m_imgNode.className='di_i';}else{this.m_imgNode.className='di_in';}}},SetOnClick:function(onClick){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Image.SetOnClick() is obsolete. '+'Please use SetNav() instead.'),true);if(onClick){if(this.m_navInfo==null){this.m_navInfo=new D2L.NavInfo();}
this.m_navInfo.SetOnClick(onClick);this.SetNav(this.m_navInfo);}},SetNav:function(navInfo){if(navInfo){this.m_navInfo=navInfo;if(this.IsRendered()){this.BuildAnchorNode();if(this.m_anchorNode){if(this.m_alt){var me=this;this.m_alt.GetText().Register(function(val){if(val.length>0){me.m_anchorNode.title=val;}});}
var navStruct=this.m_navInfo.SetupHrefOnClick(this);this.m_href=navStruct.Href;if(this.m_isEnabled){this.m_anchorNode.href=this.m_href;}
if(navStruct.Target==null||navStruct.Target==''){if(this.m_anchorNode.attributes.getNamedItem('target')){this.m_anchorNode.attributes.removeNamedItem('target');}}else{this.m_anchorNode.target=navStruct.Target;}
var me=this;if(navStruct.OnClick){this.AttachObject(this.m_anchorNode,'onclick',function(){if(navStruct.OnClick&&me.IsEnabled()){return navStruct.OnClick.call();}});}}}}},SetImage:function(image){if(image){this.m_img=image;if(this.m_imgNode&&this.m_isEnabled){this.m_img.Assign(this.m_imgNode);this.m_imgNode.style.display='inline';}}},SetImageDisabled:function(image){if(image){this.m_imgDisabled=image;if(this.m_imgNode&&!this.m_isEnabled){this.m_imgDisabled.Assign(this.m_imgNode);this.m_imgNode.style.display='inline';}}},SetText:function(text){if(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Image','SetText','text');this.BuildTextNode();if(this.m_textNode){var me=this;this.m_text.GetHtml().Register(function(val){if(val.length>0){me.m_textNode.innerHTML=val;}});}}},SetAlt:function(alt){if(alt){this.m_alt=D2L.LP.Text.IText.Normalize(alt,'D2L.Control.Image','SetAlt','alt');if(this.m_imgNode){var me=this;this.m_alt.GetText().Register(function(val){if(val.length>0){me.m_imgNode.alt=val;me.m_imgNode.title=val;}});}
if(this.m_anchorNode){var me=this;this.m_alt.GetText().Register(function(val){if(val.length>0){me.m_anchorNode.title=val;}});}}},Show:function(){if(!this.IsDisplayed()){this.SetIsDisplayed(true);var e=new D2L.TransformEvent(this.IDomNode);e.Bubble();}},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){if(!isDisplayed){this.IDomNode.style.display='none';if(this.m_anchorNode){this.m_anchorNode.style.display='none';}}else{this.IDomNode.style.display='inline';if(this.m_anchorNode){this.m_anchorNode.style.display='inline';}}}
this.m_isDisplayed=isDisplayed;}});D2L.Control.Image.InstallEvents=function(domNode,GetControl){var me=null;UI.AttachObject(domNode,'onmouseover',function(){if(me===null){me=GetControl();}
me.OnMouseOver.Trigger(me);});UI.AttachObject(domNode,'onmouseout',function(){if(me===null){me=GetControl();}
me.OnMouseOut.Trigger(me);});};D2L.Image=D2L.Control.Image;

D2L.Control.ImageLink=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_alt=null;this.m_float=D2L.Style.Float.None;this.m_image=null;this.m_imageHover=null;this.m_isDisplayed=true;this.m_isEnabled=true;this.m_navInfo=null;this.m_isHover=false;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var anchor=this.SetDomNode(this.GetUI().CreateElement('a'));anchor.className='dil';anchor.appendChild(this.GetUI().CreateElement('img'));this.RenderAlt();this.RenderImage();this.RenderIsDisplayed();this.RenderFloat();this.RenderNav();},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this);this.m_image=deserializer.GetObject('Image');if(deserializer.HasMember('ImageHover')){this.m_imageHover=deserializer.GetObject('ImageHover');}
this.m_navInfo=deserializer.GetObject('NavInfo');this.m_isDisplayed=deserializer.GetMember('IsDisplayed',true);this.m_float=deserializer.GetMember('Float',D2L.Style.Float.None);},Focus:function(){if(this.IsRendered()){this.GetDomNode().focus();}},GetAlt:function(){return this.m_alt;},GetFloat:function(){return this.m_float;},GetImage:function(){return this.m_image;},GetNav:function(){return this.m_navInfo;},GetImageNode:function(){return this.GetDomNode().firstChild;},IsDisplayed:function(){return this.m_isDisplayed;},RenderAlt:function(){if(this.IsRendered()){if(this.m_alt===null){this.GetUI().GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('ImageLink \'Alt\' is required.'),true);return;}
var imgNode=this.GetImageNode();this.m_alt.AssignText(imgNode,'alt');this.m_alt.AssignText(imgNode,'title');}},RenderFloat:function(){if(this.IsRendered()){D2L.Util.Style.ApplyFloat(this.GetDomNode(),this.GetFloat());}},RenderImage:function(){if(this.IsRendered()){if(!this.m_isHover){if(this.m_image===null){this.GetUI().GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('ImageLink \'Image\' is required.'),true);return;}
this.m_image.Assign(this.GetImageNode(),false);}else{if(this.m_imageHover===null){this.GetUI().GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('ImageLink \'Image\' is required.'),true);return;}
this.m_imageHover.Assign(this.GetImageNode(),false);}}},RenderIsDisplayed:function(){if(this.IsRendered()){this.GetDomNode().style.display=this.IsDisplayed()?'inline':'none';}},RenderNav:function(){if(!this.IsRendered()){return;}
if(this.m_navInfo===null){this.GetUI().GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('ImageLink must have a navigation component specified.'),true);return;}
var anchor=this.GetDomNode();var navStruct=this.m_navInfo.SetupHrefOnClick(this,true);anchor.href=navStruct.Href;if(navStruct.Target==null||navStruct.Target==''){if(anchor.attributes.getNamedItem('target')){anchor.attributes.removeNamedItem('target');}}else{this.m_anchorNode.target=navStruct.Target;}
var me=this;if(navStruct.OnClick){this.AttachObject(anchor,'onclick',function(){return navStruct.OnClick.call();});}else{anchor.onclick=null;}},SetAlt:function(alt){this.m_alt=alt;this.RenderAlt();},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;},SetFloat:function(floatVal){if(floatVal!==this.GetFloat()){this.m_float=floatVal;this.RenderFloat();}},SetImage:function(image){this.m_image=image;if(!this.m_isHover){this.RenderImage();}},SetHoverImage:function(image){this.m_imageHover=image;this.RenderImage();},SetIsDisplayed:function(isDisplayed){if(isDisplayed!==this.IsDisplayed()){this.m_isDisplayed=isDisplayed;this.RenderIsDisplayed();}},SetNav:function(navInfo){this.m_navInfo=navInfo;this.RenderNav();}});D2L.Control.ImageLink.InstallEvents=function(domNode,GetControl){var imgNode=domNode.firstChild;UI.AttachObject(imgNode,'onmouseover',function(){GetControl().m_isHover=true;GetControl().RenderImage();});UI.AttachObject(imgNode,'onmouseout',function(){GetControl().m_isHover=false;GetControl().RenderImage();});};

D2L.Control.Link=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.Link);this.m_alt=new D2L.LP.Text.PlainText();this.m_float=D2L.Style.Float.None;this.m_href='javascript://';this.m_isEnabled=true;this.m_navInfo=new D2L.NavInfo();this.m_spacing=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing);this.m_text=new D2L.LP.Text.PlainText();},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.GetUI().CreateElement('a'));this.RenderAlt();this.RenderText();this.SetNav(this.m_navInfo);this.RenderIsEnabled();this.RenderFloat();this.RenderSpacing();},Focus:function(){try{if(this.IsRendered()){this.GetDomNode().focus();}}catch(e){}},GetAlt:function(){return this.m_alt;},GetFloat:function(){return this.m_float;},GetSpacing:function(){return this.m_spacing;},GetText:function(){return this.m_text;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isEnabled=(this.GetDomNode().className!='dlk_d');if(this.GetDomNode().title.length>0){this.m_alt=new D2L.LP.Text.PlainText(this.GetDomNode().title);}
if(this.GetDomNode().firstChild){this.m_text=new D2L.LP.Text.PlainText(this.GetDomNode().firstChild.data);}
this.m_href=deserializer.GetMember();this.m_float=deserializer.GetMember();},IsEnabled:function(){return this.m_isEnabled;},RenderAlt:function(){if(this.IsRendered()){var me=this;this.m_alt.GetText().Register(function(val){if(val.length>0){me.GetDomNode().title=val;}});}},RenderFloat:function(){if(this.IsRendered()){D2L.Util.Style.ApplyFloat(this.GetDomNode(),this.GetFloat());}},RenderIsEnabled:function(){if(this.GetDomNode()){if(this.IsEnabled()){this.GetDomNode().className='';var href=this.GetWindow().document.createAttribute('href');href.value=this.m_href;this.GetDomNode().attributes.setNamedItem(href);}else{this.GetDomNode().className='dlk_d';if(this.GetDomNode().attributes.getNamedItem('href')){this.GetDomNode().attributes.removeNamedItem('href');}}}},RenderSpacing:function(){if(this.IsRendered()){this.GetDomNode().style.margin=this.GetSpacing().ToCss();}},RenderText:function(){if(this.IsRendered()){var me=this;this.m_text.GetHtml().Register(function(val){me.GetDomNode().innerHTML='';var span=UI.CreateElement('span');span.innerHTML=val;me.GetDomNode().appendChild(span);});}},SetAlt:function(alt){this.m_alt=D2L.LP.Text.IText.Normalize(alt,'D2L.Control.Link','SetAlt','alt');this.RenderAlt();},SetFloat:function(floatVal){if(floatVal!==this.GetFloat()){this.m_float=floatVal;this.RenderFloat();}},SetIsDisplayed:function(isDisplayed){if(this.IsRendered()){if(isDisplayed){this.GetDomNode().style.display='inline';}else{this.GetDomNode().style.display='none';}}},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;this.RenderIsEnabled();},SetNav:function(navInfo){if(!navInfo){return;}
this.m_navInfo=navInfo;if(!this.IsRendered()){return;}
var navStruct=this.m_navInfo.SetupHrefOnClick(this);this.m_href=navStruct.Href;if(this.IsEnabled()){this.GetDomNode().href=this.m_href;}
if(navStruct.Target==null||navStruct.Target==''){if(this.GetDomNode().attributes.getNamedItem('target')){this.GetDomNode().attributes.removeNamedItem('target');}}else{this.GetDomNode().target=navStruct.Target;}
var me=this;this.AttachObject(this.GetDomNode(),'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);if(navStruct.OnClick&&me.IsEnabled()){return navStruct.OnClick.call();}});},SetOnClick:function(onClick){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.PlainText('Link.SetOnClick() is obsolete. Please '+'use SetNav() instead.'),true);if(onClick){this.m_navInfo.SetOnClick(onClick);this.SetNav(this.m_navInfo);}},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.Link','SetText','text');this.RenderText();}});D2L.Link=D2L.Control.Link;

D2L.Control.List=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_altLess=new D2L.LP.Text.PlainText();this.m_altMore=new D2L.LP.Text.PlainText();this.m_bulletType=D2L.Control.List.BulletTypeOptions.None;this.m_delimiter='';this.m_threshold=-1;this.m_isExpanded=false;this.m_lineHeight=1;this.m_objectName='';this.m_numItems=0;this.m_hasThreshold=false;this.m_isOnDemand=false;this.m_moreCountIsDisplayed=true;this.m_onDemandHasLessLink=false;this.m_onDemandTotalItemsCount=-1;this.m_moreLink=null;this.m_lessLink=null;this.m_onDemandCallback=null;this.m_onDemandJsCallbackObjectJs=null;this.m_isOnDemandLoaded=false;this.m_onDemandReturnsAll=null;this.m_onDemandOrigNumItems=null;},AddItem:function(item){this.AppendChild(item);},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_bulletType=deserializer.GetMember();this.m_delimiter=deserializer.GetMember();this.m_objectName=deserializer.GetMember();this.m_threshold=deserializer.GetMember();this.m_hasThreshold=(this.m_threshold>=0);var onDemandCallbackName=deserializer.GetMember();this.m_onDemandHasLessLink=deserializer.GetBoolean();this.m_onDemandReturnsAll=deserializer.GetBoolean();this.m_onDemandTotalItemsCount=deserializer.GetMember();var onDemandJsCallbackObjectJsName=deserializer.GetMember();this.m_moreCountIsDisplayed=deserializer.GetBoolean();this.m_altLess=new D2L.LP.Text.PlainText(deserializer.GetMember());this.m_altMore=new D2L.LP.Text.PlainText(deserializer.GetMember());if(onDemandJsCallbackObjectJsName.length>0){this.m_onDemandJsCallbackObjectJs=eval(onDemandJsCallbackObjectJsName);}
if(onDemandCallbackName.length>0){if(this.m_onDemandJsCallbackObjectJs){this.m_onDemandCallback=this.m_onDemandJsCallbackObjectJs[onDemandCallbackName];}else{this.m_onDemandCallback=this.GetWindow()[onDemandCallbackName];}}
if(this.m_onDemandCallback!==null&&this.m_onDemandCallback!==undefined){this.m_isOnDemand=true;}
if(this.GetDomNode().childNodes.length==1&&this.GetDomNode().childNodes[0].className=='no_disp'){this.GetDomNode().removeChild(this.GetDomNode().childNodes[0]);}
this.m_numItems=this.GetDomNode().childNodes.length;if(this.m_hasThreshold||this.m_isOnDemand){this.m_numItems=this.m_numItems-2;this.m_moreLink=this.GetDomNode().childNodes[this.m_numItems].firstChild;this.m_lessLink=this.GetDomNode().childNodes[this.m_numItems+1].firstChild;}
for(var i=0;i<this.GetDomNode().childNodes.length;i++){var child=new D2L.Control.ListItem();child.IntegrateChild(this,this.GetDomNode().childNodes[i]);}},AppendChild:function(child){if(this.m_hasThreshold||this.m_isOnDemand){child=arguments.callee.$.InsertBefore.call(this,child,this.Children()[this.m_numItems]);}else{child=arguments.callee.$.InsertBefore.call(this,child);}
this.m_numItems++;if(this.m_delimiter!=''){var delimSpan=this.CreateElement('span');if((this.m_hasThreshold&&this.m_numItems>this.m_threshold)||(this.m_isOnDemand&&this.m_onDemandHasLessLink)){delimSpan.style.display='';}else{delimSpan.style.display='none';}
delimSpan.appendChild(this.CreateTextNode(this.m_delimiter));child.GetDomNode().appendChild(delimSpan);if(this.m_numItems-2>=0){this.GetDomNode().childNodes[this.m_numItems-2].lastChild.style.display='';}}
if(this.m_hasThreshold){if(this.IsExpanded()){this.UpdateLessLink();}else{if(this.m_numItems>this.m_threshold){child.GetDomNode().style.display='none';this.m_moreLink.parentNode.style.display='';this.UpdateMoreLink();}}}
return child;},Collapse:function(){if(!this.m_isExpanded||(!this.m_isOnDemand&&!this.m_hasThreshold)){return;}
this.m_isExpanded=false;var visibleNum=this.m_hasThreshold?this.m_threshold:this.m_onDemandOrigNumItems;for(var i=0;i<this.m_numItems;i++){if(i<visibleNum){this.GetDomNode().childNodes[i].style.display='';}else{this.GetDomNode().childNodes[i].style.display='none';}}
this.m_moreLink.parentNode.style.display='';this.m_lessLink.parentNode.style.display='none';this.UpdateMoreLink();},Expand:function(){if(this.m_isExpanded||(!this.m_isOnDemand&&!this.m_hasThreshold)){return;}
this.m_isExpanded=true;var me=this;var image=this.CreateElement('img');D2L.LP.Text.LangTerm.AssignText('Standard.Misc.txtLoading',image,'title');D2L.LP.Text.LangTerm.AssignText('Standard.Misc.txtLoading',image,'alt');var UpdateItemsVisibility=function(){for(var i=0;i<me.m_numItems;i++){me.GetDomNode().childNodes[i].style.display='';}
me.m_moreLink.parentNode.style.display='none';if(me.m_hasThreshold||me.m_onDemandHasLessLink){me.m_lessLink.parentNode.style.display='';me.UpdateLessLink();}};if(this.m_hasThreshold||this.m_isOnDemandLoaded){UpdateItemsVisibility();return;}
var loadingImageInfo=new D2L.Images.ImageInfo('/d2l/img/lp/loading.gif',16,16);loadingImageInfo.Assign(image);this.m_moreLink.parentNode.appendChild(image);this.m_moreLink.style.display='none';this.m_onDemandOrigNumItems=this.m_numItems;var onDemandCallbackDL;if(this.m_onDemandJsCallbackObjectJs){onDemandCallbackDL=this.m_onDemandCallback.call(this.m_onDemandJsCallbackObjectJs,this);}else{onDemandCallbackDL=this.m_onDemandCallback.call(this,this);}
onDemandCallbackDL.Register(function(result){me.m_isOnDemandLoaded=true;me.m_moreLink.style.display='';me.m_moreLink.parentNode.removeChild(image);if(result){if(me.m_onDemandReturnsAll){me.RemoveAll();}
me.AppendChildren(result);}
UpdateItemsVisibility();});},GetBulletType:function(){return this.m_bulletType;},IsExpanded:function(){return this.m_isExpanded;},RemoveAll:function(){for(var i=this.m_numItems-1;i>=0;i--){this.RemoveChild(this.Children()[i]);}
this.m_numItems=0;},RenderLineHeight:function(){if(this.IsRendered()){this.GetDomNode().style.lineHeight=this.m_lineHeight+'em';}},SetLineHeight:function(lineHeight){this.m_lineHeight=lineHeight;this.RenderLineHeight();},UpdateMoreLink:function(){if(!this.m_isOnDemand&&!this.m_hasThreshold){return;}
var numObjects;if(this.m_onDemandTotalItemsCount>=0){if(this.m_isOnDemandLoaded){numObjects=this.m_numItems-this.m_onDemandOrigNumItems;}else{numObjects=this.m_onDemandTotalItemsCount-this.m_numItems;}}else{numObjects=(this.m_numItems-this.m_threshold);}
var moreText;if(this.m_moreCountIsDisplayed&&(this.m_onDemandTotalItemsCount>=0||this.m_hasThreshold)){moreText=new D2L.LP.Text.LangTerm('Framework.List.lblMore',numObjects);}else{moreText=new D2L.LP.Text.LangTerm('Framework.List.lblMoreNoNumber');}
moreText.AssignText(this.m_moreLink,'innerHTML',true);this.m_altMore.AssignText(this.m_moreLink,'title',false);},UpdateLessLink:function(){if(this.m_hasThreshold||(this.m_isOnDemand&&this.m_lessLink)){this.m_altLess.AssignText(this.m_lessLink,'title',false);}}});

D2L.Control.List.BulletTypeOptions={None:1,Flat:2,Circle:3,Disc:4,Square:5,Custom:6};

D2L.Control.ListItem=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.ListItem);this.m_bulletImg=null;this.m_bulletType=D2L.Control.List.BulletTypeOptions.None;this.m_textNode=null;this.m_text=null;var me=this;this.ParentChangeEvent().RegisterMethod(function(parent){me.m_bulletType=parent.GetBulletType();me.SetBulletImage(me.m_bulletImg);});},BuildDom:function(){if(this.m_hasDomBeenBuilt){return;}
arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.GetUI().CreateElement('li'));if(this.m_text!==null){this.SetText(this.m_text);}
if(this.m_bulletImg!==null){this.SetBulletImage(this.m_bulletImg);}},GetText:function(){return this.m_text;},SetBulletImage:function(image){this.m_bulletImg=image;if(!this.IsRendered()||this.m_bulletImg===null){return;}
if(this.m_bulletType!==D2L.Control.List.BulletTypeOptions.Flat&&this.m_bulletType!==D2L.Control.List.BulletTypeOptions.Custom){return;}
var domNode=this.GetDomNode();image.GetSrc().Register(function(src){src='url(\''+src+'\')';if(this.m_bulletType==D2L.Control.List.BulletTypeOptions.Custom){domNode.style.listStyleImage=src;}else{var width=image.GetWidth();if(width===0){width=16;}
domNode.style.backgroundImage=src;domNode.style.backgroundRepeat='no-repeat';domNode.style.backgroundPosition='2px 0px';domNode.style.paddingLeft=(width+4)+'px';}});},SetText:function(text){this.m_text=text;if(!this.IsRendered()){return;}
if(this.m_textNode===null){this.m_textNode=this.GetUI().CreateElement('span');this.GetDomNode().appendChild(this.m_textNode);}
this.m_text.AssignHtml(this.m_textNode,'innerHTML');}});

D2L.Control.MenuBar=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_clearFloat=null;this.m_hasBorderTop=true;this.m_hasBorderRight=true;this.m_hasBorderBottom=true;this.m_hasBorderLeft=true;this.m_isDisplayed=true;this.m_padding=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Padding,D2L.Style.Spacing.UnitType.Pixel,2);this.m_spacing=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing,D2L.Style.Spacing.UnitType.Pixel,0);},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('div'));domNode.className='dmb';this.IChildrenDomNode=this.GetUI().CreateElement('div');domNode.appendChild(this.IChildrenDomNode);this.m_clearFloat=new D2L.Control.ClearFloat();this.m_clearFloat.AppendTo(domNode);this.RenderIsDisplayed();this.RenderPadding();this.RenderSpacing();this.InstallEvents();},GetPadding:function(){return this.m_padding;},GetSpacing:function(){return this.m_spacing;},HasBorderTop:function(){return this.m_hasBorderTop;},HasBorderRight:function(){return this.m_hasBorderRight;},HasBorderBottom:function(){return this.m_hasBorderBottom;},HasBorderLeft:function(){return this.m_hasBorderLeft;},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this,deserializer);this.IChildrenDomNode=this.GetDomNode().firstChild;this.m_hasBorderTop=deserializer.GetMember('HasBorderTop',true);this.m_hasBorderRight=deserializer.GetMember('HasBorderRight',true);this.m_hasBorderBottom=deserializer.GetMember('HasBorderBottom',true);this.m_hasBorderLeft=deserializer.GetMember('HasBorderLeft',true);this.m_isDisplayed=deserializer.GetMember('IsDisplayed',true);if(deserializer.HasMember('Padding')){this.m_padding=deserializer.GetObject('Padding');}
if(deserializer.HasMember('Spacing')){this.m_spacing=deserializer.GetObject('Spacing');}
this.InstallEvents();},InstallEvents:function(){var me=this;this.m_spacing.OnChange().RegisterMethod(function(){me.RenderSpacing();});this.m_padding.OnChange().RegisterMethod(function(){me.RenderPadding();});},IsDisplayed:function(){return this.m_isDisplayed;},RenderBorder:function(direction,hasBorder){if(this.IsRendered()){var value=hasBorder?'solid':'none';this.GetDomNode().style['border'+direction+'Style']=value;}},RenderIsDisplayed:function(){if(this.IsRendered()){this.GetDomNode().style.display=this.IsDisplayed()?'block':'none';}},RenderPadding:function(){if(this.IsRendered()){this.GetDomNode().style.padding=this.GetPadding().ToCss();}},RenderSpacing:function(){if(this.IsRendered()){this.GetDomNode().style.margin=this.GetSpacing().ToCss();}},SetHasBorderTop:function(hasBorderTop){this.m_hasBorderTop=hasBorderTop;this.RenderBorder('Top',hasBorderTop);},SetHasBorderRight:function(hasBorderRight){this.m_hasBorderRight=hasBorderRight;this.RenderBorder('Right',hasBorderRight);},SetHasBorderBottom:function(hasBorderBottom){this.m_hasBorderBottom=hasBorderBottom;this.RenderBorder('Bottom',hasBorderBottom);},SetHasBorderLeft:function(hasBorderLeft){this.m_hasBorderLeft=hasBorderLeft;this.RenderBorder('Left',hasBorderLeft);},SetIsDisplayed:function(isDisplayed){this.m_isDisplayed=isDisplayed;this.RenderIsDisplayed();}});

D2L.Control.MessageArea=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_domAriaLog=null;this.m_domStatus=null;this.m_domStatusLiveRegion=null;this.m_domStatusText=null;this.m_domError=null;this.m_domErrorList=null;this.m_domErrorBalloons=[];this.m_domWarning=null;this.m_domWarningList=null;this.m_fadeOutsWaiting=0;this.m_oldHeight=0;this.m_hasWarnings=false;this.m_errorDescription=new D2L.LP.Text.LangTerm('Framework.MessageArea.lblErrors');this.m_numWarnings=0;this.m_renderingDr=new D2L.Util.DelayedReturn(true);this.m_numErrors=0;this.OnHeightChange=new D2L.EventHandler();},AddAriaMessage:function(message){var firstTime=(this.m_domAriaLog===null);var log=this.GetAriaLog();var doSet=function(){message.AssignText(log,'innerHTML',true);};message.GetPlainText().Register(function(text){if(firstTime){setTimeout(function(){doSet(text);});}else{doSet(text);}});},AddErrorObj:function(error){var control=null;if(error.m_controlId){control=UI.GetControl(error.m_controlId.ID(),error.m_controlId.SID());}
this.AddError(error.m_errorText,control);},AddError:function(errorText,control){if(this.m_domError===null){this.BuildDom_Error();}
var me=this;var item=this.GetUI().CreateElement('li');var HasFocusControl=function(cntl){if(cntl===undefined||cntl===null){return false;}
if(control.HasFocusControl!==undefined){return control.HasFocusControl();}
return(control.Focus!==undefined);};if(HasFocusControl(control)){var subjectStr=errorText.GetSubject();var subject=new D2L.LP.Text.PlainText(subjectStr);errorText.SetSubject('{tempsubject}');if(subjectStr.length===0){subject=D2L.Control.Field.GetFieldParentText(control);if(subject===null){subject=new D2L.LP.Text.LangTerm('Framework.Validation.DefaultSubject');}}
var a=this.CreateElement('a');a.href='javascript://';this.AttachObject(a,'onclick',function(){control.Focus();});item.appendChild(a);D2L.Util.DelayedReturn.RegisterAll(errorText.GetHtml(),subject.GetHtml(),function(html,subjectText){a.innerHTML=html.replace('{tempsubject}','<span class="d_ma_vet">'+D2L.Util.Html.Encode(subjectText)+'</span>');;me.m_domErrorList.appendChild(item);errorText.SetSubject(subjectText);me.AttachBalloon(control,errorText);});}else{errorText.GetText().Register(function(text){item.appendChild(me.CreateTextNode(text));});this.m_domErrorList.appendChild(item);if(control!==undefined&&control!==null){me.AttachBalloon(control,errorText);}}
this.m_numErrors++;},AddWarningMessage:function(message,doRender){if(!this.m_hasWarnings){return;}
if(this.m_domWarningList===null){this.BuildDom_Warning();}
if(doRender===undefined){doRender=false;}
var item=this.GetUI().CreateElement('li');message.AssignHtml(item,'innerHTML');this.m_domWarningList.appendChild(item);this.m_numWarnings++;if(doRender){this.RenderWarningLabel();this.RenderHeight();}},AttachBalloon:function(control,failureText){var domNode=control.GetDomNode();if(control.GetValidationBalloonDomNode!==undefined){domNode=control.GetValidationBalloonDomNode();}
if(domNode===undefined||domNode===null){return;}
var sibling=domNode.nextSibling;while(sibling){var nodeType=sibling.nodeType;if(nodeType==1){var tagName=sibling.tagName.toLowerCase();var display=YAHOO.util.Dom.getStyle(sibling,'display');if(display=='block'||display.length===0){domNode=sibling.previousSibling;break;}
domNode=sibling;if(tagName=='br'&&display=='inline'){break;}}else{domNode=sibling;}
sibling=sibling.nextSibling;}
if(domNode!==null){var balloon=D2L.Validation.CreateErrorBalloon(failureText);failureText.GetHtml().Register(function(html){if(domNode.nextSibling){domNode.parentNode.insertBefore(balloon,domNode.nextSibling);}else{domNode.parentNode.appendChild(balloon);}});this.m_domErrorBalloons.push(balloon);control.GetWindow().UI.GetWindowEventManager().Transform.Trigger();}},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.GetUI().CreateElement('div'));this.GetDomNode().id=this.GetMappedId();this.GetDomNode().className='d_ma';},BuildDom_Error:function(){this.m_domError=this.GetUI().CreateElement('div');this.m_domError.className='d_ma_ve';this.m_domError.tabIndex=0;var h=this.GetUI().CreateElement('h2');h.id=this.GetUI().GetUniqueHtmlId();h.appendChild(this.GetUI().CreateTextNode(new D2L.LP.Text.LangTerm('Framework.MessageArea.hdrErrors')));this.m_domError.appendChild(h);var p=this.GetUI().CreateElement('p');this.m_domError.appendChild(p);this.m_domErrorList=this.GetUI().CreateElement('ul');this.m_domError.appendChild(this.m_domErrorList);},BuildDom_Status:function(){this.m_domStatus=this.GetUI().CreateElement('div');this.m_domStatus.className='d_ma_s';this.m_domStatus.id=this.GetUI().GetUniqueHtmlId();this.m_domStatusLiveRegion=this.GetUI().CreateElement('div');D2L.Util.Aria.SetRole(this.m_domStatusLiveRegion,'status');D2L.Util.Aria.SetAttribute(this.m_domStatusLiveRegion,'live',D2L.Control.MessageArea.PRIORITY);this.m_domStatus.appendChild(this.m_domStatusLiveRegion);var img=this.GetUI().CreateElement('img');img.alt='';this.m_domStatusLiveRegion.appendChild(img);this.GetDomNode().appendChild(this.m_domStatus);},BuildDom_Warning:function(){if(!this.m_hasWarnings){return;}
this.m_domWarning=this.GetUI().CreateElement('div');this.m_domWarning.className='d_ma_w';var h=this.GetUI().CreateElement('h2');h.innerHTML='Code Warnings';this.m_domWarning.appendChild(h);var p=this.GetUI().CreateElement('p');this.m_domWarning.appendChild(p);var span1=this.GetUI().CreateElement('span');p.appendChild(span1);var span2=this.GetUI().CreateElement('span');span2.innerHTML='<a href="javascript:UI.GetMessageArea().ExpandWarnings();">Show Warnings</a>'+'<a href="javascript:UI.GetMessageArea().CollapseWarnings();" style="display:none;">Hide Warnings</a>';span2.style.paddingLeft='0.5em';p.appendChild(span2);this.m_domWarningList=this.GetUI().CreateElement('ul');this.m_domWarningList.style.display='none';this.m_domWarning.appendChild(this.m_domWarningList);this.RenderWarningLabel();},ClearErrors:function(doRender){if(this.m_numErrors===0&&this.m_numWarnings===0){return new D2L.Util.DelayedReturn(true);}
var dr=new D2L.Util.DelayedReturn();for(var i=0;i<this.m_domErrorBalloons.length;i++){D2L.Util.Purge(this.m_domErrorBalloons[i]);if(this.m_domErrorBalloons[i]&&this.m_domErrorBalloons[i].parentNode){this.m_domErrorBalloons[i].parentNode.removeChild(this.m_domErrorBalloons[i]);}}
this.m_domErrorBalloons=[];if(this.m_domErrorList!==null){while(this.m_domErrorList.childNodes.length>0){D2L.Util.Purge(this.m_domErrorList.firstChild);this.m_domErrorList.removeChild(this.m_domErrorList.firstChild);}}
this.m_numErrors=0;if(doRender){this.RenderHeight().Register(function(){setTimeout(function(){dr.Trigger(true);},200);});}else{dr.Trigger(true);}
return dr;},CollapseWarnings:function(){if(!this.m_hasWarnings){return;}
this.m_domWarning.childNodes[1].childNodes[1].childNodes[0].style.display='inline';this.m_domWarning.childNodes[1].childNodes[1].childNodes[1].style.display='none';this.m_domWarningList.style.display='none';this.RenderHeight();},ExpandWarnings:function(){if(!this.m_hasWarnings){return;}
this.m_domWarning.childNodes[1].childNodes[1].childNodes[0].style.display='none';this.m_domWarning.childNodes[1].childNodes[1].childNodes[1].style.display='inline';this.m_domWarningList.style.display='block';this.RenderHeight();},GetAriaLog:function(){if(this.m_domAriaLog===null){this.m_domAriaLog=this.GetUI().CreateElement('div');this.m_domAriaLog.className='d_ma_al';this.m_domAriaLog.innerHTML='<p>initial value</p>';D2L.Util.Aria.SetRole(this.m_domAriaLog,'log');D2L.Util.Aria.SetAttribute(this.m_domAriaLog,'live','polite');this.GetDomNode().appendChild(this.m_domAriaLog);}
return this.m_domAriaLog;},GetHeight:function(){if(!this.HasErrors()&&!this.HasWarnings()){return 0;}
var n=this.GetDomNode();n.style.height=this.m_oldHeight+'px';var height=0;if(this.HasErrors()){height+=this.m_domError.offsetHeight;}
if(this.HasWarnings()){height+=this.m_domWarning.offsetHeight;}
return height;},HasErrors:function(){return this.m_numErrors>0;},HasWarnings:function(){return this.m_hasWarnings&&this.m_numWarnings>0;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer,false);this.m_hasWarnings=D2L.Debug.IsEnabled();var parentId=deserializer.GetMember();var siblingId=deserializer.GetMember();var statusType=deserializer.GetMember();var errors=deserializer.GetObjectArray(D2L.Control.MessageArea.Error);if(deserializer.HasMember()){this.m_errorDescription=deserializer.GetObject();}
this.BuildDom();if(errors.length>0){for(var i=0;i<errors.length;i++){this.AddErrorObj(errors[i]);}}
var domNode=this.GetDomNode();if(siblingId==null){var parent=UI.GetById(parentId);if(parent){if(parent.childNodes.length>0){parent.insertBefore(domNode,parent.firstChild);}else{parent.appendChild(domNode);}}}else{var sibling=UI.GetById(siblingId);if(sibling){if(sibling.nextSibling){sibling.parentNode.insertBefore(domNode,sibling.nextSibling);}else{sibling.parentNode.appendChild(domNode);}}}
if(statusType!==D2L.Control.MessageArea.Status.None){this.SetStatus(statusType);}else if(this.HasErrors()||this.HasWarnings()){this.ShowErrors();}},RenderErrorLabel:function(){var me=this;if(this.m_domError.childNodes[1].firstChild){D2L.Util.Purge(this.m_domError.childNodes[1].firstChild);this.m_domError.childNodes[1].removeChild(this.m_domError.childNodes[1].firstChild);}
this.m_errorDescription.SetReplace(this.m_numErrors);this.m_errorDescription.GetHtml().Register(function(html){me.m_domError.childNodes[1].innerHTML=html;});},RenderWarningLabel:function(){if(!this.HasWarnings()){return;}
if(this.m_domWarning.childNodes[1].firstChild.firstChild){D2L.Util.Purge(this.m_domWarning.childNodes[1].firstChild.firstChild);this.m_domWarning.childNodes[1].firstChild.removeChild(this.m_domWarning.childNodes[1].firstChild.firstChild);}
if(this.m_numWarnings>1){this.m_domWarning.childNodes[1].firstChild.innerHTML='There are <b>'+this.m_domWarningList.childNodes.length+' code warnings</b> on this page:'}else{this.m_domWarning.childNodes[1].firstChild.innerHTML='There is <b>1 code warning</b> on this page:'}},RenderHeight:function(){var me=this;var newDr=new D2L.Util.DelayedReturn();var domNode=this.GetDomNode();this.m_renderingDr.Register(function(){me.m_renderingDr=newDr;if(me.HasErrors()||me.HasWarnings()){domNode.className='d_ma d_ma_e';}else{domNode.className='d_ma';}
domNode.style.height=me.m_oldHeight+'px';if(me.m_hasWarnings&&me.m_domWarning!==null){if(me.HasWarnings()){if(me.m_domWarning.parentNode!==domNode){domNode.appendChild(me.m_domWarning);}}else if(me.m_domWarning.parentNode===domNode){domNode.removeChild(me.m_domWarning);}}
if(me.m_domError!==null){if(me.HasErrors()){if(me.m_domError.parentNode!==domNode){domNode.appendChild(me.m_domError);}}else if(me.m_domError.parentNode===domNode){domNode.removeChild(me.m_domError);}}
var height=me.GetHeight();if(height!=me.m_oldHeight){me.m_oldHeight=height;var myAnim=new YAHOO.util.Anim(me.GetMappedId(),{height:{to:height}},0.5,YAHOO.util.Easing.easeOut);myAnim.onComplete.subscribe(function(){if(me.HasErrors()||me.HasWarnings()){domNode.style.height='auto';}else{domNode.style.height='0px';}
UI.GetWindowEventManager().Transform.Trigger();me.m_renderingDr.Trigger(true);me.OnHeightChange.Trigger();setTimeout(function(){domNode.focus();});});myAnim.animate();}else{me.m_renderingDr.Trigger(true);}});return newDr;},Reset:function(){var dr=new D2L.Util.DelayedReturn();this.ClearErrors(true).Register(function(){dr.Trigger(true);});return dr;},SetStatus:function(type){if(!this.IsRendered()||type==D2L.Control.MessageArea.Status.None){return;}
var me=this;if(this.m_domStatus===null){this.BuildDom_Status();}
D2L.Images.ImageTerm.Assign('Framework.MessageArea.actStatus'+type,this.m_domStatusLiveRegion.firstChild);if(this.m_domStatusText!==null){this.m_domStatusLiveRegion.removeChild(this.m_domStatusText);}
var textTerm=new D2L.LP.Text.LangTerm('Framework.MessageArea.lblStatus'+type);textTerm.GetText().Register(function(text){setTimeout(function(){me.m_domStatusText=me.GetUI().CreateTextNode(text);me.m_domStatusLiveRegion.appendChild(me.m_domStatusText);me.ShowDropDown(me.m_domStatus);});});},SetMessages:function(messages){var me=this;this.Reset().Register(function(){if(messages.HasErrors()){me.m_errorDescription=messages.m_errorDescription;for(var i=0;i<messages.m_errors.length;i++){me.AddErrorObj(messages.m_errors[i]);}
me.ShowErrors();}else{me.SetStatus(messages.GetStatusType());}});},ShowDropDown:function(domNode){var me=this;var RestoreOpacity=function(){domNode.style.top='-1000px';if(me.GetUI().GetBrowserInfo().Type==D2L.UI.BrowserType.IE){domNode.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity=100)';}else{domNode.style.opacity='1';}};var ScrollDown=function(){var from=domNode.offsetHeight*-1;var to=0;if(me.GetUI().GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&me.GetUI().GetBrowserInfo().MajorVersion<7){from+=me.GetUI().GetScrollTop();to=me.GetUI().GetScrollTop();}
domNode.style.top=from+'px';var anim=new YAHOO.util.Anim(domNode.id,{top:{to:to}},D2L.Control.MessageArea.FADE_IN_DURATION,YAHOO.util.Easing.bounceOut);anim.animate();};this.m_fadeOutsWaiting++;RestoreOpacity();ScrollDown();setTimeout(function(){if(me.m_fadeOutsWaiting>1){me.m_fadeOutsWaiting--;return;}
var anim=new YAHOO.util.Anim(domNode.id,{opacity:{to:0}},1.5,YAHOO.util.Easing.easeInStrong);anim.onTween.subscribe(function(){if(me.m_fadeOutsWaiting>1){anim.stop();}});anim.onComplete.subscribe(function(){setTimeout(RestoreOpacity);me.m_fadeOutsWaiting--;});anim.animate();},D2L.Control.MessageArea.FADE_OUT_DURATION);},ShowErrors:function(){if(this.m_numErrors===0){return new D2L.Util.DelayedReturn(true);}
this.RenderErrorLabel();return this.RenderHeight();}});D2L.Control.MessageArea.FADE_OUT_DURATION=3000;D2L.Control.MessageArea.FADE_IN_DURATION=0.5;D2L.Control.MessageArea.PRIORITY='polite';

D2L.Control.MessageArea.Error=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_errorText=new D2L.LP.Text.PlainText();this.m_controlId=null;},Deserialize:function(deserializer){this.m_errorText=deserializer.GetObject('ErrorText');if(deserializer.HasMember('ControlId')){this.m_controlId=deserializer.GetObject('ControlId',D2L.Control.Id);}}});

D2L.Control.MessageArea.Messages=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_errorDescription=new D2L.LP.Text.LangTerm('Framework.MessageArea.lblErrors');this.m_statusType=D2L.Control.MessageArea.Status.None;this.m_errors=[];},Deserialize:function(deserializer){this.m_statusType=deserializer.GetMember('StatusType');if(deserializer.HasMember('ErrorDescription')){this.m_errorDescription=deserializer.GetObject('ErrorDescription',D2L.LP.Text.IText);}
this.m_errors=deserializer.GetObjectArray('Errors',D2L.Control.MessageArea.Error);},GetStatusType:function(){return this.m_statusType;},HasErrors:function(){return this.m_errors.length>0;}});

D2L.Control.MessageArea.Status={None:0,Saved:1,Deleted:2,Created:3,Reordered:4,Copied:5,Imported:6,Exported:7,Moved:8,Added:9,Removed:10,Enrolled:11,Unenrolled:12};

D2L.Control.Paging=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_totalObjectCount=0;this.m_totalObjectCountChangeEvent=new D2L.EventHandler();this.m_pageNumber=1;this.m_pageSize=20;this.m_pageSizeLimit=200;this.m_pageSizeChangeEvent=new D2L.EventHandler();this.m_pageNumberChangeEvent=new D2L.EventHandler();this.m_renderEvent=new D2L.EventHandler();this.m_resetEvent=new D2L.EventHandler();},BuildDom:function(){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('span'));this.RenderEvent().Trigger();},GetPageNumber:function(){return this.m_pageNumber;},GetState:function(serializer){serializer.AddMember('PageNumber',this.GetPageNumber());serializer.AddMember('PageSize',this.GetPageSize());},GetTotalObjectCount:function(){return this.m_totalObjectCount;},GetPageSize:function(){return this.m_pageSize;},GetPageSizeLimit:function(){return this.m_pageSizeLimit;},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this,deserializer);this.m_pageNumber=deserializer.GetMember('PageNumber');this.m_pageSize=deserializer.GetMember('PageSize');this.m_pageSizeLimit=deserializer.GetMember('PageSizeLimit');this.m_totalObjectCount=deserializer.GetMember('TotalObjectCount');var renderer=new D2L.Control.Paging.NumericRenderer(this);this.RenderEvent().Trigger();},TotalObjectCountChangeEvent:function(){return this.m_totalObjectCountChangeEvent;},PageNumberChangeEvent:function(){return this.m_pageNumberChangeEvent;},PageSizeChangeEvent:function(){return this.m_pageSizeChangeEvent;},RenderEvent:function(){return this.m_renderEvent;},Reset:function(){this.SetPageNumber(1,false);this.ResetEvent().Trigger();},ResetEvent:function(){return this.m_resetEvent;},SetTotalObjectCount:function(totalObjectCount){if(totalObjectCount==this.m_totalObjectCount){return;}
this.m_totalObjectCount=totalObjectCount;this.TotalObjectCountChangeEvent().Trigger(totalObjectCount);},SetPageSize:function(pageSize,doTriggerEvent){if(doTriggerEvent===undefined){doTriggerEvent=true;}
if(pageSize===this.m_pageSize){return;}
this.m_pageSize=pageSize;this.Reset();if(doTriggerEvent){this.PageSizeChangeEvent().Trigger(pageSize);}},SetPageSizeLimit:function(pageSizeLimit){this.m_pageSizeLimit=pageSizeLimit;},SetPageNumber:function(pageNumber,doTriggerEvent){if(doTriggerEvent===undefined){doTriggerEvent=true;}
if(pageNumber===this.m_pageNumber){return;}
this.m_pageNumber=pageNumber;if(doTriggerEvent){this.PageNumberChangeEvent().Trigger(pageNumber);}}});

D2L.Control.Paging.NumericRenderer=D2L.Class.extend({Construct:function(paging){arguments.callee.$.Construct.call(this);this.m_hasPageSize=true;this.m_pageSizes=[10,20,50,100,200];this.m_paging=paging;this.m_yuiPaginator=null;this.Init();},HasPageSize:function(){return this.m_hasPageSize;},Init:function(){var me=this;this.m_paging.TotalObjectCountChangeEvent().RegisterMethod(function(objectCount){if(me.m_yuiPaginator!==null){me.m_yuiPaginator.setTotalRecords(objectCount,true);}});this.m_paging.PageSizeChangeEvent().RegisterMethod(function(pageSize){if(me.m_yuiPaginator!==null){me.m_yuiPaginator.setRowsPerPage(pageSize,true);}});this.m_paging.PageNumberChangeEvent().RegisterMethod(function(pageNum){if(me.m_yuiPaginator!==null){me.m_yuiPaginator.setPage(pageNum,true);}});this.m_paging.ResetEvent().RegisterMethod(function(){if(me.m_yuiPaginator!==null){me.m_yuiPaginator.setPage(1,true);}});this.m_paging.RenderEvent().RegisterMethod(function(){me.Render();});},Render:function(){var id=UI.GetUniqueHtmlId();var yuiContainer=UI.CreateElement('span');yuiContainer.className='dpgn';yuiContainer.id=id;this.m_paging.GetDomNode().appendChild(yuiContainer);var lm=UI.GetLanguageManager();var strFirst=D2L.Util.Html.JsString(lm.GetPrefetchedTerm('Framework.Paging.altFirst'));var strPrev=D2L.Util.Html.JsString(lm.GetPrefetchedTerm('Framework.Paging.altPrevious'));var strNext=D2L.Util.Html.JsString(lm.GetPrefetchedTerm('Framework.Paging.altNext'));var strLast=D2L.Util.Html.JsString(lm.GetPrefetchedTerm('Framework.Paging.altLast'));var configs={initialPage:this.m_paging.GetPageNumber(),rowsPerPage:this.m_paging.GetPageSize(),totalRecords:this.m_paging.GetTotalObjectCount(),containers:id,updateOnChange:true,pageLinks:5,firstPageLinkClass:'dpg_icon dpg_first',firstPageLinkLabel:'<img src=\'/d2l/img/lp/pixel.gif\' alt=\''+strFirst+'\' title=\''+strFirst+'\' />',previousPageLinkClass:'dpg_icon dpg_prev',previousPageLinkLabel:'<img src=\'/d2l/img/lp/pixel.gif\' alt=\''+strPrev+'\' title=\''+strPrev+'\' />',nextPageLinkClass:'dpg_icon dpg_next',nextPageLinkLabel:'<img src=\'/d2l/img/lp/pixel.gif\' alt=\''+strNext+'\' title=\''+strNext+'\' />',lastPageLinkClass:'dpg_icon dpg_last',lastPageLinkLabel:'<img src=\'/d2l/img/lp/pixel.gif\' alt=\''+strLast+'\' title=\''+strLast+'\' />',template:'{FirstPageLink}{PreviousPageLink}{PageLinks}{NextPageLink}{LastPageLink}'};var me=this;setTimeout(function(){me.m_yuiPaginator=new YAHOO.widget.Paginator(configs);me.m_yuiPaginator.subscribe('pageChange',function(event){me.m_paging.SetPageNumber(event.newValue);});me.m_yuiPaginator.render();},0);this.RenderPageSize();},RenderPageSize:function(){if(!this.HasPageSize()){return;}
var me=this;var domNode=this.m_paging.GetDomNode();var container=UI.CreateElement('span');container.style.paddingLeft='1em';domNode.appendChild(container);var sl=new D2L.Control.SelectList();sl.SetTitle(new D2L.LP.Text.LangTerm('Framework.Paging.altPageSize'));sl.SetOnChange(function(){me.m_paging.SetPageSize(sl.GetSelectedKey());});for(var i=0;i<this.m_pageSizes.length;i++){var size=this.m_pageSizes[i];if(size>this.m_paging.GetPageSizeLimit()){break;}
sl.AppendChild(new D2L.Control.SelectOption(size,size,size.toString()));}
sl.SelectOptionByKey(this.m_paging.GetPageSize(),false);sl.AppendTo(container);},SetHasPageSize:function(hasPageSize){this.m_hasPageSize=hasPageSize;}});

D2L.Control.SelectList=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this,D2L.Control.Type.SelectList);this.m_float=D2L.Style.Float.None;this.m_isDisplayed=true;this.options=[];this.m_onChange=null;this.m_spacing=new D2L.Style.Spacing(D2L.Style.Spacing.Type.Spacing);this.m_title=null;this.m_hasEnablerTargetItem=false;if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<7){WindowEventManager.SelectIeHack.Register(this,'HandleSelectIeHack');}
var me=this;this.m_spacing.GetTop().SetUnitType(D2L.Style.Measurement.UnitType.Pixel);this.m_spacing.GetTop().SetValue(2);this.m_spacing.GetBottom().SetUnitType(D2L.Style.Measurement.UnitType.Pixel);this.m_spacing.GetBottom().SetValue(2);this.m_spacing.OnChange().RegisterMethod(function(){me.RenderSpacing();});},AddOption:function(parentKey,opt){var parentOpt=this.GetOption(parentKey);if(parentOpt){return parentOpt.AppendChild(opt);}else{return this.AppendChild(opt);}},AppendChild:function(opt){return this.InsertBefore(opt,null);},Blur:function(){if(this.GetDomNode()){this.GetDomNode().blur();}},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('select'));domNode.name=this.GetMappedId();this.RenderTitle();this.RenderFloat();this.RenderSpacing();this.AttachObject(domNode,'ID2L',this);for(var i=0;i<this.options.length;i++){this.options[i].BuildDom();if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){domNode.add(this.options[i].GetDomNode());}else{domNode.add(this.options[i].GetDomNode(),null);}}
var me=this;D2L.Control.SelectList.InstallEvents(domNode,function(){return me;});},ClearOptions:function(){while(this.options.length>0){this.RemoveChild(this.options[this.options.length-1]);}},Disable:function(){this.GetDomNode().disabled=true;},Enable:function(){this.GetDomNode().disabled=false;},Focus:function(){if(this.IsRendered()){this.GetDomNode().focus();}},GetFloat:function(){return this.m_float;},GetIndex:function(opt){for(var i=0;i<this.GetDomNode().options.length;i++){if(this.GetDomNode().options[i].ID2L==opt){return i;}}
return-1;},GetMultiEditValue:function(){return this.GetSelectedValue();},GetOption:function(key){for(var i=0;i<this.options.length;i++){if(this.options[i].key==key){return this.options[i];}}
return null;},GetOptions:function(){return this.options;},GetSelectedIndex:function(){return this.GetDomNode().selectedIndex;},GetSelectedOption:function(){if(this.GetDomNode().selectedIndex>=0){return this.GetDomNode().options[this.GetDomNode().selectedIndex].ID2L;}else{return null;}},GetSelectedKey:function(){var opt=this.GetSelectedOption();if(opt!=null){return this.GetSelectedOption().key;}else{return null;}},GetSelectedValue:function(){var opt=this.GetSelectedOption();if(opt!==null&&opt!==undefined){return opt.val;}else{return null;}},GetSpacing:function(){return this.m_spacing;},GetState:function(serializer){var selectedOption=this.GetSelectedOption();if(selectedOption){serializer.AddMember('SelectedKey',selectedOption.GetKey());serializer.AddMember('SelectedVal',selectedOption.GetVal());}},GetTitle:function(){return this.m_title;},HandleSelectIeHack:function(evt){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<7&&evt.source){var srcX1=FindPosX(evt.source);var srcY1=FindPosY(evt.source);var srcX2=srcX1+evt.source.offsetWidth;var srcY2=srcY1;var srcX3=srcX1;var srcY3=srcY1+evt.source.offsetHeight;var srcX4=srcX2;var srcY4=srcY3;var ifX1=FindPosX(this.GetDomNode());var ifY1=FindPosY(this.GetDomNode());var ifX2=ifX1+this.GetDomNode().offsetWidth;var ifY2=ifY1;var ifX3=ifX1;var ifY3=ifY1+this.GetDomNode().offsetHeight+2;var ifX4=ifX2;var ifY4=ifY3;if(ifX1<srcX1){ifX1=srcX1;ifX3=srcX3;}
if(ifX2>srcX2){ifX2=srcX2;ifX4=srcX4;}
if(ifY1<srcY1){ifY1=srcY2;ifY2=srcY2;}
if(ifY3>srcY3){ifY3=srcY3;ifY4=srcY4;}
if((ifX2-ifX1)>0&&(ifY3-ifY1)>0){this.GetDomNode().style.visibility=(evt.doHide)?'hidden':'visible';}}},Hide:function(){this.SetIsDisplayed(false);},InsertBefore:function(opt,beforeOpt){if(!opt||opt===undefined||opt===null||opt.GetControlType()!=D2L.Control.Type.SelectOption){return null;}
if(!beforeOpt||beforeOpt===undefined||beforeOpt===null||beforeOpt.GetControlType()!=D2L.Control.Type.SelectOption){beforeOpt=null;}
this.BuildDom();var index=-1,insertBefore=null;if(beforeOpt){for(var i=0;i<this.m_children.length;i++){if(this.m_children[i]==beforeOpt){index=i;break;}}
if(index!=-1){if(beforeOpt.m_previousSibling){beforeOpt.m_previousSibling.m_nextSibling=opt;opt.m_previousSibling=beforeOpt.m_previousSibling;}
beforeOpt.m_previousSibling=opt;opt.m_nextSibling=beforeOpt;}}
if(index!=-1){insertBefore=beforeOpt;this.m_children.splice(index,0,opt);}else{if(this.m_children.length>0){var optTemp=this.m_children[this.m_children.length-1];optTemp.m_nextSibling=opt;opt.m_previousSibling=optTemp;}
this.m_children.push(opt);}
opt.m_parent=this;opt.m_sl=this;this.InsertHelper(opt,insertBefore);return opt;},InsertHelper:function(opt,beforeOpt){if(beforeOpt===undefined||beforeOpt===null){opt.BuildDom();if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){this.GetDomNode().add(opt.GetDomNode());}else{this.GetDomNode().add(opt.GetDomNode(),null);}
this.options.push(opt);}else{var index=this.GetIndex(beforeOpt);opt.BuildDom();if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){this.GetDomNode().add(opt.GetDomNode(),index);}else{this.GetDomNode().add(opt.GetDomNode(),beforeOpt.GetDomNode());}
this.options.splice(index,0,opt);}},InsertSorted:function(opt){var isGreaterThan=function(opt1,opt2){return(opt1.text.toLowerCase()>opt2.text.toLowerCase());};return arguments.callee.$.InsertSorted.call(this,opt,isGreaterThan);},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_isDisplayed=this.GetDomNode().style.display!=='none';this.SetOnChange(new Function(deserializer.GetMember()));this.m_hasEnablerTargetItem=deserializer.GetBoolean();this.m_float=deserializer.GetMember();var start=deserializer.GetMember();var end=deserializer.GetMember();var interval=deserializer.GetMember();var c=[];if(start>-1&&end>-1){for(var i=start;i<end+1;i=i+interval){c.push(new D2L.Control.SelectOption(i.toString(),i.toString()));}}else{c=deserializer.GetObjectArrayMin(D2L.Control.SelectOption);}
for(var i=0;i<c.length;i++){this.options.push(c[i]);c[i].IntegrateChild(this,this.GetDomNode().childNodes[this.options.length-1]);}},IsDisplayed:function(){return this.m_isDisplayed;},IsEnabled:function(){return!this.GetDomNode().disabled;},OnChange:function(event){event=(event!==undefined)?event:((window.event!==undefined)?window.event:null);WindowEventManager.BubbleChangeEvent(this.GetDomNode(),event);if(this.m_hasEnablerTargetItem&&this.Enablers){this.Enablers.ResetEnablers();}
if(this.m_onChange!==undefined&&this.m_onChange!==null){this.m_onChange.call(this);}},RemoveChild:function(opt){if(opt){if(opt.m_parent==this){while(opt.m_children.length>0){opt.RemoveChild(opt.m_children[0]);}
arguments.callee.$.RemoveChild.call(this,opt);for(var i=0;i<this.options.length;i++){if(this.options[i]==opt){this.options.splice(i,1);break;}}}else{opt.m_parent.RemoveChild(opt);}
return opt;}
return null;},RenderFloat:function(){if(this.IsRendered()){D2L.Util.Style.ApplyFloat(this.GetDomNode(),this.GetFloat());}},RenderSpacing:function(){if(this.IsRendered()){this.GetDomNode().style.margin=this.GetSpacing().ToCss();}},RenderTitle:function(){if(this.IsRendered()){if(this.m_title!==null){this.m_title.AssignText(this.GetDomNode(),'title');}else{this.GetDomNode().removeAttribute('title');}}},SelectOption:function(opt,triggerChange){if(opt){if(opt.canSelect){var index=this.GetIndex(opt);if(index==-1){return;}
this.GetDomNode().options.selectedIndex=index;if(triggerChange){this.OnChange();}}}},SelectOptionByKey:function(key,triggerChange){var opt=this.GetOption(key);if(opt!==null){this.SelectOption(opt,triggerChange);}},SetFloat:function(val){this.m_float=val;this.RenderFloat();},SetIsEnabled:function(isEnabled){if(isEnabled){this.Enable();}else{this.Disable();}},SetTitle:function(title){this.m_title=(title===undefined)?null:title;this.RenderTitle();},SetIsDisplayed:function(isDisplayed){if(this.IsDisplayed()!=isDisplayed){if(isDisplayed){this.GetDomNode().style.display='inline';}else{this.GetDomNode().style.display='none';}
this.m_isDisplayed=isDisplayed;var transformEvent=new D2L.TransformEvent(this.GetDomNode());transformEvent.Bubble();}},SetIsEnabled:function(isEnabled){if(isEnabled){this.Enable();}else{this.Disable();}},SetOnChange:function(onChange){this.m_onChange=onChange;},Show:function(){this.SetIsDisplayed(true);},ToggleEnabled:function(){if(this.IsEnabled()){this.Disable();}else{this.Enable();}}});D2L.Control.SelectList.InstallEvents=function(domNode,GetControl){UI.AttachObject(domNode,'onchange',function(e){var me=GetControl();me.OnChange.call(me,e);});};D2L.SelectList=D2L.Control.SelectList.extend({Construct:function(name,onChange){arguments.callee.$.Construct.call(this);this.m_onChange=onChange;}});

D2L.Control.SelectOption=D2L.Control.extend({Construct:function(key,val,text){arguments.callee.$.Construct.call(this,D2L.Control.Type.SelectOption);if(key===undefined){key='';}
if(val===undefined){val='';}
if(text===undefined||text===null){text='';}else if(text.isString===undefined){text=text.toString();}
this.canSelect=true;this.depth=0;this.key=key;this.m_depthStr='';this.m_sl=null;this.text=text.stripHtml();this.val=val;this.m_options=[];},AppendChild:function(opt){return this.InsertBefore(opt,null);},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);if(this.canSelect){this.SetDomNode(document.createElement('OPTION'));this.AttachObject(this.IDomNode,'ID2L',this);this.GetDomNode().value=this.val;var depthStr='';for(var i=0;i<this.depth;i++){depthStr+='&nbsp;&nbsp;&nbsp;';}
if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){depthStr=depthStr.replace(/&nbsp;/g,' ');this.GetDomNode().text=depthStr+this.text;}else{this.GetDomNode().innerHTML=depthStr+this.text;}}else{this.SetDomNode(document.createElement('OPTGROUP'));this.AttachObject(this.IDomNode,'ID2L',this);this.GetDomNode().label=this.text;}
this.m_depthStr=depthStr;}},DeserializeMin:function(deserializer){this.key=deserializer.GetMember();this.val=deserializer.GetMember();this.canSelect=deserializer.GetBoolean();this.m_options=deserializer.GetObjectArrayMin(D2L.Control.SelectOption);},GetDepth:function(){return this.depth;},GetKey:function(){return this.key;},GetText:function(){return this.text;},GetVal:function(){return this.val;},InsertBefore:function(opt,beforeOpt){if(!opt||opt===undefined||opt===null||opt.GetControlType()!=D2L.Control.Type.SelectOption){return null;}
if(!beforeOpt||beforeOpt===undefined||beforeOpt===null||beforeOpt.GetControlType()!=D2L.Control.Type.SelectOption){beforeOpt=null;}
this.BuildDom();var index=-1,insertBefore=null;if(beforeOpt!==null){for(var i=0;i<this.m_children.length;i++){if(this.m_children[i]==beforeOpt){index=i;break;}}
if(index!=-1){if(beforeOpt.m_previousSibling){beforeOpt.m_previousSibling.m_nextSibling=opt;opt.m_previousSibling=beforeOpt.m_previousSibling;}
beforeOpt.m_previousSibling=opt;opt.m_nextSibling=beforeOpt;}}
if(index!=-1){insertBefore=beforeOpt;this.m_children.splice(index,0,opt);}else{if(this.m_children.length>0){var optTemp=this.m_children[this.m_children.length-1];optTemp.m_nextSibling=opt;opt.m_previousSibling=optTemp;}
insertBefore=this.m_nextSibling;var temp=this;while(insertBefore===null&&temp.m_parent!==this.m_sl){temp=temp.m_parent;insertBefore=temp.m_nextSibling;}
this.m_children.push(opt);}
opt.depth=this.depth+1;opt.m_parent=this;opt.m_sl=this.m_sl;this.m_sl.InsertHelper(opt,insertBefore);return opt;},InsertSorted:function(opt){var isGreaterThan=function(opt1,opt2){return(opt1.text.toLowerCase()>opt2.text.toLowerCase());};return arguments.callee.$.InsertSorted.call(this,opt,isGreaterThan);},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_sl=this.GetDomNode().parentNode.ID2L;this.text=this.GetDomNode().innerHTML.toString().stripHtml().replace(/^(&nbsp;)*/,'');if(parent!==this.m_sl){this.depth=parent.depth+1;}
for(var i=0;i<this.m_options.length;i++){this.m_sl.options.push(this.m_options[i]);this.m_options[i].IntegrateChild(this,this.m_sl.GetDomNode().childNodes[this.m_sl.options.length-1]);}},RemoveChild:function(opt){if(opt&&opt.m_parent==this){while(opt.m_children.length>0){opt.RemoveChild(opt.m_children[0]);}
arguments.callee.$.RemoveChild.call(this,opt);for(var i=0;i<this.m_sl.options.length;i++){if(this.m_sl.options[i]==opt){this.m_sl.options.splice(i,1);break;}}
return opt;}
return null;},SetText:function(text){this.text=text.stripHtml();if(this.GetDomNode()){if(this.canSelect){this.GetDomNode().text=this.m_depthStr+this.text;}else{this.GetDomNode().label=this.text;}}},SetVal:function(val){this.val=val;if(this.GetDomNode()){this.GetDomNode().value=val;}}});D2L.SelectOption=D2L.Control.SelectOption;

D2L.Control.Selector=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_isRequired=false;this.m_itemListNode=null;this.m_items=[];this.m_keysNode=null;this.m_orientation=D2L.Control.Selector.Orientation.Horizontal;this.m_selectedItem=null;this.m_selectedMsg=new D2L.LP.Text.LangTerm('Framework.Selector.lblItemIsSelected');this.m_selectionMode=D2L.Control.Selector.SelectionModes.Single;this.m_selectItemEvent=new D2L.EventHandler();this.m_summary='';this.m_summaryNode=null;this.m_unSelectedMsg=new D2L.LP.Text.LangTerm('Framework.Selector.lblItemIsNotSelected');this.m_unSelectItemEvent=new D2L.EventHandler();this.Init();},AddItem:function(item){if(item!=null){for(var i=0;i<this.m_items.length;i++){if(item.GetKey()==this.m_items[i].GetKey()){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.SmlText('Selector item already has '+'the specified key \'[0]\'.',item.GetKey()),true);return;}}
if(this.m_selectionMode==D2L.Control.Selector.SelectionModes.Single){item.SetIsSelected(false);}
item.Init(this);this.m_items.push(item);if(this.IsRendered()){this.RenderItems([item]);}}},BuildDom:function(){if(!this.IsRendered()){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('div'));this.GetDomNode().className='dsel_c';this.Render();}},GetItemByKey:function(key){if(key!=null){for(var i=0;i<this.m_items.length;i++){if(this.m_items[i].GetKey()==key){return this.m_items[i];}}}
return null;},GetItemSummaryMsg:function(isSelected){if(isSelected){return this.m_selectedMsg;}else{return this.m_unSelectedMsg;}},GetOrientation:function(){return this.m_orientation;},GetSelectedItem:function(){return this.m_selectedItem;},GetSelectedItemCount:function(){return this.GetSelectedItems().length;},GetSelectedItemKey:function(){if(this.m_selectedItem!=null){return this.m_selectedItem.GetKey();}else{return null;}},GetSelectedItems:function(){var items=[];for(var i=0;i<this.m_items.length;i++){if(this.m_items[i].IsSelected()){items.push(this.m_items[i]);}}
return items;},GetSelectionMode:function(){return this.m_selectionMode;},GetSummary:function(){return this.m_summary;},Init:function(){},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this);this.SetSummary(deserializer.GetObject(D2L.LP.Text.IText));this.m_orientation=deserializer.GetMember();this.m_isRequired=deserializer.GetBoolean();this.m_selectionMode=deserializer.GetMember();var selectedItemKey=deserializer.GetMember();var onSelect=deserializer.GetMember();if(onSelect.length>0&&window[onSelect]!==undefined){this.m_selectItemEvent.RegisterMethod(function(item){window[onSelect](item);});}
var onUnSelect=deserializer.GetMember();if(onUnSelect.length>0&&window[onUnSelect]!==undefined){this.m_unSelectItemEvent.RegisterMethod(function(item){window[onUnSelect](item);});}
this.m_items=deserializer.GetObjectArrayMin(D2L.Control.Selector.Item);for(var i=0;i<this.m_items.length;i++){this.m_items[i].Init(this);}
this.SelectItem(this.GetItemByKey(selectedItemKey),false);this.Render();},IsRequired:function(){return this.m_isRequired;},IsChangeSelectionAllowed:function(item){if(item!=null){return true;}else{return false;}},RemoveItem:function(item){if(item!=null){if((!this.IsRequired())||(this.m_selectedItem!=item)){var index=-1;for(var i=0;i<this.m_items.length;i++){if(this.m_items[i]==item){index=i;break;}}
if(index!=-1){this.m_items.splice(index,1);for(var i=0;i<this.m_items.length;i++){if(i==0){this.m_keysNode.value=this.m_items[i].GetKey();}else{this.m_keysNode.value=this.m_keysNode.value+','+this.m_items[i].GetKey();}}
this.m_itemListNode.removeChild(item.GetNode());if(this.m_selectedItem==item){this.UnSelectItem(item);}}}}},Render:function(){this.m_summaryNode=this.CreateElement('span');this.m_summaryNode.className='dsr';this.m_summary.AssignText(this.m_summaryNode,'innerHTML');this.GetDomNode().appendChild(this.m_summaryNode);this.m_itemListNode=this.CreateElement('ul');this.SetOrientation(this.m_orientation);this.GetDomNode().appendChild(this.m_itemListNode);this.m_keysNode=this.CreateElement('input');this.m_keysNode.name=this.GetMappedId()+'_keys';this.m_keysNode.type='hidden';this.m_keysNode.value='';this.GetDomNode().appendChild(this.m_keysNode);this.RenderItems(this.m_items);var clear=this.CreateElement('span');clear.className='clear';this.GetDomNode().appendChild(clear);},RenderItems:function(items){var item=null;var itemNode=null;for(var i=0;i<items.length;i++){item=items[i];itemNode=item.Render();if((i==0)&&(this.m_itemListNode.childNodes.length==0)){itemNode.className='f';this.m_keysNode.value=item.GetKey();}else{this.m_keysNode.value=this.m_keysNode.value+','+item.GetKey();}
this.m_itemListNode.appendChild(itemNode);}},SelectItem:function(item,doTriggerSelectEvent){if(doTriggerSelectEvent===undefined){doTriggerSelectEvent=true;}
if(this.m_selectionMode==D2L.Control.Selector.SelectionModes.Single){if(this.m_selectedItem!=null&&this.m_selectedItem!=item){this.m_selectedItem.SetIsSelected(false);}
this.m_selectedItem=item;}else{this.m_selectedItem=null;}
if(doTriggerSelectEvent){this.SelectItemEvent().Trigger(item);}},SelectItemEvent:function(){return this.m_selectItemEvent;},SetIsRequired:function(isRequired){this.m_isRequired=isRequired;},SetOrientation:function(orientation){this.m_orientation=orientation;if(this.IsRendered()){if(this.m_orientation==D2L.Control.Selector.Orientation.Vertical){this.m_itemListNode.className='dsel_lv';}else{this.m_itemListNode.className='dsel_lh';}}},SetSelectedItem:function(item){if(item!=null){item.SetIsSelected(true);}else{if(!this.IsRequired()){item=this.m_selectedItem;if(item!=null){item.SetIsSelected(false);}}}},SetSelectedItemByKey:function(key){if(key!=null){this.SetSelectedItem(this.GetItemByKey(key));}else{this.SetSelectedItem(null);}},SetSelectionMode:function(selectionMode){this.m_selectionMode=selectionMode;},SetSummary:function(summary){this.m_summary=summary;if(this.m_summaryNode!=null){this.m_summary.AssignText(this.m_summaryNode,'innerHTML');}},UnSelectItem:function(item,doTriggerUnSelectEvent){if(doTriggerUnSelectEvent===undefined){doTriggerUnSelectEvent=true;}
if(this.m_selectedItem==item){this.m_selectedItem=null;}
if(doTriggerUnSelectEvent){this.UnSelectItemEvent().Trigger(item);}},UnSelectItemEvent:function(){return this.m_unSelectItemEvent;}});

D2L.Control.Selector.Orientation={Horizontal:0,Vertical:1};D2L.Control.Selector.SelectionModes={Single:0,Multiple:1};

D2L.Control.Selector.Item=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_description='';this.m_descriptionNode=null;this.m_image=new D2L.Control.Image();this.m_isSelected=false;this.m_key='';this.m_node=null;this.m_selectEvent=new D2L.EventHandler();this.m_selector=null;this.m_summaryNode=null;this.m_titleNode=null;this.m_title='';this.m_unSelectEvent=new D2L.EventHandler();this.m_valueNode=null;},ApplyStyle:function(){if(this.m_node!=null){if(this.IsSelected()){this.m_node.firstChild.className='s';}else{this.m_node.firstChild.className='';}}},ApplyText:function(){if(this.m_node!=null){this.m_selector.GetItemSummaryMsg(this.IsSelected()).AssignText(this.m_summaryNode,'innerHTML');}},DeserializeMin:function(deserializer){this.SetKey(deserializer.GetMember());this.SetTitle(deserializer.GetObject(D2L.LP.Text.IText));this.SetDescription(deserializer.GetObject(D2L.LP.Text.IText));this.SetIsSelected(deserializer.GetBoolean());this.SetAlt(deserializer.GetObject(D2L.LP.Text.IText));this.SetImage(deserializer.GetObjectMin(D2L.Images.Image));var onSelect=deserializer.GetMember();if(onSelect.length>0&&window[onSelect]!==undefined){this.m_selectEvent.RegisterMethod(function(item){window[onSelect](item);});}
var onUnSelect=deserializer.GetMember();if(onUnSelect.length>0&&window[onUnSelect]!==undefined){this.m_unSelectEvent.RegisterMethod(function(item){window[onUnSelect](item);});}},GetAlt:function(){return this.m_image.GetAlt();},GetDescription:function(){return this.m_description;},GetImage:function(){return this.m_image.GetImage();},GetKey:function(){return this.m_key;},GetNode:function(){return this.m_node;},GetTitle:function(){return this.m_title;},Init:function(selector){this.m_selector=selector;},IsSelected:function(){return this.m_isSelected;},HandleOnClick:function(){if(this.m_selector.IsRequired()){if(this.m_selector.GetSelectionMode()==D2L.Control.Selector.SelectionModes.Single){this.SetIsSelected(true);}else{if(this.m_selector.GetSelectedItemCount()>1){this.ToggleSelected();}else{this.SetIsSelected(true);}}}else{this.ToggleSelected();}},Render:function(){this.m_node=this.m_selector.CreateElement('li');var anchorNode=this.m_selector.CreateElement('a');this.m_title.AssignText(anchorNode,'title');anchorNode.href='javascript://';var me=this;this.AttachObject(anchorNode,'onclick',function(){me.HandleOnClick();});this.m_image.AppendTo(anchorNode);this.m_titleNode=this.m_selector.CreateElement('span');this.m_titleNode.className='dsel_it';this.m_title.AssignText(this.m_titleNode,'innerHTML');if((this.m_description!=null)&&(this.m_description!='')){this.m_descriptionNode=this.m_selector.CreateElement('div');this.m_descriptionNode.className='dsel_id';this.m_description.AssignText(this.m_descriptionNode,'innerHTML');}
this.m_summaryNode=this.m_selector.CreateElement('span');this.m_summaryNode.className='dsr';this.m_valueNode=this.m_selector.CreateElement('input');this.m_valueNode.name=this.m_selector.GetMappedId()+'_key_'+this.m_key;this.m_valueNode.type='hidden';this.m_valueNode.value=this.m_isSelected;anchorNode.appendChild(this.m_titleNode);anchorNode.appendChild(this.m_summaryNode);if(this.m_descriptionNode!=null){anchorNode.appendChild(this.m_descriptionNode);}
anchorNode.appendChild(this.m_valueNode);this.m_node.appendChild(anchorNode);this.ApplyStyle();this.ApplyText();return this.m_node;},SelectEvent:function(){return this.m_selectEvent;},SetAlt:function(alt){this.m_image.SetAlt(alt);},SetDescription:function(description){this.m_description=description;if(this.m_descriptionNode!=null){this.m_description.AssignText(this.m_descriptionNode,'innerHTML');}},SetImage:function(image){this.m_image.SetImage(image);},SetIsSelected:function(isSelected){if(this.m_selector!=null){if(this.m_selector.IsChangeSelectionAllowed(this)){this.m_isSelected=isSelected;if(isSelected){this.m_selector.SelectItem(this);this.m_selectEvent.Trigger(this);}else{this.m_selector.UnSelectItem(this);this.m_unSelectEvent.Trigger(this);}}}else{this.m_isSelected=isSelected;}
if(this.m_valueNode!=null){this.m_valueNode.value=this.m_isSelected;}
this.ApplyStyle();this.ApplyText();},SetKey:function(key){this.m_key=key;},SetTitle:function(title){this.m_title=title;if(this.m_titleNode!=null){this.m_title.AssignText(this.m_titleNode,'innerHTML');}},ToggleSelected:function(){this.SetIsSelected(!this.IsSelected());},UnSelectEvent:function(){return this.m_unSelectEvent;}});

D2L.Control.Shim=D2L.Control.extend({Construct:function(domScope,isTimeBased,zIndex){if(isTimeBased===undefined){isTimeBased=false;}
arguments.callee.$.Construct.call(this);this.m_backgroundColour='#333300';this.m_domScope=domScope;this.m_externalObjects=[];this.m_height=0;this.m_isTimeBased=isTimeBased;this.m_opacity=0.5;this.m_posX=0;this.m_posY=0;this.m_width=0;this.m_zIndex=zIndex;if(isTimeBased){this.m_backgroundColour='#ffffff';this.m_opacity=0;}},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetWindow().document.createElement('div'));domNode.className='ddial_shim';domNode.style.zIndex=this.m_zIndex;this.RenderHeight();this.RenderOpacity();this.RenderPosition();this.RenderWidth();},GetBackgroundColour:function(){return this.m_backgroundColour;},GetHeight:function(){return this.m_height;},GetOpacity:function(){return this.m_opacity;},GetPosition:function(){return{'x':this.m_posX,'y':this.m_posY};},GetWidth:function(){return this.m_width;},RenderBackgroundColour:function(){if(this.IsRendered()){this.GetDomNode().style.backgroundColor=this.GetBackgroundColour();}},RenderHeight:function(){if(this.IsRendered()){this.GetDomNode().style.height=this.GetHeight()+'px';}},RenderOpacity:function(){if(this.IsRendered()){if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){this.GetDomNode().style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+
(this.GetOpacity()*100)+')';}else{this.GetDomNode().style.opacity=this.GetOpacity();}}},RenderPosition:function(){if(this.IsRendered()){this.GetDomNode().style.left=this.m_posX+'px';this.GetDomNode().style.top=this.m_posY+'px';}},RenderWidth:function(){if(this.IsRendered()){this.GetDomNode().style.width=this.GetWidth()+'px';}},SetBackgroundColour:function(colour){this.m_backgroundColour=colour;this.RenderBackgroundColour();},SetHeight:function(height){this.m_height=height;this.RenderHeight();},SetIsVisible:function(isVisible){if(isVisible){this.SetObjectVisibility(this.m_domScope);this.BuildDom();var me=this;var body=me.GetWindow().document.getElementsByTagName('body');if(body&&body.length==1){body[0].appendChild(me.GetDomNode());}
if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion>=8){setTimeout(function(){me.RenderBackgroundColour();},0);}else{me.RenderBackgroundColour();}
if(this.m_isTimeBased){setTimeout(function(){me.GetDomNode().style.backgroundImage='url(/d2l/img/lp/Dialog/loading.gif)';me.SetBackgroundColour('#d6e1f3');me.SetOpacity(0.3);},500);}}else if(this.IsRendered()){for(var n=0;n<this.m_externalObjects.length;n++){try{this.m_externalObjects[n].style.visibility='visible';}catch(e){}}
this.GetDomNode().parentNode.removeChild(this.GetDomNode());}},SetObjectVisibility:function(domNode){var tags=['applet','object','embed'];if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE&&UI.GetBrowserInfo().MajorVersion<7){tags.push('select');}
for(var tagIndex=0;tagIndex<tags.length;tagIndex++){var domNodes=domNode.getElementsByTagName(tags[tagIndex]);for(var n=0;n<domNodes.length;n++){domNodes[n].style.visibility='hidden';this.m_externalObjects.push(domNodes[n]);}}
var iframes=domNode.getElementsByTagName('iframe');for(var m=0;m<iframes.length;m++){try{if(iframes[m].contentWindow){this.SetObjectVisibility(iframes[m].contentWindow.document);}}catch(e){}}},SetOpacity:function(opacity){this.m_opacity=opacity;this.RenderOpacity();},SetPosition:function(x,y){this.m_posX=x;this.m_posY=y;this.RenderPosition();},SetSize:function(width,height){this.SetWidth(width);this.SetHeight(height);},SetWidth:function(width){this.m_width=width;this.RenderWidth();}});

D2L.Control.SplitLayout=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_height=null;this.m_isFullScreen=false;this.m_nestedSplitLayouts=[];this.m_orientation=D2L.Control.SplitLayout.Orientation.Horizontal;this.m_panels=[];this.m_recentlyResizedPanel=null;this.m_width=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_height=deserializer.GetMember();this.m_width=deserializer.GetMember();this.m_isFullScreen=deserializer.GetBoolean();this.m_orientation=deserializer.GetMember();this.m_panels=deserializer.GetObjectArrayMin(D2L.Control.SplitLayoutPanel);this.m_hasParentSplitLayout=deserializer.GetBoolean();if(this.m_hasParentSplitLayout){var parentSplitLayoutControlId=deserializer.GetObjectMin(D2L.Control.Id);if(parentSplitLayoutControlId){UI.GetControl(parentSplitLayoutControlId.ID(),parentSplitLayoutControlId.SID()).RegisterNestedSplitLayout(this);}}
var j=0;for(var i=0;i<this.m_panels.length;i++){if(this.GetDomNode().childNodes[j].tagName.toLowerCase().indexOf('h')==0){j++;}
this.m_panels[i].IntegrateChild(this,this.GetDomNode().childNodes[j]);j++;}
this.InstallEvents();if(this.m_isFullScreen){UI.GetById('d2l_body').style.overflow='hidden';this.GetWindow().document.getElementsByTagName('html')[0].style.overflow='hidden';}
var me=this;setTimeout(function(){me.AdjustSize();var loading=UI.GetById(me.GetMappedId()+"_loading");if(loading){loading.parentNode.removeChild(loading);}
me.GetDomNode().style.visibility='visible';},0);},AdjustHeight:function(){if(this.m_isFullScreen){var offsetParent=this.GetDomNode();var posX=0;while(offsetParent){posX+=offsetParent.offsetTop;offsetParent=offsetParent.offsetParent;}
var windowHeight=UI.GetWindowHeight();var h=windowHeight-posX;if(h<10){h=10;}
this.GetDomNode().style.height=h+'px';}else if(this.m_height!=''){this.GetDomNode().style.height=this.m_height+'px';}else{if(this.m_hasParentSplitLayout){this.GetDomNode().style.height='100%';}else{this.GetDomNode().style.height='auto';}
this.GetDomNode().style.height=this.GetDomNode().offsetHeight+'px';}},AdjustSize:function(){this.AdjustHeight();this.AdjustWidth();this.AdjustPanels();for(var i=0;i<this.m_nestedSplitLayouts.length;i++){this.m_nestedSplitLayouts[i].AdjustSize();}},AdjustWidth:function(){if(this.m_isFullScreen){this.GetDomNode().style.width='auto';this.GetDomNode().style.width=this.GetDomNode().offsetWidth+'px';}else if(this.m_width!=''){this.GetDomNode().style.width=this.m_width+'px';}else{this.GetDomNode().style.width='auto';this.GetDomNode().style.width=this.GetDomNode().offsetWidth+'px';}},AdjustPanels:function(){var offsetProperty='';var styleProperty=''
if(this.m_orientation==D2L.Control.SplitLayout.Orientation.Horizontal){offsetProperty='offsetWidth';styleProperty='width';}else{offsetProperty='offsetHeight';styleProperty='height';}
var remainingSize=this.GetDomNode()[offsetProperty];var origSize=this.GetDomNode()[offsetProperty];var totalSize=0;var autoPanels=[];var autoPanelsAssignedSizes=[];for(var i=0;i<this.m_panels.length;i++){var panel=this.m_panels[i];if(panel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Auto){panel.RemoveFixedSize(styleProperty);var size=panel.GetDomNode()[offsetProperty]+1;if(totalSize+size>origSize){size=origSize-totalSize;}
if(totalSize>=origSize){size=0;}
autoPanels.push(panel);autoPanelsAssignedSizes.push(size);panel.SetFixedSize(styleProperty,size);remainingSize-=size;totalSize+=size;}}
var pixelPanels=[];var pixelPanelsAssignedSizes=[];for(var i=0;i<this.m_panels.length;i++){var panel=this.m_panels[i];if(panel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Pixel){var size=panel.GetSize().GetValue();if(totalSize+size>origSize){size=origSize-totalSize;}
if(totalSize>=origSize){size=0;}
pixelPanels.push(panel);pixelPanelsAssignedSizes.push(size);panel.SetFixedSize(styleProperty,size);remainingSize-=size;totalSize+=size;}}
var percentPanels=[];var percentPanelsAssignedSizes=[];var remainingSizeForPercent=remainingSize;for(var i=0;i<this.m_panels.length;i++){var panel=this.m_panels[i];if(panel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Percentage){var size=Math.floor(remainingSizeForPercent*panel.GetSize().GetValue()/100);if(remainingSize<=0){size=0;}
if(totalSize+size>origSize){size=origSize-totalSize;}
if(totalSize>=origSize){size=0;}
percentPanels.push(panel);percentPanelsAssignedSizes.push(size);panel.SetFixedSize(styleProperty,size);remainingSize-=size;totalSize+=size;}}
var sumWildcardMultipliers=0;var remainingSizeForWildcard=remainingSize;for(var i=0;i<this.m_panels.length;i++){var panel=this.m_panels[i];if(panel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Wildcard){sumWildcardMultipliers+=panel.GetSize().GetValue();}}
var eachWildcardSize=Math.floor(remainingSizeForWildcard/sumWildcardMultipliers);if(eachWildcardSize<0){eachWildcardSize=0;}
for(var i=0;i<this.m_panels.length;i++){var panel=this.m_panels[i];if(panel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Wildcard){panel.SetFixedSize(styleProperty,eachWildcardSize*panel.GetSize().GetValue());remainingSize-=size;totalSize+=eachWildcardSize;}}
var forgiveness=this.m_panels.length;if(totalSize<origSize-forgiveness){var delta=origSize-totalSize;if(percentPanels.length>0){var sizeForEach=Math.floor(delta/percentPanels.length);for(var i=0;i<percentPanels.length;i++){var panel=percentPanels[i];panel.SetFixedSize(styleProperty,percentPanelsAssignedSizes[i]+sizeForEach);}}else if(pixelPanels.length>1||(this.m_recentlyResizedPanel==null&&pixelPanels.length>0)){var sizeForEach=Math.floor(delta/(this.m_recentlyResizedPanel==null?pixelPanels.length:pixelPanels.length-1));for(var i=0;i<pixelPanels.length;i++){var panel=pixelPanels[i];if(panel!=this.m_recentlyResizedPanel){panel.SetFixedSize(styleProperty,pixelPanelsAssignedSizes[i]+sizeForEach);}}}else if(autoPanels.length>1){var sizeForEach=Math.floor(delta/autoPanels.length);for(var i=0;i<autoPanels.length;i++){var panel=autoPanels[i];panel.SetFixedSize(styleProperty,autoPanelsAssignedSizes[i]+sizeForEach);}}}},GetOrientation:function(){return this.m_orientation;},GetPanels:function(){return this.m_panels;},GetPanelByKey:function(key){var panels=this.GetPanels();for(var i=0;i<panels.length;i++){if(panels[i].GetKey()==key){return panels[i];}}},HandleBrowserResize:function(){if(this.m_isFullScreen||(!this.m_width&&UI.IsPageFullScreen())){this.AdjustSize();}},HandlePanelResize:function(){this.AdjustSize();},InstallEvents:function(){var me=this;UI.GetWindowEventManager().Resize.Register(this,'HandleBrowserResize');for(var i=0;i<this.m_panels.length;i++){var panel=this.m_panels[i];panel.OnResize.Register(this,'HandlePanelResize');}
if(this.m_isFullScreen){UI.GetMessageArea().OnHeightChange.RegisterMethod(function(){me.AdjustSize();});}},RegisterNestedSplitLayout:function(splitLayout){this.m_nestedSplitLayouts.push(splitLayout);}});D2L.Control.SplitLayout.Orientation={Horizontal:1,Vertical:2};

D2L.Control.SplitLayoutPanel=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_dragDropScrollTargetTop=null;this.m_dragDropScrollTargetBottom=null;this.m_hasParentSplitLayout=false;this.m_hasDragDropScrollTarget=false;this.m_backgroundColour='';this.m_beforeHiddingSize=null;this.m_gutterNode=null;this.m_hasGutter=true;this.m_isHidden=false;this.m_isResizable=true;this.m_isScrollable=true;this.m_key='';this.m_panelWrapper=null;this.m_panelWrapperInner=null;this.m_size=null;this.m_splitLayout=null;this.m_title=null;this.OnResize=new D2L.EventHandler();},DeserializeMin:function(deserializer){this.m_hasDragDropScrollTarget=deserializer.GetBoolean();this.m_backgroundColour=deserializer.GetMember();this.m_isResizable=deserializer.GetBoolean();this.m_hasGutter=deserializer.GetBoolean();this.m_isScrollable=deserializer.GetBoolean();this.m_title=deserializer.GetObjectMin(D2L.LP.Text.IText);this.m_size=D2L.Style.Utility.ParseMeasurementUnit(deserializer.GetMember());this.m_key=deserializer.GetMember();},GetBackgroundColour:function(){return this.m_backgroundColour;},GetIsHidden:function(){return this.m_isHidden;},GetIsResizable:function(){return this.m_isResizable;},GetIsScrollable:function(){return this.m_isScrollable;},GetKey:function(){return this.m_key;},GetNextSiblingPanel:function(){var nextPanel=null;for(var i=0;i<this.GetSplitLayout().GetPanels().length;i++){var panel=this.GetSplitLayout().GetPanels()[i];if(panel==this&&(i+1)<this.GetSplitLayout().GetPanels().length){nextPanel=this.GetSplitLayout().GetPanels()[i+1];break;}}
return nextPanel;},GetPreviousSiblingPanel:function(){var nextPanel=null;for(var i=0;i<this.GetSplitLayout().GetPanels().length;i++){var panel=this.GetSplitLayout().GetPanels()[i];if(panel==this&&i>1){nextPanel=this.GetSplitLayout().GetPanels()[i-1];break;}}
return nextPanel;},GetTitle:function(){return this.m_title;},GetSize:function(){return this.m_size;},GetSplitLayout:function(){return this.m_splitLayout;},HandleOnTransform:function(){this.OnResize.Trigger();},HasGutter:function(){return this.m_hasGutter;},Hide:function(){if(!this.m_isHidden){this.m_beforeHiddingSize=this.GetSize();var sizeZero=new D2L.Style.Measurement.Unit(D2L.Style.Measurement.UnitType.Px,0);this.SetSize(sizeZero);this.GetDomNode().style.display='none';this.m_isHidden=true;}},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_splitLayout=parent;if(this.HasGutter()){this.m_gutterNode=this.GetDomNode().childNodes[1];}
if(this.m_hasDragDropScrollTarget){this.m_panelWrapper=this.GetDomNode().firstChild.childNodes[1];}else{this.m_panelWrapper=this.GetDomNode().firstChild.firstChild;}
this.m_panelWrapperInner=this.m_panelWrapper.firstChild;if(this.m_hasDragDropScrollTarget){this.m_dragDropScrollTargetTop=this.GetDomNode().firstChild.firstChild;this.m_dragDropScrollTargetBottom=this.GetDomNode().firstChild.lastChild;}
this.InstallEvents();},InstallEvents:function(){var me=this;if(this.m_size.GetUnitType()==D2L.Style.Measurement.UnitType.Auto){if(this.GetDomNode().ID2LOnTransform===undefined){UI.AttachObject(this.GetDomNode(),'ID2LOnTransform',new D2L.EventHandler());}
var me=this;this.GetDomNode().ID2LOnTransform.RegisterMethod(function(evt){me.HandleOnTransform();});}
if(this.HasGutter()&&this.GetIsResizable()){this.InstallResizeBarEvents();}
if(this.m_hasDragDropScrollTarget&&this.m_dragDropScrollTargetTop&&this.m_dragDropScrollTargetBottom){var dragDropScrollTargetTopDD=new D2L.DragDrop.Droppable(this.m_dragDropScrollTargetTop);var dragDropScrollTargetBottomDD=new D2L.DragDrop.Droppable(this.m_dragDropScrollTargetBottom);var keepScrolling=true;var DoScroll=function(up){var DoScrollTimeOut=function(){DoScroll(up);}
if(keepScrolling){if(up){me.m_panelWrapper.scrollTop=me.m_panelWrapper.scrollTop-10;}else{me.m_panelWrapper.scrollTop=me.m_panelWrapper.scrollTop+10;}
setTimeout(DoScrollTimeOut,10);}else{clearTimeout(DoScrollTimeOut);}}
var StartScrolling=function(up){if(up){me.m_dragDropScrollTargetTop.className='dsl_p_m_sclUpHov';}else{me.m_dragDropScrollTargetBottom.className='dsl_p_m_sclDnwHov';}
keepScrolling=true;DoScroll(up);UI.GetDragDropManager().RefreshCache();};var StopScrolling=function(){me.m_dragDropScrollTargetTop.className='dsl_p_m_sclUp';me.m_dragDropScrollTargetBottom.className='dsl_p_m_sclDnw';keepScrolling=false;UI.GetDragDropManager().RefreshCache();};dragDropScrollTargetTopDD.OnDragEnter.RegisterMethod(function(){StartScrolling(true);});dragDropScrollTargetBottomDD.OnDragEnter.RegisterMethod(function(){StartScrolling(false);});dragDropScrollTargetTopDD.OnDragExit.RegisterMethod(function(){StopScrolling();});dragDropScrollTargetBottomDD.OnDragExit.RegisterMethod(function(){StopScrolling();});dragDropScrollTargetTopDD.OnDragDropped.RegisterMethod(function(){StopScrolling();});dragDropScrollTargetBottomDD.OnDragDropped.RegisterMethod(function(){StopScrolling();});}},InstallResizeBarEvents:function(){var me=this;if(this.GetSplitLayout().GetOrientation()==D2L.Control.SplitLayout.Orientation.Horizontal){this.m_gutterNode.style.cursor='e-resize';}else{this.m_gutterNode.style.cursor='n-resize';}
var HandleMouseDownEvent=function(evt){var gutterNodeClone=me.m_gutterNode.cloneNode(true);gutterNodeClone.style.position='absolute';gutterNodeClone.style.left='1000';gutterNodeClone.style.zIndex=UI.GetZIndex();YAHOO.util.Dom.setStyle(gutterNodeClone,"opacity",0.7);if(me.m_splitLayout.GetOrientation()==D2L.Control.SplitLayout.Orientation.Horizontal){gutterNodeClone.style.height=me.m_gutterNode.offsetHeight+'px';}else{gutterNodeClone.style.width=me.m_gutterNode.offsetWidth+'px';}
var d2lBody=UI.GetById('d2l_body');d2lBody.appendChild(gutterNodeClone);var xy=YAHOO.util.Dom.getXY(me.m_gutterNode);var origXY=YAHOO.util.Dom.getXY(me.m_gutterNode);YAHOO.util.Dom.setXY(gutterNodeClone,xy);var theW=me.GetWindow();var parentLayoutXY=YAHOO.util.Dom.getXY(me.GetSplitLayout().GetDomNode());var parentLayoutHeight=me.GetSplitLayout().GetDomNode().offsetHeight;var parentLayoutWidth=me.GetSplitLayout().GetDomNode().offsetWidth;var prevSibilingPanel=me.GetPreviousSiblingPanel();var nexSiblingPanel=me.GetNextSiblingPanel();var bLeft;var bRight;var bTop;var bBottom;if(me.GetSplitLayout().GetOrientation()==D2L.Control.SplitLayout.Orientation.Horizontal){if(prevSibilingPanel!=null){bLeft=YAHOO.util.Dom.getXY(prevSibilingPanel.GetDomNode())[0]+prevSibilingPanel.GetDomNode().offsetWidth;}else{bLeft=YAHOO.util.Dom.getXY(me.GetDomNode())[0];}
if(nexSiblingPanel){bRight=YAHOO.util.Dom.getXY(nexSiblingPanel.GetDomNode())[0]+nexSiblingPanel.GetDomNode().offsetWidth;}else{bRight=YAHOO.util.Dom.getXY(me.GetDomNode())[0]+me.GetDomNode().offsetWidth;}}else{if(prevSibilingPanel!=null){bTop=YAHOO.util.Dom.getXY(prevSibilingPanel.GetDomNode())[1]+prevSibilingPanel.GetDomNode().offsetHeight;}else{bTop=YAHOO.util.Dom.getXY(me.GetDomNode())[1];}
if(nexSiblingPanel){bBottom=YAHOO.util.Dom.getXY(nexSiblingPanel.GetDomNode())[1]+nexSiblingPanel.GetDomNode().offsetHeight;}else{bBottom=YAHOO.util.Dom.getXY(me.GetDomNode())[1]+me.GetDomNode().offsetHeight;}}
var start=function(evt){var newX=UI.GetCursorX(theW,evt);var newY=UI.GetCursorY(theW,evt);var isOutOfBound=false;if(me.GetSplitLayout().GetOrientation()==D2L.Control.SplitLayout.Orientation.Horizontal){var xToSet=newX-(gutterNodeClone.offsetWidth/2);if(xToSet<bLeft+5||xToSet>bRight-5-gutterNodeClone.offsetWidth){isOutOfBound=true;}else{xy[0]=xToSet;d2lBody.style.cursor='e-resize';}}else{var yToSet=newY-(gutterNodeClone.offsetHeight/2);if(yToSet<bTop+5||yToSet>bBottom-10-gutterNodeClone.offsetHeight){isOutOfBound=true;}else{xy[1]=yToSet;d2lBody.style.cursor='n-resize';}}
if(!isOutOfBound){gutterNodeClone.style.display='none';gutterNodeClone.style.display='block';YAHOO.util.Dom.setXY(gutterNodeClone,xy);}
if(theW.event){theW.event.cancelBubble=true;theW.event.returnValue=false;}else{evt.preventDefault();}};var stop=function(evt){d2lBody.style.cursor='default';var delta;if(me.GetSplitLayout().GetOrientation()==D2L.Control.SplitLayout.Orientation.Horizontal){delta=xy[0]-origXY[0];}else{delta=xy[1]-origXY[1];}
var thisPanel=me;var nextPanel=me.GetNextSiblingPanel();var panelToResize;if(thisPanel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Pixel){panelToResize=thisPanel;}else if(nextPanel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Pixel){panelToResize=nextPanel;}else if(thisPanel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Auto){panelToResize=thisPanel;}else if(nextPanel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Auto){panelToResize=nextPanel;}else if(thisPanel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Percentage){panelToResize=thisPanel;}else if(nextPanel.GetSize().GetUnitType()==D2L.Style.Measurement.UnitType.Percentage){panelToResize=nextPanel;}else{panelToResize=thisPanel;}
if(panelToResize==nextPanel){delta=delta*-1;}
panelToResize.ResizeBy(delta);if(theW.document.detachEvent){theW.document.detachEvent("onmousemove",start);theW.document.detachEvent("onmouseup",stop);}else if(theW.document.removeEventListener){theW.document.removeEventListener("mousemove",start,true);theW.document.removeEventListener("mouseup",stop,true);}
d2lBody.removeChild(gutterNodeClone);};if(theW.document.attachEvent){theW.document.attachEvent("onmousemove",start);theW.document.attachEvent("onmouseup",stop);}else if(theW.document.addEventListener){theW.document.addEventListener("mousemove",start,true);theW.document.addEventListener("mouseup",stop,true);evt.preventDefault();}};this.AttachObject(this.m_gutterNode,'onmousedown',function(evt){WindowEventManager.Click.Trigger(evt);HandleMouseDownEvent(evt);});},RemoveFixedSize:function(widthHeight){this.GetDomNode().style[widthHeight]='auto';this.m_panelWrapper.style[widthHeight]='auto';this.m_panelWrapperInner.style.width='auto';this.m_panelWrapperInner.style.height='auto';},ResizeBy:function(pixelDelta){var currentSizePx;if(this.GetSplitLayout().GetOrientation()==D2L.Control.SplitLayout.Orientation.Horizontal){currentSizePx=this.GetDomNode().offsetWidth;}else{currentSizePx=this.GetDomNode().offsetHeight;}
var newSizePx=currentSizePx+pixelDelta;var newSize=new D2L.Style.Measurement.Unit(D2L.Style.Measurement.UnitType.Px,newSizePx);this.GetSplitLayout().m_recentlyResizedPanel=this;this.SetSize(newSize);},SetFixedSize:function(widthHeight,size){this.GetDomNode().style[widthHeight]=size+'px';if(this.m_hasDragDropScrollTarget){this.m_panelWrapper.style.height='100%';this.m_dragDropScrollTargetBottom.style.width='100%';this.m_dragDropScrollTargetTop.style.width='100%';}
var childSize=size;if(this.HasGutter()){if(this.m_gutterNode.style.display!='none'){this.m_gutterNode.style.display='none';this.m_gutterNode.style.display='block';if(widthHeight=='width'){childSize-=this.m_gutterNode.offsetWidth;}else{childSize-=this.m_gutterNode.offsetHeight;}}}
if(childSize>0){this.m_panelWrapper.style[widthHeight]=childSize+'px';}
if(this.GetIsScrollable()){var widthSize=this.m_panelWrapper.offsetWidth-20;if(widthSize>20){this.m_panelWrapperInner.style.width=widthSize+'px';}
var heightSize=this.m_panelWrapper.offsetHeight-20;if(this.m_hasDragDropScrollTarget){heightSize-=20;}
if(heightSize>20){this.m_panelWrapperInner.style.height=heightSize+'px';}}else{this.m_panelWrapperInner.style.height='100%';this.m_panelWrapperInner.style.width='100%';}
if(this.m_hasDragDropScrollTarget){var offHeight=this.m_panelWrapper.offsetHeight-20;if(offHeight>0){this.m_panelWrapper.style.height=offHeight+'px';}
var topWidth=this.m_panelWrapper.offsetWidth;if(topWidth>0){this.m_dragDropScrollTargetTop.style.width=topWidth-1+'px';}
var bottomWidth=this.m_panelWrapper.offsetWidth;if(bottomWidth>0){this.m_dragDropScrollTargetBottom.style.width=bottomWidth-1+'px';}}},SetSize:function(size){this.m_size=size;this.OnResize.Trigger();},Show:function(){if(this.m_isHidden){this.GetDomNode().style.display='block';this.SetSize(this.m_beforeHiddingSize);this.m_isHidden=false;}}});

D2L.Control.Tabs={};D2L.Control.Tabs.AriaIsEnabled=true;

D2L.Control.Tabs.AriaController=D2L.Class.extend({Construct:function(tabGroup){arguments.callee.$.Construct.call(this);this.m_tabGroup=tabGroup;},Init:function(){var me=this;this.m_tabGroup.SelectTabEvent().RegisterMethod(function(tab){D2L.Util.Aria.SetAttribute(tab.m_objC.firstChild,'selected','true');});this.m_tabGroup.UnSelectTabEvent().RegisterMethod(function(tab){D2L.Util.Aria.SetAttribute(tab.m_objC.firstChild,'selected','false');});var header=this.m_tabGroup.GetDomNode().firstChild
var headerRow=header.firstChild.rows[0];D2L.Util.Aria.SetRole(headerRow,'tablist');for(var i=0;i<headerRow.cells.length;i++){var cell=headerRow.cells[i];D2L.Util.Aria.SetRole(cell,'presentation');if(cell.className=='d_tabs_c'||cell.className=='d_tabs_c_s'){D2L.Util.Aria.SetRole(cell.firstChild,'tab');}}
var container=this.m_tabGroup.GetDomNode().childNodes[1];D2L.Util.Aria.SetRole(container,'tabpanel');D2L.Util.Aria.SetAttribute(container,'expanded','true');}});

D2L.Control.Tab=D2L.Control.extend({Construct:function(text,name,onClick){arguments.callee.$.Construct.call(this);if(name===undefined){name='';}
if(onClick===undefined){onClick='';}
this.m_name=name;this.m_text=text;this.m_isSelected=false;this.m_onClick=new Function(onClick);this.m_objL=null;this.m_objC=null;this.m_objR=null;this.m_objLink=null;this.m_paddingTop='1em';this.m_paddingRight='1em';this.m_paddingBottom='1em';this.m_paddingLeft='1em';},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);if(this.m_name===undefined){this.m_name=this.GetUI().GetUniqueHtmlId();}
this.SetDomNode(this.GetUI().CreateElement('div'));this.GetDomNode().className='d_tabs_tab';this.IChildrenDomNode=this.GetUI().CreateElement('div');this.IChildrenDomNode.className='d_tabs_tabcontent';this.SetPadding(this.m_paddingTop,this.m_paddingRight,this.m_paddingBottom,this.m_paddingLeft);this.GetDomNode().appendChild(this.IChildrenDomNode);},Click:function(){this.Parent().m_tabToSelect=this;return this.m_onClick.call(this);},DeserializeMin:function(deserializer){this.m_name=deserializer.GetMember();this.m_text=deserializer.GetMember();this.m_isSelected=deserializer.GetBoolean();this.m_onClick=new Function(deserializer.GetMember());},GetName:function(){return this.m_name;},IntegrateChild:function(parent,domNode){arguments.callee.$.IntegrateChild.call(this,parent,domNode);this.m_objL=UI.GetById(parent.GetMappedId()+'_'+this.m_name+'_l');this.m_objC=this.m_objL.nextSibling
this.m_objLink=this.m_objC.firstChild;this.m_objR=this.m_objC.nextSibling;this.InstallEvents();},InstallEvents:function(){var me=this;this.AttachObject(this.m_objC,'onclick',function(){me.Parent().ClickTab(me.GetName());});var onmouseover=function(){if(this.parentNode.className!='d_tabs_c_s'){this.parentNode.className='d_tabs_c_o';}};var onmouseout=function(){if(this.parentNode.className!='d_tabs_c_s'){this.parentNode.className='d_tabs_c';}};this.AttachObject(this.m_objLink,'onmouseover',onmouseover);this.AttachObject(this.m_objLink,'onfocus',onmouseover);this.AttachObject(this.m_objLink,'onmouseout',onmouseout);this.AttachObject(this.m_objLink,'onblur',onmouseout);this.AttachObject(this.m_objLink,'onclick',function(){return false;});},IsSelected:function(){return this.m_isSelected;},SetPadding:function(top,right,bottom,left){this.m_paddingTop=top;this.m_paddingRight=right;this.m_paddingBottom=bottom;this.m_paddingLeft=left;if(this.IsRendered()){this.IChildrenDomNode.style.paddingTop=this.m_paddingTop;this.IChildrenDomNode.style.paddingRight=this.m_paddingRight;this.IChildrenDomNode.style.paddingBottom=this.m_paddingBottom;this.IChildrenDomNode.style.paddingLeft=this.m_paddingLeft;}}});

D2L.Control.TabGroup=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_ariaController=new D2L.Control.Tabs.AriaController(this);this.m_container=null;this.m_hasBorder=true;this.m_selectedTab=null;this.m_selectTabEvent=new D2L.EventHandler();this.m_tabToSelect=null;this.m_unSelectTabEvent=new D2L.EventHandler();this.OnClick=new D2L.EventHandler();var me=this;Nav.OnNavigate.RegisterMethod(function(){if(me.m_tabToSelect){me.m_oldSelectedTab=me.m_selectedTab;me.m_selectedTab=me.m_tabToSelect;}});Nav.OnNavigationFailure.RegisterMethod(function(){me.m_tabToSelect=null;if(me.m_oldSelectedTab){me.m_selectedTab=me.m_oldSelectedTab;}});this.OnChildAdd.RegisterMethod(function(evt,child){if(me.IsRendered()){me.BuildDom_Tab(child);}});},IntegrateControlMin:function(deserializer){this.m_container=this.GetDomNode().childNodes[1];var tabs=deserializer.GetObjectArrayMin(D2L.Control.Tab);var selectedTab='';for(var i=0;i<tabs.length;i++){tabs[i].IntegrateChild(this,UI.GetById(this.GetMappedId()+'_'+tabs[i].m_name));if(tabs[i].IsSelected()){selectedTab=tabs[i].m_name;}}
if(D2L.Control.Tabs.AriaIsEnabled){this.m_ariaController.Init();}
if(selectedTab.length>0){this.SelectTab(selectedTab);}},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);var domNode=this.SetDomNode(this.GetUI().CreateElement('div'));domNode.className='d_tabs';var header=this.GetUI().CreateElement('div');header.className='d_tabs_header';if(!this.m_hasBorder){header.style.background='none';}
domNode.appendChild(header);var headerTable=this.GetUI().CreateElement('table');headerTable.cellSpacing='0';headerTable.cellPadding='0';header.appendChild(headerTable);var headerTableRow=headerTable.insertRow(-1);this.m_container=this.GetUI().CreateElement('div');this.m_container.className='d_tabs_container';if(!this.m_hasBorder){this.m_container.style.border='none';this.m_container.style.background='none';}
domNode.appendChild(this.m_container);for(var i=0;i<this.Children().length;i++){if(i==0){var beforeTabsSpacerCell=headerTableRow.insertCell(-1);var beforeTabsSpacerImg=this.GetUI().CreateElement('img');beforeTabsSpacerImg.width='2';beforeTabsSpacerImg.height='1';beforeTabsSpacerImg.src='/d2l/tools/img/pixel.gif';beforeTabsSpacerCell.appendChild(beforeTabsSpacerImg);}
this.BuildDom_Tab(this.Children()[i]);}},BuildDom_Tab:function(tab){if(!this.IsRendered()){return;}
var headerTableRow=this.GetDomNode().firstChild.firstChild.rows[0];tab.BuildDom();tab.m_objL=headerTableRow.insertCell(-1);tab.m_objL.className='d_tabs_l';var leftImg=this.GetUI().CreateElement('img');leftImg.src='/d2l/tools/img/pixel.gif';leftImg.width='2';leftImg.seigth='1';tab.m_objL.appendChild(leftImg);tab.m_objC=headerTableRow.insertCell(-1);tab.m_objC.className='d_tabs_c';tab.m_objLink=this.GetUI().CreateElement('a');tab.m_objLink.href='javascript://';tab.m_objLink.appendChild(this.CreateTextNode(tab.m_text));tab.m_objC.appendChild(tab.m_objLink);tab.m_objR=headerTableRow.insertCell(-1);tab.m_objR.className='d_tabs_r';var rightImg=this.GetUI().CreateElement('img');rightImg.src='/d2l/tools/img/pixel.gif';rightImg.width='2';rightImg.seigth='1';tab.m_objR.appendChild(rightImg);if(tab.GetDomNode()){this.m_container.appendChild(tab.GetDomNode());}
var spacerCell=headerTableRow.insertCell(-1);var spacerImg=this.GetUI().CreateElement('img');spacerImg.width='2';spacerImg.height='1';spacerImg.src='/d2l/tools/img/pixel.gif';spacerCell.appendChild(spacerImg);headerTableRow.appendChild(spacerCell);tab.InstallEvents();},ClickTab:function(name){var tab=this.GetTab(name);if(tab&&tab!=this.m_selectedTab){tab.Click();this.OnClick.Trigger(tab);}},GetSelectedTab:function(){return this.m_selectedTab;},GetState:function(serializer){var tab=this.GetSelectedTab();if(tab){serializer.AddMember('SelectedTab',tab.m_name);}else{serializer.AddMember('SelectedTab','');}},GetTab:function(name){for(var i=0;i<this.Children().length;i++){if(this.Children()[i].m_name==name){return this.Children()[i];}}
return null;},SelectTab:function(name){if(this.m_selectedTab){var selectedTab=this.m_selectedTab;if(selectedTab.m_objL&&selectedTab.m_objC&&selectedTab.m_objR){selectedTab.m_objL.className='d_tabs_l';selectedTab.m_objC.className='d_tabs_c';selectedTab.m_objR.className='d_tabs_r';}
if(selectedTab.GetDomNode()){selectedTab.GetDomNode().style.display='none';}
selectedTab.m_isSelected=false;this.m_selectedTab=null;this.UnSelectTabEvent().Trigger(selectedTab);}
var tab=this.GetTab(name);if(tab){if(tab.m_objL&&tab.m_objC&&tab.m_objR){tab.m_objL.className='d_tabs_l_s';tab.m_objC.className='d_tabs_c_s';tab.m_objR.className='d_tabs_r_s';}
if(tab.GetDomNode()){tab.GetDomNode().style.display='block';}
tab.m_isSelected=true;this.m_selectedTab=tab;this.m_tabToSelect=tab;this.SelectTabEvent().Trigger(tab);}},SelectTabEvent:function(){return this.m_selectTabEvent;},SetHasBorder:function(hasBorder){this.m_hasBorder=hasBorder;},UnSelectTabEvent:function(){return this.m_unSelectTabEvent;}});

D2L.Control.TextBlock=D2L.Control.extend({Construct:function(text){arguments.callee.$.Construct.call(this);if(text===undefined){text=new D2L.LP.Text.PlainText();}
this.m_float=D2L.Style.Float.None;this.m_isDisplayed=true;this.m_isInline=true;this.m_text=text;},BuildDom:function(){if(this.IsRendered()){return;}
arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.GetUI().CreateElement('span'));this.RenderFloat();this.RenderIsDisplayed();this.RenderIsInline();this.RenderText();},GetFloat:function(){return this.m_float;},GetText:function(){return this.m_text;},IntegrateControl:function(deserializer){arguments.callee.$.IntegrateControl.call(this,deserializer);this.m_float=deserializer.GetMember('Float',D2L.Style.Float.None);this.m_isDisplayed=deserializer.GetMember('IsDisplayed',true);this.m_isInline=deserializer.GetMember('IsInline',true);this.m_text=new D2L.LP.Text.PlainText(this.GetDomNode().innerHTML);},IsDisplayed:function(){return this.m_isDisplayed;},IsInline:function(){return this.m_isInline;},RenderFloat:function(){if(this.IsRendered()){D2L.Util.Style.ApplyFloat(this.GetDomNode(),this.GetFloat());}},RenderIsDisplayed:function(){if(this.IsRendered()){if(this.IsDisplayed()){if(this.IsInline()){this.GetDomNode().style.display='inline';}else{this.GetDomNode().style.display='block';}}else{this.GetDomNode().style.display='none';}}},RenderIsInline:function(){if(this.IsRendered()&&this.IsDisplayed()){if(this.IsInline()){this.GetDomNode().style.display='inline';}else{this.GetDomNode().style.display='block';}}},RenderText:function(){if(this.IsRendered()){this.GetText().AssignHtml(this.GetDomNode(),'innerHTML');}},SetFloat:function(val){this.m_float=val;this.RenderFloat();},SetIsDisplayed:function(isDisplayed){this.m_isDisplayed=isDisplayed;this.RenderIsDisplayed();},SetIsInline:function(isInline){this.m_isInline=isInline;this.RenderIsInline();},SetText:function(text){this.m_text=D2L.LP.Text.IText.Normalize(text,'D2L.Control.TextBlock','SetText','text');this.RenderText();}});

D2L.Control.Tree=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_activeNode=null;this.m_dragDropMode=D2L.DragDrop.Modes.None;this.m_dragDropInfo=null;this.m_siblingDragDropInfo=null;this.m_hasSiblingDragDrop=false;this.m_hideRoot=false;this.m_lineStyle=D2L.Control.Tree.LineStyle.Solid;this.m_parameters=new D2L.Util.Dictionary();this.m_root=null;this.m_rpc=null;this.m_rpcSource=null;this.OnNodeActivation=new D2L.EventHandler();},Adjust:function(){if(this.m_root){this.m_root.Adjust();}},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_hideRoot=deserializer.GetBoolean();this.m_parameters=deserializer.GetObject(D2L.Util.Dictionary);this.m_rpc=deserializer.GetMember();this.m_rpcSource=deserializer.GetMember();this.m_lineStyle=deserializer.GetMember();hasRoot=deserializer.GetBoolean();if(hasRoot){rootJsClass=deserializer.GetMember();this.m_root=deserializer.GetObject(rootJsClass);}
hasDragDropInfo=deserializer.GetBoolean();if(hasDragDropInfo){var dragDropSettingsControlId=deserializer.GetObjectMin(D2L.Control.Id);this.m_dragDropInfo=UI.GetControl(dragDropSettingsControlId.ID(),dragDropSettingsControlId.SID()).GetDragDropInfo();}
this.m_dragDropMode=deserializer.GetMember();this.m_hasSiblingDragDrop=deserializer.GetBoolean();if(this.m_hasSiblingDragDrop){var dragDropSettingsControlId=deserializer.GetObjectMin(D2L.Control.Id);this.m_siblingDragDropInfo=UI.GetControl(dragDropSettingsControlId.ID(),dragDropSettingsControlId.SID()).GetDragDropInfo();}
this.BuildChildrenDom();if(this.m_root){this.m_root.IntegrateChild(null,this);}
if(this.IsRootHidden()&&this.m_root.GetDomNode()){this.m_root.m_wrapper1.style.display='none';}
this.Adjust();this.AppendChild(this.m_root);},BuildDom:function(){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('div'));this.GetDomNode().className='dt_w';if(this.m_root&&!this.m_root.IsRendered()){this.m_root.BuildDom();}
if(this.IsRootHidden()&&this.m_root.GetDomNode()){this.m_root.m_wrapper1.style.display='none';}},BuildChildrenDom:function(){this.IChildrenDomNode=this.CreateElement('ul');var className='dt_m';if(this.GetTreeLineStyle()==D2L.Control.Tree.LineStyle.Solid){className+='s';}else if(this.GetTreeLineStyle()==D2L.Control.Tree.LineStyle.Dotted){className+='d';}else if(this.GetTreeLineStyle()==D2L.Control.Tree.LineStyle.None){className+='n';}
this.IChildrenDomNode.className=className;this.GetDomNode().appendChild(this.IChildrenDomNode);},GetActiveNode:function(){return this.m_activeNode;},GetAllNodes:function(){var allNodes=[];var GetAllNodesRec=function(node){allNodes.push(node);if(node.GetChildNodes().length>0){for(var i=0;i<node.GetChildNodes().length;i++){GetAllNodesRec(node.GetChildNodes()[i]);}}else{return;}};GetAllNodesRec(this.GetRoot());return allNodes;},GetDragDropMode:function(){return this.m_dragDropMode;},GetDragDropInfo:function(){return this.m_dragDropInfo;},GetSiblingDragDropInfo:function(){return this.m_siblingDragDropInfo;},GetNodeByKey:function(key){var allNodes=this.GetAllNodes();for(var i=0;i<allNodes.length;i++){var node=allNodes[i];if(node.GetKey().toLowerCase()==key.toLowerCase()){return node;}}
return null;},GetParameter:function(name){return this.m_parameters.Get(name);},GetParameters:function(){return this.m_parameters;},GetSelectedNodes:function(){var nodes=this.GetAllNodes();var result=[];for(var i=0;i<nodes.length;i++){var node=nodes[i];if(node.GetIsSelected()){result.push(node);}}
return result;},GetTreeLineStyle:function(){return this.m_lineStyle;},GetRoot:function(){return this.m_root;},GetRpc:function(){return this.m_rpc;},GetRpcSource:function(){return this.m_rpcSource;},GetHasSiblingDragDrop:function(){return this.m_hasSiblingDragDrop;},IsRootHidden:function(){return this.m_hideRoot;},RemoveParameter:function(name){this.m_parameters.Remove(name);},SetActiveNode:function(node,fireEvent){if(fireEvent===undefined){fireEvent=true;}
if(this.GetActiveNode()!=node){var allNodes=this.GetAllNodes();for(var i=0;i<allNodes.length;i++){if(allNodes[i]!=node){allNodes[i].OnBeforeDeactivate.Trigger();}}
node.OnBeforeActivate.Trigger();this.m_activeNode=node;if(fireEvent){this.OnNodeActivation.Trigger(this.m_activeNode);}}},SetParameter:function(name,value){this.m_parameters.Add(name,value);},SetRoot:function(root){if(!root.IsRendered()){root.BuildDom();}
this.m_root=root;}});D2L.Control.Tree.LineStyle={Solid:0,Dotted:1,None:2};

D2L.Control.Tree.TreeNode=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_childNodes=[];this.m_data=new D2L.Util.Dictionary();this.m_ddObject=null;this.m_ddHandle=null;this.m_doNotAdjust=false;this.m_canBeCollapsed=true;this.m_checkboxControl=null;this.m_customExpandCollapseIconPlaceholder=null;this.m_collpaseImgTermDisabled=new D2L.Language.ImageTerm('Framework.TreeView2.actCollapseDisabled');this.m_collapseImgTerm=new D2L.Language.ImageTerm('Framework.TreeView2.actCollapse');this.m_collapseAltText=new D2L.LP.Text.LangTerm('Framework.Tree.altCollapseNode');this.m_expandAltText=new D2L.LP.Text.LangTerm('Framework.Tree.altExpandNode');this.m_expandImgTerm=new D2L.Language.ImageTerm('Framework.TreeView2.actExpand');this.m_expandImgTermDisabled=new D2L.Language.ImageTerm('Framework.TreeView2.actExpandDisabled');this.m_expandCollapseIcon=null;this.m_expandCollapseAnimationSpeed=0.2;this.m_hasAutoExpandOnDragOver=true;this.m_isActive=false;this.m_hasSelection=false;this.m_isSelected=false;this.m_isSelectionEnabled=true;this.m_fetchInProgress=false;this.m_isExpanded=true;this.m_key=null;this.m_nodeSpacing=4;this.m_loadChildNodesOnDemand=false;this.m_loadingImgTerm=new D2L.Language.ImageTerm('Framework.TreeView2.actLoading');this.m_levelSpacing='17px';this.m_leftSpacing=3;this.m_nodeTsectionSize=16;this.m_overrideDraggability=false;this.m_overrideDroppability=false;this.m_parentNode=null;this.m_renderedNodeWrapper=null;this.m_selectedATHelp=null;this.m_siblingTopDragDropTarget=null;this.m_siblingBottomDragDropTarget=null;this.m_siblingDragDropTargetSize=6;this.m_subject='';this.m_tree=null;this.m_wrapper1=null;this.m_wrapper2=null;if(!this.m_canBeCollapsed){this.m_isExpanded=true;}
this.OnBeforeActivate=new D2L.EventHandler();this.OnBeforeDeactivate=new D2L.EventHandler();this.OnExpand=new D2L.EventHandler();this.OnCollapse=new D2L.EventHandler();this.OnSubjectChange=new D2L.EventHandler();this.OnAddNode=new D2L.EventHandler();this.OnSelectionChange=new D2L.EventHandler();this.OnSelectionEnableDisableChange=new D2L.EventHandler();},AddNode:function(node){this.AddNodeBefore(node,null);},AddNodeAfter:function(node,afterNode){var afterNodeIndex=0;for(var i=0;i<this.GetChildNodes().length;i++){if(this.GetChildNodes()[i]==afterNode){afterNodeIndex=i;break;}}
if(afterNodeIndex>=0&&this.GetChildNodes().length>=afterNodeIndex+2){this.AddNodeBefore(node,this.GetChildNodes()[afterNodeIndex+1]);}else{this.AddNode(node);}},AddNodeBefore:function(node,beforeNode){this.m_ignoreTransformEvent=true;if(this.IsAncestor(node)||node==this){return;}
if(node==beforeNode){return;}
node.Remove();if(node.GetKey()!=null&&node.GetKey()!=''&&this.GetTree().GetNodeByKey(node.GetKey())!=null){return;}
if(this.m_loadChildNodesOnDemand){return;}
if(beforeNode==null){this.m_childNodes.push(node);}else{var beforePos=-1;for(var i=0;i<this.m_childNodes.length;i++){if(this.m_childNodes[i]==beforeNode){beforePos=i;break;}}
this.m_childNodes.splice(beforePos,0,node);}
node.IntegrateChild(this,this.GetTree());this.InsertBefore(node,beforeNode);if(this.GetTree()&&!this.m_doNotAdjust){this.GetTree().Adjust();}
this.OnAddNode.Trigger(node);this.m_ignoreTransformEvent=false;},AddNodes:function(nodes){this.m_doNotAdjust=true;for(var i=0;i<nodes.length;i++){this.AddNode(nodes[i]);}
this.m_doNotAdjust=false;this.GetTree().Adjust();},AddNodesBefore:function(nodes,beforeNode){this.m_doNotAdjust=true;for(var i=0;i<nodes.length;i++){this.AddNodeBefore(nodes[i],beforeNode);}
this.m_doNotAdjust=false;this.GetTree().Adjust();},AddNodesAfter:function(nodes,afterNode){this.m_doNotAdjust=true;for(var i=nodes.length-1;i>=0;i--){this.AddNodeAfter(nodes[i],afterNode);}
this.m_doNotAdjust=false;this.GetTree().Adjust();},Adjust:function(){if(this.GetChildNodes().length==0&&!this.m_loadChildNodesOnDemand){this.m_expandCollapseIcon.style.display='none';}else{this.m_expandCollapseIcon.style.display='inline';}
this.GetDomNode().className="dt_n_li";this.m_wrapper1.className='dt_n_cw1';if(this.GetParentNode()==null){this.GetDomNode().className="dt_n_lir";this.m_wrapper1.className='dt_n_cw1r';}
if(this.GetParentNode()&&this.GetParentNode().GetFirstChild()==this){this.GetDomNode().className="dt_n_lif";}
if(this.GetParentNode()&&this.GetParentNode().GetLastChild()==this){this.GetDomNode().className="dt_n_lil";this.m_wrapper1.className='dt_n_cw1l';}
if(this.GetTree().IsRootHidden()&&this.GetParentNode()==this.GetTree().GetRoot()){this.GetDomNode().style.backgroundImage='none';this.m_wrapper1.style.backgroundImage='none';}
var ntss=Math.floor(this.m_nodeTsectionSize/2);var spacing=this.m_nodeSpacing;if(this.GetTree().GetHasSiblingDragDrop()){spacing+=this.m_siblingDragDropTargetSize}
if(this.GetParentNode()&&this.GetParentNode().GetLastChild()==this){this.m_wrapper1.style.backgroundPosition=(ntss-1)+'px '+((100-spacing-ntss-1)*-1)+'px';}else{this.m_wrapper1.style.backgroundPosition=(ntss-1)+'px '+(spacing+ntss+1)+'px';}
for(var i=0;i<this.GetChildNodes().length;i++){this.GetChildNodes()[i].Adjust();}},BuildDom:function(){arguments.callee.$.BuildDom.call(this);this.SetDomNode(this.CreateElement('li'));this.GetDomNode().className='dt_n_li';this.IChildrenDomNode=this.CreateElement('ul');this.IChildrenDomNode.className='dt_n_ul';this.m_wrapper1=this.CreateElement('div');this.m_wrapper1.className='dt_n_cw1';this.m_wrapper2=this.CreateElement('div');this.m_wrapper2.className='dt_n_cw2';this.m_selectedATHelp=this.CreateElement('div');this.m_selectedATHelp.className='dsr';this.m_selectedATHelp.appendChild(this.CreateTextNode(new D2L.LP.Text.LangTerm('Framework.Tree.lblSelected')));if(this.GetTree().GetHasSiblingDragDrop()){this.m_nodeSpacing=0;this.m_siblingTopDragDropTarget=this.CreateElement('div');this.m_siblingTopDragDropTarget.className='dt_n_sddt';this.m_siblingTopDragDropTarget.style.paddingTop=(this.m_siblingDragDropTargetSize/4)+'px';this.m_siblingTopDragDropTarget.style.paddingBottom=(this.m_siblingDragDropTargetSize/4)+'px';this.m_siblingTopDragDropTarget.style.margin='1px';this.m_siblingTopDragDropTarget.style.marginBottom='2px';this.m_siblingBottomDragDropTarget=this.CreateElement('div');this.m_siblingBottomDragDropTarget.className='dt_n_sddt';this.m_siblingBottomDragDropTarget.style.paddingTop=(this.m_siblingDragDropTargetSize/4)+'px';this.m_siblingBottomDragDropTarget.style.paddingBottom=(this.m_siblingDragDropTargetSize/4)+'px';this.m_siblingBottomDragDropTarget.style.margin='1px';this.m_siblingBottomDragDropTarget.style.marginTop='2px';var line1=this.CreateElement('div');line1.style.height='2px';line1.style.visibility='hidden';line1.style.backgroundColor='#000000';var line2=line1.cloneNode(true);line1.style.fontSize='0px';line2.style.fontSize='0px';this.m_siblingTopDragDropTarget.appendChild(line1);this.m_siblingBottomDragDropTarget.appendChild(line2);this.m_wrapper2.appendChild(this.m_siblingTopDragDropTarget);}
if(this.m_subject){this.m_expandAltText.SetSubject(this.m_subject);this.m_collapseAltText.SetSubject(this.m_subject);}
this.BuildTSection();this.m_renderedNodeWrapper=this.CreateElement('div');if(this.GetHasSelection()){this.RenderSelection();this.m_checkboxControl.AppendTo(this.m_renderedNodeWrapper);}
this.m_renderedNodeWrapper.style.backgroundColor='#FFFFFF';this.m_wrapper2.appendChild(this.m_renderedNodeWrapper);var renderedNode=this.Render();if(D2L.Util.IsD2LControl(renderedNode)){renderedNode.AppendTo(this.m_renderedNodeWrapper);}else{this.m_renderedNodeWrapper.appendChild(renderedNode);}
this.m_wrapper1.appendChild(this.m_wrapper2);if(this.GetTree().GetHasSiblingDragDrop()){this.m_wrapper2.appendChild(this.m_siblingBottomDragDropTarget);}
var clearingDiv=this.CreateElement('div');clearingDiv.className='clear';this.m_wrapper1.appendChild(clearingDiv);this.m_wrapper1.style.paddingTop=this.m_nodeSpacing+'px';if(this.GetTree().IsRootHidden()&&this==this.GetTree().GetRoot()){this.IChildrenDomNode.style.paddingLeft='0px';}else{this.IChildrenDomNode.style.paddingLeft=this.m_levelSpacing;}
this.GetDomNode().style.backgroundPosition=(Math.floor(this.m_nodeTsectionSize/2)-1)+'px 0px';this.GetDomNode().appendChild(this.m_wrapper1);this.GetDomNode().appendChild(this.IChildrenDomNode);this.InstallEvents();},BuildTSection:function(){var me=this;var defaultExpandCollapsePlaceholder=this.CreateElement('div');defaultExpandCollapsePlaceholder.style.height=this.m_nodeTsectionSize+'px';defaultExpandCollapsePlaceholder.style.width=this.m_nodeTsectionSize+this.m_leftSpacing+'px';this.m_wrapper2.style.marginLeft=this.m_nodeTsectionSize+this.m_leftSpacing+'px';this.m_expandCollapseIcon=this.CreateElement('a');var expandCollapseImage=this.CreateElement('img');if(this.GetChildNodes().length==0&&!this.m_loadChildNodesOnDemand){this.m_expandCollapseIcon.style.display='none';}
if(this.m_isExpanded){this.m_collapseImgTerm.Assign(expandCollapseImage,false);this.m_collapseAltText.GetText().Register(function(t){me.m_expandCollapseIcon.title=t;expandCollapseImage.alt=t;expandCollapseImage.title=t;});this.IChildrenDomNode.style.display='block';}else{this.m_expandImgTerm.Assign(expandCollapseImage,false);this.m_expandAltText.GetText().Register(function(t){me.m_expandCollapseIcon.title=t;expandCollapseImage.alt=t;expandCollapseImage.title=t;});this.IChildrenDomNode.style.display='none';}
var me=this;this.m_expandCollapseIcon.href='javascript://';this.AttachObject(this.m_expandCollapseIcon,'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);me.SetIsExpanded(!me.m_isExpanded);return false;});if(this.m_customExpandCollapseIconPlaceholder==null){defaultExpandCollapsePlaceholder.appendChild(this.m_expandCollapseIcon);}else{this.m_customExpandCollapseIconPlaceholder.appendChild(this.m_expandCollapseIcon);}
if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){defaultExpandCollapsePlaceholder.style.styleFloat='left';}else{defaultExpandCollapsePlaceholder.style.cssFloat='left';}
this.m_expandCollapseIcon.appendChild(expandCollapseImage);this.m_wrapper1.appendChild(defaultExpandCollapsePlaceholder);},Deserialize:function(deserializer){this.m_isExpanded=deserializer.GetMember('IsExpanded');this.m_isActive=deserializer.GetMember('IsActiveNode');this.m_key=deserializer.GetMember('Key');this.m_data=deserializer.GetObject('Data',D2L.Util.Dictionary);var hasChildren=deserializer.GetMember('HasChildren');if(hasChildren){this.m_childNodes=deserializer.GetObjectArray('ChildNodes');}
this.SetLoadChildNodesOnDemand(deserializer.GetMember('OnDemand'));this.m_subject=deserializer.GetMember('Subject');if(deserializer.HasMember('OverrideDraggability')){this.m_overrideDraggability=deserializer.GetMember('OverrideDraggability');}
if(deserializer.HasMember('OverrideDroppability')){this.m_overrideDroppability=deserializer.GetMember('OverrideDroppability');}
this.m_hasSelection=deserializer.GetMember('HasSelection',false);this.m_isSelected=deserializer.GetMember('IsSelected',false);this.m_isSelectionEnabled=deserializer.GetMember('IsSelectionEnabled',true);},FetchChildNodes:function(parentNode){var dl=new D2L.Util.DelayedReturn();var FetchCallback=function(rpcResponse){if(rpcResponse.GetResponseType()==D2L.Rpc.ResponseType.Success){var treeNode=rpcResponse.GetResult(D2L.Control.Tree.TreeNode);var childNodes=treeNode.GetChildNodes();dl.Trigger(childNodes);}};D2L.Rpc.Create('FetchNodes',FetchCallback,'/d2l/common/rpc/tree/tree.d2l').Call(this,this.GetTree().GetParameters(),this.GetTree().GetRpc(),this.GetTree().GetRpcSource());return dl;},GetChildNodes:function(){return this.m_childNodes;},GetData:function(key){return this.m_data.Get(key);},GetDragDropObject:function(){return this.m_ddObject;},GetFirstChild:function(){if(this.GetChildNodes().length>0){return this.GetChildNodes()[0];}else{return null;}},GetHasSelection:function(){return this.m_hasSelection;},GetIsSelectionEnabled:function(){return this.m_isSelectionEnabled;},GetIsSelected:function(){return this.m_isSelected;},GetIsActive:function(){return this.m_isActive;},GetKey:function(){return this.m_key;},GetLastChild:function(){if(this.GetChildNodes().length>0){return this.GetChildNodes()[this.GetChildNodes().length-1];}else{return null;}},GetNextSibling:function(){if(this.GetParentNode()){for(var i=0;i<this.GetParentNode().GetChildNodes().length;i++){if(this.GetParentNode().GetChildNodes()[i]==this){if(this.GetParentNode().GetChildNodes().length>=i+2){return this.GetParentNode().GetChildNodes()[i+1];}}}}
return null;},GetParentNode:function(){return this.m_parentNode;},GetPreviousSibling:function(){if(this.GetParentNode()){for(var i=0;i<this.GetParentNode().GetChildNodes().length;i++){if(this.GetParentNode().GetChildNodes()[i]==this){if(i>0){return this.GetParentNode().GetChildNodes()[i-1];}}}}
return null;},GetSubject:function(){return this.m_subject;},GetTree:function(){return this.m_tree;},IntegrateChild:function(parentNode,tree){this.SetTree(tree);this.SetParentNode(parentNode);if(!this.IsRendered()){this.BuildDom();}
arguments.callee.$.IntegrateChild.call(this,parentNode,this.GetDomNode());for(var i=0;i<this.GetChildNodes().length;i++){this.GetChildNodes()[i].IntegrateChild(this,tree);this.AppendChild(this.GetChildNodes()[i]);}
if(this.GetIsActive()){this.GetTree().SetActiveNode(this,false);}},InstallDragDrop:function(){if(this.GetTree().GetDragDropMode()!=D2L.DragDrop.Modes.None){var ddObject;var calculatedMode=this.GetTree().GetDragDropMode();if(this.GetTree().GetDragDropMode()==D2L.DragDrop.Modes.DraggableDroppable){if(this.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.Droppable;}
if(this.IsDroppabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.Draggable;}
if(this.IsDroppabilityOverridden()&&this.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}}
if(this.GetTree().GetDragDropMode()==D2L.DragDrop.Modes.Draggable){if(this.IsDraggabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}}
if(this.GetTree().GetDragDropMode()==D2L.DragDrop.Modes.Droppable){if(this.IsDroppabilityOverridden()){calculatedMode=D2L.DragDrop.Modes.None;}}
if(calculatedMode==D2L.DragDrop.Modes.None){return;}
var handle=this.m_renderedNodeWrapper;if(this.m_ddHandle){if(D2L.Util.IsD2LControl(this.m_ddHandle)){if(!this.m_ddHandle.IsRendered()){this.m_ddHandle.BuildDom();}
handle=this.m_ddHandle.GetDomNode();}else{handle=this.m_ddHandle;}}
if(calculatedMode==D2L.DragDrop.Modes.DraggableDroppable){ddObject=new D2L.DragDrop.DraggableDroppable(this,handle);}
if(calculatedMode==D2L.DragDrop.Modes.Draggable){ddObject=new D2L.DragDrop.Draggable(this,handle);}
if(calculatedMode==D2L.DragDrop.Modes.Droppable){ddObject=new D2L.DragDrop.Droppable(this,handle);}
this.SetDragDropObject(ddObject);if(this.GetDragDropObject()&&this.GetTree().GetDragDropInfo()){D2L.DragDrop.SetDragDropInfo(this.GetDragDropObject(),this.GetTree().GetDragDropInfo());}
var me=this;var timedExpansion=null;if((calculatedMode==D2L.DragDrop.Modes.Droppable||calculatedMode==D2L.DragDrop.Modes.DraggableDroppable)&&this.m_hasAutoExpandOnDragOver){me.OnExpand.RegisterMethod(function(){UI.GetDragDropManager().RefreshCache();});this.GetDragDropObject().OnDragEnter.RegisterMethod(function(){timedExpansion=setTimeout(function(){me.SetIsExpanded(true);},1000);});}
if((calculatedMode==D2L.DragDrop.Modes.Droppable||calculatedMode==D2L.DragDrop.Modes.DraggableDroppable)&&this.m_hasAutoExpandOnDragOver){this.GetDragDropObject().OnDragExit.RegisterMethod(function(){if(timedExpansion){clearTimeout(timedExpansion);}});}
if(ddObject){var me=this;ddObject.SetCustomGhostRenderer(function(){if(me.IsExpanded()){var ul=me.CreateElement('ul');ul.className='dt_mn'
ul.style.width=me.GetTree().GetDomNode().offsetWidth+'px';var clone=me.GetDomNode().cloneNode(true);ul.appendChild(clone);return ul;}else{var clone=handle.cloneNode(true);clone.style.width=handle.offsetWidth+'px';return handle.cloneNode(true);}});}}
if(this.GetTree().GetHasSiblingDragDrop()){var siblingTopDDObject=new D2L.DragDrop.Droppable(this,this.m_siblingTopDragDropTarget);var siblingBottomDDObject=new D2L.DragDrop.Droppable(this,this.m_siblingBottomDragDropTarget);siblingTopDDObject.SetData('DropLocation',D2L.Control.Tree.TreeNode.SiblingDropTargets.Top);siblingBottomDDObject.SetData('DropLocation',D2L.Control.Tree.TreeNode.SiblingDropTargets.Bottom);var me=this;siblingTopDDObject.OnDragEnter.RegisterMethod(function(){me.m_siblingTopDragDropTarget.firstChild.style.visibility='visible';});siblingTopDDObject.OnDragExit.RegisterMethod(function(){me.m_siblingTopDragDropTarget.firstChild.style.visibility='hidden';});siblingTopDDObject.OnDragDropped.RegisterMethod(function(){me.m_siblingTopDragDropTarget.firstChild.style.visibility='hidden';});siblingBottomDDObject.OnDragEnter.RegisterMethod(function(){me.m_siblingBottomDragDropTarget.firstChild.style.visibility='visible';});siblingBottomDDObject.OnDragExit.RegisterMethod(function(){me.m_siblingBottomDragDropTarget.firstChild.style.visibility='hidden';});siblingBottomDDObject.OnDragDropped.RegisterMethod(function(){me.m_siblingBottomDragDropTarget.firstChild.style.visibility='hidden';});D2L.DragDrop.SetDragDropInfo(siblingTopDDObject,this.GetTree().GetSiblingDragDropInfo());D2L.DragDrop.SetDragDropInfo(siblingBottomDDObject,this.GetTree().GetSiblingDragDropInfo());}},InstallEvents:function(){var me=this;this.OnBeforeActivate.RegisterMethod(function(){me.m_isActive=true;me.m_expandCollapseIcon.parentNode.insertBefore(me.m_selectedATHelp,me.m_expandCollapseIcon.nextSibling);});this.OnBeforeDeactivate.RegisterMethod(function(){me.m_isActive=false;if(me.m_selectedATHelp.parentNode){me.m_selectedATHelp.parentNode.removeChild(me.m_selectedATHelp);}});if(this.GetDragDropObject()==null){this.InstallDragDrop();}
this.OnSubjectChange.RegisterMethod(function(){if(me.m_checkboxControl){me.m_checkboxControl.SetText(new D2L.LP.Text.LangTerm('Framework.Tree.altSelect',me.m_subject));}
if(me.m_expandAltText&&me.m_collapseAltText){me.m_expandAltText.SetSubject(me.m_subject);me.m_collapseAltText.SetSubject(me.m_subject);if(me.m_expandCollapseIcon){me.m_collapseAltText.GetText().Register(function(t){me.m_expandCollapseIcon.title=t;me.m_expandCollapseIcon.firstChild.alt=t;me.m_expandCollapseIcon.firstChild.title=t;});}
if(me.m_expandCollapseIcon){me.m_expandAltText.GetText().Register(function(t){me.m_expandCollapseIcon.title=t;me.m_expandCollapseIcon.firstChild.alt=t;me.m_expandCollapseIcon.firstChild.title=t;});}}});},IsAncestor:function(node){var isAncestor=false;var nextNode=this.GetParentNode();while(nextNode){if(nextNode==node){isAncestor=true;break;}
nextNode=nextNode.GetParentNode();}
return isAncestor;},IsDraggabilityOverridden:function(){return this.m_overrideDraggability;},IsDroppabilityOverridden:function(){return this.m_overrideDroppability;},IsExpanded:function(){return this.m_isExpanded;},Reload:function(){var dl=new D2L.Util.DelayedReturn();if(!this.m_loadChildNodesOnDemand){var me=this;this.m_doNotAdjust=true;var allNodes=this.GetChildNodes();for(var i=allNodes.length-1;i>=0;i--){allNodes[i].Remove();}
this.m_doNotAdjust=false;this.FetchChildNodes(this).Register(function(childNodes){me.AddNodes(childNodes);dl.Trigger();});}else{dl.Trigger();}
return dl;},Remove:function(){arguments.callee.$.Remove.call(this);var parentNode=this.GetParentNode();if(parentNode){for(var i=0;i<parentNode.GetChildNodes().length;i++){if(parentNode.GetChildNodes()[i]==this){break;}}
parentNode.m_childNodes.splice(i,1);if(this.GetTree()&&!this.m_doNotAdjust){this.m_tree.GetRoot().Adjust();}}},RenderSelection:function(){if(this.m_checkboxControl==null){this.m_checkboxControl=new D2L.Control.Checkbox();this.m_checkboxControl.SetShowText(false);var me=this;this.m_checkboxControl.SetOnClick(function(){me.SetIsSelected(me.m_checkboxControl.IsChecked());});this.m_checkboxControl.SetText(new D2L.LP.Text.LangTerm('Framework.Tree.altSelect',this.GetSubject()));}
this.m_checkboxControl.SetIsChecked(this.GetIsSelected());this.m_checkboxControl.SetIsEnabled(this.GetIsSelectionEnabled());},Render:function(){},SetCollapseIconImageTerm:function(imageTerm){this.m_collapseImgTerm=imageTerm;},SetData:function(key,val){this.m_data.Add(key,val);},SetDragDropObject:function(ddObject){this.m_ddObject=ddObject;},SetDragDropHandle:function(ddHandle){this.m_ddHandle=ddHandle;},SetExpandCollapseCustomPlaceholder:function(customPlaceholder){this.m_customExpandCollapseIconPlaceholder=customPlaceholder;},SetExpandIconImageTerm:function(imageTerm){this.m_expandImgTerm=imageTerm;},SetHasSelection:function(hasSelection){if(this.GetHasSelection()!=hasSelection){this.m_hasSelection=hasSelection;if(this.IsRendered()){if(hasSelection){this.RenderSelection();if(!this.m_checkboxControl.IsRendered()){this.m_checkboxControl.BuildDom();}
this.m_renderedNodeWrapper.insertBefore(this.m_checkboxControl.GetDomNode(),this.m_renderedNodeWrapper.firstChild);}else{this.m_checkboxControl.Remove();}}}},SetIsSelectionEnabled:function(isSelectionEnabled){this.m_isSelectionEnabled=isSelectionEnabled;if(this.IsRendered()){this.RenderSelection();this.OnSelectionEnableDisableChange.Trigger(isSelectionEnabled);}},SetIsSelected:function(isSelected){this.m_isSelected=isSelected;if(this.IsRendered()&&this.m_checkboxControl){this.m_checkboxControl.SetIsChecked(this.GetIsSelected());this.OnSelectionChange.Trigger(isSelected);}},SetLevelSpacing:function(levelSpacing){this.m_levelSpacing=levelSpacing;},Serialize:function(serializer){serializer.AddMember('IsExpanded',this.m_isExpanded);serializer.AddMember('IsActiveNode',this.m_isActive);serializer.AddMember('Key',this.m_key);serializer.AddMember('Data',this.m_data);serializer.AddMember('ChildNodes',this.GetChildNodes());serializer.AddMember('OnDemand',this.m_loadChildNodesOnDemand);serializer.AddMember('Subject',this.m_subject);if(this.m_hasSelection&&this.m_isSelected){serializer.AddMember('IsSelected',this.m_isSelected);}},SetIsExpanded:function(isExpanded,animate){if(animate===undefined){animate=true;}
var dl=new D2L.Util.DelayedReturn();var me=this;if(this.m_isExpanded!=isExpanded){if(this.m_loadChildNodesOnDemand&&!this.m_fetchInProgress){this.m_fetchInProgress=true;this.FetchChildNodes(this).Register(function(childNodes){me.m_loadChildNodesOnDemand=false;me.m_fetchInProgress=false;me.AddNodes(childNodes);me.SetIsExpanded(true).Register(function(){dl.Trigger();});var href=me.GetWindow().document.createAttribute('href');href.value='javascript://';me.m_expandCollapseIcon.attributes.setNamedItem(href);});me.m_expandCollapseIcon.firstChild.src='/d2l/img/lp/loading.gif';if(me.m_expandCollapseIcon.attributes.getNamedItem('href')){me.m_expandCollapseIcon.attributes.removeNamedItem('href');}}else{var DoExpandCollapse=function(){if(isExpanded){me.m_collapseImgTerm.Assign(me.m_expandCollapseIcon.firstChild,false);me.m_collapseAltText.GetText().Register(function(t){me.m_expandCollapseIcon.title=t;me.m_expandCollapseIcon.firstChild.alt=t;me.m_expandCollapseIcon.firstChild.title=t;});me.IChildrenDomNode.style.display='block';}else{me.m_expandImgTerm.Assign(me.m_expandCollapseIcon.firstChild,false);me.m_expandAltText.GetText().Register(function(t){me.m_expandCollapseIcon.title=t;me.m_expandCollapseIcon.firstChild.alt=t;me.m_expandCollapseIcon.firstChild.title=t;});me.IChildrenDomNode.style.display='none';}
var nav=new D2L.NavInfo();me.AttachObject(me.m_expandCollapseIcon,'onclick',function(evt){D2L.Util.Dom.CancelBubble(evt);me.SetIsExpanded(!isExpanded);return false;});me.m_isExpanded=isExpanded;if(isExpanded){me.OnExpand.Trigger();}else{me.OnCollapse.Trigger();}
dl.Trigger();};if(animate&&this.GetChildNodes().length<20){var DoAnimate=function(height){var toOpt=1;var fromOpt=0.2;if(!isExpanded){toOpt=0.2;fromOpt=1;}
me.IChildrenDomNode.style.position='relative';me.IChildrenDomNode.style.zoom='1';var sizeAnim=new YAHOO.util.Anim(me.IChildrenDomNode,{height:{to:height}},me.m_expandCollapseAnimationSpeed,YAHOO.util.Easing.easeNone);var fadeAnim=new YAHOO.util.ColorAnim(me.IChildrenDomNode,{opacity:{from:fromOpt,to:toOpt}},me.m_expandCollapseAnimationSpeed,YAHOO.util.Easing.easeNon);sizeAnim.onComplete.subscribe(function(){me.IChildrenDomNode.style.position='';me.IChildrenDomNode.style.zoom='';me.IChildrenDomNode.style.overflow='visible';me.IChildrenDomNode.style.height='';if(me.IChildrenDomNode.style.filter){me.IChildrenDomNode.style.filter='';}else{me.IChildrenDomNode.style.opacity='';}
var href=me.GetWindow().document.createAttribute('href');href.value='javascript://';me.m_expandCollapseIcon.attributes.setNamedItem(href);DoExpandCollapse();});if(isExpanded){me.IChildrenDomNode.style.height='0px';}
me.IChildrenDomNode.style.display='block';me.IChildrenDomNode.style.overflow='hidden';if(me.m_expandCollapseIcon.attributes.getNamedItem('href')){me.m_expandCollapseIcon.attributes.removeNamedItem('href');}
sizeAnim.animate();fadeAnim.animate();};if(isExpanded){var h=0;if(this.IChildrenDomNode.childNodes.length>0){h=D2L.Util.Dom.GetHeightHelper(this.IChildrenDomNode)}
DoAnimate(h);}else{DoAnimate(0);}}else{DoExpandCollapse();}}}else{dl.Trigger();}
return dl;},SetKey:function(key){this.m_key=key;},SetLoadChildNodesOnDemand:function(isOnDemand){this.m_loadChildNodesOnDemand=isOnDemand;if(isOnDemand){this.m_isExpanded=false;this.m_childNodes=[];}},SetParentNode:function(parentNode){this.m_parentNode=parentNode;},SetSubject:function(subject){this.m_subject=subject;this.OnSubjectChange.Trigger();},SetTree:function(tree){this.m_tree=tree;for(var i=0;i<this.GetChildNodes().length;i++){this.GetChildNodes()[i].SetTree(tree);}},SetWidth:function(width){this.m_wrapper2.style.width=width;}});

D2L.Control.Tree.TreeNode.SiblingDropTargets={Top:0,Bottom:1};

D2L.Control.Tree.TextTreeNode=D2L.Control.Tree.TreeNode.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_allowWrap=true;this.m_alt=null;this.m_imageExpanded=null;this.m_hasActivation=true;this.m_hasHighlighting=true;this.m_image=null;this.m_imageControl=null;this.m_navInfo=null;this.m_text=null;this.m_textFormat=D2L.Control.TextFormat.Normal;},Deserialize:function(deserializer){arguments.callee.$.Deserialize.call(this,deserializer);this.m_imageExpanded=deserializer.GetObject("ImageExpanded",D2L.Images.Image);this.m_navInfo=deserializer.GetObject("NavInfo",D2L.NavInfo);this.m_image=deserializer.GetObject("Image",D2L.Images.Image);if(this.m_image===undefined){this.m_image=null;}
if(this.m_imageExpanded==null||this.m_imageExpanded===undefined){this.m_imageExpanded=this.m_image;}
this.m_text=deserializer.GetObject("Text",D2L.LP.Text.IText);this.m_textFormat=deserializer.GetMember("TextFormat");this.m_alt=deserializer.GetObject("Alt",D2L.LP.Text.IText);this.m_hasActivation=deserializer.GetMember("HasActivation");this.m_hasHighlighting=deserializer.GetMember("HasHighlighting");this.m_allowWrap=deserializer.GetMember('AllowWrap');},Render:function(){this.m_wrapper=this.CreateElement('span');this.m_wrapper.style.padding='2px';if(!this.m_allowWrap){this.m_wrapper.style.whiteSpace='nowrap';}
if(this.m_hasActivation){this.RenderActive(this.GetIsActive());}
this.m_imageControl=new D2L.Control.Image();this.m_imageControl.SetText(this.m_text);this.m_imageControl.SetNav(this.m_navInfo);if(this.IsExpanded()){if(this.m_imageExpanded){this.m_imageControl.SetImage(this.m_imageExpanded);}}else{if(this.m_image){this.m_imageControl.SetImage(this.m_image);}}
this.SetTextFormat(this.m_textFormat);if(this.m_alt){this.SetAlt(this.m_alt);}
this.m_imageControl.AppendTo(this.m_wrapper);this.InstallEvents();return this.m_wrapper;},GetNav:function(){return this.m_navInfo;},GetText:function(){return this.m_text;},InstallEvents:function(){this.SetDragDropHandle(this.m_wrapper);arguments.callee.$.InstallEvents.call(this);var me=this;if(this.m_hasActivation){this.AttachObject(this.m_imageControl.GetDomNode(),'onclick',function(){me.m_imageControl.Focus();me.GetTree().SetActiveNode(me);});}
this.SetHasActivation(this.m_hasActivation);this.SetHasHighlighting(this.m_hasHighlighting);this.OnExpand.RegisterMethod(function(){if(me.m_imageExpanded){me.m_imageControl.SetImage(me.m_imageExpanded);}});this.OnCollapse.RegisterMethod(function(){if(me.m_image){me.m_imageControl.SetImage(me.m_image);}});this.OnSubjectChange.RegisterMethod(function(){me.SetAlt(me.m_alt);});},HandleOnMouseOver:function(){if(this.m_hasHighlighting&&!this.GetIsActive()){this.m_wrapper.style.backgroundColor='#E2EEFF';}},HandleOnMouseOut:function(){if(this.m_hasHighlighting){this.m_wrapper.style.backgroundColor='';this.RenderActive(this.GetIsActive());}},RenderActive:function(isActive){if(this.m_hasActivation){if(isActive){this.m_wrapper.style.backgroundColor='#B3C8E8';}else{this.m_wrapper.style.backgroundColor='';}}},SetAllowWrap:function(allowWrap){this.m_allowWrap=allowWrap;if(this.m_wrapper){if(allowWrap){this.m_wrapper.style.whiteSpace='normal';}else{this.m_wrapper.style.whiteSpace='nowrap';}}},SetAlt:function(alt){this.m_alt=alt;if(this.GetSubject()){this.m_alt.SetSubject(this.GetSubject());}
if(this.m_imageControl){this.m_imageControl.SetAlt(this.m_alt);}},SetHasActivation:function(hasActivation){this.m_hasActivation=hasActivation;var me=this;if(this.m_hasActivation){this.OnBeforeActivate.RegisterMethod(function(){me.RenderActive(true);});this.OnBeforeDeactivate.RegisterMethod(function(){me.RenderActive(false);});}},SetHasHighlighting:function(hasHighlighting){this.m_hasHighlighting=hasHighlighting;if(this.m_wrapper){var me=this;if(this.m_hasHighlighting){this.AttachObject(this.m_wrapper,'onmouseover',function(){me.HandleOnMouseOver();});this.AttachObject(this.m_wrapper,'onmouseout',function(){me.HandleOnMouseOut();});if(!this.IsDroppabilityOverridden()&&(this.GetTree().GetDragDropMode()==D2L.DragDrop.Modes.DraggableDroppable||this.GetTree().GetDragDropMode()==D2L.DragDrop.Modes.Droppable)){this.GetDragDropObject().OnDragEnter.Register(this,'HandleOnMouseOver');this.GetDragDropObject().OnDragExit.Register(this,'HandleOnMouseOut');}}}},SetImage:function(img){this.m_image=img;if(this.m_imageExpanded==null){this.m_imageExpanded=this.m_image;}
if(this.m_imageControl){if(this.m_imageExpanded==null||!this.IsExpanded()){this.m_imageControl.SetImage(this.m_image);}}},SetImageExpanded:function(img){this.m_imageExpanded=img;if(this.m_imageControl){if(this.IsExpanded()){this.m_imageControl.SetImage(this.m_imageExpanded);}}},SetNav:function(navInfo){this.m_navInfo=navInfo;if(this.m_imageControl){this.m_imageControl.SetNav(navInfo);}},SetText:function(text){this.m_text=text;if(this.m_imageControl){this.m_imageControl.SetText(text);}},SetTextFormat:function(textFormat){this.m_textFormat=textFormat;if(this.m_wrapper){if(this.m_textFormat==D2L.Control.TextFormat.Bold){this.m_wrapper.className='dt_tn_wb';}else{this.m_wrapper.className='dt_tn_wn';}}}});

D2L.Debug={Error:function(message){},Info:function(message){},Warn:function(message){},Debug:function(message){},Trace:function(message){},IsEnabled:function(){return false;},SetLevel:function(level){},Level:{Error:0,Warn:1,Info:2,Debug:3,Trace:4}};

D2L.Images={};

D2L.Images.Image=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.ClassName='D2L.Images.Image';this.m_width=0;this.m_height=0;this.m_fileId='';this.m_fileSystemType='';this.m_path='';this.m_src='';},Assign:function(image,makeSizeRelative){this.GetSrc().Register(function(src){image.src=src;});var width=this.GetWidth();var height=this.GetHeight();if(makeSizeRelative===undefined){makeSizeRelative=true;}
if(makeSizeRelative){image.className=image.className.replace('di_16','');image.className=image.className.replace('di_24','');}
var fontSizes=UI.GetRelativeFontSizeManager().ToDictionary();var basePixel=16*fontSizes['d2l_body'];var dictLength=0;for(var key in fontSizes){dictLength++;}
if(makeSizeRelative&&dictLength==1){if(width==16&&height==16){image.className+=' di_16 ';}else if(width==24&&height==24){image.className+=' di_24 ';}else if(width>0&&height>0){image.style.width=D2L.Style.Utility.PixelToEm(basePixel,width)+'em';image.style.height=D2L.Style.Utility.PixelToEm(basePixel,height)+'em';}else{image.style.width='';image.style.height='';}}else if(width>0&&height>0){image.style.width=width+'px';image.style.height=height+'px';}},Deserialize:function(deserializer){this.m_height=deserializer.GetMember('H');this.m_width=deserializer.GetMember('W');if(deserializer.HasMember('F')){var path=deserializer.GetMember('F');if(path.substr(0,1)!='/'&&!D2L.Util.Url.IsExternal(path)){this.m_path='/d2l/img/'+path;}else{this.m_path=path;}}else{this.m_fileId=deserializer.GetMember('FileId');this.m_fileSystemType=deserializer.GetMember('FileSystemType');}},DeserializeMin:function(deserializer){this.m_height=deserializer.GetMember();this.m_width=deserializer.GetMember();var member=deserializer.GetMember();if(!deserializer.HasMember()){if(member.substr(0,1)!='/'&&!D2L.Util.Url.IsExternal(member)){this.m_path='/d2l/img/'+member;}else{this.m_path=member;}}else{this.m_fileId=member;this.m_fileSystemType=deserializer.GetMember();}},GetHeight:function(){return this.m_height;},GetSrc:function(){if(this.m_path.length>0){return new D2L.Util.DelayedReturn(this.m_path);}else if(this.m_fileId.length>0&&this.m_fileSystemType.length>0){var src=D2L.Util.GetViewFileUrl(new D2L.Files.FileInfo(this.m_fileSystemType,this.m_fileId));return new D2L.Util.DelayedReturn(src);}else{return new D2L.Util.DelayedReturn('/d2l/img/lp/pixel.gif');}},GetWidth:function(){return this.m_width;},Serialize:function(serializer){serializer.AddMember('ClassName',this.ClassName);serializer.AddMember('W',this.m_width);serializer.AddMember('H',this.m_height);if(this.m_path.length>0){serializer.AddMember('F',this.m_path);}else{serializer.AddMember('FileId',this.m_fileId);serializer.AddMember('FileSystemType',this.m_fileSystemType);}}});

D2L.Images.ImageInfo=D2L.Images.Image.extend({Construct:function(imageFile,width,height){arguments.callee.$.Construct.call(this);if(imageFile===undefined){imageFile='';}
if(width===undefined){width=0;}
if(height===undefined){height=0;}
this.m_path=imageFile;this.m_width=width;this.m_height=height;},GetImageFile:function(){return this.m_path;}});D2L.Image.ImageInfo=D2L.Images.ImageInfo;

D2L.Images.ImageTerm=D2L.Images.Image.extend({Construct:function(termName){arguments.callee.$.Construct.call(this);if(termName===undefined){termName='';}
this.m_termName=termName.toLowerCase();this.m_image=null;},GetSrc:function(){if(D2L.Images.ImageTerm.SrcCache[this.m_termName]!==undefined){return new D2L.Util.DelayedReturn(D2L.Images.ImageTerm.SrcCache[this.m_termName]);}
if(this.m_image!==null){return this.m_image.GetSrc();}
var dr=new D2L.Util.DelayedReturn();var me=this;UI.GetLanguageManager().GetImageTerm(this.m_termName).Register(function(image){me.m_image=image;image.GetSrc().Register(function(src){D2L.Images.ImageTerm.SrcCache[me.m_termName]=src;dr.Trigger(src);});});return dr;},GetTermName:function(){return this.m_name;}});D2L.Images.ImageTerm.SrcCache={};D2L.Images.ImageTerm.Assign=function(termName,image,makeSizeRelative){var term=new D2L.Images.ImageTerm(termName);term.Assign(image,makeSizeRelative);};

D2L.Language={Collections:{},ImageCollections:{},PrefetchedTerms:{},PrefetchedImageTerms:{},ImageTerm:D2L.Images.ImageTerm};

D2L.Language.LanguageManager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_cachedImageObjects={};this.m_waitingCollections={};this.m_waitingImageCollections={};this.SmlProcessor=new D2L.Sml.SmlProcessor();var me=this;this.OnCollectionLoad=new D2L.EventHandler();this.OnCollectionLoad.RegisterMethod(function(collectionName){if(me.m_waitingCollections[collectionName]){me.m_waitingCollections[collectionName].Trigger();}});this.OnImageCollectionLoad=new D2L.EventHandler();this.OnImageCollectionLoad.RegisterMethod(function(collectionName){for(var key in D2L.Language.ImageCollections[collectionName]){D2L.Language.ImageCollections[collectionName][key]=D2L.Serialization.JsonDeserializer.Deserialize(D2L.Language.ImageCollections[collectionName][key],D2L.Images.Image);}
if(me.m_waitingImageCollections[collectionName]){me.m_waitingImageCollections[collectionName].Trigger();}});},GetCollection:function(collection){var dr=new D2L.Util.DelayedReturn();if(D2L.Language.Collections[collection]===undefined&&this.m_waitingCollections[collection]===undefined){this.m_waitingCollections[collection]=new D2L.Util.DelayedReturn();var script=document.createElement('script');script.type='text/javascript';script.src='/d2l/common/language/language.d2l?ou='+Global.OrgUnitId
+'&collection='+D2L.Util.Url.Encode(collection)
+'&lid='+Global.Language.LanguageId;UI.GetById('d2l_body').appendChild(script);}
if(this.m_waitingCollections&&this.m_waitingCollections[collection]){this.m_waitingCollections[collection].Register(function(){dr.Trigger(D2L.Language.Collections[collection]);});}
return dr;},GetImageCollection:function(collection){var dr=new D2L.Util.DelayedReturn();if(D2L.Language.ImageCollections[collection]===undefined&&this.m_waitingImageCollections[collection]===undefined){this.m_waitingImageCollections[collection]=new D2L.Util.DelayedReturn();var script=document.createElement('script');script.type='text/javascript';script.src='/d2l/common/language/image.d2l?ou='+Global.OrgUnitId+'&isi='+Global.ImageSetId+'&iv='+Global.ImageVersion+'&collection='+D2L.Util.Url.Encode(collection);UI.GetById('d2l_body').appendChild(script);}
this.m_waitingImageCollections[collection].Register(function(){dr.Trigger(D2L.Language.ImageCollections[collection]);});return dr;},GetPrefetchedTerm:function(term){term=term.toLowerCase();if(D2L.Language.PrefetchedTerms[term]!==undefined){return D2L.Language.PrefetchedTerms[term];}
return'';},GetTerm:function(term){var dr=new D2L.Util.DelayedReturn();term=term.toLowerCase();var collectionName=term.substring(0,term.lastIndexOf('.'));var termName=term.substr(collectionName.length+1);if(D2L.Language.PrefetchedTerms[term]!==undefined){dr.Trigger(D2L.Language.PrefetchedTerms[term]);}else{var collDr=this.GetCollection(collectionName);D2L.Debug.Warn('Client-side fetch of language collection: \''+
collectionName+'\' for term \''+term+'\'');collDr.Register(function(collection){if(collection[termName]){dr.Trigger(collection[termName]);}});}
return dr;},GetImageTerm:function(term){var dr=new D2L.Util.DelayedReturn();term=term.toLowerCase();var collectionName=term.substring(0,term.lastIndexOf('.')).toLowerCase();var termName=term.substr(collectionName.length+1).toLowerCase();var me=this;if(this.m_cachedImageObjects[term]!==undefined&&1==1){dr.Trigger(this.m_cachedImageObjects[term]);}else if(D2L.Language.PrefetchedImageTerms[term]!==undefined){var imgObj=D2L.Serialization.JsonDeserializer.Deserialize(D2L.Language.PrefetchedImageTerms[term],D2L.Images.Image);this.m_cachedImageObjects[term]=imgObj
dr.Trigger(imgObj);}else{var collDr=this.GetImageCollection(collectionName);D2L.Debug.Warn('Client-side fetch of image collection: \''+collectionName+'\'');collDr.Register(function(collection){if(collection[termName]){me.m_cachedImageObjects[termName]=collection[termName];dr.Trigger(collection[termName]);}});}
return dr;},GetPrefetchedImageTerm:function(term){term=term.toLowerCase();if(D2L.Language.PrefetchedImageTerms[term]!==undefined){return D2L.Serialization.JsonDeserializer.Deserialize(D2L.Language.PrefetchedImageTerms[term],D2L.Images.ImageInfo);}else{return new D2L.Images.ImageInfo('/d2l/common/img/failed_cache_image.gif',16,16);}},HasImageTerm:function(term){term=term.toLowerCase();return(D2L.Language.PrefetchedImageTerms[term]!==undefined);},HasTerm:function(term){term=term.toLowerCase();return(D2L.Language.PrefetchedTerms[term]!==undefined);}});

D2L.LP.LayeredArch={};

D2L.LP.LayeredArch.PagingInfo=D2L.Class.extend({Construct:function(pageSize,pageNumber){if(pageSize===undefined){pageSize=20;}
if(pageNumber===undefined){pageNumber=1;}
arguments.callee.$.Construct.call(this);this.m_pageSize=pageSize;this.m_pageNumber=pageNumber;},Deserialize:function(deserializer){this.m_pageSize=deserializer.GetMember('PageSize');this.m_pageNumber=deserializer.GetMember('PageNumber');},GetPageSize:function(){return this.m_pageSize;},GetPageNumber:function(){return this.m_pageNumber;},Serialize:function(serializer){serializer.AddMember('PageSize',this.GetPageSize());serializer.AddMember('PageNumber',this.GetPageNumber());},SetPageSize:function(pageSize){this.m_pageSize=pageSize;},SetPageNumber:function(pageNumber){this.m_pageNumber=pageNumber;}});

D2L.LP.LayeredArch.SelectionFilterTypes={None:0,All:1,AllExcept:2,Some:3};

D2L.LP.LayeredArch.SortingInfo=D2L.Class.extend({Construct:function(sortField,isAscending,collationCultureCode){if(sortField===undefined){sortField='';}
if(isAscending===undefined){isAscending=true;}
if(collationCultureCode===undefined){collationCultureCode=null;}
arguments.callee.$.Construct.call(this);this.m_collationCultureCode=null;this.m_isAscending=isAscending;this.m_sortField=sortField;},Deserialize:function(deserializer){this.m_isAscending=deserializer.GetMember('IsAscending');this.m_sortField=deserializer.GetMember('SortField');if(deserializer.HasMember('CollationCultureCode')){this.m_collationCultureCode=deserializer.GetMember('CollationCultureCode');}},GetCollationCultureCode:function(){return this.m_collationCultureCode;},GetSortField:function(){return this.m_sortField;},IsAscending:function(){return this.m_isAscending;},Serialize:function(serializer){serializer.AddMember('SortField',this.GetSortField());serializer.AddMember('IsAscending',this.IsAscending());serializer.AddMember('CollationCultureCode',this.GetCollationCultureCode());},SetIsAscending:function(isAscending){this.m_isAscending=isAscending;},SetSortField:function(sortField){this.m_sortField=sortField;}});

D2L.LP.Text={};

D2L.LP.Text.IText=D2L.Class.extend({Construct:function(val){if(val===undefined||val===null){val='';}
if(typeof val=='number'){val=val.toString();}
arguments.callee.$.Construct.call(this);this.ClassName='D2L.LP.Text.IText';this.m_characterLimit=-1;this.m_value=val;this.m_cleanedValue=null;this.m_subject='';this.m_subjectTwo='';this.m_isHtml=false;this.m_isLangTerm=false;this.m_isTrusted=true;this.m_isLegacy=false;this.m_replace=[];for(var i=1;i<arguments.length;i++){this.m_replace.push(arguments[i]);}},AssignHtml:function(obj,attrName){this.GetHtml().Register(function(val){obj[attrName]=val;});},AssignText:function(obj,attrName,doHtmlEncode){if(doHtmlEncode===undefined){doHtmlEncode=false;}
this.GetText().Register(function(val){if(doHtmlEncode){val=D2L.Util.Html.Encode(val);}
obj[attrName]=val;});},DoReplacements:function(val,doEncodeHtml){var dr=new D2L.Util.DelayedReturn();var me=this;var Replace=function(i){if(i<me.m_replace.length){if(me.m_replace[i]!==undefined&&me.m_replace[i]!==null&&me.m_replace[i].GetHtml){me.m_replace[i].GetHtml().Register(function(rep){val=val.replace('['+i+']',rep);Replace(++i);});}else{if(doEncodeHtml){val=val.replace('['+i+']',D2L.Util.Html.Encode(me.m_replace[i]));}else{val=val.replace('['+i+']',me.m_replace[i]);}
Replace(++i);}}else{dr.Trigger(val);}};Replace(0);return dr;},GetValueHelper:function(mode,callback,doEncodeHtml){var dr=new D2L.Util.DelayedReturn();var me=this;var Finish=function(val){if(me.m_isLegacy){if(mode==D2L.Sml.SmlProcessor.Mode.PlainText){val=D2L.Util.Html.Decode(val);}}else{if(me.m_isTrusted&&val.indexOf('[')!=-1){val=UI.LanguageManager.SmlProcessor.Process(val,mode);}else if(mode==D2L.Sml.SmlProcessor.Mode.Html&&!me.m_isHtml){val=D2L.Util.Html.Encode(val);}else if(mode==D2L.Sml.SmlProcessor.Mode.PlainText&&me.m_isHtml){val=val.stripHtml();}}
if(!this.m_isHtml&&me.m_characterLimit>-1){if(mode==D2L.Sml.SmlProcessor.Mode.Html){val=val.stripHtml();}
val=UI.GetCulture().LimitChars(val,me.m_characterLimit);}
var ReturnResult=function(result){if(me.m_isLangTerm&&me.m_replace.length==0&&UI.GetD2LTextCacheManager().Get(me,mode)===null){UI.GetD2LTextCacheManager().Add(me,mode,result);}
if(me.m_isTrusted){if(me.m_subject.length>0){if(result.indexOf('{subject}')!=-1){result=result.replace('{subject}',me.m_subject);}
if(result.indexOf('{subjectone}')!=-1){result=result.replace('{subjectone}',me.m_subject);}}
if(me.m_subjectTwo.length>0&&result.indexOf('{subjecttwo}')!=-1){result=result.replace('{subjecttwo}',me.m_subjectTwo);}
result=result.replace('{subject}','');result=result.replace('{subjectone}','');result=result.replace('{subjecttwo}','');}
dr.Trigger(result);if(callback!==undefined){callback.call(callback,result);}};if(me.m_isTrusted&&me.m_replace.length>0){me.DoReplacements(val,!doEncodeHtml).Register(function(repVal){ReturnResult(repVal);});}else{ReturnResult(val);}};if(this.m_isLangTerm){if(this.m_value!==undefined){Finish(this.m_value);}else{UI.LanguageManager.GetTerm(this.m_name).Register(function(val){me.m_value=val;Finish(val);});}}else{if(this.m_isHtml){if(this.m_cleanedValue!==null){Finish(this.m_cleanedValue);}else{D2L.LP.Text.HtmlText.Filter(this.m_value).Register(function(val){me.m_cleanedValue=val;Finish(val);});}}else{Finish(this.m_value);}}
return dr;},GetHtml:function(){var cacheResult=UI.GetD2LTextCacheManager().Get(this,D2L.Sml.SmlProcessor.Mode.Html);if(cacheResult===null){return this.GetValueHelper(D2L.Sml.SmlProcessor.Mode.Html,undefined,false);}else{return new D2L.Util.DelayedReturn(cacheResult);}},GetPlainText:function(callback){var cacheResult=UI.GetD2LTextCacheManager().Get(this,D2L.Sml.SmlProcessor.Mode.PlainText);if(cacheResult===null){return this.GetValueHelper(D2L.Sml.SmlProcessor.Mode.PlainText,callback,true);}else{if(callback!==undefined){callback.call(callback,cacheResult);}
return new D2L.Util.DelayedReturn(cacheResult);}},GetSubject:function(){return this.m_subject;},GetSubjectTwo:function(){return this.m_subject;},GetText:function(callback){return this.GetPlainText(callback);},Deserialize:function(deserializer){this.m_isHtml=deserializer.GetMember('IsHtml',false);this.m_isTrusted=deserializer.GetMember('IsTrusted',true);this.m_isLangTerm=deserializer.GetMember('IsLangTerm',false);this.m_name=deserializer.GetMember('TermName','');this.m_value=deserializer.GetMember('Value','');this.m_subject=deserializer.GetMember('Subject','');this.m_replace=deserializer.GetMember('Replace',[]);},DeserializeMin:function(deserializer){this.m_isHtml=deserializer.GetBoolean();this.m_isTrusted=deserializer.GetBoolean();this.m_isLangTerm=deserializer.GetBoolean();this.m_value=deserializer.GetMember();this.m_subject=deserializer.GetMember();this.m_replace=deserializer.GetMember();},Serialize:function(serializer){serializer.AddMember('ClassName',this.ClassName);serializer.AddMember('IsHtml',this.m_isHtml);serializer.AddMember('IsTrusted',this.m_isTrusted);serializer.AddMember('IsLangTerm',this.m_isLangTerm);if(this.m_isLangTerm){serializer.AddMember('Value',this.m_name);}else{serializer.AddMember('Value',this.m_value);}
serializer.AddMember('Subject',this.GetSubject());serializer.AddMember('Replace',this.m_replace);},SetCharacterLimit:function(numChars){this.m_characterLimit=numChars;},SetReplace:function(){this.m_replace=[];for(var i=0;i<arguments.length;i++){this.m_replace.push(arguments[i]);}},SetSubject:function(subject){this.m_subject=subject;},SetSubjectTwo:function(subjectTwo){this.m_subjectTwo=subjectTwo;}});D2L.LP.Text.IText.Normalize=function(text,objectName,methodName,paramName){if(text!==undefined&&text!==null){if(typeof text=='number'){text=text.toString();}
if(typeof text=='string'){if(objectName!==undefined){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.SmlText('[0].[1]() expects parameter '+'"[2]" to be of type D2L.LP.Text.IText.',objectName,methodName,paramName),true);}
var itext=new D2L.LP.Text.IText(text);itext.m_isLegacy=true;return itext;}}else{return new D2L.LP.Text.PlainText('');}
return text;};D2L.Text=D2L.LP.Text.IText;

D2L.LP.Text.Cache=D2L.Class.extend({Construct:function(val){arguments.callee.$.Construct.call(this);this.m_cacheArray=[];this.m_cacheMaxSize=100;},Add:function(textObj,mode,cValue){var cacheToken=new D2L.LP.Text.CacheToken(textObj,mode,cValue);if(this.m_cacheArray.length<this.m_cacheMaxSize){this.m_cacheArray.push(cacheToken);}},Get:function(textObj,mode){for(var i=0;i<this.m_cacheArray.length;i++){var cacheToken=this.m_cacheArray[i];if(cacheToken.GetTextObject().m_isLangTerm==textObj.m_isLangTerm&&cacheToken.GetMode()==mode){if(textObj.m_isLangTerm&&cacheToken.GetTextObject().m_name==textObj.m_name){if(cacheToken.GetTextObject().m_replace.length==textObj.m_replace.length){var replaceMatches=true;for(var j=0;j<cacheToken.GetTextObject().m_replace.length;j++){if(cacheToken.GetTextObject().m_replace[j]!=textObj.m_replace[j]){replaceMatches=false;break;}}
if(replaceMatches){var cachedVal=cacheToken.GetCachedValue();if(textObj.m_subject.length>0){cachedVal=cachedVal.replace('{subject}',textObj.m_subject);}else{cachedVal=cachedVal.replace('{subject}','');}
return cachedVal;}}}}}
return null;}});

D2L.LP.Text.CacheToken=D2L.Class.extend({Construct:function(textObj,mode,cValue){arguments.callee.$.Construct.call(this);this.m_textObj=textObj;this.m_mode=mode;this.m_cachedValue=cValue;},GetMode:function(){return this.m_mode;},GetTextObject:function(){return this.m_textObj;},GetCachedValue:function(){return this.m_cachedValue;}});

D2L.LP.Text.HtmlText=D2L.LP.Text.IText.extend({Construct:function(value,doFilter){if(doFilter==undefined){doFilter=true;}
arguments.callee.$.Construct.call(this,value);this.m_isTrusted=false;this.m_isHtml=true;if(!doFilter){this.m_cleanedValue=value;}}});D2L.LP.Text.HtmlText.Filter=function(val){var result=new D2L.Util.DelayedReturn();var HandleRpc=function(rpcResponse){if(rpcResponse.GetType()==D2L.Rpc.ResponseType.Success){result.Trigger(rpcResponse.GetResult());}else{result.Trigger('');}};D2L.Rpc.Create('Filter',HandleRpc,'/d2l/common/rpc/text/text.d2l').Call(val);return result;};

D2L.LP.Text.LangTerm=D2L.LP.Text.IText.extend({Construct:function(termName){arguments.callee.$.Construct.call(this,undefined);this.m_name=termName.toLowerCase();this.m_isLangTerm=true;this.m_value=undefined;for(var i=1;i<arguments.length;i++){this.m_replace.push(arguments[i]);}}});D2L.LP.Text.LangTerm.AssignHtml=function(name,obj,attrName){var term=new D2L.LP.Text.LangTerm(name);term.AssignHtml(obj,attrName);};D2L.LP.Text.LangTerm.AssignText=function(name,obj,attrName,doHtmlEncode){var term=new D2L.LP.Text.LangTerm(name);term.AssignText(obj,attrName,doHtmlEncode);};D2L.Language.Term=D2L.LP.Text.LangTerm;

D2L.LP.Text.PlainText=D2L.LP.Text.IText.extend({Construct:function(value){arguments.callee.$.Construct.call(this,value);this.m_isTrusted=false;}});

D2L.LP.Text.SmlText=D2L.LP.Text.IText.extend({Construct:function(value){arguments.callee.$.Construct.call(this,value);for(var i=1;i<arguments.length;i++){this.m_replace.push(arguments[i]);}}});

D2L.Notifiers={};

D2L.Notifiers.Manager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_initialResults=[];this.m_notifiers=[];this.m_refreshRate=10000;this.m_sessionLength=180*60000;this.m_timeoutIsHandled=false;this.m_textExpiryNotice='';this.m_textExpired='';},Deserialize:function(deserializer){var isLegacy=deserializer.GetMember('IsLegacy');this.m_notifiers=deserializer.GetObjectArray('Notifiers');this.m_refreshRate=deserializer.GetMember('RefreshRate');this.m_initialResults=deserializer.GetObjectArray('Results');this.m_sessionLength=deserializer.GetMember('SessionTimeout')*60000;this.m_textExpiryNotice=deserializer.GetMember('ExpiryNotice');this.m_textExpired=deserializer.GetMember('Expired');if(isLegacy){for(var i=0;i<this.m_notifiers.length;i++){this.m_notifiers[i].m_normal=this.m_notifiers[i].m_normal_legacy;this.m_notifiers[i].m_alert=this.m_notifiers[i].m_alert_legacy;}}
var notifierStyles=deserializer.GetObjectArray('NotifierStyles');for(var i=0;i<notifierStyles.length;i++){var normal=notifierStyles[i].GetIconNormal();var alert=notifierStyles[i].GetIconAlert()
if(normal!==null||alert!==null){var notifier=this.GetNotifier(notifierStyles[i].GetKey());if(notifier!==null){if(normal!==null){notifier.m_normal=normal;}
if(alert!==null){notifier.m_alert=alert;}}}}},GetNotifier:function(key){for(var i=0;i<this.m_notifiers.length;i++){if(this.m_notifiers[i].GetKey()==key){return this.m_notifiers[i];}}
return null;},GetRefreshRate:function(){return this.m_refreshRate;},HandlePollResults:function(results){for(var i=0;i<results.length;i++){var notifier=this.GetNotifier(results[i].Key);if(notifier!==null){notifier.ResultEvent().Trigger(results[i].Result);}}},Poll:function(){var me=this;var Callback=function(rpcResponse){if(rpcResponse.GetType()!=D2L.Rpc.ResponseType.Success){return;}
me.HandlePollResults(rpcResponse.GetResult());setTimeout(function(){me.Poll();},me.GetRefreshRate());};var rpc=D2L.Rpc.Create('Poll',Callback,'/d2l/common/rpc/notifiers/notifiers.d2l');rpc.SetSessionKeepAlive(false);rpc.Call();},ResetTimeout:function(){var beforeTime=5*60*1000;if(this.m_sessionLength<=beforeTime){if(this.m_sessionLength>60000){beforeTime=60000;}else{beforeTime=0;}}
var now=new Date();this.m_timeoutTime=now.getTime()+this.m_sessionLength;this.m_timeoutIsHandled=false;var me=this;var Callback=function(rpcResponse){if(rpcResponse.GetType()!=D2L.Rpc.ResponseType.Success){return;}
var sessionAlive=rpcResponse.GetResult();if(sessionAlive){me.ResetTimeout();}else{alert(me.m_textExpired);}};setTimeout(function(){var now2=new Date();if(!me.m_timeoutIsHandled&&now2.getTime()+1000>=me.m_timeoutTime-beforeTime){me.m_timeoutIsHandled=true;alert(me.m_textExpiryNotice);D2L.Rpc.Create('ExtendSession',Callback,'/d2l/common/rpc/notifiers/notifiers.d2l').Call();}},this.m_sessionLength-beforeTime);},Start:function(){if(this.m_notifiers.length===0){return;}
this.HandlePollResults(this.m_initialResults);var me=this;setTimeout(function(){me.Poll();},me.GetRefreshRate());}});D2L.Notifiers.Manager.PollResult=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.Key='';this.Result=null;},Deserialize:function(deserializer){this.Key=deserializer.GetMember('Key');this.Result=deserializer.GetObject('Result');}});

D2L.Notifiers.Notifier=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_key='';this.m_safeKey='';this.m_normal=null;this.m_normal_legacy=null;this.m_alert=null;this.m_alert_legacy=null;this.m_clickEvent=new D2L.EventHandler();this.m_resultEvent=new D2L.EventHandler();},ClickEvent:function(){return this.m_clickEvent;},Deserialize:function(deserializer){this.m_key=deserializer.GetMember('Key');this.m_safeKey=this.m_key.replace('.','_');this.m_alert=deserializer.GetObject('IconAlert');this.m_alert_legacy=deserializer.GetObject('IconAlert_Legacy');this.m_normal=deserializer.GetObject('IconNormal');this.m_normal_legacy=deserializer.GetObject('IconNormal_Legacy');},GetIconAlert:function(){return this.m_alert;},GetIconNormal:function(){return this.m_normal;},GetKey:function(){return this.m_key;},ResultEvent:function(){return this.m_resultEvent;},SetIcon:function(icon){var domNodes=UI.GetByClassName('d_nb_n_'+this.m_safeKey);for(var i=0;i<domNodes.length;i++){var domNode=domNodes[i].tagName.toLowerCase()=='div'?domNodes[i].firstChild.firstChild:domNodes[i].firstChild;icon.Assign(domNode);}}});D2L.Notifiers.C=function(key){var manager=UI.GetNotifierManager();var notifier=manager.GetNotifier(key);if(notifier!==null){notifier.ClickEvent().Trigger();}};

D2L.Notifiers.Style=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_key='';this.m_normal=null;this.m_alert=null;},Deserialize:function(deserializer){this.m_key=deserializer.GetMember('Key');this.m_alert=deserializer.GetObject('IconAlert');this.m_normal=deserializer.GetObject('IconNormal');},GetIconAlert:function(){return this.m_alert;},GetIconNormal:function(){return this.m_normal;},GetKey:function(){return this.m_key;}});

D2L.Rpc={};

D2L.Rpc.Create=function(serverFunc,callback,src){return new D2L.RpcMethodProxy(D2L.Rpc.Type.Ajax,serverFunc,callback,src);};D2L.Rpc.CreatePost=function(serverFunc,callback,src){return new D2L.RpcMethodProxy(D2L.Rpc.Type.Post,serverFunc,callback,src);};D2L.Rpc.CreateSynchronous=function(serverFunc,src){return new D2L.RpcMethodProxy(D2L.Rpc.Type.Synchronous,serverFunc,undefined,src);};

D2L.Rpc.ResponseType={Success:0,Error:1};D2L.Rpc.Type={Ajax:0,Post:1,Synchronous:2};

D2L.Rpc.Manager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_xhrNum=0;},Send:function(type,serverFunc,src,params){this.m_xhrNum++;var obj={'Type':type,'ServerFunc':serverFunc,'Src':src,'Params':params,'Num':new Number(this.m_xhrNum)};if(type==D2L.Rpc.Type.Synchronous){var xhr=this.SendAjax(obj);D2L.Debug.Trace('Rpc '+obj.Num+': Received positive response \''+xhr.responseText+'\'.');return D2L.Serialization.JsonDeserializer.Deserialize(xhr.responseText,D2L.Rpc.Response);}else{obj.DR=new D2L.Util.DelayedReturn();this.SendAjax(obj);return obj.DR;}},SendAjax:function(obj){var extIndex=obj.Src.lastIndexOf('.d2l');if(extIndex>-1){obj.Src=obj.Src.substring(0,extIndex)+'.d2lfile'+
obj.Src.substr(extIndex+4);}
var xhr=this.GetXhr(obj,(obj.Type==D2L.Rpc.Type.Ajax));UI.GenerateHitCode();obj.Params+='&d2l_hitcode='+UI.GetHitCode()+'&d2l_action=rpc';UI.GenerateHitCode();xhr.open('POST',obj.Src+'&d2l_rh=rpc&d2l_rt=call',(obj.Type==D2L.Rpc.Type.Ajax));xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');xhr.send(obj.Params);return xhr;},GetXhr:function(obj,isAsynchronous){var xhr=function createXMLHttpRequest(){var ex;try{return new XMLHttpRequest();}catch(ex){}
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(ex){}
try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(ex){}
D2L.Debug.Error('Rpc '+obj.Num+': Could not initialize D2L.Rpc object.');return null;}();if(isAsynchronous){var me=this;var timer=new Date();var response=new D2L.Rpc.Response();response.SetType(D2L.Rpc.ResponseType.Error);xhr.onreadystatechange=function(){var readyState=null;var d2l=null;try{var readyState=xhr.readyState;var d2l=D2L;}catch(e){}
if(readyState&&d2l){D2L.Debug.Trace('Rpc '+obj.Num+': Ready State:'+readyState);if(readyState==4){var status;try{status=xhr.status;}catch(e){}
if(status){D2L.Debug.Trace('Rpc '+obj.Num+': Status is \''+status+'\'.');if(status==200){try{response=D2L.Serialization.JsonDeserializer.Deserialize(xhr.responseText,D2L.Rpc.Response);D2L.Debug.Trace('Rpc '+obj.Num+': Received positive response \''+xhr.responseText+'\'.');}catch(e){D2L.Debug.Error('Rpc '+obj.Num+': Error evaluating response \''+xhr.responseText+'\'.');}
if(response.GetRedirectUrl().length>0){document.location.href=response.GetRedirectUrl();}else{var messages=response.GetMessages();if(messages){if(messages.GetStatusType()!=D2L.Control.MessageArea.Status.None||messages.HasErrors()){UI.GetMessageArea().SetMessages(messages);if(messages.GetStatusType()==D2L.Control.MessageArea.Status.Saved){FormManager.ResetChanges();}}}
response.SetDuration(new Date().valueOf()-timer.valueOf());obj.DR.Trigger(response);}}else{D2L.Debug.Error(xhr.responseText);obj.DR.Trigger(response);}}}}};}
return xhr;}});

D2L.RpcMethodProxy=D2L.Util.MethodProxy.extend({Construct:function(type,serverFunc,callback,src){this.m_skipValidation=true;if(type==D2L.Rpc.Type.Post){this.m_skipValidation=false;}
this.m_sessionKeepAlive=true;if(src===undefined||src.length===0){src=document.location.href;}
src=src.split("#")[0];if(src.indexOf('ou=')==-1){if(src.indexOf('?')==-1){src+='?';}else{src+='&';}
src+='ou='+Global.OrgUnitId;}
var me=this;var CallAjax=function(){arguments.Serialize=function(serializer){for(var i=0;i<this.length;i++){serializer.AddMember('param'+(i+1),this[i]);}};var params='d2l_rf='+serverFunc+'&params='+D2L.Util.Url.Encode(D2L.Serialization.JsonSerializer.Serialize(arguments));if(!me.m_sessionKeepAlive){params+='&d2l_nokeepalive=1';}
if(me.m_includeState!==null){params+='&d2l_stateGroups='+D2L.Util.Url.Encode(me.m_includeState.Groups);params+='&d2l_stateScopes='+D2L.Util.Url.Encode(me.m_includeState.Scopes);params+='&d2l_statePageId='+D2L.Util.Url.Encode(UI.pageId);for(var currStateGroup in me.m_includeState.State){params+='&d2l_state_'+currStateGroup+'='+D2L.Util.Url.Encode(me.m_includeState.State[currStateGroup]);}}
return RpcManager.Send(type,serverFunc,src,params);};var CallPost=function(){var dr=new D2L.Util.DelayedReturn();var iframeName=UI.GetUniqueHtmlId();if(document.body.insertAdjacentHTML){document.body.insertAdjacentHTML('beforeEnd','<iframe id=\''+iframeName+'\' name=\''+iframeName+'\' style=\'display:none\'></iframe>');}else{var iframe=document.createElement('iframe');iframe.id=iframeName;iframe.name=iframeName;iframe.style.position='absolute';iframe.style.left='-200px';iframe.style.top='-200px';iframe.style.width='1px';iframe.style.height='1px';document.body.appendChild(iframe);}
var cbName=UI.GetUniqueHtmlId();window[cbName]=function(responseText){var response=D2L.Serialization.JsonDeserializer.Deserialize(responseText,D2L.Rpc.Response);if(response.GetRedirectUrl().length>0){document.location.href=response.GetRedirectUrl();}else{if(!me.m_skipValidation){var messages=response.GetMessages();if(messages!==null){UI.GetMessageArea().SetMessages(messages);if(messages.GetStatusType()==D2L.Control.MessageArea.Status.Saved){FormManager.ResetChanges();}}}
D2L.Debug.Trace('Post-Rpc: Received positive response \''+responseText+'\'.');dr.Trigger(response);}};arguments.Serialize=function(serializer){for(var i=0;i<this.length;i++){serializer.AddMember('param'+(i+1),this[i]);}};var ni=new D2L.NavInfo();ni.navigation=src;ni.target=iframeName;ni.action='RPC';ni.SetParam('d2l_rh','rpc');ni.SetParam('d2l_rt','post');ni.SetParam('d2l_rcb',cbName);ni.SetParam('d2l_rf',serverFunc);ni.SetParam('params',D2L.Serialization.JsonSerializer.Serialize(arguments));D2L.Debug.Trace('Post-Rpc: posting to function \''+serverFunc+'\' on Src \''+src+'\'...');Nav.Go(ni,me.m_skipValidation);return dr;};var beginFunc=(type==D2L.Rpc.Type.Post)?CallPost:CallAjax;arguments.callee.$.Construct.call(this,beginFunc,callback,(type!=D2L.Rpc.Type.Synchronous));this.m_includeState=null;},SetSessionKeepAlive:function(keepAlive){this.m_sessionKeepAlive=keepAlive;},SetSkipValidation:function(skipValidation){this.m_skipValidation=skipValidation;},SetIncludeState:function(state){this.m_includeState=state;}});

D2L.Rpc.Response=D2L.Class.extend({Construct:function(duration){if(duration===undefined){duration=0;}
this.m_duration=duration;this.m_isResultMin=false;this.m_messages=null;this.m_redirectUrl='';this.m_responseType=D2L.Rpc.ResponseType.Success;this.m_result=null;},Deserialize:function(deserializer){if(deserializer.HasMember('MessageArea')){this.m_messages=deserializer.GetObject('MessageArea',D2L.Control.MessageArea.Messages);}
this.m_isResultMin=deserializer.GetMember('IsResultMin');this.m_responseType=deserializer.GetMember('ResponseType');this.m_redirectUrl=deserializer.GetMember('RedirectUrl');this.m_result=deserializer.GetMember('Result');},GetDuration:function(){return this.m_duration;},GetMessages:function(){return this.m_messages;},GetRedirectUrl:function(){return this.m_redirectUrl;},GetResponseType:function(){return this.GetType();},GetType:function(){return this.m_responseType;},GetResult:function(type){if(this.m_isResultMin){return D2L.Serialization.JsonDeserializerMin.Deserialize(this.m_result,type);}else{var hasType=type!==undefined||(this.m_result instanceof Array&&this.m_result.length>0&&this.m_result[0]!==null&&this.m_result[0].ClassName!==undefined)||(this.m_result!==undefined&&this.m_result!==null&&this.m_result.ClassName!==undefined);if(hasType){return D2L.Serialization.JsonDeserializer.Deserialize(this.m_result,type);}else{return this.m_result;}}},SetDuration:function(duration){this.m_duration=duration;},SetType:function(type){this.m_responseType=type;}});D2L.Rpc.Response.Timeout="timeout";

D2L.Serialization={};

D2L.Serialization.JsonDeserializer=D2L.Class.extend({Construct:function(json){arguments.callee.$.Construct.call(this);if(json!==undefined){this.m_data=json;if(json!==null&&json.isString){this.m_data=eval('('+json+')');}}
this.m_keys=[];for(var key in this.m_data){this.m_keys.push(key);}},Keys:function(){return this.m_keys;},GetDictionary:function(name,keyType,valueType){var ret={};if(this.m_data!==undefined&&this.m_data!==null&&this.m_data[name]!==undefined){var dic=this.m_data[name];for(var key in dic){var dKey=key;if(typeof key=='object'){dKey=D2L.Serialization.JsonDeserializerMin.Deserialize(key,keyType);}else if(keyType=='number'){dKey=parseFloat(key);}
if(typeof dic[key]=='object'){ret[dKey]=D2L.Serialization.JsonDeserializerMin.Deserialize(dic[key],valueType);}else{ret[dKey]=dic[key];}}}
return ret;},GetMember:function(name,defaultValue){if(this.m_data!==undefined&&this.m_data!==null){if(this.m_data[name]===undefined){return defaultValue;}
return this.m_data[name];}
return defaultValue;},GetObject:function(name,type){if(this.m_data[name]!==undefined){return D2L.Serialization.JsonDeserializer.Deserialize(this.m_data[name],type);}
return undefined;},GetObjectArray:function(name,type){var ret=[];if(this.m_data[name]!==undefined){for(var i=0;i<this.m_data[name].length;i++){ret.push(D2L.Serialization.JsonDeserializer.Deserialize(this.m_data[name][i],type));}}
return ret;},HasMember:function(name){return(this.m_data!==undefined&&this.m_data!==null&&this.m_data[name]!==undefined);},IsArray:function(name){return isArray(this.m_data[name]);}});D2L.Serialization.JsonDeserializer.Deserialize=function(json,type){var obj=json;if(json!==undefined&&json!==null&&json.isString){obj=eval('('+json+')');}
if(obj===null){return null;}
if(obj instanceof Array){var l=obj.length;for(var i=0;i<l;i++){obj[i]=D2L.Serialization.JsonDeserializer.Deserialize(obj[i],type);}}else{var deserializer=new D2L.Serialization.JsonDeserializer(json);if(type===undefined&&deserializer.HasMember('ClassName')){type=deserializer.GetMember('ClassName');if(type.isString){type=eval(type);}}
if(type!==undefined){obj=new type();if(obj.Deserialize!==undefined){obj.Deserialize(deserializer);}}}
return obj;};

D2L.Serialization.JsonDeserializerMin=D2L.Class.extend({Construct:function(json){arguments.callee.$.Construct.call(this);this.m_data=[];this.m_index=-1;if(json!==undefined){this.m_data=json;if(json!==undefined&&json!==null&&json.isString){this.m_data=eval('('+json+')');}}},GetBoolean:function(){if(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1){this.m_index++;return(this.m_data[this.m_index]==1);}
return false;},GetMember:function(){if(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1){this.m_index++;return this.m_data[this.m_index];}
return undefined;},GetObject:function(type){if(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1){this.m_index++;return D2L.Serialization.JsonDeserializer.Deserialize(this.m_data[this.m_index],type);}
return undefined;},GetObjectMin:function(type){if(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1){this.m_index++;return D2L.Serialization.JsonDeserializerMin.Deserialize(this.m_data[this.m_index],type);}
return undefined;},GetObjectArray:function(type){var ret=[];if(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1){this.m_index++;for(var i=0;i<this.m_data[this.m_index].length;i++){ret.push(D2L.Serialization.JsonDeserializer.Deserialize(this.m_data[this.m_index][i],type));}}
return ret;},GetObjectArrayMin:function(type){var ret=[];if(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1){this.m_index++;for(var i=0;i<this.m_data[this.m_index].length;i++){ret.push(D2L.Serialization.JsonDeserializerMin.Deserialize(this.m_data[this.m_index][i],type));}}
return ret;},GetDictionaryMin:function(keyType,valueType){var ret={};if(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1){this.m_index++;var dic=this.m_data[this.m_index];for(var key in dic){var dKey=key;if(typeof key=='object'){dKey=D2L.Serialization.JsonDeserializerMin.Deserialize(key,keyType);}else if(keyType=='number'){dKey=parseFloat(key);}
if(typeof dic[key]=='object'){ret[dKey]=D2L.Serialization.JsonDeserializerMin.Deserialize(dic[key],valueType);}else{ret[dKey]=dic[key];}}}
return ret;},HasMember:function(){return(this.m_data!==undefined&&this.m_data!==null&&this.m_data.length>this.m_index+1);}});D2L.Serialization.JsonDeserializerMin.Deserialize=function(json,type){var obj=json;if(json!==undefined&&json!==null&&json.isString){obj=eval('('+json+')');}
if(obj===null){return null;}
var deserializer=new D2L.Serialization.JsonDeserializerMin(obj);if(type!==undefined){var t=typeof type;if(t!='string'){obj=new type();}}
if(obj.DeserializeMin!==undefined){obj.DeserializeMin(deserializer);}
return obj;};

D2L.Serialization.JsonSerializer=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_text=new D2L.Util.StringBuilder();this.m_comma='';},DoSerialize:function(obj,serializeMethod,noStringEncode,param1,param2){if(serializeMethod===undefined){serializeMethod='Serialize';}
if(noStringEncode===undefined){noStringEncode=false;}
if(obj===undefined||obj===null){this.m_text.Append('null');}else{if(typeof obj=='boolean'){this.m_text.Append(obj);}else if(typeof obj=='string'){if(noStringEncode){this.m_text.Append(obj);}else{this.m_text.Append('\''+obj.jsString()+'\'');}}else if(typeof obj=='number'){this.m_text.Append(obj);}else if(typeof obj=='object'){if(isArray(obj)){this.m_text.Append('[');var l=obj.length;var comma='';for(var i=0;i<l;i++){this.m_text.Append(comma);this.DoSerialize(obj[i],serializeMethod);comma=',';}
this.m_text.Append(']');}else{if(obj[serializeMethod]){this.m_text.Append('{');var oldComma=this.m_comma;this.m_comma='';obj[serializeMethod](this,param1,param2);this.m_text.Append('}');this.m_comma=oldComma;}else{this.m_text.Append('{');var comma='';var i=0;for(var key in obj){this.m_text.Append(comma);this.m_text.Append(key+':');this.DoSerialize(obj[key],serializeMethod);comma=',';}
this.m_text.Append('}');}}}else{this.m_text.Append('null');}}},AddMember:function(name,member,serializeMethod,noStringEncode,param1,param2){if(name===undefined||name===null||name.length===0){return;}
this.m_text.Append(this.m_comma+'\''+name.jsString()+'\':'+D2L.Serialization.JsonSerializer.Serialize(member,serializeMethod,noStringEncode,param1,param2));this.m_comma=',';},ToString:function(){return this.m_text.ToString();}});D2L.Serialization.JsonSerializer.Serialize=function(obj,serializeMethod,noStringEncode,param1,param2){var serializer=new D2L.Serialization.JsonSerializer();serializer.DoSerialize(obj,serializeMethod,noStringEncode,param1,param2);return serializer.ToString();};

D2L.Sml={};

D2L.Sml.SmlProcessor=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);},Encode:function(input){if(!input){return'';}
return input.replace(/(\\|\[|\])/g,"\\$1");},Process:function(input,type){if(input===undefined||input===null){return'';}
var st=new D2L.Sml.SmlTokenizer(input);var stack=new Array();var ret='';var isEmpty=true;while(!st.IsDone()){var token=st.GetToken();if(token.m_type==D2L.Sml.SmlTokenType.Text){isEmpty=false;if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+=D2L.Util.Html.Encode(token.m_text);}else{ret+=token.m_text;}}else if(token.m_type==D2L.Sml.SmlTokenType.Unknown){isEmpty=false;ret+="["+token.m_text+"]";}else if(token.m_isOpen){if(token.m_isContainer){stack.push(token);if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+=this.WriteOpenTag(token);}else if(type==D2L.Sml.SmlProcessor.Mode.PlainText&&token.m_type==D2L.Sml.SmlTokenType.Abbr){ret+=token.m_text.substring(5,token.m_text.length)+" (";}}else{if(token.m_type==D2L.Sml.SmlTokenType.Break){isEmpty=false;if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+="<br/>";}else{ret+="\n";}}else if(token.m_type==D2L.Sml.SmlTokenType.Space){isEmpty=false;if(token.m_text.indexOf(':')>0){var spaces=token.m_text.substring(token.m_text.indexOf(':')+1,token.m_text.length);for(var i=0;i<spaces;i++){if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+="&nbsp;";}else{ret+=" ";}}}else{if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+="&nbsp;";}else{ret+=" ";}}}}}else{if(stack.length!=0){if(stack[stack.length-1].m_type!=token.m_type){var contained=false;for(x in stack){if(stack[x].m_type==token.m_type){contained=true;break;}}
if(contained){while(stack[stack.length-1].m_type!=token.m_type){if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+=this.WriteCloseTag(stack.pop());}else{stack.pop();if(type==D2L.Sml.SmlProcessor.Mode.PlainText&&token.m_type==D2L.Sml.SmlTokenType.Abbr){ret+=")";}}}
if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+=this.WriteCloseTag(stack.pop());}else{stack.pop();if(type==D2L.Sml.SmlProcessor.Mode.PlainText&&token.m_type==D2L.Sml.SmlTokenType.Abbr){ret+=")";}}}}else{if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+=this.WriteCloseTag(stack.pop());}else{stack.pop();if(type==D2L.Sml.SmlProcessor.Mode.PlainText&&token.m_type==D2L.Sml.SmlTokenType.Abbr){ret+=")";}}}}}}
while(stack.length!=0){if(type==D2L.Sml.SmlProcessor.Mode.Html){ret+=this.WriteCloseTag(stack.pop());}else{stack.pop();}}
if(isEmpty){return'';}else{return ret;}},WriteOpenTag:function(token){var ret='';switch(token.m_type){case D2L.Sml.SmlTokenType.Abbr:var title=token.m_text.substring(5,token.m_text.length);ret="<abbr title=\""+title+"\">";break;case D2L.Sml.SmlTokenType.Alert:ret="<span class=\"ds_a\">";break;case D2L.Sml.SmlTokenType.Bold:ret="<strong>";break;case D2L.Sml.SmlTokenType.Italic:ret="<em>";break;case D2L.Sml.SmlTokenType.Light:ret="<span class=\"ds_b\">";break;case D2L.Sml.SmlTokenType.Info:ret="<span class=\"ds_c\">";break;case D2L.Sml.SmlTokenType.Colour:var clr=token.m_text.substring(4,token.m_text.length);ret="<span style=\"color:"+clr+"\">";break;case D2L.Sml.SmlTokenType.Underline:ret="<span class=\"ds_d\">";break;case D2L.Sml.SmlTokenType.Large:ret="<span class=\"ds_e\">";break;case D2L.Sml.SmlTokenType.Larger:ret="<span class=\"ds_f\">";break;case D2L.Sml.SmlTokenType.Small:ret="<span class=\"ds_g\">";break;case D2L.Sml.SmlTokenType.Smaller:ret="<span class=\"ds_h\">";break;case D2L.Sml.SmlTokenType.Medium:ret="<span class=\"ds_m\">";break;case D2L.Sml.SmlTokenType.Normal:ret="<span class=\"ds_i\">";break;}
return ret;},WriteCloseTag:function(token){var ret='';switch(token.m_type){case D2L.Sml.SmlTokenType.Abbr:ret="</abbr>";break;case D2L.Sml.SmlTokenType.Bold:ret="</strong>";break;case D2L.Sml.SmlTokenType.Italic:ret="</em>";break;default:ret="</span>";break;}
return ret;}});D2L.Sml.SmlProcessor.Mode={PlainText:0,Html:1};

D2L.Sml.SmlToken=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_type=D2L.Sml.SmlTokenType.Text;this.m_isOpen=true;this.m_isContainer=true;this.m_text='';}});

D2L.Sml.SmlTokenizer=D2L.Class.extend({Construct:function(input){this.m_input=input?input:'';this.m_length=input?input.length:0;this.m_pos=0;},GetText:function(start,end){var ret=this.m_input.substring(start,end);return ret.replace(/\\(\\|\[|\])/g,"$1");},GetToken:function(){var ret=new D2L.Sml.SmlToken();var returnstart=this.m_pos;var returnend=0;if(this.m_pos>=this.m_length){ret.m_type=D2L.Sml.SmlTokenType.EndOfInput;}else if(this.m_input.charAt(this.m_pos)=='['){this.m_pos++;if(this.m_pos<this.m_length){if(this.m_input.charAt(this.m_pos)=='/'){ret.m_isOpen=false;this.m_pos++;}
var contentstart=this.m_pos;while(this.m_pos<this.m_length){switch(this.m_input.charAt(this.m_pos)){case']':ret.m_text=this.GetText(contentstart,this.m_pos);this.ParseTag(ret,ret.m_text);this.m_pos++;return ret;case'\\':this.m_pos+=2;break;default:this.m_pos++;break;}}}}else{while(this.m_pos<this.m_length){var c=this.m_input.charAt(this.m_pos);if(c=='['){break;}else if(c=='\\'){this.m_pos+=2;}else{this.m_pos++;}}}
returnend=this.m_pos>this.m_length?this.m_length:this.m_pos;ret.m_text=this.GetText(returnstart,returnend);return ret;},IsDone:function(){return this.m_pos>=this.m_input.length;},ParseTag:function(token,tag){switch(tag.charAt(0)){case'b':if(tag=="b"){token.m_type=D2L.Sml.SmlTokenType.Bold;}else if(tag=="br"){token.m_type=D2L.Sml.SmlTokenType.Break;token.m_isContainer=false;}
break;case'i':if(tag=="i"){token.m_type=D2L.Sml.SmlTokenType.Italic;}else if(tag=="info"){token.m_type=D2L.Sml.SmlTokenType.Info;}
break;case'a':if(tag=="alert"){token.m_type=D2L.Sml.SmlTokenType.Alert;}else if(tag.substring(0,4)=="abbr"){token.m_type=D2L.Sml.SmlTokenType.Abbr;}
break;case'l':if(tag=="light"){token.m_type=D2L.Sml.SmlTokenType.Light;}else if(tag=="large"){token.m_type=D2L.Sml.SmlTokenType.Large;}else if(tag=="larger"){token.m_type=D2L.Sml.SmlTokenType.Larger;}
break;case'c':if(tag.substring(0,3)=="clr"){token.m_type=D2L.Sml.SmlTokenType.Colour;}
break;case'u':if(tag=="u"){token.m_type=D2L.Sml.SmlTokenType.Underline;}
break;case's':if(tag=="small"){token.m_type=D2L.Sml.SmlTokenType.Small;}else if(tag=="smaller"){token.m_type=D2L.Sml.SmlTokenType.Smaller;}else if(tag.substring(0,2)=="sp"){token.m_type=D2L.Sml.SmlTokenType.Space;token.m_isContainer=false;}
break;case'n':if(tag=="normal"){token.m_type=D2L.Sml.SmlTokenType.Normal;}
break;case'm':if(tag=="medium"){token.m_type=D2L.Sml.SmlTokenType.Medium;}
break;default:token.m_type=D2L.Sml.SmlTokenType.Unknown;token.m_isContainer=false;break;}}});

D2L.Sml.SmlTokenType={Text:1,Bold:2,Italic:3,Underline:4,Light:5,Normal:6,Info:7,Alert:8,Break:9,Colour:10,Large:11,Larger:12,Small:13,Smaller:14,Space:15,Unknown:16,EndOfInput:17,Abbr:18,Medium:19};

D2L.Style={};

D2L.Style.BorderInfo=D2L.Class.extend({Construct:function(style,colour,width){if(style===undefined){style=D2L.Style.BorderStyle.None;}
if(colour===undefined){colour='#000000';}
if(width===undefined){width=0;}
this.m_style=style;this.m_colour=colour;this.m_width=width;},DeserializeMin:function(deserializer){this.m_style=deserializer.GetMember();this.m_colour=deserializer.GetMember();this.m_width=deserializer.GetMember();},GetColour:function(){return this.m_colour;},GetStyle:function(){return this.m_style;},GetWidth:function(){return this.m_width;},SetColour:function(colour){this.m_colour=colour;},SetStyle:function(style){this.m_style=style;},SetWidth:function(width){this.m_width=width;},ToCss:function(){if(this.m_style==D2L.Style.BorderStyle.None||this.m_width<1||this.m_colour.length===0){return'none';}else{var style='none';switch(this.m_style){case D2L.Style.BorderStyle.Hidden:style='hidden';break;case D2L.Style.BorderStyle.Dotted:style='dotted';break;case D2L.Style.BorderStyle.Dashed:style='dashed';break;case D2L.Style.BorderStyle.Solid:style='solid';break;case D2L.Style.BorderStyle.Double:style='double';break;case D2L.Style.BorderStyle.Groove:style='groove';break;case D2L.Style.BorderStyle.Ridge:style='ridge';break;case D2L.Style.BorderStyle.Inset:style='inset';break;case D2L.Style.BorderStyle.Outset:style='outset';break;default:style='none';}
return this.m_width+'px '+style+' '+this.m_colour;}}});

D2L.Style.FontFace={Arial:1,Courier:2,Georgia:3,Times:4,Trebuchet:5,Verdana:6,Comic:7};D2L.Style.FontSize={XXLarge:5,XLarge:10,Large:20,Medium:30,Small:40,XSmall:50};D2L.Style.TextAlignment={Left:1,Middle:2,Right:3,Justify:4};D2L.Style.ImageRepeat={NoRepeat:1,RepeatY:2,RepeatX:3,RepeatBoth:4};D2L.Style.ImagePosition={TopLeft:1,Top:2,TopRight:3,Left:4,Center:5,Right:6,BottomLeft:7,Bottom:8,BottomRight:9};D2L.Style.BorderPosition={All:1,Top:2,Right:3,Bottom:4,Left:5};D2L.Style.BorderStyle={None:1,Hidden:2,Dotted:3,Dashed:4,Solid:5,Double:6,Groove:7,Ridge:8,Inset:9,Outset:10};D2L.Style.BorderWidth={Thin:1,Medium:2,Thick:3};D2L.Style.PointFontSize={pt30:1,pt28:2,pt26:3,pt24:4,pt22:5,pt20:7,pt18:10,pt16:15,pt14:20,pt12:25,pt10:30,pt9:40,pt8:50};D2L.Style.Float={None:0,Left:1,Right:2};D2L.Style.HorizontalAlignment={Left:0,Middle:1,Right:2};D2L.Style.AnimationMode={None:0,Slide:1,Fade:2};D2L.Style.WidthType={None:0,Em:1,Percent:2,Pixels:3};D2L.Animation={};D2L.Animation.Mode=D2L.Style.AnimationMode;

D2L.Style.RelativeFontSizeManager=D2L.Class.extend({Construct:function(data){arguments.callee.$.Construct.call(this);this.m_fontSizes=data;},ToDictionary:function(){return this.m_fontSizes;},GetBaseFontSize:function(){return this.m_fontSizes['d2l_body']*16;}});

D2L.Style.Measurement={};

D2L.Style.Measurement.Unit=D2L.Class.extend({Construct:function(unitType,value){arguments.callee.$.Construct.call(this);if(unitType===undefined){unitType=D2L.Style.Measurement.UnitType.Pixel;}
if(value===undefined){value=0;}
this.m_unitType=unitType;this.m_value=value;this.m_onChange=new D2L.EventHandler();},Deserialize:function(deserializer){this.m_unitType=deserializer.GetMember('Type',D2L.Style.Measurement.UnitType.Pixel);this.m_value=deserializer.GetMember('Val',0);},DeserializeMin:function(deserializer){this.m_unitType=deserializer.GetMember();this.m_value=deserializer.GetMember();},Serialize:function(serializer){serializer.AddMember('Val',this.m_value);serializer.AddMember('Type',this.m_unitType);},GetUnitType:function(){return this.m_unitType;},GetValue:function(){return this.m_value;},OnChange:function(){return this.m_onChange;},SetUnitType:function(unitType){if(unitType!==this.m_unitType){this.m_unitType=unitType;this.OnChange().Trigger();}},SetValue:function(value){if(value!==this.m_value){this.m_value=value;this.OnChange().Trigger();}},ToCss:function(){var value='';var unit='';if(this.m_unitType==D2L.Style.Measurement.UnitType.Pixel){value=this.m_value.toString();unit='px';}else if(this.m_unitType==D2L.Style.Measurement.UnitType.Em){value=this.m_value.toString();unit='em';}else if(this.m_unitType==D2L.Style.Measurement.UnitType.Percentage){value=this.m_value.toString();unit='%';}else if(this.m_unitType==D2L.Style.Measurement.UnitType.Auto){unit='auto';}
return value+unit;}});D2L.Style.Measurement.UnitType={Pixel:0,Em:1,Percentage:2,Wildcard:3,Auto:4};

D2L.Style.Spacing=D2L.Class.extend({Construct:function(spacingType,defaultUnitType,defaultUnitValue){arguments.callee.$.Construct.call(this);if(spacingType===undefined){spacingType=D2L.Style.Spacing.Type.Padding;}
if(defaultUnitType===undefined){defaultUnitType=D2L.Style.Spacing.UnitType.Pixel;}
if(defaultUnitValue===undefined){defaultUnitValue=0;}
this.m_spacingType=spacingType;this.m_top=new D2L.Style.Spacing.Unit(defaultUnitType,defaultUnitValue);this.m_right=new D2L.Style.Spacing.Unit(defaultUnitType,defaultUnitValue);this.m_bottom=new D2L.Style.Spacing.Unit(defaultUnitType,defaultUnitValue);this.m_left=new D2L.Style.Spacing.Unit(defaultUnitType,defaultUnitValue);this.m_onChange=new D2L.EventHandler();this.m_ignoreChange=false;this.SetupOnChange();},Deserialize:function(deserializer){this.m_spacingType=deserializer.GetMember('Type',D2L.Style.Spacing.Type.Padding);this.m_top=deserializer.GetObject('Top',D2L.Style.Spacing.Unit);this.m_right=deserializer.GetObject('Right',D2L.Style.Spacing.Unit);this.m_bottom=deserializer.GetObject('Bottom',D2L.Style.Spacing.Unit);this.m_left=deserializer.GetObject('Left',D2L.Style.Spacing.Unit);this.SetupOnChange();},DeserializeMin:function(deserializer){this.m_spacingType=deserializer.GetMember();this.m_top=deserializer.GetObjectMin(D2L.Style.Spacing.Unit);this.m_right=deserializer.GetObjectMin(D2L.Style.Spacing.Unit);this.m_bottom=deserializer.GetObjectMin(D2L.Style.Spacing.Unit);this.m_left=deserializer.GetObjectMin(D2L.Style.Spacing.Unit);this.SetupOnChange();},Serialize:function(serializer){serializer.AddMember('Type',this.m_spacingType);serializer.AddMember('Top',this.m_top);serializer.AddMember('Right',this.m_right);serializer.AddMember('Bottom',this.m_bottom);serializer.AddMember('Left',this.m_left);},SetupOnChange:function(){var me=this;var HandleChange=function(){if(!me.m_ignoreChange){me.m_onChange.Trigger();}};this.m_top.OnChange().RegisterMethod(HandleChange);this.m_right.OnChange().RegisterMethod(HandleChange);this.m_bottom.OnChange().RegisterMethod(HandleChange);this.m_left.OnChange().RegisterMethod(HandleChange);},GetTop:function(){return this.m_top;},GetRight:function(){return this.m_right;},GetBottom:function(){return this.m_bottom;},GetLeft:function(){return this.m_left;},GetType:function(){return this.m_spacingType;},OnChange:function(){return this.m_onChange;},SetAllValues:function(val){this.m_ignoreChange=true;this.GetTop().SetValue(val);this.GetRight().SetValue(val);this.GetBottom().SetValue(val);this.GetLeft().SetValue(val);this.m_ignoreChange=false;this.OnChange().Trigger();},SetAllUnitTypes:function(unitType){this.m_ignoreChange=true;this.GetTop().SetUnitType(unitType);this.GetRight().SetUnitType(unitType);this.GetBottom().SetUnitType(unitType);this.GetLeft().SetUnitType(unitType);this.m_ignoreChange=false;this.OnChange().Trigger();},ToCss:function(){return this.m_top.ToCss()+' '+this.m_right.ToCss()+' '+
this.m_bottom.ToCss()+' '+this.m_left.ToCss();},ApplyToDomNode:function(domNode){if(this.m_spacingType==D2L.Style.Spacing.Type.Spacing){domNode.style.margin=this.ToCss();}else{domNode.style.padding=this.ToCss();}}});D2L.Style.Spacing.Unit=D2L.Style.Measurement.Unit;D2L.Style.Spacing.UnitType=D2L.Style.Measurement.UnitType;

D2L.Style.Spacing.Type={Spacing:0,Padding:1};

D2L.Style.Utility={};D2L.Style.Utility.PixelToEm=function(base,pixel){var em=pixel/base;return Math.round(em*10000)/10000;};D2L.Style.Utility.FontFaceToCss=function(fontFace){var strFace='verdana, sans-serif';switch(fontFace){case D2L.Style.FontFace.Arial:strFace='arial, sans-serif';break;case D2L.Style.FontFace.Courier:strFace='\'courier new\', sans-serif';break;case D2L.Style.FontFace.Georgia:strFace='georgia, serif';break;case D2L.Style.FontFace.Times:strFace='\'times new roman\', serif';break;case D2L.Style.FontFace.Trebuchet:strFace='\'trebuchet ms\', sans-serif';break;case D2L.Style.FontFace.Comic:strFace='\'comic sans ms\', sans-serif';break;case D2L.Style.FontFace.Verdana:strFace='verdana, sans-serif';break;}
return strFace;};D2L.Style.Utility.ImageRepeatToCss=function(imageRepeat){if(imageRepeat==D2L.Style.ImageRepeat.NoRepeat){return'no-repeat';}else if(imageRepeat==D2L.Style.ImageRepeat.RepeatY){return'repeat-y';}else if(imageRepeat==D2L.Style.ImageRepeat.RepeatX){return'repeat-x';}else{return'repeat';}};D2L.Style.Utility.BorderToCss=function(style,width,colour){var sStyle='solid';if(style==D2L.Style.BorderStyle.None){return'none';}else if(style==D2L.Style.BorderStyle.Dashed){sStyle='dashed';}else if(style==D2L.Style.BorderStyle.Dotted){sStyle='dotted';}else if(style==D2L.Style.BorderStyle.Double){sStyle='double';}
var sWidth='1px';if(width==D2L.Style.BorderWidth.Thick){sWidth='3px';}else if(width==D2L.Style.BorderWidth.Medium){sWidth='2px';}
if(colour!='transparent'){colour='#'+colour;}
return sWidth+' '+sStyle+' '+colour;};D2L.Style.Utility.TextAlignToCss=function(align){var style='left';if(align==D2L.Style.TextAlignment.Middle){style='center';}else if(align==D2L.Style.TextAlignment.Right){style='right';}else if(align==D2L.Style.TextAlignment.Justify){style='justify';}
return style;};D2L.Style.Utility.CssToTextAlign=function(style){var align=D2L.Style.TextAlignment.Left;if(style=='center'){align=D2L.Style.TextAlignment.Middle;}else if(style=='right'){align=D2L.Style.TextAlignment.Right;}else if(style=='justify'){align=D2L.Style.TextAlignment.Justify;}
return align;};D2L.Style.Utility.ParseMeasurementUnit=function(sVal){sVal=sVal.toLowerCase();var unitValue;var unitType;var unitIndex;var tempUnitIndex=sVal.indexOf('%');if(tempUnitIndex>-1){unitType=D2L.Style.Measurement.UnitType.Percentage;unitIndex=tempUnitIndex;}
tempUnitIndex=sVal.indexOf('px');if(tempUnitIndex>-1){unitType=D2L.Style.Measurement.UnitType.Px;unitIndex=tempUnitIndex;}
tempUnitIndex=sVal.indexOf('em');if(tempUnitIndex>-1){unitType=D2L.Style.Measurement.UnitType.Em;unitIndex=tempUnitIndex;}
tempUnitIndex=sVal.indexOf('*');if(tempUnitIndex>-1){unitType=D2L.Style.Measurement.UnitType.Wildcard;unitIndex=tempUnitIndex;}
tempUnitIndex=sVal.indexOf('auto');if(tempUnitIndex>-1){unitType=D2L.Style.Measurement.UnitType.Auto;unitIndex=tempUnitIndex;}
if(unitIndex>-1){unitValue=sVal.substring(0,unitIndex);if(unitValue!=''){unitValue=parseFloat(unitValue);}else{if(unitType==D2L.Style.Measurement.UnitType.Wildcard){unitValue=1;}}}
var mUnit=new D2L.Style.Measurement.Unit(unitType,unitValue);return mUnit;};

D2L.UI.AriaController=D2L.Class.extend({Construct:function(ui){arguments.callee.$.Construct.call(this);this.m_ui=ui;if(D2L.Util.Aria.IsEnabled()){var me=this;this.m_ui.OnPageLoad().RegisterMethod(function(){me.OnPageLoad();});}},OnPageLoad:function(){var navBars=this.m_ui.GetByClassName('d_nb');if(navBars.length>0){D2L.Util.Aria.SetRole(navBars[0],'navigation');}
var banners=this.m_ui.GetByClassName('d_nb_c3');if(banners.length>0){D2L.Util.Aria.SetRole(banners[0],'banner');}
var main=this.m_ui.GetById('d_content');if(main!==null){D2L.Util.Aria.SetRole(main,'main');}
var areaToolbars=this.m_ui.GetByClassName('datb_ul');for(var i=0;i<areaToolbars.length;i++){D2L.Util.Aria.SetRole(areaToolbars[i],'navigation');}
var toolbars=this.m_ui.GetByClassName('dtb_ul');for(var i=0;i<toolbars.length;i++){D2L.Util.Aria.SetRole(toolbars[i],'navigation');}}});

D2L.UI.ShimController=D2L.Class.extend({Construct:function(ui){arguments.callee.$.Construct.call(this);this.m_shims=[];this.m_ui=ui;var me=this;ui.OnPageUnload().RegisterMethod(function(){me.ClearShims();});},ClearShims:function(depth){if(depth===undefined||depth==-1||depth>this.m_shims.length){depth=this.m_shims.length;}
for(var i=0;i<depth;i++){var shimsData=this.m_shims.pop();for(var j=0;j<shimsData.shims.length;j++){if(shimsData.shims[j]!==null){shimsData.shims[j].SetIsVisible(false);}}}},ShimWindow:function(w,isTimeBased){var me=this;var shims=[];var TravelDown=function(win){var wFrames=win.document.getElementsByTagName('frame');var iframes=win.document.getElementsByTagName('iframe');var shimFrame=(wFrames.length===0);for(var i=0;i<wFrames.length;i++){try{TravelDown(wFrames[i].contentWindow);}catch(e){}}
for(var i=0;i<iframes.length;i++){var test=null;try{if(iframes[i].contentWindow!==undefined&&iframes[i].contentWindow.document!=undefined){test=iframes[i].contentWindow.document.location;}}catch(e){}
if(test===null){shims.push(me.AddShim(win,iframes[i]));}else if(iframes[i].className=='dif'&&(iframes[i].offsetWidth>0||iframes[i].offsetHeight>0)){shimFrame=false;TravelDown(iframes[i].contentWindow);}}
if(shimFrame){shims.push(me.AddShim(win,win.document,isTimeBased));}};var w=window;while(w.parent!=w){w=w.parent;}
TravelDown(w);return shims;},AddShim:function(w,domNode,isTimeBased){if(w===undefined){w=window;}
if(isTimeBased===undefined){isTimeBased=false;}
var ui=this.m_ui;var offset=0;if(ui.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){offset=-1;}
var shim=null;try{shim=new D2L.Control.Shim(domNode,isTimeBased,ui.GetZIndex());shim.SetWindow(w);if(domNode===w.document){var resize=function(){var windowWidth=ui.GetWindowWidth(w)+offset;var windowHeight=ui.GetWindowHeight(w)+offset;shim.SetSize(windowWidth,windowHeight);var pageWidth=ui.GetPageWidth(w)+offset;var pageHeight=ui.GetPageHeight(w)+offset;var height=Math.max(windowHeight,pageHeight);var width=Math.max(windowWidth,pageWidth);shim.SetSize(width,height);};resize();WindowEventManager.Resize.RegisterMethod(resize);}else{shim.SetPosition(FindPosX(domNode),FindPosY(domNode));shim.SetSize(domNode.offsetWidth,domNode.offsetHeight);}
shim.SetIsVisible(true);}catch(e){}
return shim;},Shim:function(control,isTimeBased){var shimsData={'control':control,'shims':[]};if(this.m_shims.length===0){shimsData.shims=this.ShimWindow(window,isTimeBased);}else if(!isTimeBased){var prevShim=this.m_shims[this.m_shims.length-1];shimsData.shims.push(this.AddShim(window,prevShim.control.GetDomNode()));}
this.m_shims.push(shimsData);if(control){control.IDomNode.style.zIndex=this.m_ui.GetZIndex();}}});

D2L.Util.Aria={};D2L.Util.Aria.IsEnabled=function(){var browserInfo=UI.GetBrowserInfo();return(browserInfo.Type==D2L.UI.BrowserType.Firefox&&browserInfo.MajorVersion>=3)||(browserInfo.Type==D2L.UI.BrowserType.IE&&browserInfo.MajorVersion>=8);};D2L.Util.Aria.RemoveAttribute=function(element,attribute){if(D2L.Util.Aria.IsEnabled()&&element!==undefined&&element!==null){element.removeAttribute('aria-'+attribute);}};D2L.Util.Aria.SetAttribute=function(element,attribute,value){if(D2L.Util.Aria.IsEnabled()&&element!==undefined&&element!==null){element.setAttribute('aria-'+attribute,value);}};D2L.Util.Aria.SetRole=function(element,role){if(D2L.Util.Aria.IsEnabled()&&element!==undefined&&element!==null){element.setAttribute('role',role);}};

D2L.Util.Base64={};D2L.Util.Base64.Encode=function(data){var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var reg=new RegExp("([^%])|(%[a-fA-F0-9][a-fA-F0-9])","g");var binary="";var ret=encodeURIComponent(data).replace(reg,function(m){var val;if(m.length==1){val=m.charCodeAt(0);}else{val=parseInt(m.substr(1),16);}
val=val.toString(2);while(val.length<8){val="0"+val;}
binary+=val;val="";while(binary.length>=6){val+=chars.charAt(parseInt(binary.substr(0,6),2));binary=binary.substr(6);}
return val;});if(binary.length>0){while(binary.length<6){binary+="0";}
ret+=chars.charAt(parseInt(binary,2));}
while(ret.length%4!=0){ret+="=";}
return ret;};D2L.Util.Base64.Decode=function(data){data=data.replace(/[^a-z0-9\+\/]/ig,'');var chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';var ret="";var binary="";for(var i=0;i<data.length;i++){var val=chars.indexOf(data.charAt(i));val=val.toString(2);while(val.length<6){val="0"+val;}
binary+=val;while(binary.length>=8){var ch=binary.substr(0,8);binary=binary.substr(8);ch=parseInt(ch,2);ch=ch.toString(16);if(ch.length==1){ch="0"+ch;}
ret+="%"+ch;}}
return decodeURIComponent(ret);};

D2L.Util.Clipboard=D2L.Class.extend({Construct:function(){this.m_item=null;},Clear:function(){this.m_item=null;},IsEmpty:function(){return(this.m_item===null);},Get:function(){return this.m_item;},Set:function(clipboardItem){this.m_item=clipboardItem;}});D2L.Util.Clipboard.Item=D2L.Class.extend({Construct:function(dataObj,clipboardAction){this.m_dataObj=dataObj;this.m_action=clipboardAction;},GetAction:function(){return this.m_action;},GetDataObject:function(){return this.m_dataObj;},SetAction:function(action){this.m_action=action;},SetDataObject:function(dataObj){this.m_dataObj=dataObj;}});D2L.Util.Clipboard.Actions={Cut:1,Copy:2};

D2L.Util.DateTime=D2L.Class.extend({Construct:function(year,month,day,hour,minute,second){arguments.callee.$.Construct.call(this);if(hour===undefined){hour=0;}
if(minute===undefined){minute=0;}
if(second===undefined){second=0;}
this.m_date=new Date(year,month-1,day,hour,minute,second);},CompareTo:function(date){if(this.GetTimestamp()<date.GetTimestamp()){return-1;}else if(this.GetTimestamp()>date.GetTimestamp()){return 1;}else{return 0;}},GetDay:function(){return this.m_date.getDate();},GetDayOfWeek:function(){return this.m_date.getDay();},GetHour:function(){return this.m_date.getHours();},GetMinute:function(){return this.m_date.getMinutes();},GetMonth:function(){return this.m_date.getMonth()+1;},GetSecond:function(){return this.m_date.getSeconds();},GetTimestamp:function(){return this.m_date.getTime();},GetYear:function(){return this.m_date.getFullYear();},Deserialize:function(deserializer){var year=deserializer.GetMember('Year');var month=deserializer.GetMember('Month');var day=deserializer.GetMember('Day');var hour=deserializer.GetMember('Hour');var minute=deserializer.GetMember('Minute');var second=deserializer.GetMember('Second');this.m_date=new Date(year,month-1,day,hour,minute,second);},Serialize:function(serializer){serializer.AddMember('Year',this.GetYear());serializer.AddMember('Month',this.GetMonth());serializer.AddMember('Day',this.GetDay());serializer.AddMember('Hour',this.GetHour());serializer.AddMember('Minute',this.GetMinute());serializer.AddMember('Second',this.GetSecond());}});D2L.Util.DateTime.ConvertToD2LDateTime=function(dateTime){var result=new D2L.DateTime();result.SetYear(dateTime.GetYear());result.SetMonth(dateTime.GetMonth()-1);result.SetDay(dateTime.GetDay());result.SetHour(dateTime.GetHour());result.SetMinute(dateTime.GetMinute());return result;};D2L.Util.DateTime.ConvertFromD2LDateTime=function(d2lDateTime){var result=new D2L.Util.DateTime(d2lDateTime.GetYear(),d2lDateTime.GetMonth()+1,d2lDateTime.GetDay(),d2lDateTime.GetHour(),d2lDateTime.GetMinute(),0);return result;};D2L.Util.DateTime.Now=function(){var diffMilliseconds=new Date().getTime()-D2L.Util.DateTime.LoadTimestamp;var newDate=new Date(D2L.Util.DateTime.LoadDateTime.GetTimestamp()
+diffMilliseconds);return new D2L.Util.DateTime(newDate.getFullYear(),newDate.getMonth()+1,newDate.getDate(),newDate.getHours(),newDate.getMinutes(),newDate.getSeconds());};D2L.Util.DateTime.Today=function(){var now=D2L.Util.DateTime.Now();return new D2L.Util.DateTime(now.GetYear(),now.GetMonth(),now.GetDay(),0,0,0);};D2L.Util.DateTime.DayOfWeek={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};D2L.Util.DateTime.LoadDateTime=null;D2L.Util.DateTime.LoadTimestamp=new Date().getTime();

D2L.Util.Decimal={MaxValue:999999999999999,MinValue:-999999999999999,Parse:function(value){var ret='';var negative=false;var digits=0;var hasDecimal=false;var decimalDigits=0;value=value.trim();var re=new RegExp(Culture.decimalRegex);if(!re.test(value)){throw'Invalid Decimal (re)';}
for(var i=0;i<value.length;i++){var c=value.charAt(i);if(c=='.'||c==','){if(!hasDecimal){ret+='.';}
hasDecimal=true;}else if(c=='-'||c=='('){negative=true;}else{c=parseInt(c);if(!isNaN(c)&&c>=0&&c<=9){ret+=c;}else{throw'Invalid Decimal 2';}}}
ret=parseFloat(ret);if(negative){ret=ret*-1;}
return ret;}};

D2L.Util.DelayedReturn=D2L.Class.extend({Construct:function(ret){arguments.callee.$.Construct.call(this,true);this.m_hasReturned=false;this.m_isDelayedReturn=true;this.m_registrees=[];this.m_returnValue=null;if(ret!==undefined){this.Trigger(ret);}},Dispose:function(){this.m_registrees=null;},GetReturnValue:function(){return this.m_returnValue;},HasReturned:function(){return this.m_hasReturned;},Register:function(method){if(this.HasReturned()){method.call(method,this.GetReturnValue());}else{this.m_registrees.push(method);}},RegisterWithReturn:function(method){var dr=new D2L.Util.DelayedReturn();this.Register(function(val){var ret=method(val);dr.Trigger(ret);});return dr;},Trigger:function(ret){if(!this.HasReturned()){if(D2L.Util.IsDelayedReturn(ret)){var me=this;ret.Register(function(ret2){me.Trigger(ret2);});}else{this.m_returnValue=ret;this.m_hasReturned=true;if(this.m_registrees){for(var i=0;i<this.m_registrees.length;i++){this.m_registrees[i].call(this.m_registrees[i],ret);}}}}},Unregister:function(method){var newRegistrees=[];for(var i=0;i<this.m_registrees.length;i++){if(this.m_registrees[i]!=method){newRegistrees.push(this.m_registrees[i]);}}
this.m_registrees=newRegistrees;}});D2L.Util.DelayedReturn.Create=function(beginMethod,endMethod){return new D2L.MethodProxy(beginMethod,endMethod);};D2L.Util.DelayedReturn.RegisterAll=function(){if(arguments.length===0){return;}
var delegate=arguments[arguments.length-1];var args=arguments;var retVals=[];var numComplete=0;for(var i=0;i<args.length-1;i++){void function(){var index=i;args[i].Register(function(val){retVals[index]=val;numComplete++;if(numComplete==args.length-1){delegate.apply(delegate,retVals);}});}();}};D2L.Util.IsDelayedReturn=function(obj){if(obj!==undefined){return(obj.m_isDelayedReturn!==undefined);}
return false;};

D2L.Util.Dictionary=D2L.Class.extend({Construct:function(){this.m_keys=[];this.m_dict={};this.m_values=[];arguments.callee.$.Construct.call(this);},Add:function(key,value){var found=false;for(var i=0;i<this.m_keys.length;i++){if(this.m_keys[i]==key){this.m_values[i]=value;found=true;break;}}
if(!found){this.m_keys.push(key);this.m_values.push(value);}
this.m_dict[key]=value;},ContainsKey:function(key){for(var i=0;i<this.m_keys.length;i++){if(this.m_keys[i]==key){return true;}}
return false;},GetCount:function(){return this.m_keys.length;},Get:function(key){if(this.m_dict[key]!==undefined){return this.m_dict[key];}
return undefined;},Keys:function(){return this.m_keys;},Remove:function(key){for(var i=0;i<this.m_keys.length;i++){if(this.m_keys[i]==key){this.m_keys.splice(i,1);this.m_values.splice(i,1);this.m_dict[key]=undefined;return true;}}
return false;},Values:function(){return this.m_values;},Serialize:function(serializer){for(var i=0;i<this.m_keys.length;i++){serializer.AddMember(this.m_keys[i],this.Get(this.m_keys[i]));}},Deserialize:function(deserializer){var keys=deserializer.Keys();for(var i=0;i<keys.length;i++){this.Add(keys[i],deserializer.GetMember(keys[i]));}}});

D2L.Util.Dom={};D2L.Util.Dom.GetHeightHelper=function(node){return D2L.Util.Dom.GetSizeHelper(node).height;};D2L.Util.Dom.GetWidthHelper=function(node){return D2L.Util.Dom.GetSizeHelper(node).width;};D2L.Util.Dom.GetSizeHelper=function(node){var dr=new D2L.Util.DelayedReturn();var me=this;var n=node.cloneNode(true);n.id='';n.style.display='none';if(node.parentNode){node.parentNode.insertBefore(n,node);}
n.style.borderStyle='none';n.style.margin='0px';n.style.padding='0px';n.style.overflow='hidden';n.style.left='-2000px';n.style.position='absolute';n.style.display='block';var height=n.offsetHeight;var width=n.offsetWidth;if(n.parentNode){n.parentNode.removeChild(n);}
return{height:height,width:width};};D2L.Util.Dom.CancelBubble=function(event){if(event===undefined){event=window.event;}
if(event.stopPropagation!==undefined){event.stopPropagation();}else if(event.cancelBubble!==undefined){event.cancelBubble=true;}};

D2L.Util.Email={};D2L.Util.Email.GetValidityRegex=function(){return new RegExp('^[^ \t\r\n]+\\@[^ \t\r\n]+\\.[^ \t\r\n]+$');};D2L.Util.Email.IsAddressValid=function(emailAddress){return D2L.Util.Email.GetValidityRegex().test(emailAddress);};function IsEmailValid(emailAddress){D2L.Debug.Warn('IsEmailValid() is deprecated, use D2L.Util.Email.IsAddressValid( address ) instead.');return D2L.Util.Email.IsAddressValid(emailAddress);}

D2L.Util.Html={};D2L.Util.Html.Encode=function(str){if(str!=undefined&&str.encodeHtml!==undefined){return str.encodeHtml();}
return str;};D2L.Util.Html.Decode=function(str){if(str!=undefined&&str.encodeHtml!==undefined){return str.decodeHtml();}
return str;};D2L.Util.Html.HasClassName=function(domNode,className){if(domNode&&domNode.className!==undefined){var classNames=domNode.className.split(' ');for(var i=0;i<classNames.length;i++){if(classNames[i]==className){return true;}}}
return false;};D2L.Util.Html.JsString=function(str){var str=new String(str);str=str.replace('\\','\\\\');str=str.replace('\'','\\\'');str=str.replace('"','\\"');str=str.replace('/','\\/');str=str.replace('\n','\\n');return str;};D2L.Util.Html.FindFrame=function(frameName,baseWindow){if(baseWindow===undefined){baseWindow=window;}
var FindFrameFromWindow=function(win){var TravelDown=function(win2){if(win2.frames&&win2.frames[frameName]){return win2.frames[frameName];}else if(win2.frames){for(var i=0;i<win2.frames.length;i++){var result=TravelDown(win2.frames[i]);if(result!==null){return result;}}}
return null;};var start=win;while(true){if(start.parent&&start.parent!=start){start=start.parent;}else{break;}}
var down=TravelDown(start);if(down!==null){return down;}
if(win.opener){return FindFrameFromWindow(win.opener);}
return null;};return FindFrameFromWindow(baseWindow);};D2L.Util.Html.IsDomNode=function(obj){if(obj!==undefined&&obj!==null){return(obj.tagName!==undefined);}
return false;};D2L.Util.Html.ParseAttribute=function(strTag,strAttrib){try{var regExp=new RegExp('<[^>]*\\s'+strAttrib+'[\\s]*=[\\s]*(\'([^\']*)\'|\"([^\"]*)\"|([^>^\\s^\/]*))[^>]*>','i');var result=regExp.exec(strTag);var value=result[1];var singleQuotes=result[2];var doubleQuotes=result[3];var noQuotes=result[4];if(singleQuotes&&singleQuotes.length>0){noQuotes=singleQuotes;}else if(doubleQuotes&&doubleQuotes.length>0){noQuotes=doubleQuotes;}else if(!noQuotes){noQuotes=value;}
return noQuotes;}catch(e){return null;}};

D2L.Util.Integer={MaxValue32:2147483647,MinValue32:-2147483648,MaxValue64:999999999999999,MinValue64:-999999999999999,Parse:function(value){var ret='';var negative=false;var digits=0;value=value.trim();var re=new RegExp(Culture.integerRegex);if(!re.test(value)){throw'Invalid Integer (re)';}
for(var i=0;i<value.length;i++){var c=value.charAt(i);if(c=='.'||c==','){throw'Invalid Integer 2';}else if(c=='-'||c=='('){negative=true;}else{c=parseInt(c);if(!isNaN(c)&&c>=0&&c<=9){ret+=c;}else{throw'Invalid Integer 3';}}}
ret=parseInt(ret);if(negative){ret=ret*-1;}
return ret;}};

D2L.Util.JavaScript={};D2L.Util.JavaScript.DeepCopy=function(obj){if(obj===undefined||obj===null){return obj;}
if(typeof(obj)=='object'&&obj.__isArray){var copy=[];for(var i=0;i<obj.length;i++){copy.push(D2L.Util.JavaScript.DeepCopy(obj[i]));}
return copy;}else if(typeof(obj)=='object'){var copy={};for(var property in obj){copy[property]=D2L.Util.JavaScript.DeepCopy(obj[property]);}
return copy;}
return obj;};

D2L.Util.Number={};D2L.Util.Number.Mod=function(num,base){var mod=num%base;return mod<0?base+mod:mod;};

D2L.Util.ProfanityFilter={};D2L.Util.ProfanityFilter.IsValidTerm=function(term){var dl=new D2L.Util.DelayedReturn();var callback=function(rpcResponse){if(rpcResponse.GetResponseType()==D2L.Rpc.ResponseType.Success){dl.Trigger(rpcResponse.GetResult());}else{dl.Trigger(false);}};D2L.Rpc.Create('IsValidTerm',callback,'/d2l/common/rpc/profanityFilter/profanityFilter.d2l').Call(term);return dl;};D2L.Util.ProfanityFilter.FilterTerms=function(terms){var dl=new D2L.Util.DelayedReturn();var callback=function(rpcResponse){if(rpcResponse.GetResponseType()==D2L.Rpc.ResponseType.Success){dl.Trigger(rpcResponse.GetResult());}else{dl.Trigger([]);}};D2L.Rpc.Create('FilterTerms',callback,'/d2l/common/rpc/profanityFilter/profanityFilter.d2l').Call(terms);return dl;};D2L.Util.ProfanityFilter.Synchronous={};D2L.Util.ProfanityFilter.Synchronous.IsValidTerm=function(term){var rpcResponse=D2L.Rpc.CreateSynchronous('IsValidTerm','/d2l/common/rpc/profanityFilter/profanityFilter.d2l').Call(term);if(rpcResponse.GetResponseType()==D2L.Rpc.ResponseType.Success){return rpcResponse.GetResult();}else{return false;}};D2L.Util.ProfanityFilter.Synchronous.FilterTerms=function(terms){var rpcResponse=D2L.Rpc.CreateSynchronous('FilterTerms','/d2l/common/rpc/profanityFilter/profanityFilter.d2l').Call(terms);if(rpcResponse.GetResponseType()==D2L.Rpc.ResponseType.Success){return rpcResponse.GetResult();}else{return false;}};

String.prototype.isString=true;String.prototype.ltrim=function(){return this.replace(/^\s+/,'');};String.prototype.rtrim=function(){return this.replace(/\s+$/,'');};String.prototype.trim=function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');};String.prototype.stripHtml=function(){var str=this.replace('&nbsp;',' ')
return str.replace(/(<([^>]+)>)/ig,'');};String.prototype.encodeHtml=function(){var str=this.toString();if(str.indexOf('&')!=-1){str=str.replace('&','&amp;');}
if(str.indexOf('<')!=-1){str=str.replace('<','&lt;');}
if(str.indexOf('>')!=-1){str=str.replace('>','&gt;');}
if(str.indexOf('"')!=-1){str=str.replace('"','&quot;');}
return str;};String.prototype.d_oldReplace=String.prototype.replace;String.prototype.replace=function(strOrRegex,replaceVal){if(strOrRegex.isString){return this.split(strOrRegex).join(replaceVal);}else{return this.d_oldReplace(strOrRegex,replaceVal);}};String.prototype.format=function(params){var str=this.toString();for(var i=0;i<arguments.length;i++){str=str.replace('{'+i+'}',arguments[i]);}
return str;};String.prototype.langReplace=function(params){var str=this.toString();for(var i=0;i<arguments.length;i++){str=str.replace('['+i+']',arguments[i]);}
return str;};String.prototype.decodeHtml=function(){return this.replace(/\&[a-zA-Z0-9#]*;/g,DecodeHtmlEntity);};String.prototype.jsString=function(){return D2L.Util.Html.JsString(this.toString());};String.prototype.endsWith=function(end){var str=this.toString();return(str.length>=end.length&&str.substr(str.length-end.length)==end);};function DecodeHtmlEntity(entity){var newEntity=entity;var entities=window.getHtmlEntities();if(entities[entity]){newEntity='&#'+entities[entity]+';';}
var charCodeMatches=newEntity.match(/\&\#[0-9]+;/);if(charCodeMatches){return String.fromCharCode(newEntity.substring(2,newEntity.length-1));}
return entity;}
window.getHtmlEntities=function(){if(!this.entities){this.entities=new Array();this.entities['&quot;']=34;this.entities['&amp;']=38;this.entities['&lt;']=60;this.entities['&gt;']=62;this.entities['&OElig;']=338;this.entities['&oelig;']=339;this.entities['&Scaron;']=352;this.entities['&scaron;']=353;this.entities['&Yuml;']=376;this.entities['&circ;']=710;this.entities['&tilde;']=732;this.entities['&ensp;']=8194;this.entities['&emsp;']=8195;this.entities['&thinsp;']=8201;this.entities['&zwnj;']=8204;this.entities['&zwj;']=8205;this.entities['&lrm;']=8206;this.entities['&rlm;']=8207;this.entities['&ndash;']=8211;this.entities['&mdash;']=8212;this.entities['&lsquo;']=8216;this.entities['&rsquo;']=8217;this.entities['&sbquo;']=8218;this.entities['&ldquo;']=8220;this.entities['&rdquo;']=8221;this.entities['&bdquo;']=8222;this.entities['&dagger;']=8224;this.entities['&Dagger;']=8225;this.entities['&permil;']=8240;this.entities['&lsaquo;']=8249;this.entities['&rsaquo;']=8250;this.entities['&euro;']=8364;this.entities['&apos;']=39;this.entities['&nbsp;']=160;this.entities['&iexcl;']=161;this.entities['&cent;']=162;this.entities['&pound;']=163;this.entities['&curren;']=164;this.entities['&yen;']=165;this.entities['&brvbar;']=166;this.entities['&sect;']=167;this.entities['&uml;']=168;this.entities['&copy;']=169;this.entities['&ordf;']=170;this.entities['&laquo;']=171;this.entities['&not;']=172;this.entities['&shy;']=173;this.entities['&reg;']=174;this.entities['&macr;']=175;this.entities['&deg;']=176;this.entities['&plusmn;']=177;this.entities['&sup2;']=178;this.entities['&sup3;']=179;this.entities['&acute;']=180;this.entities['&micro;']=181;this.entities['&para;']=182;this.entities['&middot;']=183;this.entities['&cedil;']=184;this.entities['&sup1;']=185;this.entities['&ordm;']=186;this.entities['&raquo;']=187;this.entities['&frac14;']=188;this.entities['&frac12;']=189;this.entities['&frac34;']=190;this.entities['&iquest;']=191;this.entities['&Agrave;']=192;this.entities['&Aacute;']=193;this.entities['&Acirc;']=194;this.entities['&Atilde;']=195;this.entities['&Auml;']=196;this.entities['&Aring;']=197;this.entities['&AElig;']=198;this.entities['&Ccedil;']=199;this.entities['&Egrave;']=200;this.entities['&Eacute;']=201;this.entities['&Ecirc;']=202;this.entities['&Euml;']=203;this.entities['&Igrave;']=204;this.entities['&Iacute;']=205;this.entities['&Icirc;']=206;this.entities['&Iuml;']=207;this.entities['&ETH;']=208;this.entities['&Ntilde;']=209;this.entities['&Ograve;']=210;this.entities['&Oacute;']=211;this.entities['&Ocirc;']=212;this.entities['&Otilde;']=213;this.entities['&Ouml;']=214;this.entities['&times;']=215;this.entities['&Oslash;']=216;this.entities['&Ugrave;']=217;this.entities['&Uacute;']=218;this.entities['&Ucirc;']=219;this.entities['&Uml;']=220;this.entities['&Yacute;']=221;this.entities['&THORN;']=222;this.entities['&szlig;']=223;this.entities['&agrave;']=224;this.entities['&aacute;']=225;this.entities['&acirc;']=226;this.entities['&atilde;']=227;this.entities['&auml;']=228;this.entities['&aring;']=229;this.entities['&aelig;']=230;this.entities['&ccedil;']=231;this.entities['&egrave;']=232;this.entities['&eactute;']=233;this.entities['&ecirc;']=234;this.entities['&euml;']=235;this.entities['&igrave;']=236;this.entities['&iacute;']=237;this.entities['&icirc;']=238;this.entities['&iuml;']=239;this.entities['&eth;']=240;this.entities['&ntilde;']=241;this.entities['&ograve;']=242;this.entities['&oacute;']=243;this.entities['&ocirc;']=244;this.entities['&otilde;']=245;this.entities['&ouml;']=246;this.entities['&divide;']=247;this.entities['&oslash;']=248;this.entities['&ugrave;']=249;this.entities['&uacute;']=250;this.entities['&ucirc;']=251;this.entities['&uuml;']=252;this.entities['&yacute;']=253;this.entities['&thorn;']=254;this.entities['&yuml;']=255;}
return this.entities;};

D2L.Util.StringBuilder=D2L.Class.extend({Construct:function(initialValue){this.m_buffer=new Array("");if(initialValue!==undefined){this.Append(initialValue);}},Append:function(value){this.m_buffer.push(value);},ToString:function(){return this.m_buffer.join("");}});

D2L.Util.Style={};D2L.Util.Style.ApplyFloat=function(domNode,val){var f='none';if(val==D2L.Style.Float.Left){f='left';}else if(val==D2L.Style.Float.Right){f='right';}
if(UI.GetBrowserInfo().Type==D2L.UI.BrowserType.IE){domNode.style.styleFloat=f;}else{domNode.style.cssFloat=f;}};

D2L.Util.Url={};D2L.Util.Url.Encode=function(str){var ret=encodeURIComponent(str);ret=ret.replace('\'','%27');ret=ret.replace('%2F','/');ret=ret.replace('%2C',',');return ret;};D2L.Util.Url.Decode=function(str){return decodeURIComponent(str);};D2L.Util.Url.IsExternal=function(url){url=url.trim();var regexp=new RegExp('^[a-zA-Z]+://','i');var hasProtocol=regexp.test(url);if(hasProtocol){var protocol=url.substr(0,url.indexOf(':'));if(protocol.toLowerCase()=='javascript'){hasProtocol=false;}}
return hasProtocol;};

D2L.Validation={};D2L.Validation.NumberFailureType={None:0,NaN:1,NaNOutOfRange:2,GTE:3,GT:4,LTE:5,LT:6};D2L.Validation.CreateErrorBalloon=function(failureText){var div1=document.createElement('div');div1.className='d_vb';var div2=document.createElement('div');div2.className='d_vb1';div1.appendChild(div2);var div3=document.createElement('div');div3.className='d_vb2';div1.appendChild(div3);failureText.GetHtml().Register(function(html){div3.innerHTML=html;});return div1;};

D2L.Validation.IValidator=D2L.Control.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_passed=true;},CanValidateNoDelay:function(obj){return(obj.GetValueNoDelay!==undefined);},GetFailureText:function(){return new D2L.LP.Text.LangTerm('Framework.Validation.GenericInvalid');},Passed:function(){return this.m_passed;},Validate:function(){return true;},ValidateObject:function(obj){return new D2L.Util.DelayedReturn(this.Validate());},ValidateObjectNoDelay:function(obj){return this.Validate();}});

D2L.Validation.StringValidator=D2L.Validation.IValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this);this.m_value=value;this.m_maxCharacters=0;this.m_isRequired=false;this.m_regex=null;this.m_regexFailureText=new D2L.LP.Text.PlainText();this.m_failureText=new D2L.LP.Text.PlainText();},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);if(deserializer.HasMember()){this.m_maxCharacters=deserializer.GetMember();this.m_isRequired=deserializer.GetBoolean();if(deserializer.HasMember()){var regex=deserializer.GetMember();if(regex.length>0){this.m_regex=new RegExp(regex);this.m_regexFailureText=deserializer.GetObject(D2L.LP.Text.IText);}}}},GetFailureText:function(){return this.m_failureText;},GetRegexFailureText:function(){return this.m_regexFailureText;},GetIsRequired:function(){return this.m_isRequired;},GetMaxCharacters:function(){return this.m_maxCharacters;},GetRegex:function(){return this.m_regex;},GetValue:function(){return this.m_value;},SetRegexFailureText:function(failureText){this.m_regexFailureText=failureText;},SetIsRequired:function(isRequired){this.m_isRequired=isRequired;},SetMaxCharacters:function(maxCharacters){this.m_maxCharacters=maxCharacters;},SetRegex:function(regex){this.m_regex=regex;},SetValue:function(value){this.m_value=value;},Validate:function(value){if(value===undefined){value=this.GetValue();}
if(this.GetIsRequired()){var validator=new D2L.Validation.RequiredValidator(value);if(!validator.Validate()){this.m_failureText=validator.GetFailureText();return false;}}else if(value.length===0){return true;}
if(this.GetMaxCharacters()>0&&value.length>this.GetMaxCharacters()){this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.StringMaxCharacters',this.GetMaxCharacters());return false;}
if(this.GetRegex()!==null&&!this.GetRegex().test(value)){this.m_failureText=this.GetRegexFailureText();return false;}
return true;},ValidateObject:function(obj){var dr=new D2L.Util.DelayedReturn();var me=this;obj.GetValue().Register(function(value){dr.Trigger(me.Validate(value));});return dr;},ValidateObjectNoDelay:function(obj){return this.Validate(obj.GetValueNoDelay());}});D2L.Control.ValidatorString=D2L.Validation.StringValidator;

D2L.Validation.AndValidator=D2L.Validation.IValidator.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_children=[];this.m_failureText=new D2L.LP.Text.PlainText();},CanValidateNoDelay:function(obj){var ret=true;for(var i=0;i<this.m_children.length;i++){var validator=UI.GetControl(this.m_children[i].ID(),this.m_children[i].SID());ret=ret&&validator.CanValidateNoDelay(obj);}
return ret;},IntegrateControlMin:function(deserializer){this.m_children=deserializer.GetObjectArrayMin(D2L.Control.Id);},GetFailureText:function(){return this.m_failureText;},Validate:function(){var ret=true;for(var i=0;i<this.m_children.length;i++){var validator=UI.GetControl(this.m_children[i].ID(),this.m_children[i].SID());var pass=validator.Validate();validator.m_passed=pass;if(!pass){this.m_failureText=validator.GetFailureText();}
ret=ret&&pass;}
return pass;},ValidateObject:function(obj){var dr=new D2L.Util.DelayedReturn();var me=this;var ret=true;var HandleResult=function(validator,result){validator.m_passed=result;if(!result){me.m_failureText=validator.GetFailureText();}
ret=ret&&result;};var Validate=function(index){if(index==me.m_children.length||!ret){dr.Trigger(ret);}else{var validator=UI.GetControl(me.m_children[index].ID(),me.m_children[index].SID());var drChild=validator.ValidateObject(obj);if(D2L.Util.IsDelayedReturn(drChild)){drChild.Register(function(pass){HandleResult(validator,pass);Validate(++index);});}else{HandleResult(validator,drChild);Validate(++index);}}};Validate(0);return dr;},ValidateObjectNoDelay:function(obj){var me=this;var Validate=function(index){if(index==me.m_children.length){return true;}else{var validator=UI.GetControl(me.m_children[index].ID(),me.m_children[index].SID());var success=validator.ValidateObjectNoDelay(obj);validator.m_passed=success;if(!success){me.m_failureText=validator.GetFailureText();}
return Validate(++index)&&success;}};return Validate(0);}});D2L.Control.ValidatorAnd=D2L.Validation.AndValidator;

D2L.Validation.CustomValidator=D2L.Validation.IValidator.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_jsFunction=null;this.m_jsParams=[this];this.m_failureText=null;this.m_failureControl=null;this.m_failureControlId=null;this.m_validationTarget=null;},CanValidateNoDelay:function(){return false;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_jsFunction=deserializer.GetMember();this.m_jsParams=this.m_jsParams.concat(deserializer.GetMember());var failureControlID=deserializer.GetMember();var failureControlSID=deserializer.GetMember();if(failureControlID.length>0){this.m_failureControlId=new D2L.Control.Id(failureControlID,failureControlSID);}
var failureText=deserializer.GetMember().replace('{tempsubject}','{subject}');if(failureText.length>0){this.m_failureText=new D2L.LP.Text.SmlText(failureText);}},Focus:function(){if(this.m_failureControlId!==null){this.m_failureControl=UI.GetControl(this.m_failureControlId.ID(),this.m_failureControlId.SID());}
if(this.m_failureControl!==null){if(this.m_failureControl.Focus!==undefined){this.m_failureControl.Focus();}else if(this.m_failureControl.focus!==undefined){try{this.m_failureControl.focus();}catch(e){}}}},GetDomNode:function(){if(this.m_failureControlId!==null){this.m_failureControl=UI.GetControl(this.m_failureControlId.ID(),this.m_failureControlId.SID());}
if(this.m_failureControl!==null){if(D2L.Util.IsD2LControl(this.m_failureControl)){if(this.m_failureControl.GetValidationDomNode!==undefined){return this.m_failureControl.GetValidationDomNode();}
return this.m_failureControl.GetDomNode();}else{return this.m_failureControl;}}
return null;},GetFailureText:function(){return this.m_failureText;},GetValidationTarget:function(){return this.m_validationTarget;},HasFocusControl:function(){var control=this.m_failureControl;if(this.m_failureControlId!==null){control=UI.GetControl(this.m_failureControlId.ID(),this.m_failureControlId.SID());}
if(control!==null){return(control.Focus!==undefined)||(control.focus!==undefined);}
return false;},SetFailureControl:function(control){this.m_failureControl=control;if(this.m_failureControl!==null){var domNode=control;if(D2L.Util.IsD2LControl(control)){domNode=control.GetDomNode();}
var me=this;if(domNode!==null){this.AttachObject(domNode,'ID2LOnRemove',new D2L.EventHandler());domNode.ID2LOnRemove.RegisterMethod(function(evt){me.IsEnabled=function(){return false;};});}}},SetDomNode:function(domNode){this.SetFailureControl(domNode);},SetFailureText:function(failureText){this.m_failureText=D2L.LP.Text.IText.Normalize(failureText,'D2L.Validation.CustomValidator','SetFailureText','failureText');},ValidateObject:function(obj){this.m_validationTarget=obj;return new D2L.Util.DelayedReturn(this.Validate());},Validate:function(){var ret=true;if(this.m_jsFunction!==undefined&&this.m_jsFunction!==null){ret=this.m_jsFunction.apply(this.m_jsFunction,this.m_jsParams);if(ret===undefined){ret=true;}}
return ret;}});D2L.Control.Validator=D2L.Validation.CustomValidator;

D2L.Validation.DateRangeValidator=D2L.Validation.IValidator.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_startYear=null;this.m_startMonth=null;this.m_startDay=null;this.m_startHour=null;this.m_startMinute=null;this.m_endYear=null;this.m_endMonth=null;this.m_endDay=null;this.m_endHour=null;this.m_endMinute=null;this.m_hasStartDate=true;this.m_hasEndDate=true;this.m_failureText=null;this.m_validationFailureSource=0;},GetFailureText:function(){return this.m_failureText;},Validate:function(){if(this.m_hasStartDate){var validator=new D2L.Validation.DateTimeValidator(this.m_startYear,this.m_startMonth,this.m_startDay,this.m_startHour,this.m_startMinute,this.m_startSecond);if(!validator.Validate()){this.m_validationFailureSource=1;this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.DateRangeStartInvalid');return false;}}
if(this.m_hasEndDate){var validator=new D2L.Validation.DateTimeValidator(this.m_endYear,this.m_endMonth,this.m_endDay,this.m_endHour,this.m_endMinute,this.m_endSecond);if(!validator.Validate()){this.m_validationFailureSource=2;this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.DateRangeEndInvalid');return false;}}
this.m_validationFailureSource=0;this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.DateRangeInvalid');if(this.m_hasStartDate&&this.m_hasEndDate){if(this.m_startYear<this.m_endYear){return true;}else if(this.m_startYear>this.m_endYear){return false;}
if(this.m_startMonth<this.m_endMonth){return true;}else if(this.m_startMonth>this.m_endMonth){return false;}
if(this.m_startDay<this.m_endDay){return true;}else if(this.m_startDay>this.m_endDay){return false;}
if(this.m_hasTime){if(this.m_startHour<this.m_endHour){return true;}else if(this.m_startHour>this.m_endHour){return false;}
if(this.m_startMinute<this.m_endMinute){return true;}else if(this.m_startMinute>this.m_endMinute){return false;}}}
return true;},ValidateObject:function(obj){return new D2L.Util.DelayedReturn(this.ValidateObjectNoDelay(obj));},ValidateObjectNoDelay:function(obj){this.m_hasStartDate=obj.HasStartDate();this.m_hasEndDate=obj.HasEndDate();this.m_hasTime=obj.HasTime();if(this.m_hasStartDate){this.m_startYear=obj.GetStartYear();this.m_startMonth=obj.GetStartMonth();this.m_startDay=obj.GetStartDay();if(this.m_hasTime){this.m_startHour=obj.GetStartHour();this.m_startMinute=obj.GetStartMinute();}}
if(this.m_hasEndDate){this.m_endYear=obj.GetEndYear();this.m_endMonth=obj.GetEndMonth();this.m_endDay=obj.GetEndDay();if(this.m_hasTime){this.m_endHour=obj.GetEndHour();this.m_endMinute=obj.GetEndMinute();}}
var pass=this.Validate();if(!pass&&obj.m_validationFailureSource!==undefined){obj.m_validationFailureSource=this.m_validationFailureSource;}
return pass;}});D2L.Control.ValidatorDateRange=D2L.Validation.DateRangeValidator;

D2L.Validation.DateTimeValidator=D2L.Validation.IValidator.extend({Construct:function(year,month,day,hour,minute){arguments.callee.$.Construct.call(this);var today=new D2L.Util.DateTime.Now();if(year===undefined){year=today.GetYear();}
if(month===undefined){month=today.GetMonth();}
if(day===undefined){day=today.GetDay();}
if(hour===undefined){hour=today.GetHour();}
if(minute===undefined){minute=today.GetMinute();}
this.m_year=year;this.m_month=month;this.m_day=day;this.m_hour=hour;this.m_minute=minute;},GetFailureText:function(){return new D2L.LP.Text.LangTerm('Framework.Validation.DateInvalid');},GetDay:function(){return this.m_day;},GetMonth:function(){return this.m_month;},GetHour:function(){return this.m_hour;},GetMinute:function(){return this.m_minute;},GetYear:function(){return this.m_year;},SetDay:function(day){this.m_day=day;},SetMonth:function(month){this.m_month=month;},SetYear:function(year){this.m_year=year;},SetHour:function(hour){this.m_hour=hour;},SetMinute:function(minute){this.m_minute=minute;},Validate:function(year,month,day,hour,minute){if(year===undefined||year===null){year=this.GetYear();}
if(month===undefined||month===null){month=this.GetMonth();}
if(day===undefined||day===null){day=this.GetDay();}
if(hour===undefined||hour===null){hour=this.GetHour();}
if(minute===undefined||minute===null){minute=this.GetMinute();}
if(year<0){return false;}
if(month<1||month>12){return false;}
if(day<1||day>31){return false;}
if(hour<0||hour>23){return false;}
if(minute<0||minute>59){return false;}
var allowedDays=31;if(month==2){if((year%4===0)&&(!(year%100===0)||(year%400===0))){allowedDays=29;}else{allowedDays=28;}}else if(month==4||month==6||month==9||month==11){allowedDays=30;}
if(day>allowedDays){return false;}
return true;},ValidateObject:function(obj){return new D2L.Util.DelayedReturn(this.Validate(obj.GetYear(),obj.GetMonth(),obj.GetDay(),obj.GetHour(),obj.GetMinute()));},ValidateObjectNoDelay:function(obj){return this.Validate(obj.GetYear(),obj.GetMonth(),obj.GetDay(),obj.GetHour(),obj.GetMinute());}});D2L.Control.ValidatorDateTime=D2L.Validation.DateTimeValidator;

D2L.Validation.DecimalValidator=D2L.Validation.IValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this);if(value===undefined){value=0;}
this.m_value=value;this.m_min=null;this.m_max=null;this.m_minIsInclusive=true;this.m_maxIsInclusive=true;this.m_minIsSet=false;this.m_maxIsSet=false;this.m_lastFailureType=D2L.Validation.NumberFailureType.None;},IntegrateControlMin:function(deserializer){this.m_value=deserializer.GetMember();this.m_min=deserializer.GetMember();this.m_max=deserializer.GetMember();this.m_minIsSet=deserializer.GetBoolean();this.m_maxIsSet=deserializer.GetBoolean();this.m_minIsInclusive=deserializer.GetBoolean();this.m_maxIsInclusive=deserializer.GetBoolean();},GetFailureText:function(){if(this.m_lastFailureType==D2L.Validation.NumberFailureType.NaN){return new D2L.LP.Text.LangTerm('Framework.Validation.DecimalInvalid');}else if(this.m_lastFailureType==D2L.Validation.NumberFailureType.NaNOutOfRange){return new D2L.LP.Text.LangTerm('Framework.Validation.DecimalInvalidRange',D2L.Util.Decimal.MinValue,D2L.Util.Decimal.MaxValue);}
var term='';var param1=undefined;var param2=undefined;if(this.m_minIsSet&&this.m_maxIsSet){param1=this.m_min;param2=this.m_max;term+='Between';if(this.m_minIsInclusive&&this.m_maxIsInclusive){term+='Both';}else if(this.m_minIsInclusive){term+='Min';}else if(this.m_maxIsInclusive){term+='Max';}else{term+='None';}
term+='Inclusive';}else if(this.m_minIsSet){param1=this.m_min;term+='Higher';if(this.m_minIsInclusive){term+='Inclusive';}}else if(this.m_maxIsSet){param1=this.m_max;term+='Lower';if(this.m_maxIsInclusive){term+='Inclusive';}}
return new D2L.LP.Text.LangTerm('Framework.Validation.Number'+term,param1,param2);},GetMax:function(){return this.m_max;},GetMin:function(){return this.m_min;},GetMaxIsInclusive:function(){return this.m_maxIsInclusive;},GetMinIsInclusive:function(){return this.m_minIsInclusive;},GetValue:function(){return this.m_value;},SetMax:function(max){this.m_max=max;this.m_maxIsSet=true;},SetMin:function(min){this.m_min=min;this.m_minIsSet=true;},SetMaxIsInclusive:function(maxIsInclusive){this.m_maxIsInclusive=maxIsInclusive;},SetMinIsInclusive:function(minIsInclusive){this.m_minIsInclusive=minIsInclusive;},SetValue:function(value){this.m_value=value;},Validate:function(value){if(value===undefined){value=this.m_value;}
this.m_lastFailureType=D2L.Validation.NumberFailureType.None;if(value.isString){if(value.length===0){return true;}
try{value=D2L.Util.Decimal.Parse(value);}catch(e){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaN;return false;}}
if(isNaN(value)){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaN;return false;}
if(this.m_minIsSet){if(this.GetMinIsInclusive()){if(value<this.GetMin()){this.m_lastFailureType=D2L.Validation.NumberFailureType.LTE;return false;}}else{if(value<=this.GetMin()){this.m_lastFailureType=D2L.Validation.NumberFailureType.LT;return false;}}}
if(value<D2L.Util.Decimal.MinValue){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaNOutOfRange;return false;}
if(this.m_maxIsSet){if(this.GetMaxIsInclusive()){if(value>this.GetMax()){this.m_lastFailureType=D2L.Validation.NumberFailureType.GTE;return false;}}else{if(value>=this.GetMax()){this.m_lastFailureType=D2L.Validation.NumberFailureType.GT;return false;}}}
if(value>D2L.Util.Decimal.MaxValue){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaNOutOfRange;return false;}
return true;},ValidateObject:function(obj){var dr=new D2L.Util.DelayedReturn();var me=this;obj.GetValue().Register(function(value){dr.Trigger(me.Validate(value));});return dr;},ValidateObjectNoDelay:function(obj){return this.Validate(obj.GetValueNoDelay());}});D2L.Control.ValidatorDecimal=D2L.Validation.DecimalValidator;

D2L.Validation.EmailValidator=D2L.Validation.StringValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this,value);this.SetRegex(D2L.Util.Email.GetValidityRegex());this.SetRegexFailureText(new D2L.LP.Text.LangTerm('Framework.Validation.EmailInvalid'));}});D2L.Control.ValidatorEmail=D2L.Validation.EmailValidator;

D2L.Validation.FileNameValidator=D2L.Validation.StringValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this,value);this.SetRestrictLength(true);this.SetRegex(new RegExp(D2L.Files.ValidFileNameNoMaxCharactersRegex));this.SetRegexFailureText(new D2L.LP.Text.LangTerm('Framework.Validation.FileNameInvalid',D2L.Files.InvalidFileNameCharacters));this.m_validExtensions=null;this.m_reservedFilenames=['con','prn','aux','nul','com1','com2','com3','com4','com5','com6','com7','com8','com9','lpt1','lpt2','lpt3','lpt4','lpt5','lpt6','lpt7','lpt8','lpt9','clock$'];},SetValidExtensions:function(extensions){this.m_validExtensions=extensions;},SetRestrictLength:function(restrictLength){if(restrictLength){this.SetMaxCharacters(D2L.Files.MaxFileNameCharacters);}else{this.SetMaxCharacters(0);}},Validate:function(value){value=value.trim();var pass=arguments.callee.$.Validate.call(this,value);if(!pass){return false;}
var valueToCompare=value.toLowerCase();var pos=value.indexOf('.');if(pos>0){valueToCompare=value.substring(0,pos).toLowerCase();}
for(var i=0;i<this.m_reservedFilenames.length;i++){if(this.m_reservedFilenames[i]==valueToCompare){this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.FileNameReserved');return false;}}
var extension='';var dotIndex=value.lastIndexOf('.');if(dotIndex>-1&&dotIndex!=value.length-1){extension=value.substr(dotIndex+1).toLowerCase();}
var extensions=D2L.Files.RestrictedExtensions;for(var i=0;i<extensions.length;i++){if(extension==extensions[i]){this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.FileSetRestrictedExtension');return false;}}
if(this.m_validExtensions!==null&&this.m_validExtensions.length>0){var valid=false;for(var i=0;i<this.m_validExtensions.length;i++){if(extension==this.m_validExtensions[i]){valid=true;break;}}
if(!valid){this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.FileSetInvalidExtension',this.m_validExtensions.join(', '));return false;}}
return true;}});D2L.Control.ValidatorFileName=D2L.Validation.FileNameValidator;

D2L.Validation.FileSetValidator=D2L.Validation.IValidator.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_maxTotalFileSize=0;this.m_totalFileSize=0;this.m_fileNames=[];this.m_failureText=null;this.m_truncateFileNames=false;this.m_filenameValidator=new D2L.Validation.FileNameValidator();this.m_filenameValidator.SetRestrictLength(false);},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);this.m_maxTotalFileSize=deserializer.GetMember();if(deserializer.HasMember()){this.m_filenameValidator.SetValidExtensions(deserializer.GetMember());}},GetFailureText:function(){return this.m_failureText;},GetMaxTotalFileSize:function(){return this.m_maxTotalFileSize;},GetTotalFileSize:function(){return this.m_totalFileSize;},SetMaxTotalFileSize:function(maxTotalFileSize){this.m_maxTotalFileSize=maxTotalFileSize;},SetTotalFileSize:function(totalFileSize){this.m_totalFileSize=totalFileSize;},ValidateObject:function(obj){if(obj.SetValidationFailureIndex){obj.SetValidationFailureIndex(-1);}
if(obj.GetMaxTotalFileSize){this.SetMaxTotalFileSize(obj.GetMaxTotalFileSize());}
if(obj.GetTotalFileSize){this.SetTotalFileSize(obj.GetTotalFileSize());}
if(obj.GetFileNames){this.m_fileNames=obj.GetFileNames();}
if(this.m_maxTotalFileSize>0&&this.m_totalFileSize>this.m_maxTotalFileSize){this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.FileSetMaxTotalFileSizeExceeded',Culture.FormatFileSize(this.m_maxTotalFileSize));return new D2L.Util.DelayedReturn(false);}
var me=this;var index=0;var ValidateFileName=function(){if(me.m_fileNames.length===index){return new D2L.Util.DelayedReturn(true);}
var fileName=me.m_fileNames[index];if(fileName.length===0){return ValidateFileName(++index);}
var isValid=me.m_filenameValidator.Validate(fileName);if(!isValid){me.m_failureText=me.m_filenameValidator.GetFailureText();return new D2L.Util.DelayedReturn(false);}
if(fileName.length>D2L.Files.MaxFileNameCharacters&&!me.m_truncateFileNames){var dr=new D2L.Util.DelayedReturn();var Cb=function(dialogResponse){if(dialogResponse.GetType()==D2L.Dialog.ResponseType.Positive){me.m_truncateFileNames=true;dr.Trigger(ValidateFileName(++index));}else{me.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.FileSetFileNameTooLong',D2L.Files.MaxFileNameCharacters);dr.Trigger(false);}};UI.Confirm(Cb,new D2L.LP.Text.LangTerm('Framework.Validation.FileSetFileNameTooLong1',D2L.Files.MaxFileNameCharacters),new D2L.LP.Text.LangTerm('Framework.Validation.FileSetFileNameTooLong2'));return dr;}else{return ValidateFileName(++index);}};var result=ValidateFileName(index);result.Register(function(success){if(!success){obj.SetValidationFailureIndex(index);}});return result;}});D2L.Control.ValidatorFileSet=D2L.Validation.FileSetValidator;

D2L.Validation.FolderNameValidator=D2L.Validation.StringValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this,value);this.SetMaxCharacters(D2L.Files.MaxDirectoryNameCharacters);this.SetRegex(new RegExp(D2L.Files.ValidDirectoryNameRegex));this.SetRegexFailureText(new D2L.LP.Text.LangTerm('Framework.Validation.FolderNameInvalid',D2L.Files.InvalidDirectoryNameCharacters));this.m_reservedFoldernames=['con','prn','aux','nul','com1','com2','com3','com4','com5','com6','com7','com8','com9','lpt1','lpt2','lpt3','lpt4','lpt5','lpt6','lpt7','lpt8','lpt9','clock$'];},Validate:function(value){value=value.trim();var pass=arguments.callee.$.Validate.call(this,value);if(!pass){return false;}
var valueToCompare=value.toLowerCase();for(var i=0;i<this.m_reservedFoldernames.length;i++){if(this.m_reservedFoldernames[i]==valueToCompare){this.m_failureText=new D2L.LP.Text.LangTerm('Framework.Validation.FolderNameReserved');return false;}}
return true;}});D2L.Control.ValidatorFolderName=D2L.Validation.FolderNameValidator;

D2L.Validation.Group=D2L.Class.extend({Construct:function(name){if(name===undefined){name='';}
arguments.callee.$.Construct.call(this);this.m_controls=[];this.m_isEnabled=true;this.m_name=name;},DeserializeMin:function(deserializer){this.m_name=deserializer.GetMember().toLowerCase();this.m_controls=deserializer.GetObjectArrayMin(D2L.Validation.ValidationControlInfo);},GetName:function(){return this.m_name;},IsEnabled:function(){return this.m_isEnabled;},SetIsEnabled:function(isEnabled){this.m_isEnabled=isEnabled;},Validate:function(skipFailureMessage){return UI.GetValidationManager().Validate(this.GetName(),skipFailureMessage);}});

D2L.Validation.Int64Validator=D2L.Validation.IValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this);if(value===undefined){value=0;}
this.m_value=value;this.m_is64Bit=true;this.m_min=null;this.m_max=null;this.m_minIsInclusive=true;this.m_maxIsInclusive=true;this.m_minIsSet=false;this.m_maxIsSet=false;this.m_lastFailureType=D2L.Validation.NumberFailureType.None;},IntegrateControlMin:function(deserializer){this.m_min=deserializer.GetMember();this.m_max=deserializer.GetMember();this.m_minIsSet=deserializer.GetBoolean();this.m_maxIsSet=deserializer.GetBoolean();this.m_minIsInclusive=deserializer.GetBoolean();this.m_maxIsInclusive=deserializer.GetBoolean();},GetFailureText:function(){if(this.m_lastFailureType==D2L.Validation.NumberFailureType.NaN){return new D2L.LP.Text.LangTerm('Framework.Validation.IntegerInvalid');}else if(this.m_lastFailureType==D2L.Validation.NumberFailureType.NaNOutOfRange){if(!this.m_is64Bit){return new D2L.LP.Text.LangTerm('Framework.Validation.IntegerInvalid32',D2L.Util.Integer.MinValue32,D2L.Util.Integer.MaxValue32);}else{return new D2L.LP.Text.LangTerm('Framework.Validation.IntegerInvalid64',D2L.Util.Integer.MinValue64,D2L.Util.Integer.MaxValue64);}}
var term='';var param1=undefined;var param2=undefined;if(this.m_minIsSet&&this.m_maxIsSet){param1=this.m_min;param2=this.m_max;term+='Between';if(this.m_minIsInclusive&&this.m_maxIsInclusive){term+='Both';}else if(this.m_minIsInclusive){term+='Min';}else if(this.m_maxIsInclusive){term+='Max';}else{term+='None';}
term+='Inclusive';}else if(this.m_minIsSet){param1=this.m_min;term+='Higher';if(this.m_minIsInclusive){term+='Inclusive';}}else if(this.m_maxIsSet){param1=this.m_max;term+='Lower';if(this.m_maxIsInclusive){term+='Inclusive';}}
return new D2L.LP.Text.LangTerm('Framework.Validation.Number'+term,param1,param2);},GetMax:function(){return this.m_max;},GetMin:function(){return this.m_min;},GetMaxIsInclusive:function(){return this.m_maxIsInclusive;},GetMinIsInclusive:function(){return this.m_minIsInclusive;},GetValue:function(){return this.m_value;},SetMax:function(max){this.m_max=max;this.m_maxIsSet=true;},SetMin:function(min){this.m_min=min;this.m_minIsSet=true;},SetMaxIsInclusive:function(maxIsInclusive){this.m_maxIsInclusive=maxIsInclusive;},SetMinIsInclusive:function(minIsInclusive){this.m_minIsInclusive=minIsInclusive;},SetValue:function(value){this.m_value=value;},Validate:function(value){if(value===undefined){value=this.m_value;}
this.m_lastFailureType=D2L.Validation.NumberFailureType.None;if(value.isString){if(value.length===0){return true;}
try{value=D2L.Util.Integer.Parse(value);}catch(e){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaN;return false;}}
if(isNaN(value)){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaN;return false;}
if(this.m_minIsSet){if(this.GetMinIsInclusive()){if(value<this.GetMin()){this.m_lastFailureType=D2L.Validation.NumberFailureType.LTE;return false;}}else{if(value<=this.GetMin()){this.m_lastFailureType=D2L.Validation.NumberFailureType.LT;return false;}}}
if(!this.m_is64Bit&&value<D2L.Util.Integer.MinValue32||this.m_is64Bit&&value<D2L.Util.Integer.MinValue64){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaNOutOfRange;return false;}
if(this.m_maxIsSet){if(this.GetMaxIsInclusive()){if(value>this.GetMax()){this.m_lastFailureType=D2L.Validation.NumberFailureType.GTE;return false;}}else{if(value>=this.GetMax()){this.m_lastFailureType=D2L.Validation.NumberFailureType.GT;return false;}}}
if(!this.m_is64Bit&&value>D2L.Util.Integer.MaxValue32||this.m_is64Bit&&value>D2L.Util.Integer.MaxValue64){this.m_lastFailureType=D2L.Validation.NumberFailureType.NaNOutOfRange;return false;}
return true;},ValidateObject:function(obj){var dr=new D2L.Util.DelayedReturn();var me=this;obj.GetValue().Register(function(value){dr.Trigger(me.Validate(value));});return dr;},ValidateObjectNoDelay:function(obj){return this.Validate(obj.GetValueNoDelay());}});D2L.Control.ValidatorInt64=D2L.Validation.Int64Validator;D2L.Validation.Int32Validator=D2L.Validation.Int64Validator.extend({Construct:function(value){arguments.callee.$.Construct.call(this,value);this.m_is64Bit=false;}});D2L.Control.ValidatorInt32=D2L.Validation.Int32Validator;

D2L.Validation.Manager=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.m_groups=[];this.m_groupLessControls=[];this.m_isValidating=false;},DeserializeMin:function(deserializer){this.m_groups=deserializer.GetObjectArrayMin(D2L.Validation.Group);},GetControlInfo:function(cId,addToAction){var vci=null;for(var i=0;i<this.m_groups.length;i++){for(var j=0;j<this.m_groups[i].m_controls.length;j++){if(this.m_groups[i].m_controls[j].ControlId.ID()==cId.ID()&&this.m_groups[i].m_controls[j].ControlId.SID()==cId.SID()){vci=this.m_groups[i].m_controls[j];break;}}}
if(vci===null){vci=new D2L.Validation.ValidationControlInfo();vci.ControlId=cId;this.m_groupLessControls.push(vci);if(addToAction){this.SetControlValidationGroup(cId,'action');}}
return vci;},SetControlValidator:function(cId,vcId){var vci=this.GetControlInfo(cId,true);vci.ValidatorControlId=vcId;},SetControlSubject:function(cId,subject){if(subject===undefined||subject===null){subject='';}
this.GetControlInfo(cId).Subject=subject;},SetControlValidationGroup:function(cId,groupName){groupName=groupName.toLowerCase();var vci=null;for(var i=0;i<this.m_groups.length;i++){for(var j=0;j<this.m_groups[i].m_controls.length;j++){if(this.m_groups[i].m_controls[j].ControlId.ID()==cId.ID()&&this.m_groups[i].m_controls[j].ControlId.SID()==cId.SID()){vci=this.m_groups[i].m_controls[j];this.m_groups[i].m_controls.splice(j,1);break;}}}
for(var i=0;i<this.m_groupLessControls.length;i++){if(this.m_groupLessControls[i].ControlId.ID()==cId.ID()&&this.m_groupLessControls[i].ControlId.SID()==cId.SID()){vci=this.m_groupLessControls[i];this.m_groupLessControls.splice(i,1);break;}}
if(vci===null){vci=new D2L.Validation.ValidationControlInfo();vci.ControlId=cId;}
var group=this.GetGroup(groupName,true);group.m_controls.push(vci);},GetGroup:function(groupName,addIfNotThere){if(addIfNotThere===undefined){addIfNotThere=false;}
groupName=groupName.toLowerCase();for(var i=0;i<this.m_groups.length;i++){if(this.m_groups[i].GetName()==groupName){return this.m_groups[i];}}
if(addIfNotThere){var group=new D2L.Validation.Group(groupName);this.m_groups.push(group);return group;}
return null;},Validate:function(groupNames,skipFailureMessage){if(!isArray(groupNames)){groupNames=[groupNames];}
var controlHash={};var controls=[];for(var i=0;i<groupNames.length;i++){var group=this.GetGroup(groupNames[i]);if(group!==null&&group.IsEnabled()){for(var j=0;j<group.m_controls.length;j++){var key=group.m_controls[j].ControlId.ID()+'_'+group.m_controls[j].ControlId.SID();if(controlHash[key]===undefined){controlHash[key]=true;controls.push(group.m_controls[j]);}}}}
return this.ValidateControls(controls,skipFailureMessage);},ValidateControls:function(controls,skipFailureMessage){if(controls.length===0){return new D2L.Util.DelayedReturn(true);}
if(this.m_isValidating){return new D2L.Util.DelayedReturn(false);}
this.m_isValidating=true;if(skipFailureMessage===undefined){skipFailureMessage=false;}
var ret=new D2L.Util.DelayedReturn();var success=true;var me=this;var Finish=function(pass){me.m_isValidating=false;ret.Trigger(pass);};var HandleReturn=function(vci,validator,control,pass){validator.m_passed=pass;if(!pass){success=false;if(!skipFailureMessage){WindowEventManager.BubbleExpandEvent(control.GetDomNode(),null);var failureText=validator.GetFailureText();if(failureText!==null){failureText.SetSubject(vci.Subject);UI.GetMessageArea().AddError(failureText,control);}}}};var Validate=function(index){if(index==controls.length){if(!success&&!skipFailureMessage){setTimeout(function(){UI.GetMessageArea().ShowErrors(true).Register(function(){Finish(false);});});}else{Finish(success);}}else{var vci=controls[index];var validator=UI.GetControl(vci.ValidatorControlId.ID(),vci.ValidatorControlId.SID());var control=UI.GetControl(vci.ControlId.ID(),vci.ControlId.SID());if(control.IsEnabled===undefined||control.IsEnabled()){var dRet=null;if(validator.CanValidateNoDelay(control)){dRet=validator.ValidateObjectNoDelay(control);}else{dRet=validator.ValidateObject(control);}
if(D2L.Util.IsDelayedReturn(dRet)){dRet.Register(function(pass){HandleReturn(vci,validator,control,pass);Validate(++index);});}else{HandleReturn(vci,validator,control,dRet);Validate(++index);}}else{Validate(++index);}}};UI.GetMessageArea().Reset().Register(function(){Validate(0);});return ret;},ValidateGroup:function(groupName,skipFailureMessage){UI.GetMessageArea().AddWarningMessage(new D2L.LP.Text.SmlText('ValidationManager.ValidateGroup(\'[0]\') '+'is deprecated, use Validate() instead.',groupName),false);if(skipFailureMessage===undefined){skipFailureMessage=false;}
var controls=[];var group=this.GetGroup(groupName);if(group===null||!group.IsEnabled()){return true;}
var controls=group.m_controls;var success=true;if(controls.length===0){return true;}
if(this.m_isValidating){return false;}
this.m_isValidating=true;var mrDr=UI.GetMessageArea().Reset();var me=this;var HandleReturn=function(vci,validator,control,pass){validator.m_passed=pass;if(!pass){success=false;if(!skipFailureMessage){WindowEventManager.BubbleExpandEvent(control.GetDomNode(),null);var failureText=validator.GetFailureText();if(failureText!==null){failureText.SetSubject(vci.Subject);}
mrDr.Register(function(){UI.GetMessageArea().AddError(failureText,control);});}}};var Validate=function(index){if(index==controls.length){if(!success){if(!skipFailureMessage){mrDr.Register(function(){UI.GetMessageArea().ShowErrors(true).Register(function(){me.m_isValidating=false;});});}
return false;}else{me.m_isValidating=false;return true;}}else{var vci=controls[index];var validator=UI.GetControl(vci.ValidatorControlId.ID(),vci.ValidatorControlId.SID());var control=UI.GetControl(vci.ControlId.ID(),vci.ControlId.SID());if(control.IsEnabled===undefined||control.IsEnabled()){var pass=validator.ValidateObjectNoDelay(control);HandleReturn(vci,validator,control,pass);return Validate(++index)&&pass;}else{return Validate(++index);}}};return Validate(0);}});

D2L.Validation.RegexValidator=D2L.Validation.StringValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this,value);},IntegrateControlMin:function(deserializer){if(deserializer.HasMember()){this.SetRegex(new RegExp(deserializer.GetMember()));this.SetRegexFailureText(deserializer.GetObject(D2L.LP.Text.IText));}
arguments.callee.$.IntegrateControlMin.call(this,deserializer);}});D2L.Control.ValidatorRegex=D2L.Validation.RegexValidator;

D2L.Validation.RequiredValidator=D2L.Validation.IValidator.extend({Construct:function(value){arguments.callee.$.Construct.call(this);this.m_value=value;this.m_failureTerm=null;},IntegrateControlMin:function(deserializer){arguments.callee.$.IntegrateControlMin.call(this,deserializer);if(deserializer.HasMember()){this.m_failureTerm=new D2L.LP.Text.LangTerm(deserializer.GetMember());}},GetFailureText:function(){if(this.m_failureTerm===null){return new D2L.LP.Text.LangTerm('Framework.Validation.Required');}else{return this.m_failureTerm;}},GetValue:function(){return this.m_value;},SetValue:function(value){this.m_value=value;},Validate:function(value){if(value===undefined){value=this.GetValue();}
if(value===undefined||value===null){return false;}
if(value.isString){return(value.trim().length>0);}
return true;},ValidateObject:function(obj){var dr=new D2L.Util.DelayedReturn();obj.HasValue().Register(function(value){dr.Trigger(value);});return dr;},ValidateObjectNoDelay:function(obj){return obj.HasValueNoDelay();}});D2L.Control.ValidatorRequired=D2L.Validation.RequiredValidator;

D2L.Validation.ValidationControlInfo=D2L.Class.extend({Construct:function(){arguments.callee.$.Construct.call(this);this.ControlId=null;this.ValidatorControlId=null;this.Subject='';this.IsEnablerTargetItem=false;},DeserializeMin:function(deserializer){this.ControlId=deserializer.GetObjectMin(D2L.Control.Id);this.ValidatorControlId=deserializer.GetObjectMin(D2L.Control.Id);this.Subject=deserializer.GetMember();this.IsEnablerTargetItem=deserializer.GetBoolean();}});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=(""+A[C]).split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules,B,H,G,F,C;if(!I[A]){I[A]={versions:[],builds:[]};}B=I[A];H=D.version;G=D.build;F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:0},B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}A=B.match(/Caja\/([^\s]*)/);if(A&&A[1]){C.caja=parseFloat(A[1]);}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var B=YAHOO.lang,F="[object Array]",C="[object Function]",A=Object.prototype,E=["toString","valueOf"],D={isArray:function(G){return A.toString.apply(G)===F;},isBoolean:function(G){return typeof G==="boolean";},isFunction:function(G){return A.toString.apply(G)===C;},isNull:function(G){return G===null;},isNumber:function(G){return typeof G==="number"&&isFinite(G);},isObject:function(G){return(G&&(typeof G==="object"||B.isFunction(G)))||false;},isString:function(G){return typeof G==="string";},isUndefined:function(G){return typeof G==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(I,H){var G,K,J;for(G=0;G<E.length;G=G+1){K=E[G];J=H[K];if(B.isFunction(J)&&J!=A[K]){I[K]=J;}}}:function(){},extend:function(J,K,I){if(!K||!J){throw new Error("extend failed, please check that "+"all dependencies are included.");}var H=function(){},G;H.prototype=K.prototype;J.prototype=new H();J.prototype.constructor=J;J.superclass=K.prototype;if(K.prototype.constructor==A.constructor){K.prototype.constructor=K;}if(I){for(G in I){if(B.hasOwnProperty(I,G)){J.prototype[G]=I[G];}}B._IEEnumFix(J.prototype,I);}},augmentObject:function(K,J){if(!J||!K){throw new Error("Absorb failed, verify dependencies.");}var G=arguments,I,L,H=G[2];if(H&&H!==true){for(I=2;I<G.length;I=I+1){K[G[I]]=J[G[I]];}}else{for(L in J){if(H||!(L in K)){K[L]=J[L];}}B._IEEnumFix(K,J);}},augmentProto:function(J,I){if(!I||!J){throw new Error("Augment failed, verify dependencies.");}var G=[J.prototype,I.prototype],H;for(H=2;H<arguments.length;H=H+1){G.push(arguments[H]);}B.augmentObject.apply(this,G);},dump:function(G,L){var I,K,N=[],O="{...}",H="f(){...}",M=", ",J=" => ";if(!B.isObject(G)){return G+"";}else{if(G instanceof Date||("nodeType" in G&&"tagName" in G)){return G;}else{if(B.isFunction(G)){return H;}}}L=(B.isNumber(L))?L:3;if(B.isArray(G)){N.push("[");for(I=0,K=G.length;I<K;I=I+1){if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}if(N.length>1){N.pop();}N.push("]");}else{N.push("{");for(I in G){if(B.hasOwnProperty(G,I)){N.push(I+J);if(B.isObject(G[I])){N.push((L>0)?B.dump(G[I],L-1):O);}else{N.push(G[I]);}N.push(M);}}if(N.length>1){N.pop();}N.push("}");}return N.join("");},substitute:function(V,H,O){var L,K,J,R,S,U,Q=[],I,M="dump",P=" ",G="{",T="}",N;for(;;){L=V.lastIndexOf(G);if(L<0){break;}K=V.indexOf(T,L);if(L+1>=K){break;}I=V.substring(L+1,K);R=I;U=null;J=R.indexOf(P);if(J>-1){U=R.substring(J+1);R=R.substring(0,J);}S=H[R];if(O){S=O(R,S,U);}if(B.isObject(S)){if(B.isArray(S)){S=B.dump(S,parseInt(U,10));}else{U=U||"";N=U.indexOf(M);if(N>-1){U=U.substring(4);}if(S.toString===A.toString||N>-1){S=B.dump(S,parseInt(U,10));}else{S=S.toString();}}}else{if(!B.isString(S)&&!B.isNumber(S)){S="~-"+Q.length+"-~";Q[Q.length]=I;}}V=V.substring(0,L)+S+V.substring(K+1);}for(L=Q.length-1;L>=0;L=L-1){V=V.replace(new RegExp("~-"+L+"-~"),"{"+Q[L]+"}","g");}return V;},trim:function(G){try{return G.replace(/^\s+|\s+$/g,"");}catch(H){return G;}},merge:function(){var J={},H=arguments,G=H.length,I;for(I=0;I<G;I=I+1){B.augmentObject(J,H[I],true);}return J;},later:function(N,H,O,J,K){N=N||0;H=H||{};var I=O,M=J,L,G;if(B.isString(O)){I=H[O];}if(!I){throw new TypeError("method undefined");}if(!B.isArray(M)){M=[J];}L=function(){I.apply(H,M);};G=(K)?setInterval(L,N):setTimeout(L,N);return{interval:K,cancel:function(){if(this.interval){clearInterval(G);}else{clearTimeout(G);}}};},isValue:function(G){return(B.isObject(G)||B.isString(G)||B.isNumber(G)||B.isBoolean(G));}};B.hasOwnProperty=(A.hasOwnProperty)?function(G,H){return G&&G.hasOwnProperty(H);}:function(G,H){return !B.isUndefined(G[H])&&G.constructor.prototype[H]!==G[H];};D.augmentObject(B,D,true);YAHOO.util.Lang=B;B.augment=B.augmentProto;YAHOO.augment=B.augmentProto;YAHOO.extend=B.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.7.0",build:"1799"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
(function(){YAHOO.env._id_counter=YAHOO.env._id_counter||0;var E=YAHOO.util,L=YAHOO.lang,m=YAHOO.env.ua,A=YAHOO.lang.trim,d={},h={},N=/^t(?:able|d|h)$/i,X=/color$/i,K=window.document,W=K.documentElement,e="ownerDocument",n="defaultView",v="documentElement",t="compatMode",b="offsetLeft",P="offsetTop",u="offsetParent",Z="parentNode",l="nodeType",C="tagName",O="scrollLeft",i="scrollTop",Q="getBoundingClientRect",w="getComputedStyle",a="currentStyle",M="CSS1Compat",c="BackCompat",g="class",F="className",J="",B=" ",s="(?:^|\\s)",k="(?= |$)",U="g",p="position",f="fixed",V="relative",j="left",o="top",r="medium",q="borderLeftWidth",R="borderTopWidth",D=m.opera,I=m.webkit,H=m.gecko,T=m.ie;E.Dom={CUSTOM_ATTRIBUTES:(!W.hasAttribute)?{"for":"htmlFor","class":F}:{"htmlFor":"for","className":g},get:function(y){var AA,Y,z,x,G;if(y){if(y[l]||y.item){return y;}if(typeof y==="string"){AA=y;y=K.getElementById(y);if(y&&y.id===AA){return y;}else{if(y&&K.all){y=null;Y=K.all[AA];for(x=0,G=Y.length;x<G;++x){if(Y[x].id===AA){return Y[x];}}}}return y;}if(y.DOM_EVENTS){y=y.get("element");}if("length" in y){z=[];for(x=0,G=y.length;x<G;++x){z[z.length]=E.Dom.get(y[x]);}return z;}return y;}return null;},getComputedStyle:function(G,Y){if(window[w]){return G[e][n][w](G,null)[Y];}else{if(G[a]){return E.Dom.IE_ComputedStyle.get(G,Y);}}},getStyle:function(G,Y){return E.Dom.batch(G,E.Dom._getStyle,Y);},_getStyle:function(){if(window[w]){return function(G,y){y=(y==="float")?y="cssFloat":E.Dom._toCamel(y);var x=G.style[y],Y;if(!x){Y=G[e][n][w](G,null);if(Y){x=Y[y];}}return x;};}else{if(W[a]){return function(G,y){var x;switch(y){case"opacity":x=100;try{x=G.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(z){try{x=G.filters("alpha").opacity;}catch(Y){}}return x/100;case"float":y="styleFloat";default:y=E.Dom._toCamel(y);x=G[a]?G[a][y]:null;return(G.style[y]||x);}};}}}(),setStyle:function(G,Y,x){E.Dom.batch(G,E.Dom._setStyle,{prop:Y,val:x});},_setStyle:function(){if(T){return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){switch(x){case"opacity":if(L.isString(Y.style.filter)){Y.style.filter="alpha(opacity="+y*100+")";if(!Y[a]||!Y[a].hasLayout){Y.style.zoom=1;}}break;case"float":x="styleFloat";default:Y.style[x]=y;}}else{}};}else{return function(Y,G){var x=E.Dom._toCamel(G.prop),y=G.val;if(Y){if(x=="float"){x="cssFloat";}Y.style[x]=y;}else{}};}}(),getXY:function(G){return E.Dom.batch(G,E.Dom._getXY);},_canPosition:function(G){return(E.Dom._getStyle(G,"display")!=="none"&&E.Dom._inDoc(G));},_getXY:function(){if(K[v][Q]){return function(y){var z,Y,AA,AF,AE,AD,AC,G,x,AB=Math.floor,AG=false;if(E.Dom._canPosition(y)){AA=y[Q]();AF=y[e];z=E.Dom.getDocumentScrollLeft(AF);Y=E.Dom.getDocumentScrollTop(AF);AG=[AB(AA[j]),AB(AA[o])];if(T&&m.ie<8){AE=2;AD=2;AC=AF[t];G=S(AF[v],q);x=S(AF[v],R);if(m.ie===6){if(AC!==c){AE=0;AD=0;}}if((AC==c)){if(G!==r){AE=parseInt(G,10);}if(x!==r){AD=parseInt(x,10);}}AG[0]-=AE;AG[1]-=AD;}if((Y||z)){AG[0]+=z;AG[1]+=Y;}AG[0]=AB(AG[0]);AG[1]=AB(AG[1]);}else{}return AG;};}else{return function(y){var x,Y,AA,AB,AC,z=false,G=y;if(E.Dom._canPosition(y)){z=[y[b],y[P]];x=E.Dom.getDocumentScrollLeft(y[e]);Y=E.Dom.getDocumentScrollTop(y[e]);AC=((H||m.webkit>519)?true:false);while((G=G[u])){z[0]+=G[b];z[1]+=G[P];if(AC){z=E.Dom._calcBorders(G,z);}}if(E.Dom._getStyle(y,p)!==f){G=y;while((G=G[Z])&&G[C]){AA=G[i];AB=G[O];if(H&&(E.Dom._getStyle(G,"overflow")!=="visible")){z=E.Dom._calcBorders(G,z);}if(AA||AB){z[0]-=AB;z[1]-=AA;}}z[0]+=x;z[1]+=Y;}else{if(D){z[0]-=x;z[1]-=Y;}else{if(I||H){z[0]+=x;z[1]+=Y;}}}z[0]=Math.floor(z[0]);z[1]=Math.floor(z[1]);}else{}return z;};}}(),getX:function(G){var Y=function(x){return E.Dom.getXY(x)[0];};return E.Dom.batch(G,Y,E.Dom,true);},getY:function(G){var Y=function(x){return E.Dom.getXY(x)[1];};return E.Dom.batch(G,Y,E.Dom,true);},setXY:function(G,x,Y){E.Dom.batch(G,E.Dom._setXY,{pos:x,noRetry:Y});},_setXY:function(G,z){var AA=E.Dom._getStyle(G,p),y=E.Dom.setStyle,AD=z.pos,Y=z.noRetry,AB=[parseInt(E.Dom.getComputedStyle(G,j),10),parseInt(E.Dom.getComputedStyle(G,o),10)],AC,x;if(AA=="static"){AA=V;y(G,p,AA);}AC=E.Dom._getXY(G);if(!AD||AC===false){return false;}if(isNaN(AB[0])){AB[0]=(AA==V)?0:G[b];}if(isNaN(AB[1])){AB[1]=(AA==V)?0:G[P];}if(AD[0]!==null){y(G,j,AD[0]-AC[0]+AB[0]+"px");}if(AD[1]!==null){y(G,o,AD[1]-AC[1]+AB[1]+"px");}if(!Y){x=E.Dom._getXY(G);if((AD[0]!==null&&x[0]!=AD[0])||(AD[1]!==null&&x[1]!=AD[1])){E.Dom._setXY(G,{pos:AD,noRetry:true});}}},setX:function(Y,G){E.Dom.setXY(Y,[G,null]);},setY:function(G,Y){E.Dom.setXY(G,[null,Y]);},getRegion:function(G){var Y=function(x){var y=false;if(E.Dom._canPosition(x)){y=E.Region.getRegion(x);}else{}return y;};return E.Dom.batch(G,Y,E.Dom,true);},getClientWidth:function(){return E.Dom.getViewportWidth();},getClientHeight:function(){return E.Dom.getViewportHeight();},getElementsByClassName:function(AB,AF,AC,AE,x,AD){AB=L.trim(AB);AF=AF||"*";AC=(AC)?E.Dom.get(AC):null||K;if(!AC){return[];}var Y=[],G=AC.getElementsByTagName(AF),z=E.Dom.hasClass;for(var y=0,AA=G.length;y<AA;++y){if(z(G[y],AB)){Y[Y.length]=G[y];}}if(AE){E.Dom.batch(Y,AE,x,AD);}return Y;},hasClass:function(Y,G){return E.Dom.batch(Y,E.Dom._hasClass,G);},_hasClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(Y.exec){G=Y.test(y);}else{G=Y&&(B+y+B).indexOf(B+Y+B)>-1;}}else{}return G;},addClass:function(Y,G){return E.Dom.batch(Y,E.Dom._addClass,G);},_addClass:function(x,Y){var G=false,y;if(x&&Y){y=E.Dom.getAttribute(x,F)||J;if(!E.Dom._hasClass(x,Y)){E.Dom.setAttribute(x,F,A(y+B+Y));G=true;}}else{}return G;},removeClass:function(Y,G){return E.Dom.batch(Y,E.Dom._removeClass,G);},_removeClass:function(y,x){var Y=false,AA,z,G;if(y&&x){AA=E.Dom.getAttribute(y,F)||J;E.Dom.setAttribute(y,F,AA.replace(E.Dom._getClassRegex(x),J));z=E.Dom.getAttribute(y,F);if(AA!==z){E.Dom.setAttribute(y,F,A(z));Y=true;if(E.Dom.getAttribute(y,F)===""){G=(y.hasAttribute&&y.hasAttribute(g))?g:F;y.removeAttribute(G);}}}else{}return Y;},replaceClass:function(x,Y,G){return E.Dom.batch(x,E.Dom._replaceClass,{from:Y,to:G});
},_replaceClass:function(y,x){var Y,AB,AA,G=false,z;if(y&&x){AB=x.from;AA=x.to;if(!AA){G=false;}else{if(!AB){G=E.Dom._addClass(y,x.to);}else{if(AB!==AA){z=E.Dom.getAttribute(y,F)||J;Y=(B+z.replace(E.Dom._getClassRegex(AB),B+AA)).split(E.Dom._getClassRegex(AA));Y.splice(1,0,B+AA);E.Dom.setAttribute(y,F,A(Y.join(J)));G=true;}}}}else{}return G;},generateId:function(G,x){x=x||"yui-gen";var Y=function(y){if(y&&y.id){return y.id;}var z=x+YAHOO.env._id_counter++;if(y){if(y[e].getElementById(z)){return E.Dom.generateId(y,z+x);}y.id=z;}return z;};return E.Dom.batch(G,Y,E.Dom,true)||Y.apply(E.Dom,arguments);},isAncestor:function(Y,x){Y=E.Dom.get(Y);x=E.Dom.get(x);var G=false;if((Y&&x)&&(Y[l]&&x[l])){if(Y.contains&&Y!==x){G=Y.contains(x);}else{if(Y.compareDocumentPosition){G=!!(Y.compareDocumentPosition(x)&16);}}}else{}return G;},inDocument:function(G,Y){return E.Dom._inDoc(E.Dom.get(G),Y);},_inDoc:function(Y,x){var G=false;if(Y&&Y[C]){x=x||Y[e];G=E.Dom.isAncestor(x[v],Y);}else{}return G;},getElementsBy:function(Y,AF,AB,AD,y,AC,AE){AF=AF||"*";AB=(AB)?E.Dom.get(AB):null||K;if(!AB){return[];}var x=[],G=AB.getElementsByTagName(AF);for(var z=0,AA=G.length;z<AA;++z){if(Y(G[z])){if(AE){x=G[z];break;}else{x[x.length]=G[z];}}}if(AD){E.Dom.batch(x,AD,y,AC);}return x;},getElementBy:function(x,G,Y){return E.Dom.getElementsBy(x,G,Y,null,null,null,true);},batch:function(x,AB,AA,z){var y=[],Y=(z)?AA:window;x=(x&&(x[C]||x.item))?x:E.Dom.get(x);if(x&&AB){if(x[C]||x.length===undefined){return AB.call(Y,x,AA);}for(var G=0;G<x.length;++G){y[y.length]=AB.call(Y,x[G],AA);}}else{return false;}return y;},getDocumentHeight:function(){var Y=(K[t]!=M||I)?K.body.scrollHeight:W.scrollHeight,G=Math.max(Y,E.Dom.getViewportHeight());return G;},getDocumentWidth:function(){var Y=(K[t]!=M||I)?K.body.scrollWidth:W.scrollWidth,G=Math.max(Y,E.Dom.getViewportWidth());return G;},getViewportHeight:function(){var G=self.innerHeight,Y=K[t];if((Y||T)&&!D){G=(Y==M)?W.clientHeight:K.body.clientHeight;}return G;},getViewportWidth:function(){var G=self.innerWidth,Y=K[t];if(Y||T){G=(Y==M)?W.clientWidth:K.body.clientWidth;}return G;},getAncestorBy:function(G,Y){while((G=G[Z])){if(E.Dom._testElement(G,Y)){return G;}}return null;},getAncestorByClassName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return E.Dom.hasClass(y,G);};return E.Dom.getAncestorBy(Y,x);},getAncestorByTagName:function(Y,G){Y=E.Dom.get(Y);if(!Y){return null;}var x=function(y){return y[C]&&y[C].toUpperCase()==G.toUpperCase();};return E.Dom.getAncestorBy(Y,x);},getPreviousSiblingBy:function(G,Y){while(G){G=G.previousSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getPreviousSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getPreviousSiblingBy(G);},getNextSiblingBy:function(G,Y){while(G){G=G.nextSibling;if(E.Dom._testElement(G,Y)){return G;}}return null;},getNextSibling:function(G){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getNextSiblingBy(G);},getFirstChildBy:function(G,x){var Y=(E.Dom._testElement(G.firstChild,x))?G.firstChild:null;return Y||E.Dom.getNextSiblingBy(G.firstChild,x);},getFirstChild:function(G,Y){G=E.Dom.get(G);if(!G){return null;}return E.Dom.getFirstChildBy(G);},getLastChildBy:function(G,x){if(!G){return null;}var Y=(E.Dom._testElement(G.lastChild,x))?G.lastChild:null;return Y||E.Dom.getPreviousSiblingBy(G.lastChild,x);},getLastChild:function(G){G=E.Dom.get(G);return E.Dom.getLastChildBy(G);},getChildrenBy:function(Y,y){var x=E.Dom.getFirstChildBy(Y,y),G=x?[x]:[];E.Dom.getNextSiblingBy(x,function(z){if(!y||y(z)){G[G.length]=z;}return false;});return G;},getChildren:function(G){G=E.Dom.get(G);if(!G){}return E.Dom.getChildrenBy(G);},getDocumentScrollLeft:function(G){G=G||K;return Math.max(G[v].scrollLeft,G.body.scrollLeft);},getDocumentScrollTop:function(G){G=G||K;return Math.max(G[v].scrollTop,G.body.scrollTop);},insertBefore:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}return G[Z].insertBefore(Y,G);},insertAfter:function(Y,G){Y=E.Dom.get(Y);G=E.Dom.get(G);if(!Y||!G||!G[Z]){return null;}if(G.nextSibling){return G[Z].insertBefore(Y,G.nextSibling);}else{return G[Z].appendChild(Y);}},getClientRegion:function(){var x=E.Dom.getDocumentScrollTop(),Y=E.Dom.getDocumentScrollLeft(),y=E.Dom.getViewportWidth()+Y,G=E.Dom.getViewportHeight()+x;return new E.Region(x,y,G,Y);},setAttribute:function(Y,G,x){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;Y.setAttribute(G,x);},getAttribute:function(Y,G){G=E.Dom.CUSTOM_ATTRIBUTES[G]||G;return Y.getAttribute(G);},_toCamel:function(Y){var x=d;function G(y,z){return z.toUpperCase();}return x[Y]||(x[Y]=Y.indexOf("-")===-1?Y:Y.replace(/-([a-z])/gi,G));},_getClassRegex:function(Y){var G;if(Y!==undefined){if(Y.exec){G=Y;}else{G=h[Y];if(!G){Y=Y.replace(E.Dom._patterns.CLASS_RE_TOKENS,"\\$1");G=h[Y]=new RegExp(s+Y+k,U);}}}return G;},_patterns:{ROOT_TAG:/^body|html$/i,CLASS_RE_TOKENS:/([\.\(\)\^\$\*\+\?\|\[\]\{\}])/g},_testElement:function(G,Y){return G&&G[l]==1&&(!Y||Y(G));},_calcBorders:function(x,y){var Y=parseInt(E.Dom[w](x,R),10)||0,G=parseInt(E.Dom[w](x,q),10)||0;if(H){if(N.test(x[C])){Y=0;G=0;}}y[0]+=G;y[1]+=Y;return y;}};var S=E.Dom[w];if(m.opera){E.Dom[w]=function(Y,G){var x=S(Y,G);if(X.test(G)){x=E.Dom.Color.toRGB(x);}return x;};}if(m.webkit){E.Dom[w]=function(Y,G){var x=S(Y,G);if(x==="rgba(0, 0, 0, 0)"){x="transparent";}return x;};}})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this.y=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this.x=B;this[0]=B;this.width=this.right-this.left;this.height=this.bottom-this.top;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top),D=Math.min(this.right,E.right),A=Math.min(this.bottom,E.bottom),B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);
}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top),D=Math.max(this.right,E.right),A=Math.max(this.bottom,E.bottom),B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D),C=F[1],E=F[0]+D.offsetWidth,A=F[1]+D.offsetHeight,B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}YAHOO.util.Point.superclass.constructor.call(this,B,A,B,A);};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var B=YAHOO.util,A="clientTop",F="clientLeft",J="parentNode",K="right",W="hasLayout",I="px",U="opacity",L="auto",D="borderLeftWidth",G="borderTopWidth",P="borderRightWidth",V="borderBottomWidth",S="visible",Q="transparent",N="height",E="width",H="style",T="currentStyle",R=/^width|height$/,O=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,M={get:function(X,Z){var Y="",a=X[T][Z];if(Z===U){Y=B.Dom.getStyle(X,U);}else{if(!a||(a.indexOf&&a.indexOf(I)>-1)){Y=a;}else{if(B.Dom.IE_COMPUTED[Z]){Y=B.Dom.IE_COMPUTED[Z](X,Z);}else{if(O.test(a)){Y=B.Dom.IE.ComputedStyle.getPixel(X,Z);}else{Y=a;}}}}return Y;},getOffset:function(Z,e){var b=Z[T][e],X=e.charAt(0).toUpperCase()+e.substr(1),c="offset"+X,Y="pixel"+X,a="",d;if(b==L){d=Z[c];if(d===undefined){a=0;}a=d;if(R.test(e)){Z[H][e]=d;if(Z[c]>d){a=d-(Z[c]-d);}Z[H][e]=L;}}else{if(!Z[H][Y]&&!Z[H][e]){Z[H][e]=b;}a=Z[H][Y];}return a+I;},getBorderWidth:function(X,Z){var Y=null;if(!X[T][W]){X[H].zoom=1;}switch(Z){case G:Y=X[A];break;case V:Y=X.offsetHeight-X.clientHeight-X[A];break;case D:Y=X[F];break;case P:Y=X.offsetWidth-X.clientWidth-X[F];break;}return Y+I;},getPixel:function(Y,X){var a=null,b=Y[T][K],Z=Y[T][X];Y[H][K]=Z;a=Y[H].pixelRight;Y[H][K]=b;return a+I;},getMargin:function(Y,X){var Z;if(Y[T][X]==L){Z=0+I;}else{Z=B.Dom.IE.ComputedStyle.getPixel(Y,X);}return Z;},getVisibility:function(Y,X){var Z;while((Z=Y[T])&&Z[X]=="inherit"){Y=Y[J];}return(Z)?Z[X]:S;},getColor:function(Y,X){return B.Dom.Color.toRGB(Y[T][X])||Q;},getBorderColor:function(Y,X){var Z=Y[T],a=Z[X]||Z.color;return B.Dom.Color.toRGB(B.Dom.Color.toHex(a));}},C={};C.top=C.right=C.bottom=C.left=C[E]=C[N]=M.getOffset;C.color=M.getColor;C[G]=C[P]=C[V]=C[D]=M.getBorderWidth;C.marginTop=C.marginRight=C.marginBottom=C.marginLeft=M.getMargin;C.visibility=M.getVisibility;C.borderColor=C.borderTopColor=C.borderRightColor=C.borderBottomColor=C.borderLeftColor=M.getBorderColor;B.Dom.IE_COMPUTED=C;B.Dom.IE_ComputedStyle=M;})();(function(){var C="toString",A=parseInt,B=RegExp,D=YAHOO.util;D.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Dom.Color.re_RGB.test(E)){E=D.Dom.Color.toHex(E);}if(D.Dom.Color.re_hex.exec(E)){E="rgb("+[A(B.$1,16),A(B.$2,16),A(B.$3,16)].join(", ")+")";}return E;},toHex:function(H){H=D.Dom.Color.KEYWORDS[H]||H;if(D.Dom.Color.re_RGB.exec(H)){var G=(B.$1.length===1)?"0"+B.$1:Number(B.$1),F=(B.$2.length===1)?"0"+B.$2:Number(B.$2),E=(B.$3.length===1)?"0"+B.$3:Number(B.$3);H=[G[C](16),F[C](16),E[C](16)].join("");}if(H.length<6){H=H.replace(D.Dom.Color.re_hex3,"$1$1");}if(H!=="transparent"&&H.indexOf("#")<0){H="#"+H;}return H.toLowerCase();}};}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1796"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
YAHOO.util.CustomEvent=function(D,C,B,A){this.type=D;this.scope=C||window;this.silent=B;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(A,B,C){if(!A){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(A,B,C);}this.subscribers.push(new YAHOO.util.Subscriber(A,B,C));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){var A=this.subscribers.length,B;for(B=A-1;B>-1;B--){this._delete(B);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"context: "+this.scope;}};YAHOO.util.Subscriber=function(A,B,C){this.fn=A;this.obj=YAHOO.lang.isUndefined(B)?null:B;this.overrideContext=C;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.overrideContext){if(this.overrideContext===true){return this.obj;}else{return this.overrideContext;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(S,O,Q,R,P){var M=(YAHOO.lang.isString(S))?[S]:S;for(var N=0;N<M.length;N=N+1){F.push({id:M[N],fn:O,obj:Q,overrideContext:R,checkReady:P});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(P,M,N,O){this.onAvailable(P,M,N,O,true);},onDOMReady:function(M,N,O){if(this.DOMReady){setTimeout(function(){var P=window;if(O){if(O===true){P=N;}else{P=O;}}M.call(P,"DOMReady",[],N);},0);}else{this.DOMReadyEvent.subscribe(M,N,O);}},_addListener:function(O,M,Y,S,W,b){if(!Y||!Y.call){return false;}if(this._isValidCollection(O)){var Z=true;for(var T=0,V=O.length;T<V;++T){Z=this.on(O[T],M,Y,S,W)&&Z;}return Z;}else{if(YAHOO.lang.isString(O)){var R=this.getEl(O);if(R){O=R;}else{this.onAvailable(O,function(){YAHOO.util.Event.on(O,M,Y,S,W);});return true;}}}if(!O){return false;}if("unload"==M&&S!==this){J[J.length]=[O,M,Y,S,W];return true;}var N=O;if(W){if(W===true){N=S;}else{N=W;}}var P=function(c){return Y.call(N,YAHOO.util.Event.getEvent(c,O),S);};var a=[O,M,Y,P,N,S,W];var U=I.length;I[U]=a;if(this.useLegacyEvent(O,M)){var Q=this.getLegacyIndex(O,M);if(Q==-1||O!=G[Q][0]){Q=G.length;B[O.id+M]=Q;G[Q]=[O,M,O["on"+M]];E[Q]=[];O["on"+M]=function(c){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(c),Q);};}E[Q].push(a);}else{try{this._simpleAdd(O,M,P,b);}catch(X){this.lastError=X;this.removeListener(O,M,Y);return false;}}return true;},addListener:function(N,Q,M,O,P){return this._addListener(N,Q,M,O,P,false);},addFocusListener:function(N,M,O,P){return this._addListener(N,K,M,O,P,true);},removeFocusListener:function(N,M){return this.removeListener(N,K,M);},addBlurListener:function(N,M,O,P){return this._addListener(N,L,M,O,P,true);},removeBlurListener:function(N,M){return this.removeListener(N,L,M);},fireLegacyEvent:function(R,P){var T=true,M,V,U,N,S;V=E[P].slice();for(var O=0,Q=V.length;O<Q;++O){U=V[O];if(U&&U[this.WFN]){N=U[this.ADJ_SCOPE];S=U[this.WFN].call(N,R);T=(T&&S);}}M=G[P];if(M&&M[2]){M[2](R);}return T;},getLegacyIndex:function(N,O){var M=this.generateId(N)+O;if(typeof B[M]=="undefined"){return -1;}else{return B[M];}},useLegacyEvent:function(M,N){return(this.webkit&&this.webkit<419&&("click"==N||"dblclick"==N));},removeListener:function(N,M,V){var Q,T,X;if(typeof N=="string"){N=this.getEl(N);}else{if(this._isValidCollection(N)){var W=true;for(Q=N.length-1;Q>-1;Q--){W=(this.removeListener(N[Q],M,V)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[3];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q<T;++Q){X=O[Q];if(X&&X[this.EL]==N&&X[this.TYPE]==M&&X[this.FN]==V){O.splice(Q,1);break;}}}}else{try{this._simpleRemove(N,M,R[this.WFN],false);}catch(U){this.lastError=U;return false;}}delete I[S][this.WFN];delete I[S][this.FN];
I.splice(S,1);return true;},getTarget:function(O,N){var M=O.target||O.srcElement;return this.resolveTextNode(M);},resolveTextNode:function(N){try{if(N&&3==N.nodeType){return N.parentNode;}}catch(M){}return N;},getPageX:function(N){var M=N.pageX;if(!M&&0!==M){M=N.clientX||0;if(this.isIE){M+=this._getScrollLeft();}}return M;},getPageY:function(M){var N=M.pageY;if(!N&&0!==N){N=M.clientY||0;if(this.isIE){N+=this._getScrollTop();}}return N;},getXY:function(M){return[this.getPageX(M),this.getPageY(M)];},getRelatedTarget:function(N){var M=N.relatedTarget;if(!M){if(N.type=="mouseout"){M=N.toElement;}else{if(N.type=="mouseover"){M=N.fromElement;}}}return this.resolveTextNode(M);},getTime:function(O){if(!O.time){var N=new Date().getTime();try{O.time=N;}catch(M){this.lastError=M;return N;}}return O.time;},stopEvent:function(M){this.stopPropagation(M);this.preventDefault(M);},stopPropagation:function(M){if(M.stopPropagation){M.stopPropagation();}else{M.cancelBubble=true;}},preventDefault:function(M){if(M.preventDefault){M.preventDefault();}else{M.returnValue=false;}},getEvent:function(O,M){var N=O||window.event;if(!N){var P=this.getEvent.caller;while(P){N=P.arguments[0];if(N&&Event==N.constructor){break;}P=P.caller;}}return N;},getCharCode:function(N){var M=N.keyCode||N.charCode||0;if(YAHOO.env.ua.webkit&&(M in D)){M=D[M];}return M;},_getCacheIndex:function(Q,R,P){for(var O=0,N=I.length;O<N;O=O+1){var M=I[O];if(M&&M[this.FN]==P&&M[this.EL]==Q&&M[this.TYPE]==R){return O;}}return -1;},generateId:function(M){var N=M.id;if(!N){N="yuievtautoid-"+A;++A;M.id=N;}return N;},_isValidCollection:function(N){try{return(N&&typeof N!=="string"&&N.length&&!N.tagName&&!N.alert&&typeof N[0]!=="undefined");}catch(M){return false;}},elCache:{},getEl:function(M){return(typeof M==="string")?document.getElementById(M):M;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(N){if(!H){H=true;var M=YAHOO.util.Event;M._ready();M._tryPreloadAttach();}},_ready:function(N){var M=YAHOO.util.Event;if(!M.DOMReady){M.DOMReady=true;M.DOMReadyEvent.fire();M._simpleRemove(document,"DOMContentLoaded",M._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;if(this._interval){clearInterval(this._interval);this._interval=null;}return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var S=!H;if(!S){S=(C>0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.overrideContext){if(W.overrideContext===true){U=W.obj;}else{U=W.overrideContext;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N<M;N=N+1){Q=F[N];if(Q){P=this.getEl(Q.id);if(P){if(Q.checkReady){if(H||P.nextSibling||!S){O.push(Q);F[N]=null;}}else{T(P,Q);F[N]=null;}}else{R.push(Q);}}}for(N=0,M=O.length;N<M;N=N+1){Q=O[N];T(this.getEl(Q.id),Q);}C--;if(S){for(N=F.length-1;N>-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{if(this._interval){clearInterval(this._interval);this._interval=null;}}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this.removeListener(O,N.type,N.fn);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P<M;++P){this.purgeElement(O.childNodes[P],R,T);}}},getListeners:function(O,M){var R=[],N;if(!M){N=[I,J];}else{if(M==="unload"){N=[J];}else{N=[I];}}var T=(YAHOO.lang.isString(O))?this.getEl(O):O;for(var Q=0;Q<N.length;Q=Q+1){var V=N[Q];if(V){for(var S=0,U=V.length;S<U;++S){var P=V[S];if(P&&P[this.EL]===T&&(!M||M===P[this.TYPE])){R.push({type:P[this.TYPE],fn:P[this.FN],obj:P[this.OBJ],adjust:P[this.OVERRIDE],scope:P[this.ADJ_SCOPE],index:S});}}}}return(R.length)?R:null;},_unload:function(T){var N=YAHOO.util.Event,Q,P,O,S,R,U=J.slice(),M;for(Q=0,S=J.length;Q<S;++Q){O=U[Q];if(O){M=window;if(O[N.ADJ_SCOPE]){if(O[N.ADJ_SCOPE]===true){M=O[N.UNLOAD_OBJ];}else{M=O[N.ADJ_SCOPE];}}O[N.FN].call(M,N.getEvent(T,O[N.EL]),O[N.UNLOAD_OBJ]);U[Q]=null;}}O=null;M=null;J=null;if(I){for(P=I.length-1;P>-1;P--){O=I[P];if(O){N.removeListener(O[N.EL],O[N.TYPE],O[N.FN],P);}}O=null;}G=null;N._simpleRemove(window,"unload",N._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);
}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,overrideContext:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].overrideContext);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};(function(){var A=YAHOO.util.Event,C=YAHOO.lang;YAHOO.util.KeyListener=function(D,I,E,F){if(!D){}else{if(!I){}else{if(!E){}}}if(!F){F=YAHOO.util.KeyListener.KEYDOWN;}var G=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(C.isString(D)){D=document.getElementById(D);}if(C.isFunction(E)){G.subscribe(E);}else{G.subscribe(E.fn,E.scope,E.correctScope);}function H(O,N){if(!I.shift){I.shift=false;}if(!I.alt){I.alt=false;}if(!I.ctrl){I.ctrl=false;}if(O.shiftKey==I.shift&&O.altKey==I.alt&&O.ctrlKey==I.ctrl){var J,M=I.keys,L;if(YAHOO.lang.isArray(M)){for(var K=0;K<M.length;K++){J=M[K];L=A.getCharCode(O);if(J==L){G.fire(L,O);break;}}}else{L=A.getCharCode(O);if(M==L){G.fire(L,O);}}}}this.enable=function(){if(!this.enabled){A.on(D,F,H);this.enabledEvent.fire(I);}this.enabled=true;};this.disable=function(){if(this.enabled){A.removeListener(D,F,H);this.disabledEvent.fire(I);}this.enabled=false;};this.toString=function(){return"KeyListener ["+I.keys+"] "+D.tagName+(D.id?"["+D.id+"]":"");};};var B=YAHOO.util.KeyListener;B.KEYDOWN="keydown";B.KEYUP="keyup";B.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};})();YAHOO.register("event",YAHOO.util.Event,{version:"2.7.0",build:"1796"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,F,E){var D=this.getEl();if(this.patterns.noNegatives.test(C)){F=(F>0)?F:0;}if("style" in D){B.Dom.setStyle(D,C,F+E);}else{if(C in D){D[C]=F;}}},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if("style" in E){if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}}else{if(C in E){G=E[C];}}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";A.DEFAULT_BGCOLOR="#fff";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];
}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var I=YAHOO.util.Dom.getStyle(G,E);var H=this;if(this.patterns.transparent.test(I)){var F=YAHOO.util.Dom.getAncestorBy(G,function(J){return !H.patterns.transparent.test(I);});if(F){I=C.Dom.getStyle(F,E);}else{I=A.DEFAULT_BGCOLOR;}}}else{I=D.getAttribute.call(this,E);}return I;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
/*
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);
}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.7.0",build:"1796"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.8.0r4
*/
(function(){var I=document,B=I.createElement("p"),D=B.style,C=YAHOO.lang,L={},H={},E=0,J=("cssFloat" in D)?"cssFloat":"styleFloat",F,A,K;A=("opacity" in D)?function(M){M.opacity="";}:function(M){M.filter="";};D.border="1px solid red";D.border="";K=D.borderLeft?function(M,O){var N;if(O!==J&&O.toLowerCase().indexOf("float")!=-1){O=J;}if(typeof M[O]==="string"){switch(O){case"opacity":case"filter":A(M);break;case"font":M.font=M.fontStyle=M.fontVariant=M.fontWeight=M.fontSize=M.lineHeight=M.fontFamily="";break;default:for(N in M){if(N.indexOf(O)===0){M[N]="";}}}}}:function(M,N){if(N!==J&&N.toLowerCase().indexOf("float")!=-1){N=J;}if(C.isString(M[N])){if(N==="opacity"){A(M);}else{M[N]="";}}};function G(T,O){var W,R,V,U={},N,X,Q,S,M,P;if(!(this instanceof G)){return new G(T,O);}R=T&&(T.nodeName?T:I.getElementById(T));if(T&&H[T]){return H[T];}else{if(R&&R.yuiSSID&&H[R.yuiSSID]){return H[R.yuiSSID];}}if(!R||!/^(?:style|link)$/i.test(R.nodeName)){R=I.createElement("style");R.type="text/css";}if(C.isString(T)){if(T.indexOf("{")!=-1){if(R.styleSheet){R.styleSheet.cssText=T;}else{R.appendChild(I.createTextNode(T));}}else{if(!O){O=T;}}}if(!R.parentNode||R.parentNode.nodeName.toLowerCase()!=="head"){W=(R.ownerDocument||I).getElementsByTagName("head")[0];W.appendChild(R);}V=R.sheet||R.styleSheet;N=V&&("cssRules" in V)?"cssRules":"rules";Q=("deleteRule" in V)?function(Y){V.deleteRule(Y);}:function(Y){V.removeRule(Y);};X=("insertRule" in V)?function(a,Z,Y){V.insertRule(a+" {"+Z+"}",Y);}:function(a,Z,Y){V.addRule(a,Z,Y);};for(S=V[N].length-1;S>=0;--S){M=V[N][S];P=M.selectorText;if(U[P]){U[P].style.cssText+=";"+M.style.cssText;Q(S);}else{U[P]=M;}}R.yuiSSID="yui-stylesheet-"+(E++);G.register(R.yuiSSID,this);if(O){G.register(O,this);}C.augmentObject(this,{getId:function(){return R.yuiSSID;},node:R,enable:function(){V.disabled=false;return this;},disable:function(){V.disabled=true;return this;},isEnabled:function(){return !V.disabled;},set:function(b,a){var d=U[b],c=b.split(/\s*,\s*/),Z,Y;if(c.length>1){for(Z=c.length-1;Z>=0;--Z){this.set(c[Z],a);}return this;}if(!G.isValidSelector(b)){return this;}if(d){d.style.cssText=G.toCssText(a,d.style.cssText);}else{Y=V[N].length;a=G.toCssText(a);if(a){X(b,a,Y);U[b]=V[N][Y];}}return this;},unset:function(b,a){var d=U[b],c=b.split(/\s*,\s*/),Y=!a,e,Z;if(c.length>1){for(Z=c.length-1;Z>=0;--Z){this.unset(c[Z],a);}return this;}if(d){if(!Y){if(!C.isArray(a)){a=[a];}D.cssText=d.style.cssText;for(Z=a.length-1;Z>=0;--Z){K(D,a[Z]);}if(D.cssText){d.style.cssText=D.cssText;}else{Y=true;}}if(Y){e=V[N];for(Z=e.length-1;Z>=0;--Z){if(e[Z]===d){delete U[b];Q(Z);break;}}}}return this;},getCssText:function(Z){var a,Y;if(C.isString(Z)){a=U[Z.split(/\s*,\s*/)[0]];return a?a.style.cssText:null;}else{Y=[];for(Z in U){if(U.hasOwnProperty(Z)){a=U[Z];Y.push(a.selectorText+" {"+a.style.cssText+"}");}}return Y.join("\n");}}},true);}F=function(M,O){var N=M.styleFloat||M.cssFloat||M["float"],Q;D.cssText=O||"";if(C.isString(M)){D.cssText+=";"+M;}else{if(N&&!M[J]){M=C.merge(M);delete M.styleFloat;delete M.cssFloat;delete M["float"];M[J]=N;}for(Q in M){if(M.hasOwnProperty(Q)){try{D[Q]=C.trim(M[Q]);}catch(P){}}}}return D.cssText;};C.augmentObject(G,{toCssText:(("opacity" in D)?F:function(M,N){if(C.isObject(M)&&"opacity" in M){M=C.merge(M,{filter:"alpha(opacity="+(M.opacity*100)+")"});delete M.opacity;}return F(M,N);}),register:function(M,N){return !!(M&&N instanceof G&&!H[M]&&(H[M]=N));},isValidSelector:function(N){var M=false;if(N&&C.isString(N)){if(!L.hasOwnProperty(N)){L[N]=!/\S/.test(N.replace(/\s+|\s*[+~>]\s*/g," ").replace(/([^ ])\[.*?\]/g,"$1").replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,"$1").replace(/(?:^| )[a-z0-6]+/ig," ").replace(/\\./g,"").replace(/[.#]\w[\w\-]*/g,""));}M=L[N];}return M;}},true);YAHOO.util.StyleSheet=G;})();YAHOO.register("stylesheet",YAHOO.util.StyleSheet,{version:"2.8.0r4",build:"2446"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event,B=YAHOO.util.Dom;return{useShim:false,_shimActive:false,_shimState:false,_debugShim:false,_createShim:function(){var C=document.createElement("div");C.id="yui-ddm-shim";if(document.body.firstChild){document.body.insertBefore(C,document.body.firstChild);}else{document.body.appendChild(C);}C.style.display="none";C.style.backgroundColor="red";C.style.position="absolute";C.style.zIndex="99999";B.setStyle(C,"opacity","0");this._shim=C;A.on(C,"mouseup",this.handleMouseUp,this,true);A.on(C,"mousemove",this.handleMouseMove,this,true);A.on(window,"scroll",this._sizeShim,this,true);},_sizeShim:function(){if(this._shimActive){var C=this._shim;C.style.height=B.getDocumentHeight()+"px";C.style.width=B.getDocumentWidth()+"px";C.style.top="0";C.style.left="0";}},_activateShim:function(){if(this.useShim){if(!this._shim){this._createShim();}this._shimActive=true;var C=this._shim,D="0";if(this._debugShim){D=".5";}B.setStyle(C,"opacity",D);this._sizeShim();C.style.display="block";}},_deactivateShim:function(){this._shim.style.display="none";this._shimActive=false;},_shim:null,ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(E,D){for(var F in this.ids){for(var C in this.ids[F]){var G=this.ids[F][C];if(!this.isTypeOfDD(G)){continue;}G[E].apply(G,D);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(C){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(D,C){if(!this.initialized){this.init();}if(!this.ids[C]){this.ids[C]={};}this.ids[C][D.id]=D;},removeDDFromGroup:function(E,C){if(!this.ids[C]){this.ids[C]={};}var D=this.ids[C];if(D&&D[E.id]){delete D[E.id];}},_remove:function(E){for(var D in E.groups){if(D){var C=this.ids[D];if(C&&C[E.id]){delete C[E.id];}}}delete this.handleIds[E.id];},regHandle:function(D,C){if(!this.handleIds[D]){this.handleIds[D]={};}this.handleIds[D][C]=C;},isDragDrop:function(C){return(this.getDDById(C))?true:false;},getRelated:function(H,D){var G=[];for(var F in H.groups){for(var E in this.ids[F]){var C=this.ids[F][E];if(!this.isTypeOfDD(C)){continue;}if(!D||C.isTarget){G[G.length]=C;}}}return G;},isLegalTarget:function(G,F){var D=this.getRelated(G,true);for(var E=0,C=D.length;E<C;++E){if(D[E].id==F.id){return true;}}return false;},isTypeOfDD:function(C){return(C&&C.__ygDragDrop);},isHandle:function(D,C){return(this.handleIds[D]&&this.handleIds[D][C]);},getDDById:function(D){for(var C in this.ids){if(this.ids[C][D]){return this.ids[C][D];}}return null;},handleMouseDown:function(E,D){this.currentTarget=YAHOO.util.Event.getTarget(E);this.dragCurrent=D;var C=D.getEl();this.startX=YAHOO.util.Event.getPageX(E);this.startY=YAHOO.util.Event.getPageY(E);this.deltaX=this.startX-C.offsetLeft;this.deltaY=this.startY-C.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var F=YAHOO.util.DDM;F.startDrag(F.startX,F.startY);F.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(C,E){if(this.dragCurrent&&this.dragCurrent.useShim){this._shimState=this.useShim;this.useShim=true;}this._activateShim();clearTimeout(this.clickTimeout);var D=this.dragCurrent;if(D&&D.events.b4StartDrag){D.b4StartDrag(C,E);D.fireEvent("b4StartDragEvent",{x:C,y:E});}if(D&&D.events.startDrag){D.startDrag(C,E);D.fireEvent("startDragEvent",{x:C,y:E});}this.dragThreshMet=true;},handleMouseUp:function(C){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(C);}this.fromTimeout=false;this.fireEvents(C,true);}else{}this.stopDrag(C);this.stopEvent(C);}},stopEvent:function(C){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(C);}if(this.preventDefault){YAHOO.util.Event.preventDefault(C);}},stopDrag:function(E,D){var C=this.dragCurrent;if(C&&!D){if(this.dragThreshMet){if(C.events.b4EndDrag){C.b4EndDrag(E);C.fireEvent("b4EndDragEvent",{e:E});}if(C.events.endDrag){C.endDrag(E);C.fireEvent("endDragEvent",{e:E});}}if(C.events.mouseUp){C.onMouseUp(E);C.fireEvent("mouseUpEvent",{e:E});}}if(this._shimActive){this._deactivateShim();if(this.dragCurrent&&this.dragCurrent.useShim){this.useShim=this._shimState;this._shimState=false;}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(F){var C=this.dragCurrent;if(C){if(YAHOO.util.Event.isIE&&!F.button){this.stopEvent(F);return this.handleMouseUp(F);}else{if(F.clientX<0||F.clientY<0){}}if(!this.dragThreshMet){var E=Math.abs(this.startX-YAHOO.util.Event.getPageX(F));var D=Math.abs(this.startY-YAHOO.util.Event.getPageY(F));if(E>this.clickPixelThresh||D>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(C&&C.events.b4Drag){C.b4Drag(F);C.fireEvent("b4DragEvent",{e:F});}if(C&&C.events.drag){C.onDrag(F);C.fireEvent("dragEvent",{e:F});}if(C){this.fireEvents(F,false);}}this.stopEvent(F);}},fireEvents:function(V,L){var a=this.dragCurrent;if(!a||a.isLocked()||a.dragOnly){return;}var N=YAHOO.util.Event.getPageX(V),M=YAHOO.util.Event.getPageY(V),P=new YAHOO.util.Point(N,M),K=a.getTargetCoord(P.x,P.y),F=a.getDragEl(),E=["out","over","drop","enter"],U=new YAHOO.util.Region(K.y,K.x+F.offsetWidth,K.y+F.offsetHeight,K.x),I=[],D={},Q=[],c={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var S in this.dragOvers){var d=this.dragOvers[S];if(!this.isTypeOfDD(d)){continue;
}if(!this.isOverTarget(P,d,this.mode,U)){c.outEvts.push(d);}I[S]=true;delete this.dragOvers[S];}for(var R in a.groups){if("string"!=typeof R){continue;}for(S in this.ids[R]){var G=this.ids[R][S];if(!this.isTypeOfDD(G)){continue;}if(G.isTarget&&!G.isLocked()&&G!=a){if(this.isOverTarget(P,G,this.mode,U)){D[R]=true;if(L){c.dropEvts.push(G);}else{if(!I[G.id]){c.enterEvts.push(G);}else{c.overEvts.push(G);}this.dragOvers[G.id]=G;}}}}}this.interactionInfo={out:c.outEvts,enter:c.enterEvts,over:c.overEvts,drop:c.dropEvts,point:P,draggedRegion:U,sourceRegion:this.locationCache[a.id],validDrop:L};for(var C in D){Q.push(C);}if(L&&!c.dropEvts.length){this.interactionInfo.validDrop=false;if(a.events.invalidDrop){a.onInvalidDrop(V);a.fireEvent("invalidDropEvent",{e:V});}}for(S=0;S<E.length;S++){var Y=null;if(c[E[S]+"Evts"]){Y=c[E[S]+"Evts"];}if(Y&&Y.length){var H=E[S].charAt(0).toUpperCase()+E[S].substr(1),X="onDrag"+H,J="b4Drag"+H,O="drag"+H+"Event",W="drag"+H;if(this.mode){if(a.events[J]){a[J](V,Y,Q);a.fireEvent(J+"Event",{event:V,info:Y,group:Q});}if(a.events[W]){a[X](V,Y,Q);a.fireEvent(O,{event:V,info:Y,group:Q});}}else{for(var Z=0,T=Y.length;Z<T;++Z){if(a.events[J]){a[J](V,Y[Z].id,Q[0]);a.fireEvent(J+"Event",{event:V,info:Y[Z].id,group:Q[0]});}if(a.events[W]){a[X](V,Y[Z].id,Q[0]);a.fireEvent(O,{event:V,info:Y[Z].id,group:Q[0]});}}}}}},getBestMatch:function(E){var G=null;var D=E.length;if(D==1){G=E[0];}else{for(var F=0;F<D;++F){var C=E[F];if(this.mode==this.INTERSECT&&C.cursorIsOver){G=C;break;}else{if(!G||!G.overlap||(C.overlap&&G.overlap.getArea()<C.overlap.getArea())){G=C;}}}}return G;},refreshCache:function(D){var F=D||this.ids;for(var C in F){if("string"!=typeof C){continue;}for(var E in this.ids[C]){var G=this.ids[C][E];if(this.isTypeOfDD(G)){var H=this.getLocation(G);if(H){this.locationCache[G.id]=H;}else{delete this.locationCache[G.id];}}}}},verifyEl:function(D){try{if(D){var C=D.offsetParent;if(C){return true;}}}catch(E){}return false;},getLocation:function(H){if(!this.isTypeOfDD(H)){return null;}var F=H.getEl(),K,E,D,M,L,N,C,J,G;try{K=YAHOO.util.Dom.getXY(F);}catch(I){}if(!K){return null;}E=K[0];D=E+F.offsetWidth;M=K[1];L=M+F.offsetHeight;N=M-H.padding[0];C=D+H.padding[1];J=L+H.padding[2];G=E-H.padding[3];return new YAHOO.util.Region(N,C,J,G);},isOverTarget:function(K,C,E,F){var G=this.locationCache[C.id];if(!G||!this.useCache){G=this.getLocation(C);this.locationCache[C.id]=G;}if(!G){return false;}C.cursorIsOver=G.contains(K);var J=this.dragCurrent;if(!J||(!E&&!J.constrainX&&!J.constrainY)){return C.cursorIsOver;}C.overlap=null;if(!F){var H=J.getTargetCoord(K.x,K.y);var D=J.getDragEl();F=new YAHOO.util.Region(H.y,H.x+D.offsetWidth,H.y+D.offsetHeight,H.x);}var I=F.intersect(G);if(I){C.overlap=I;return(E)?true:C.cursorIsOver;}else{return false;}},_onUnload:function(D,C){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(D){var C=this.elementCache[D];if(!C||!C.el){C=this.elementCache[D]=new this.ElementWrapper(YAHOO.util.Dom.get(D));}return C;},getElement:function(C){return YAHOO.util.Dom.get(C);},getCss:function(D){var C=YAHOO.util.Dom.get(D);return(C)?C.style:null;},ElementWrapper:function(C){this.el=C||null;this.id=this.el&&C.id;this.css=this.el&&C.style;},getPosX:function(C){return YAHOO.util.Dom.getX(C);},getPosY:function(C){return YAHOO.util.Dom.getY(C);},swapNode:function(E,C){if(E.swapNode){E.swapNode(C);}else{var F=C.parentNode;var D=C.nextSibling;if(D==E){F.insertBefore(E,C);}else{if(C==E.nextSibling){F.insertBefore(C,E);}else{E.parentNode.replaceChild(C,E);F.insertBefore(E,D);}}}},getScroll:function(){var E,C,F=document.documentElement,D=document.body;if(F&&(F.scrollTop||F.scrollLeft)){E=F.scrollTop;C=F.scrollLeft;}else{if(D){E=D.scrollTop;C=D.scrollLeft;}else{}}return{top:E,left:C};},getStyle:function(D,C){return YAHOO.util.Dom.getStyle(D,C);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(C,E){var D=YAHOO.util.Dom.getXY(E);YAHOO.util.Dom.setXY(C,D);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(D,C){return(D-C);},_timeoutCount:0,_addListeners:function(){var C=YAHOO.util.DDM;if(YAHOO.util.Event&&document){C._onLoad();}else{if(C._timeoutCount>2000){}else{setTimeout(C._addListeners,10);if(document&&document.body){C._timeoutCount+=1;}}}},handleWasClicked:function(C,E){if(this.isHandle(E,C.id)){return true;}else{var D=C.parentNode;while(D){if(this.isHandle(E,D.id)){return true;}else{D=D.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);
}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(J,I){var D=J.which||J.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(J),F=true;if(this.events.b4MouseDown){F=this.fireEvent("b4MouseDownEvent",J);}var E=this.onMouseDown(J),H=true;if(this.events.mouseDown){H=this.fireEvent("mouseDownEvent",J);}if((C===false)||(E===false)||(F===false)||(H===false)){return;}this.DDM.refreshCache(this.groups);var G=new YAHOO.util.Point(A.getPageX(J),A.getPageY(J));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(G,this)){}else{if(this.clickValidator(J)){this.setStartPosition();this.DDM.handleMouseDown(J,this);this.DDM.stopEvent(J);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);
}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var F=this.getDragEl(),E=YAHOO.util.Dom;if(!F){F=document.createElement("div");F.id=this.dragElId;var D=F.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");F.appendChild(C);A.insertBefore(F,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.7.0",build:"1796"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,setter:null,getter:null,validator:null,getValue:function(){var A=this.value;if(this.getter){A=this.getter.call(this.owner,this.name);}return A;},setValue:function(F,B){var E,A=this.owner,C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.setter){F=this.setter.call(A,F,this.name);if(F===undefined){}}if(this.method){this.method.call(A,F,this.name);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};if(C){this._written=false;}this._initialConfig=this._initialConfig||{};for(var A in B){if(B.hasOwnProperty(A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig,true);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B||!this._configs.hasOwnProperty(C)){return null;}return B.getValue();},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var C=[],B;for(B in this._configs){if(A.hasOwnProperty(this._configs,B)&&!A.isUndefined(this._configs[B])){C[C.length]=B;}}return C;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs||{};var F=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(F.hasOwnProperty(E[D])){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var B=YAHOO.util.Dom,C=YAHOO.util.AttributeProvider;var A=function(D,E){this.init.apply(this,arguments);};A.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true,"change":true};A.prototype={DOM_EVENTS:null,DEFAULT_HTML_SETTER:function(F,D){var E=this.get("element");if(E){E[D]=F;}},DEFAULT_HTML_GETTER:function(D){var E=this.get("element"),F;if(E){F=E[D];}return F;},appendChild:function(D){D=D.get?D.get("element"):D;return this.get("element").appendChild(D);},getElementsByTagName:function(D){return this.get("element").getElementsByTagName(D);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(D,E){D=D.get?D.get("element"):D;E=(E&&E.get)?E.get("element"):E;return this.get("element").insertBefore(D,E);},removeChild:function(D){D=D.get?D.get("element"):D;return this.get("element").removeChild(D);},replaceChild:function(D,E){D=D.get?D.get("element"):D;E=E.get?E.get("element"):E;return this.get("element").replaceChild(D,E);},initAttributes:function(D){},addListener:function(H,G,I,F){var E=this.get("element")||this.get("id");F=F||this;var D=this;if(!this._events[H]){if(E&&this.DOM_EVENTS[H]){YAHOO.util.Event.addListener(E,H,function(J){if(J.srcElement&&!J.target){J.target=J.srcElement;}D.fireEvent(H,J);},I,F);}this.createEvent(H,this);}return YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){return this.addListener.apply(this,arguments);},subscribe:function(){return this.addListener.apply(this,arguments);},removeListener:function(E,D){return this.unsubscribe.apply(this,arguments);},addClass:function(D){B.addClass(this.get("element"),D);},getElementsByClassName:function(E,D){return B.getElementsByClassName(E,D,this.get("element"));},hasClass:function(D){return B.hasClass(this.get("element"),D);},removeClass:function(D){return B.removeClass(this.get("element"),D);},replaceClass:function(E,D){return B.replaceClass(this.get("element"),E,D);},setStyle:function(E,D){return B.setStyle(this.get("element"),E,D);},getStyle:function(D){return B.getStyle(this.get("element"),D);},fireQueue:function(){var E=this._queue;for(var F=0,D=E.length;F<D;++F){this[E[F][0]].apply(this,E[F][1]);}},appendTo:function(E,F){E=(E.get)?E.get("element"):B.get(E);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:E});
F=(F&&F.get)?F.get("element"):B.get(F);var D=this.get("element");if(!D){return false;}if(!E){return false;}if(D.parent!=E){if(F){E.insertBefore(D,F);}else{E.appendChild(D);}}this.fireEvent("appendTo",{type:"appendTo",target:E});return D;},get:function(D){var F=this._configs||{},E=F.element;if(E&&!F[D]&&!YAHOO.lang.isUndefined(E.value[D])){this._setHTMLAttrConfig(D);}return C.prototype.get.call(this,D);},setAttributes:function(J,G){var E={},H=this._configOrder;for(var I=0,D=H.length;I<D;++I){if(J[H[I]]!==undefined){E[H[I]]=true;this.set(H[I],J[H[I]],G);}}for(var F in J){if(J.hasOwnProperty(F)&&!E[F]){this.set(F,J[F],G);}}},set:function(E,G,D){var F=this.get("element");if(!F){this._queue[this._queue.length]=["set",arguments];if(this._configs[E]){this._configs[E].value=G;}return;}if(!this._configs[E]&&!YAHOO.lang.isUndefined(F[E])){this._setHTMLAttrConfig(E);}return C.prototype.set.apply(this,arguments);},setAttributeConfig:function(D,E,F){this._configOrder.push(D);C.prototype.setAttributeConfig.apply(this,arguments);},createEvent:function(E,D){this._events[E]=true;return C.prototype.createEvent.apply(this,arguments);},init:function(E,D){this._initElement(E,D);},destroy:function(){var D=this.get("element");YAHOO.util.Event.purgeElement(D,true);this.unsubscribeAll();if(D&&D.parentNode){D.parentNode.removeChild(D);}this._queue=[];this._events={};this._configs={};this._configOrder=[];},_initElement:function(F,E){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];E=E||{};E.element=E.element||F||null;var H=false;var D=A.DOM_EVENTS;this.DOM_EVENTS=this.DOM_EVENTS||{};for(var G in D){if(D.hasOwnProperty(G)){this.DOM_EVENTS[G]=D[G];}}if(typeof E.element==="string"){this._setHTMLAttrConfig("id",{value:E.element});}if(B.get(E.element)){H=true;this._initHTMLElement(E);this._initContent(E);}YAHOO.util.Event.onAvailable(E.element,function(){if(!H){this._initHTMLElement(E);}this.fireEvent("available",{type:"available",target:B.get(E.element)});},this,true);YAHOO.util.Event.onContentReady(E.element,function(){if(!H){this._initContent(E);}this.fireEvent("contentReady",{type:"contentReady",target:B.get(E.element)});},this,true);},_initHTMLElement:function(D){this.setAttributeConfig("element",{value:B.get(D.element),readOnly:true});},_initContent:function(D){this.initAttributes(D);this.setAttributes(D,true);this.fireQueue();},_setHTMLAttrConfig:function(D,F){var E=this.get("element");F=F||{};F.name=D;F.setter=F.setter||this.DEFAULT_HTML_SETTER;F.getter=F.getter||this.DEFAULT_HTML_GETTER;F.value=F.value||E[D];this._configs[D]=new YAHOO.util.Attribute(F,this);}};YAHOO.augment(A,C);YAHOO.util.Element=A;})();YAHOO.register("element",YAHOO.util.Element,{version:"2.7.0",build:"1796"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
(function(){var lang=YAHOO.lang,util=YAHOO.util,Ev=util.Event;util.DataSourceBase=function(oLiveData,oConfigs){if(oLiveData===null||oLiveData===undefined){return;}this.liveData=oLiveData;this._oQueue={interval:null,conn:null,requests:[]};this.responseSchema={};if(oConfigs&&(oConfigs.constructor==Object)){for(var sConfig in oConfigs){if(sConfig){this[sConfig]=oConfigs[sConfig];}}}var maxCacheEntries=this.maxCacheEntries;if(!lang.isNumber(maxCacheEntries)||(maxCacheEntries<0)){maxCacheEntries=0;}this._aIntervals=[];this.createEvent("cacheRequestEvent");this.createEvent("cacheResponseEvent");this.createEvent("requestEvent");this.createEvent("responseEvent");this.createEvent("responseParseEvent");this.createEvent("responseCacheEvent");this.createEvent("dataErrorEvent");this.createEvent("cacheFlushEvent");var DS=util.DataSourceBase;this._sName="DataSource instance"+DS._nIndex;DS._nIndex++;};var DS=util.DataSourceBase;lang.augmentObject(DS,{TYPE_UNKNOWN:-1,TYPE_JSARRAY:0,TYPE_JSFUNCTION:1,TYPE_XHR:2,TYPE_JSON:3,TYPE_XML:4,TYPE_TEXT:5,TYPE_HTMLTABLE:6,TYPE_SCRIPTNODE:7,TYPE_LOCAL:8,ERROR_DATAINVALID:"Invalid data",ERROR_DATANULL:"Null data",_nIndex:0,_nTransactionId:0,issueCallback:function(callback,params,error,scope){if(lang.isFunction(callback)){callback.apply(scope,params);}else{if(lang.isObject(callback)){scope=callback.scope||scope||window;var callbackFunc=callback.success;if(error){callbackFunc=callback.failure;}if(callbackFunc){callbackFunc.apply(scope,params.concat([callback.argument]));}}}},parseString:function(oData){if(!lang.isValue(oData)){return null;}var string=oData+"";if(lang.isString(string)){return string;}else{return null;}},parseNumber:function(oData){if(!lang.isValue(oData)||(oData==="")){return null;}var number=oData*1;if(lang.isNumber(number)){return number;}else{return null;}},convertNumber:function(oData){return DS.parseNumber(oData);},parseDate:function(oData){var date=null;if(!(oData instanceof Date)){date=new Date(oData);}else{return oData;}if(date instanceof Date){return date;}else{return null;}},convertDate:function(oData){return DS.parseDate(oData);}});DS.Parser={string:DS.parseString,number:DS.parseNumber,date:DS.parseDate};DS.prototype={_sName:null,_aCache:null,_oQueue:null,_aIntervals:null,maxCacheEntries:0,liveData:null,dataType:DS.TYPE_UNKNOWN,responseType:DS.TYPE_UNKNOWN,responseSchema:null,toString:function(){return this._sName;},getCachedResponse:function(oRequest,oCallback,oCaller){var aCache=this._aCache;if(this.maxCacheEntries>0){if(!aCache){this._aCache=[];}else{var nCacheLength=aCache.length;if(nCacheLength>0){var oResponse=null;this.fireEvent("cacheRequestEvent",{request:oRequest,callback:oCallback,caller:oCaller});for(var i=nCacheLength-1;i>=0;i--){var oCacheElem=aCache[i];if(this.isCacheHit(oRequest,oCacheElem.request)){oResponse=oCacheElem.response;this.fireEvent("cacheResponseEvent",{request:oRequest,response:oResponse,callback:oCallback,caller:oCaller});if(i<nCacheLength-1){aCache.splice(i,1);this.addToCache(oRequest,oResponse);}oResponse.cached=true;break;}}return oResponse;}}}else{if(aCache){this._aCache=null;}}return null;},isCacheHit:function(oRequest,oCachedRequest){return(oRequest===oCachedRequest);},addToCache:function(oRequest,oResponse){var aCache=this._aCache;if(!aCache){return;}while(aCache.length>=this.maxCacheEntries){aCache.shift();}var oCacheElem={request:oRequest,response:oResponse};aCache[aCache.length]=oCacheElem;this.fireEvent("responseCacheEvent",{request:oRequest,response:oResponse});},flushCache:function(){if(this._aCache){this._aCache=[];this.fireEvent("cacheFlushEvent");}},setInterval:function(nMsec,oRequest,oCallback,oCaller){if(lang.isNumber(nMsec)&&(nMsec>=0)){var oSelf=this;var nId=setInterval(function(){oSelf.makeConnection(oRequest,oCallback,oCaller);},nMsec);this._aIntervals.push(nId);return nId;}else{}},clearInterval:function(nId){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){if(tracker[i]===nId){tracker.splice(i,1);clearInterval(nId);}}},clearAllIntervals:function(){var tracker=this._aIntervals||[];for(var i=tracker.length-1;i>-1;i--){clearInterval(tracker[i]);}tracker=[];},sendRequest:function(oRequest,oCallback,oCaller){var oCachedResponse=this.getCachedResponse(oRequest,oCallback,oCaller);if(oCachedResponse){DS.issueCallback(oCallback,[oRequest,oCachedResponse],false,oCaller);return null;}return this.makeConnection(oRequest,oCallback,oCaller);},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=this.liveData;this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;},handleResponse:function(oRequest,oRawResponse,oCallback,oCaller,tId){this.fireEvent("responseEvent",{tId:tId,request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller});var xhr=(this.dataType==DS.TYPE_XHR)?true:false;var oParsedResponse=null;var oFullResponse=oRawResponse;if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oRawResponse&&oRawResponse.getResponseHeader)?oRawResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}else{if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}}switch(this.responseType){case DS.TYPE_JSARRAY:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);
if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var arrayEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,arrayEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e1){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseArrayData(oRequest,oFullResponse);break;case DS.TYPE_JSON:if(xhr&&oRawResponse&&oRawResponse.responseText){oFullResponse=oRawResponse.responseText;}try{if(lang.isString(oFullResponse)){var parseArgs=[oFullResponse].concat(this.parseJSONArgs);if(lang.JSON){oFullResponse=lang.JSON.parse.apply(lang.JSON,parseArgs);}else{if(window.JSON&&JSON.parse){oFullResponse=JSON.parse.apply(JSON,parseArgs);}else{if(oFullResponse.parseJSON){oFullResponse=oFullResponse.parseJSON.apply(oFullResponse,parseArgs.slice(1));}else{while(oFullResponse.length>0&&(oFullResponse.charAt(0)!="{")&&(oFullResponse.charAt(0)!="[")){oFullResponse=oFullResponse.substring(1,oFullResponse.length);}if(oFullResponse.length>0){var objEnd=Math.max(oFullResponse.lastIndexOf("]"),oFullResponse.lastIndexOf("}"));oFullResponse=oFullResponse.substring(0,objEnd+1);oFullResponse=eval("("+oFullResponse+")");}}}}}}catch(e){}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseJSONData(oRequest,oFullResponse);break;case DS.TYPE_HTMLTABLE:if(xhr&&oRawResponse.responseText){var el=document.createElement("div");el.innerHTML=oRawResponse.responseText;oFullResponse=el.getElementsByTagName("table")[0];}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseHTMLTableData(oRequest,oFullResponse);break;case DS.TYPE_XML:if(xhr&&oRawResponse.responseXML){oFullResponse=oRawResponse.responseXML;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseXMLData(oRequest,oFullResponse);break;case DS.TYPE_TEXT:if(xhr&&lang.isString(oRawResponse.responseText)){oFullResponse=oRawResponse.responseText;}oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseTextData(oRequest,oFullResponse);break;default:oFullResponse=this.doBeforeParseData(oRequest,oFullResponse,oCallback);oParsedResponse=this.parseData(oRequest,oFullResponse);break;}oParsedResponse=oParsedResponse||{};if(!oParsedResponse.results){oParsedResponse.results=[];}if(!oParsedResponse.meta){oParsedResponse.meta={};}if(oParsedResponse&&!oParsedResponse.error){oParsedResponse=this.doBeforeCallback(oRequest,oFullResponse,oParsedResponse,oCallback);this.fireEvent("responseParseEvent",{request:oRequest,response:oParsedResponse,callback:oCallback,caller:oCaller});this.addToCache(oRequest,oParsedResponse);}else{oParsedResponse.error=true;this.fireEvent("dataErrorEvent",{request:oRequest,response:oRawResponse,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});}oParsedResponse.tId=tId;DS.issueCallback(oCallback,[oRequest,oParsedResponse],oParsedResponse.error,oCaller);},doBeforeParseData:function(oRequest,oFullResponse,oCallback){return oFullResponse;},doBeforeCallback:function(oRequest,oFullResponse,oParsedResponse,oCallback){return oParsedResponse;},parseData:function(oRequest,oFullResponse){if(lang.isValue(oFullResponse)){var oParsedResponse={results:oFullResponse,meta:{}};return oParsedResponse;}return null;},parseArrayData:function(oRequest,oFullResponse){if(lang.isArray(oFullResponse)){var results=[],i,j,rec,field,data;if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(i=fields.length-1;i>=0;--i){if(typeof fields[i]!=="object"){fields[i]={key:fields[i]};}}var parsers={},p;for(i=fields.length-1;i>=0;--i){p=(typeof fields[i].parser==="function"?fields[i].parser:DS.Parser[fields[i].parser+""])||fields[i].converter;if(p){parsers[fields[i].key]=p;}}var arrType=lang.isArray(oFullResponse[0]);for(i=oFullResponse.length-1;i>-1;i--){var oResult={};rec=oFullResponse[i];if(typeof rec==="object"){for(j=fields.length-1;j>-1;j--){field=fields[j];data=arrType?rec[j]:rec[field.key];if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}else{if(lang.isString(rec)){for(j=fields.length-1;j>-1;j--){field=fields[j];data=rec;if(parsers[field.key]){data=parsers[field.key].call(this,data);}if(data===undefined){data=null;}oResult[field.key]=data;}}}results[i]=oResult;}}else{results=oFullResponse;}var oParsedResponse={results:results};return oParsedResponse;}return null;},parseTextData:function(oRequest,oFullResponse){if(lang.isString(oFullResponse)){if(lang.isString(this.responseSchema.recordDelim)&&lang.isString(this.responseSchema.fieldDelim)){var oParsedResponse={results:[]};var recDelim=this.responseSchema.recordDelim;var fieldDelim=this.responseSchema.fieldDelim;if(oFullResponse.length>0){var newLength=oFullResponse.length-recDelim.length;if(oFullResponse.substr(newLength)==recDelim){oFullResponse=oFullResponse.substr(0,newLength);}if(oFullResponse.length>0){var recordsarray=oFullResponse.split(recDelim);for(var i=0,len=recordsarray.length,recIdx=0;i<len;++i){var bError=false,sRecord=recordsarray[i];if(lang.isString(sRecord)&&(sRecord.length>0)){var fielddataarray=recordsarray[i].split(fieldDelim);var oResult={};if(lang.isArray(this.responseSchema.fields)){var fields=this.responseSchema.fields;for(var j=fields.length-1;j>-1;j--){try{var data=fielddataarray[j];if(lang.isString(data)){if(data.charAt(0)=='"'){data=data.substr(1);}if(data.charAt(data.length-1)=='"'){data=data.substr(0,data.length-1);}var field=fields[j];
var key=(lang.isValue(field.key))?field.key:field;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}else{bError=true;}}catch(e){bError=true;}}}else{oResult=fielddataarray;}if(!bError){oParsedResponse.results[recIdx++]=oResult;}}}}}return oParsedResponse;}}return null;},parseXMLResult:function(result){var oResult={},schema=this.responseSchema;try{for(var m=schema.fields.length-1;m>=0;m--){var field=schema.fields[m];var key=(lang.isValue(field.key))?field.key:field;var data=null;var xmlAttr=result.attributes.getNamedItem(key);if(xmlAttr){data=xmlAttr.value;}else{var xmlNode=result.getElementsByTagName(key);if(xmlNode&&xmlNode.item(0)){var item=xmlNode.item(0);data=(item)?((item.text)?item.text:(item.textContent)?item.textContent:null):null;if(!data){var datapieces=[];for(var j=0,len=item.childNodes.length;j<len;j++){if(item.childNodes[j].nodeValue){datapieces[datapieces.length]=item.childNodes[j].nodeValue;}}if(datapieces.length>0){data=datapieces.join("");}}}}if(data===null){data="";}if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}}catch(e){}return oResult;},parseXMLData:function(oRequest,oFullResponse){var bError=false,schema=this.responseSchema,oParsedResponse={meta:{}},xmlList=null,metaNode=schema.metaNode,metaLocators=schema.metaFields||{},i,k,loc,v;try{xmlList=(schema.resultNode)?oFullResponse.getElementsByTagName(schema.resultNode):null;metaNode=metaNode?oFullResponse.getElementsByTagName(metaNode)[0]:oFullResponse;if(metaNode){for(k in metaLocators){if(lang.hasOwnProperty(metaLocators,k)){loc=metaLocators[k];v=metaNode.getElementsByTagName(loc)[0];if(v){v=v.firstChild.nodeValue;}else{v=metaNode.attributes.getNamedItem(loc);if(v){v=v.value;}}if(lang.isValue(v)){oParsedResponse.meta[k]=v;}}}}}catch(e){}if(!xmlList||!lang.isArray(schema.fields)){bError=true;}else{oParsedResponse.results=[];for(i=xmlList.length-1;i>=0;--i){var oResult=this.parseXMLResult(xmlList.item(i));oParsedResponse.results[i]=oResult;}}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;},parseJSONData:function(oRequest,oFullResponse){var oParsedResponse={results:[],meta:{}};if(lang.isObject(oFullResponse)&&this.responseSchema.resultsList){var schema=this.responseSchema,fields=schema.fields,resultsList=oFullResponse,results=[],metaFields=schema.metaFields||{},fieldParsers=[],fieldPaths=[],simpleFields=[],bError=false,i,len,j,v,key,parser,path;var buildPath=function(needle){var path=null,keys=[],i=0;if(needle){needle=needle.replace(/\[(['"])(.*?)\1\]/g,function(x,$1,$2){keys[i]=$2;return".@"+(i++);}).replace(/\[(\d+)\]/g,function(x,$1){keys[i]=parseInt($1,10)|0;return".@"+(i++);}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(needle)){path=needle.split(".");for(i=path.length-1;i>=0;--i){if(path[i].charAt(0)==="@"){path[i]=keys[parseInt(path[i].substr(1),10)];}}}else{}}return path;};var walkPath=function(path,origin){var v=origin,i=0,len=path.length;for(;i<len&&v;++i){v=v[path[i]];}return v;};path=buildPath(schema.resultsList);if(path){resultsList=walkPath(path,oFullResponse);if(resultsList===undefined){bError=true;}}else{bError=true;}if(!resultsList){resultsList=[];}if(!lang.isArray(resultsList)){resultsList=[resultsList];}if(!bError){if(schema.fields){var field;for(i=0,len=fields.length;i<len;i++){field=fields[i];key=field.key||field;parser=((typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""])||field.converter;path=buildPath(key);if(parser){fieldParsers[fieldParsers.length]={key:key,parser:parser};}if(path){if(path.length>1){fieldPaths[fieldPaths.length]={key:key,path:path};}else{simpleFields[simpleFields.length]={key:key,path:path[0]};}}else{}}for(i=resultsList.length-1;i>=0;--i){var r=resultsList[i],rec={};if(r){for(j=simpleFields.length-1;j>=0;--j){rec[simpleFields[j].key]=(r[simpleFields[j].path]!==undefined)?r[simpleFields[j].path]:r[j];}for(j=fieldPaths.length-1;j>=0;--j){rec[fieldPaths[j].key]=walkPath(fieldPaths[j].path,r);}for(j=fieldParsers.length-1;j>=0;--j){var p=fieldParsers[j].key;rec[p]=fieldParsers[j].parser(rec[p]);if(rec[p]===undefined){rec[p]=null;}}}results[i]=rec;}}else{results=resultsList;}for(key in metaFields){if(lang.hasOwnProperty(metaFields,key)){path=buildPath(metaFields[key]);if(path){v=walkPath(path,oFullResponse);oParsedResponse.meta[key]=v;}}}}else{oParsedResponse.error=true;}oParsedResponse.results=results;}else{oParsedResponse.error=true;}return oParsedResponse;},parseHTMLTableData:function(oRequest,oFullResponse){var bError=false;var elTable=oFullResponse;var fields=this.responseSchema.fields;var oParsedResponse={results:[]};if(lang.isArray(fields)){for(var i=0;i<elTable.tBodies.length;i++){var elTbody=elTable.tBodies[i];for(var j=elTbody.rows.length-1;j>-1;j--){var elRow=elTbody.rows[j];var oResult={};for(var k=fields.length-1;k>-1;k--){var field=fields[k];var key=(lang.isValue(field.key))?field.key:field;var data=elRow.cells[k].innerHTML;if(!field.parser&&field.converter){field.parser=field.converter;}var parser=(typeof field.parser==="function")?field.parser:DS.Parser[field.parser+""];if(parser){data=parser.call(this,data);}if(data===undefined){data=null;}oResult[key]=data;}oParsedResponse.results[j]=oResult;}}}else{bError=true;}if(bError){oParsedResponse.error=true;}else{}return oParsedResponse;}};lang.augmentProto(DS,util.EventProvider);util.LocalDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_LOCAL;if(oLiveData){if(YAHOO.lang.isArray(oLiveData)){this.responseType=DS.TYPE_JSARRAY;}else{if(oLiveData.nodeType&&oLiveData.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oLiveData.nodeName&&(oLiveData.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;
oLiveData=oLiveData.cloneNode(true);}else{if(YAHOO.lang.isString(oLiveData)){this.responseType=DS.TYPE_TEXT;}else{if(YAHOO.lang.isObject(oLiveData)){this.responseType=DS.TYPE_JSON;}}}}}}else{oLiveData=[];this.responseType=DS.TYPE_JSARRAY;}util.LocalDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.LocalDataSource,DS);lang.augmentObject(util.LocalDataSource,DS);util.FunctionDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_JSFUNCTION;oLiveData=oLiveData||function(){};util.FunctionDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.FunctionDataSource,DS,{scope:null,makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oRawResponse=(this.scope)?this.liveData.call(this.scope,oRequest,this):this.liveData(oRequest);if(this.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){this.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse&&oRawResponse.nodeType&&oRawResponse.nodeType==9){this.responseType=DS.TYPE_XML;}else{if(oRawResponse&&oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){this.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){this.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){this.responseType=DS.TYPE_TEXT;}}}}}}this.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);return tId;}});lang.augmentObject(util.FunctionDataSource,DS);util.ScriptNodeDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_SCRIPTNODE;oLiveData=oLiveData||"";util.ScriptNodeDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.ScriptNodeDataSource,DS,{getUtility:util.Get,asyncMode:"allowAll",scriptCallbackParam:"callback",generateRequestCallback:function(id){return"&"+this.scriptCallbackParam+"=YAHOO.util.ScriptNodeDataSource.callbacks["+id+"]";},doBeforeGetScriptNode:function(sUri){return sUri;},makeConnection:function(oRequest,oCallback,oCaller){var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});if(util.ScriptNodeDataSource._nPending===0){util.ScriptNodeDataSource.callbacks=[];util.ScriptNodeDataSource._nId=0;}var id=util.ScriptNodeDataSource._nId;util.ScriptNodeDataSource._nId++;var oSelf=this;util.ScriptNodeDataSource.callbacks[id]=function(oRawResponse){if((oSelf.asyncMode!=="ignoreStaleResponses")||(id===util.ScriptNodeDataSource.callbacks.length-1)){if(oSelf.responseType===DS.TYPE_UNKNOWN){if(YAHOO.lang.isArray(oRawResponse)){oSelf.responseType=DS.TYPE_JSARRAY;}else{if(oRawResponse.nodeType&&oRawResponse.nodeType==9){oSelf.responseType=DS.TYPE_XML;}else{if(oRawResponse.nodeName&&(oRawResponse.nodeName.toLowerCase()=="table")){oSelf.responseType=DS.TYPE_HTMLTABLE;}else{if(YAHOO.lang.isObject(oRawResponse)){oSelf.responseType=DS.TYPE_JSON;}else{if(YAHOO.lang.isString(oRawResponse)){oSelf.responseType=DS.TYPE_TEXT;}}}}}}oSelf.handleResponse(oRequest,oRawResponse,oCallback,oCaller,tId);}else{}delete util.ScriptNodeDataSource.callbacks[id];};util.ScriptNodeDataSource._nPending++;var sUri=this.liveData+oRequest+this.generateRequestCallback(id);sUri=this.doBeforeGetScriptNode(sUri);this.getUtility.script(sUri,{autopurge:true,onsuccess:util.ScriptNodeDataSource._bumpPendingDown,onfail:util.ScriptNodeDataSource._bumpPendingDown});return tId;}});lang.augmentObject(util.ScriptNodeDataSource,DS);lang.augmentObject(util.ScriptNodeDataSource,{_nId:0,_nPending:0,callbacks:[]});util.XHRDataSource=function(oLiveData,oConfigs){this.dataType=DS.TYPE_XHR;this.connMgr=this.connMgr||util.Connect;oLiveData=oLiveData||"";util.XHRDataSource.superclass.constructor.call(this,oLiveData,oConfigs);};lang.extend(util.XHRDataSource,DS,{connMgr:null,connXhrMode:"allowAll",connMethodPost:false,connTimeout:0,makeConnection:function(oRequest,oCallback,oCaller){var oRawResponse=null;var tId=DS._nTransactionId++;this.fireEvent("requestEvent",{tId:tId,request:oRequest,callback:oCallback,caller:oCaller});var oSelf=this;var oConnMgr=this.connMgr;var oQueue=this._oQueue;var _xhrSuccess=function(oResponse){if(oResponse&&(this.connXhrMode=="ignoreStaleResponses")&&(oResponse.tId!=oQueue.conn.tId)){return null;}else{if(!oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:DS.ERROR_DATANULL});DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);return null;}else{if(this.responseType===DS.TYPE_UNKNOWN){var ctype=(oResponse.getResponseHeader)?oResponse.getResponseHeader["Content-Type"]:null;if(ctype){if(ctype.indexOf("text/xml")>-1){this.responseType=DS.TYPE_XML;}else{if(ctype.indexOf("application/json")>-1){this.responseType=DS.TYPE_JSON;}else{if(ctype.indexOf("text/plain")>-1){this.responseType=DS.TYPE_TEXT;}}}}}this.handleResponse(oRequest,oResponse,oCallback,oCaller,tId);}}};var _xhrFailure=function(oResponse){this.fireEvent("dataErrorEvent",{request:oRequest,callback:oCallback,caller:oCaller,message:DS.ERROR_DATAINVALID});if(lang.isString(this.liveData)&&lang.isString(oRequest)&&(this.liveData.lastIndexOf("?")!==this.liveData.length-1)&&(oRequest.indexOf("?")!==0)){}oResponse=oResponse||{};oResponse.error=true;DS.issueCallback(oCallback,[oRequest,oResponse],true,oCaller);return null;};var _xhrCallback={success:_xhrSuccess,failure:_xhrFailure,scope:this};if(lang.isNumber(this.connTimeout)){_xhrCallback.timeout=this.connTimeout;}if(this.connXhrMode=="cancelStaleRequests"){if(oQueue.conn){if(oConnMgr.abort){oConnMgr.abort(oQueue.conn);oQueue.conn=null;}else{}}}if(oConnMgr&&oConnMgr.asyncRequest){var sLiveData=this.liveData;var isPost=this.connMethodPost;var sMethod=(isPost)?"POST":"GET";var sUri=(isPost||!lang.isValue(oRequest))?sLiveData:sLiveData+oRequest;var sRequest=(isPost)?oRequest:null;if(this.connXhrMode!="queueRequests"){oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}else{if(oQueue.conn){var allRequests=oQueue.requests;
allRequests.push({request:oRequest,callback:_xhrCallback});if(!oQueue.interval){oQueue.interval=setInterval(function(){if(oConnMgr.isCallInProgress(oQueue.conn)){return;}else{if(allRequests.length>0){sUri=(isPost||!lang.isValue(allRequests[0].request))?sLiveData:sLiveData+allRequests[0].request;sRequest=(isPost)?allRequests[0].request:null;oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,allRequests[0].callback,sRequest);allRequests.shift();}else{clearInterval(oQueue.interval);oQueue.interval=null;}}},50);}}else{oQueue.conn=oConnMgr.asyncRequest(sMethod,sUri,_xhrCallback,sRequest);}}}else{DS.issueCallback(oCallback,[oRequest,{error:true}],true,oCaller);}return tId;}});lang.augmentObject(util.XHRDataSource,DS);util.DataSource=function(oLiveData,oConfigs){oConfigs=oConfigs||{};var dataType=oConfigs.dataType;if(dataType){if(dataType==DS.TYPE_LOCAL){lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_XHR){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_SCRIPTNODE){lang.augmentObject(util.DataSource,util.ScriptNodeDataSource);return new util.ScriptNodeDataSource(oLiveData,oConfigs);}else{if(dataType==DS.TYPE_JSFUNCTION){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}}}}}if(YAHOO.lang.isString(oLiveData)){lang.augmentObject(util.DataSource,util.XHRDataSource);return new util.XHRDataSource(oLiveData,oConfigs);}else{if(YAHOO.lang.isFunction(oLiveData)){lang.augmentObject(util.DataSource,util.FunctionDataSource);return new util.FunctionDataSource(oLiveData,oConfigs);}else{lang.augmentObject(util.DataSource,util.LocalDataSource);return new util.LocalDataSource(oLiveData,oConfigs);}}};lang.augmentObject(util.DataSource,DS);})();YAHOO.util.Number={format:function(C,G){var B=YAHOO.lang;if(!B.isValue(C)||(C==="")){return"";}G=G||{};if(!B.isNumber(C)){C*=1;}if(B.isNumber(C)){var E=(C<0);var K=C+"";var H=(G.decimalSeparator)?G.decimalSeparator:".";var I;if(B.isNumber(G.decimalPlaces)){var J=G.decimalPlaces;var D=Math.pow(10,J);K=Math.round(C*D)/D+"";I=K.lastIndexOf(".");if(J>0){if(I<0){K+=H;I=K.length-1;}else{if(H!=="."){K=K.replace(".",H);}}while((K.length-1-I)<J){K+="0";}}}if(G.thousandsSeparator){var M=G.thousandsSeparator;I=K.lastIndexOf(H);I=(I>-1)?I:K.length;var L=K.substring(I);var A=-1;for(var F=I;F>0;F--){A++;if((A%3===0)&&(F!==I)&&(!E||(F>1))){L=M+L;}L=K.charAt(F-1)+L;}K=L;}K=(G.prefix)?G.prefix+K:K;K=(G.suffix)?K+G.suffix:K;return K;}else{return C;}}};(function(){var A=function(C,E,D){if(typeof D==="undefined"){D=10;}for(;parseInt(C,10)<D&&D>1;D/=10){C=E.toString()+C;}return C.toString();};var B={formats:{a:function(D,C){return C.a[D.getDay()];},A:function(D,C){return C.A[D.getDay()];},b:function(D,C){return C.b[D.getMonth()];},B:function(D,C){return C.B[D.getMonth()];},C:function(C){return A(parseInt(C.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(C){return A(parseInt(B.formats.G(C)%100,10),0);},G:function(E){var F=E.getFullYear();var D=parseInt(B.formats.V(E),10);var C=parseInt(B.formats.W(E),10);if(C>D){F++;}else{if(C===0&&D>=52){F--;}}return F;},H:["getHours","0"],I:function(D){var C=D.getHours()%12;return A(C===0?12:C,0);},j:function(G){var F=new Date(""+G.getFullYear()+"/1/1 GMT");var D=new Date(""+G.getFullYear()+"/"+(G.getMonth()+1)+"/"+G.getDate()+" GMT");var C=D-F;var E=parseInt(C/60000/60/24,10)+1;return A(E,0,100);},k:["getHours"," "],l:function(D){var C=D.getHours()%12;return A(C===0?12:C," ");},m:function(C){return A(C.getMonth()+1,0);},M:["getMinutes","0"],p:function(D,C){return C.p[D.getHours()>=12?1:0];},P:function(D,C){return C.P[D.getHours()>=12?1:0];},s:function(D,C){return parseInt(D.getTime()/1000,10);},S:["getSeconds","0"],u:function(C){var D=C.getDay();return D===0?7:D;},U:function(F){var C=parseInt(B.formats.j(F),10);var E=6-F.getDay();var D=parseInt((C+E)/7,10);return A(D,0);},V:function(F){var E=parseInt(B.formats.W(F),10);var C=(new Date(""+F.getFullYear()+"/1/1")).getDay();var D=E+(C>4||C<=1?0:1);if(D===53&&(new Date(""+F.getFullYear()+"/12/31")).getDay()<4){D=1;}else{if(D===0){D=B.formats.V(new Date(""+(F.getFullYear()-1)+"/12/31"));}}return A(D,0);},w:"getDay",W:function(F){var C=parseInt(B.formats.j(F),10);var E=7-B.formats.u(F);var D=parseInt((C+E)/7,10);return A(D,0,10);},y:function(C){return A(C.getFullYear()%100,0);},Y:"getFullYear",z:function(E){var D=E.getTimezoneOffset();var C=A(parseInt(Math.abs(D/60),10),0);var F=A(Math.abs(D%60),0);return(D>0?"-":"+")+C+F;},Z:function(C){var D=C.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(D.length>4){D=B.formats.z(C);}return D;},"%":function(C){return"%";}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(G,F,D){F=F||{};if(!(G instanceof Date)){return YAHOO.lang.isValue(G)?G:"";}var H=F.format||"%m/%d/%Y";if(H==="YYYY/MM/DD"){H="%Y/%m/%d";}else{if(H==="DD/MM/YYYY"){H="%d/%m/%Y";}else{if(H==="MM/DD/YYYY"){H="%m/%d/%Y";}}}D=D||"en";if(!(D in YAHOO.util.DateLocale)){if(D.replace(/-[a-zA-Z]+$/,"") in YAHOO.util.DateLocale){D=D.replace(/-[a-zA-Z]+$/,"");}else{D="en";}}var J=YAHOO.util.DateLocale[D];var C=function(L,K){var M=B.aggregates[K];return(M==="locale"?J[K]:M);};var E=function(L,K){var M=B.formats[K];if(typeof M==="string"){return G[M]();}else{if(typeof M==="function"){return M.call(G,G,J);}else{if(typeof M==="object"&&typeof M[0]==="string"){return A(G[M[0]](),M[1]);}else{return K;}}}};while(H.match(/%[cDFhnrRtTxX]/)){H=H.replace(/%([cDFhnrRtTxX])/g,C);}var I=H.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,E);C=E=undefined;return I;}};YAHOO.namespace("YAHOO.util");YAHOO.util.Date=B;YAHOO.util.DateLocale={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};
YAHOO.util.DateLocale["en"]=YAHOO.lang.merge(YAHOO.util.DateLocale,{});YAHOO.util.DateLocale["en-US"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});YAHOO.util.DateLocale["en-GB"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"],{r:"%l:%M:%S %P %Z"});YAHOO.util.DateLocale["en-AU"]=YAHOO.lang.merge(YAHOO.util.DateLocale["en"]);})();YAHOO.register("datasource",YAHOO.util.DataSource,{version:"2.7.0",build:"1796"});
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
YAHOO.util.Chain=function(){this.q=[].slice.call(arguments);this.createEvent("end");};YAHOO.util.Chain.prototype={id:0,run:function(){var F=this.q[0],C;if(!F){this.fireEvent("end");return this;}else{if(this.id){return this;}}C=F.method||F;if(typeof C==="function"){var E=F.scope||{},B=F.argument||[],A=F.timeout||0,D=this;if(!(B instanceof Array)){B=[B];}if(A<0){this.id=A;if(F.until){for(;!F.until();){C.apply(E,B);}}else{if(F.iterations){for(;F.iterations-->0;){C.apply(E,B);}}else{C.apply(E,B);}}this.q.shift();this.id=0;return this.run();}else{if(F.until){if(F.until()){this.q.shift();return this.run();}}else{if(!F.iterations||!--F.iterations){this.q.shift();}}this.id=setTimeout(function(){C.apply(E,B);if(D.id){D.id=0;D.run();}},A);}}return this;},add:function(A){this.q.push(A);return this;},pause:function(){clearTimeout(this.id);this.id=0;return this;},stop:function(){this.pause();this.q=[];return this;}};YAHOO.lang.augmentProto(YAHOO.util.Chain,YAHOO.util.EventProvider);YAHOO.widget.ColumnSet=function(A){this._sId="yui-cs"+YAHOO.widget.ColumnSet._nCount;A=YAHOO.widget.DataTable._cloneObject(A);this._init(A);YAHOO.widget.ColumnSet._nCount++;};YAHOO.widget.ColumnSet._nCount=0;YAHOO.widget.ColumnSet.prototype={_sId:null,_aDefinitions:null,tree:null,flat:null,keys:null,headers:null,_init:function(I){var J=[];var A=[];var G=[];var E=[];var C=-1;var B=function(M,S){C++;if(!J[C]){J[C]=[];}for(var O=0;O<M.length;O++){var K=M[O];var Q=new YAHOO.widget.Column(K);K.yuiColumnId=Q._sId;A.push(Q);if(S){Q._oParent=S;}if(YAHOO.lang.isArray(K.children)){Q.children=K.children;var R=0;var P=function(V){var W=V.children;for(var U=0;U<W.length;U++){if(YAHOO.lang.isArray(W[U].children)){P(W[U]);}else{R++;}}};P(K);Q._nColspan=R;var T=K.children;for(var N=0;N<T.length;N++){var L=T[N];if(Q.className&&(L.className===undefined)){L.className=Q.className;}if(Q.editor&&(L.editor===undefined)){L.editor=Q.editor;}if(Q.editorOptions&&(L.editorOptions===undefined)){L.editorOptions=Q.editorOptions;}if(Q.formatter&&(L.formatter===undefined)){L.formatter=Q.formatter;}if(Q.resizeable&&(L.resizeable===undefined)){L.resizeable=Q.resizeable;}if(Q.sortable&&(L.sortable===undefined)){L.sortable=Q.sortable;}if(Q.hidden){L.hidden=true;}if(Q.width&&(L.width===undefined)){L.width=Q.width;}if(Q.minWidth&&(L.minWidth===undefined)){L.minWidth=Q.minWidth;}if(Q.maxAutoWidth&&(L.maxAutoWidth===undefined)){L.maxAutoWidth=Q.maxAutoWidth;}if(Q.type&&(L.type===undefined)){L.type=Q.type;}if(Q.type&&!Q.formatter){Q.formatter=Q.type;}if(Q.text&&!YAHOO.lang.isValue(Q.label)){Q.label=Q.text;}if(Q.parser){}if(Q.sortOptions&&((Q.sortOptions.ascFunction)||(Q.sortOptions.descFunction))){}}if(!J[C+1]){J[C+1]=[];}B(T,Q);}else{Q._nKeyIndex=G.length;Q._nColspan=1;G.push(Q);}J[C].push(Q);}C--;};if(YAHOO.lang.isArray(I)){B(I);this._aDefinitions=I;}else{return null;}var F;var D=function(L){var M=1;var O;var N;var P=function(T,S){S=S||1;for(var U=0;U<T.length;U++){var R=T[U];if(YAHOO.lang.isArray(R.children)){S++;P(R.children,S);S--;}else{if(S>M){M=S;}}}};for(var K=0;K<L.length;K++){O=L[K];P(O);for(var Q=0;Q<O.length;Q++){N=O[Q];if(!YAHOO.lang.isArray(N.children)){N._nRowspan=M;}else{N._nRowspan=1;}}M=1;}};D(J);for(F=0;F<J[0].length;F++){J[0][F]._nTreeIndex=F;}var H=function(K,L){E[K].push(L.getSanitizedKey());if(L._oParent){H(K,L._oParent);}};for(F=0;F<G.length;F++){E[F]=[];H(F,G[F]);E[F]=E[F].reverse();}this.tree=J;this.flat=A;this.keys=G;this.headers=E;},getId:function(){return this._sId;},toString:function(){return"ColumnSet instance "+this._sId;},getDefinitions:function(){var A=this._aDefinitions;var B=function(E,G){for(var D=0;D<E.length;D++){var F=E[D];var I=G.getColumnById(F.yuiColumnId);if(I){var H=I.getDefinition();for(var C in H){if(YAHOO.lang.hasOwnProperty(H,C)){F[C]=H[C];}}}if(YAHOO.lang.isArray(F.children)){B(F.children,G);}}};B(A,this);this._aDefinitions=A;return A;},getColumnById:function(C){if(YAHOO.lang.isString(C)){var A=this.flat;for(var B=A.length-1;B>-1;B--){if(A[B]._sId===C){return A[B];}}}return null;},getColumn:function(C){if(YAHOO.lang.isNumber(C)&&this.keys[C]){return this.keys[C];}else{if(YAHOO.lang.isString(C)){var A=this.flat;var D=[];for(var B=0;B<A.length;B++){if(A[B].key===C){D.push(A[B]);}}if(D.length===1){return D[0];}else{if(D.length>1){return D;}}}}return null;},getDescendants:function(D){var B=this;var C=[];var A;var E=function(F){C.push(F);if(F.children){for(A=0;A<F.children.length;A++){E(B.getColumn(F.children[A].key));}}};E(D);return C;}};YAHOO.widget.Column=function(B){this._sId="yui-col"+YAHOO.widget.Column._nCount;if(B&&YAHOO.lang.isObject(B)){for(var A in B){if(A){this[A]=B[A];}}}if(!YAHOO.lang.isValue(this.key)){this.key="yui-dt-col"+YAHOO.widget.Column._nCount;}if(!YAHOO.lang.isValue(this.field)){this.field=this.key;}YAHOO.widget.Column._nCount++;if(this.width&&!YAHOO.lang.isNumber(this.width)){this.width=null;}if(this.editor&&YAHOO.lang.isString(this.editor)){this.editor=new YAHOO.widget.CellEditor(this.editor,this.editorOptions);}};YAHOO.lang.augmentObject(YAHOO.widget.Column,{_nCount:0,formatCheckbox:function(B,A,C,D){YAHOO.widget.DataTable.formatCheckbox(B,A,C,D);},formatCurrency:function(B,A,C,D){YAHOO.widget.DataTable.formatCurrency(B,A,C,D);},formatDate:function(B,A,C,D){YAHOO.widget.DataTable.formatDate(B,A,C,D);},formatEmail:function(B,A,C,D){YAHOO.widget.DataTable.formatEmail(B,A,C,D);},formatLink:function(B,A,C,D){YAHOO.widget.DataTable.formatLink(B,A,C,D);},formatNumber:function(B,A,C,D){YAHOO.widget.DataTable.formatNumber(B,A,C,D);},formatSelect:function(B,A,C,D){YAHOO.widget.DataTable.formatDropdown(B,A,C,D);}});YAHOO.widget.Column.prototype={_sId:null,_nKeyIndex:null,_nTreeIndex:null,_nColspan:1,_nRowspan:1,_oParent:null,_elTh:null,_elThLiner:null,_elThLabel:null,_elResizer:null,_nWidth:null,_dd:null,_ddResizer:null,key:null,field:null,label:null,abbr:null,children:null,width:null,minWidth:null,maxAutoWidth:null,hidden:false,selected:false,className:null,formatter:null,currencyOptions:null,dateOptions:null,editor:null,resizeable:false,sortable:false,sortOptions:null,getId:function(){return this._sId;
},toString:function(){return"Column instance "+this._sId;},getDefinition:function(){var A={};A.abbr=this.abbr;A.className=this.className;A.editor=this.editor;A.editorOptions=this.editorOptions;A.field=this.field;A.formatter=this.formatter;A.hidden=this.hidden;A.key=this.key;A.label=this.label;A.minWidth=this.minWidth;A.maxAutoWidth=this.maxAutoWidth;A.resizeable=this.resizeable;A.selected=this.selected;A.sortable=this.sortable;A.sortOptions=this.sortOptions;A.width=this.width;return A;},getKey:function(){return this.key;},getField:function(){return this.field;},getSanitizedKey:function(){return this.getKey().replace(/[^\w\-]/g,"");},getKeyIndex:function(){return this._nKeyIndex;},getTreeIndex:function(){return this._nTreeIndex;},getParent:function(){return this._oParent;},getColspan:function(){return this._nColspan;},getColSpan:function(){return this.getColspan();},getRowspan:function(){return this._nRowspan;},getThEl:function(){return this._elTh;},getThLinerEl:function(){return this._elThLiner;},getResizerEl:function(){return this._elResizer;},getColEl:function(){return this.getThEl();},getIndex:function(){return this.getKeyIndex();},format:function(){}};YAHOO.util.Sort={compare:function(B,A,C){if((B===null)||(typeof B=="undefined")){if((A===null)||(typeof A=="undefined")){return 0;}else{return 1;}}else{if((A===null)||(typeof A=="undefined")){return -1;}}if(B.constructor==String){B=B.toLowerCase();}if(A.constructor==String){A=A.toLowerCase();}if(B<A){return(C)?1:-1;}else{if(B>A){return(C)?-1:1;}else{return 0;}}}};YAHOO.widget.ColumnDD=function(D,A,C,B){if(D&&A&&C&&B){this.datatable=D;this.table=D.getTableEl();this.column=A;this.headCell=C;this.pointer=B;this.newIndex=null;this.init(C);this.initFrame();this.invalidHandleTypes={};this.setPadding(10,0,(this.datatable.getTheadEl().offsetHeight+10),0);YAHOO.util.Event.on(window,"resize",function(){this.initConstraints();},this,true);}else{}};if(YAHOO.util.DDProxy){YAHOO.extend(YAHOO.widget.ColumnDD,YAHOO.util.DDProxy,{initConstraints:function(){var G=YAHOO.util.Dom.getRegion(this.table),D=this.getEl(),F=YAHOO.util.Dom.getXY(D),C=parseInt(YAHOO.util.Dom.getStyle(D,"width"),10),A=parseInt(YAHOO.util.Dom.getStyle(D,"height"),10),E=((F[0]-G.left)+15),B=((G.right-F[0]-C)+15);this.setXConstraint(E,B);this.setYConstraint(10,10);},_resizeProxy:function(){this.constructor.superclass._resizeProxy.apply(this,arguments);var A=this.getDragEl(),B=this.getEl();YAHOO.util.Dom.setStyle(this.pointer,"height",(this.table.parentNode.offsetHeight+10)+"px");YAHOO.util.Dom.setStyle(this.pointer,"display","block");var C=YAHOO.util.Dom.getXY(B);YAHOO.util.Dom.setXY(this.pointer,[C[0],(C[1]-5)]);YAHOO.util.Dom.setStyle(A,"height",this.datatable.getContainerEl().offsetHeight+"px");YAHOO.util.Dom.setStyle(A,"width",(parseInt(YAHOO.util.Dom.getStyle(A,"width"),10)+4)+"px");YAHOO.util.Dom.setXY(this.dragEl,C);},onMouseDown:function(){this.initConstraints();this.resetConstraints();},clickValidator:function(B){if(!this.column.hidden){var A=YAHOO.util.Event.getTarget(B);return(this.isValidHandleChild(A)&&(this.id==this.handleElId||this.DDM.handleWasClicked(A,this.id)));}},onDragOver:function(H,A){var F=this.datatable.getColumn(A);if(F){var C=F.getTreeIndex();while((C===null)&&F.getParent()){F=F.getParent();C=F.getTreeIndex();}if(C!==null){var B=F.getThEl();var K=C;var D=YAHOO.util.Event.getPageX(H),I=YAHOO.util.Dom.getX(B),J=I+((YAHOO.util.Dom.get(B).offsetWidth)/2),E=this.column.getTreeIndex();if(D<J){YAHOO.util.Dom.setX(this.pointer,I);}else{var G=parseInt(B.offsetWidth,10);YAHOO.util.Dom.setX(this.pointer,(I+G));K++;}if(C>E){K--;}if(K<0){K=0;}else{if(K>this.datatable.getColumnSet().tree[0].length){K=this.datatable.getColumnSet().tree[0].length;}}this.newIndex=K;}}},onDragDrop:function(){this.datatable.reorderColumn(this.column,this.newIndex);},endDrag:function(){this.newIndex=null;YAHOO.util.Dom.setStyle(this.pointer,"display","none");}});}YAHOO.util.ColumnResizer=function(E,C,D,A,B){if(E&&C&&D&&A){this.datatable=E;this.column=C;this.headCell=D;this.headCellLiner=C.getThLinerEl();this.resizerLiner=D.firstChild;this.init(A,A,{dragOnly:true,dragElId:B.id});this.initFrame();this.resetResizerEl();this.setPadding(0,1,0,0);}else{}};if(YAHOO.util.DD){YAHOO.extend(YAHOO.util.ColumnResizer,YAHOO.util.DDProxy,{resetResizerEl:function(){var A=YAHOO.util.Dom.get(this.handleElId).style;A.left="auto";A.right=0;A.top="auto";A.bottom=0;A.height=this.headCell.offsetHeight+"px";},onMouseUp:function(G){var E=this.datatable.getColumnSet().keys,B;for(var C=0,A=E.length;C<A;C++){B=E[C];if(B._ddResizer){B._ddResizer.resetResizerEl();}}this.resetResizerEl();var D=this.headCellLiner;var F=D.offsetWidth-(parseInt(YAHOO.util.Dom.getStyle(D,"paddingLeft"),10)|0)-(parseInt(YAHOO.util.Dom.getStyle(D,"paddingRight"),10)|0);this.datatable.fireEvent("columnResizeEvent",{column:this.column,target:this.headCell,width:F});},onMouseDown:function(A){this.startWidth=this.headCellLiner.offsetWidth;this.startX=YAHOO.util.Event.getXY(A)[0];this.nLinerPadding=(parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingLeft"),10)|0)+(parseInt(YAHOO.util.Dom.getStyle(this.headCellLiner,"paddingRight"),10)|0);},clickValidator:function(B){if(!this.column.hidden){var A=YAHOO.util.Event.getTarget(B);return(this.isValidHandleChild(A)&&(this.id==this.handleElId||this.DDM.handleWasClicked(A,this.id)));}},startDrag:function(){var E=this.datatable.getColumnSet().keys,D=this.column.getKeyIndex(),B;for(var C=0,A=E.length;C<A;C++){B=E[C];if(B._ddResizer){YAHOO.util.Dom.get(B._ddResizer.handleElId).style.height="1em";}}},onDrag:function(C){var D=YAHOO.util.Event.getXY(C)[0];if(D>YAHOO.util.Dom.getX(this.headCellLiner)){var A=D-this.startX;var B=this.startWidth+A-this.nLinerPadding;if(B>0){this.datatable.setColumnWidth(this.column,B);}}}});}(function(){var G=YAHOO.lang,A=YAHOO.util,E=YAHOO.widget,C=A.Dom,F=A.Event,D=E.DataTable;YAHOO.widget.RecordSet=function(H){this._sId="yui-rs"+E.RecordSet._nCount;E.RecordSet._nCount++;this._records=[];
if(H){if(G.isArray(H)){this.addRecords(H);}else{if(G.isObject(H)){this.addRecord(H);}}}};var B=E.RecordSet;B._nCount=0;B.prototype={_sId:null,_addRecord:function(J,H){var I=new YAHOO.widget.Record(J);if(YAHOO.lang.isNumber(H)&&(H>-1)){this._records.splice(H,0,I);}else{this._records[this._records.length]=I;}return I;},_setRecord:function(I,H){if(!G.isNumber(H)||H<0){H=this._records.length;}return(this._records[H]=new E.Record(I));},_deleteRecord:function(I,H){if(!G.isNumber(H)||(H<0)){H=1;}this._records.splice(I,H);},getId:function(){return this._sId;},toString:function(){return"RecordSet instance "+this._sId;},getLength:function(){return this._records.length;},getRecord:function(H){var I;if(H instanceof E.Record){for(I=0;I<this._records.length;I++){if(this._records[I]&&(this._records[I]._sId===H._sId)){return H;}}}else{if(G.isNumber(H)){if((H>-1)&&(H<this.getLength())){return this._records[H];}}else{if(G.isString(H)){for(I=0;I<this._records.length;I++){if(this._records[I]&&(this._records[I]._sId===H)){return this._records[I];}}}}}return null;},getRecords:function(I,H){if(!G.isNumber(I)){return this._records;}if(!G.isNumber(H)){return this._records.slice(I);}return this._records.slice(I,I+H);},hasRecords:function(I,H){var K=this.getRecords(I,H);for(var J=0;J<H;++J){if(typeof K[J]==="undefined"){return false;}}return true;},getRecordIndex:function(I){if(I){for(var H=this._records.length-1;H>-1;H--){if(this._records[H]&&I.getId()===this._records[H].getId()){return H;}}}return null;},addRecord:function(J,H){if(G.isObject(J)){var I=this._addRecord(J,H);this.fireEvent("recordAddEvent",{record:I,data:J});return I;}else{return null;}},addRecords:function(L,K){if(G.isArray(L)){var O=[],I,M,H;K=G.isNumber(K)?K:this._records.length;I=K;for(M=0,H=L.length;M<H;++M){if(G.isObject(L[M])){var J=this._addRecord(L[M],I++);O.push(J);}}this.fireEvent("recordsAddEvent",{records:O,data:L});return O;}else{if(G.isObject(L)){var N=this._addRecord(L);this.fireEvent("recordsAddEvent",{records:[N],data:L});return N;}else{return null;}}},setRecord:function(J,H){if(G.isObject(J)){var I=this._setRecord(J,H);this.fireEvent("recordSetEvent",{record:I,data:J});return I;}else{return null;}},setRecords:function(L,K){var O=E.Record,I=G.isArray(L)?L:[L],N=[],M=0,H=I.length,J=0;K=parseInt(K,10)|0;for(;M<H;++M){if(typeof I[M]==="object"&&I[M]){N[J++]=this._records[K+M]=new O(I[M]);}}this.fireEvent("recordsSetEvent",{records:N,data:L});this.fireEvent("recordsSet",{records:N,data:L});if(I.length&&!N.length){}return N.length>1?N:N[0];},updateRecord:function(H,L){var J=this.getRecord(H);if(J&&G.isObject(L)){var K={};for(var I in J._oData){if(G.hasOwnProperty(J._oData,I)){K[I]=J._oData[I];}}J._oData=L;this.fireEvent("recordUpdateEvent",{record:J,newData:L,oldData:K});return J;}else{return null;}},updateKey:function(H,I,J){this.updateRecordValue(H,I,J);},updateRecordValue:function(H,K,N){var J=this.getRecord(H);if(J){var M=null;var L=J._oData[K];if(L&&G.isObject(L)){M={};for(var I in L){if(G.hasOwnProperty(L,I)){M[I]=L[I];}}}else{M=L;}J._oData[K]=N;this.fireEvent("keyUpdateEvent",{record:J,key:K,newData:N,oldData:M});this.fireEvent("recordValueUpdateEvent",{record:J,key:K,newData:N,oldData:M});}else{}},replaceRecords:function(H){this.reset();return this.addRecords(H);},sortRecords:function(H,I){return this._records.sort(function(K,J){return H(K,J,I);});},reverseRecords:function(){return this._records.reverse();},deleteRecord:function(H){if(G.isNumber(H)&&(H>-1)&&(H<this.getLength())){var I=E.DataTable._cloneObject(this.getRecord(H).getData());this._deleteRecord(H);this.fireEvent("recordDeleteEvent",{data:I,index:H});return I;}else{return null;}},deleteRecords:function(J,H){if(!G.isNumber(H)){H=1;}if(G.isNumber(J)&&(J>-1)&&(J<this.getLength())){var L=this.getRecords(J,H);var I=[];for(var K=0;K<L.length;K++){I[I.length]=E.DataTable._cloneObject(L[K]);}this._deleteRecord(J,H);this.fireEvent("recordsDeleteEvent",{data:I,index:J});return I;}else{return null;}},reset:function(){this._records=[];this.fireEvent("resetEvent");}};G.augmentProto(B,A.EventProvider);YAHOO.widget.Record=function(H){this._nCount=E.Record._nCount;this._sId="yui-rec"+this._nCount;E.Record._nCount++;this._oData={};if(G.isObject(H)){for(var I in H){if(G.hasOwnProperty(H,I)){this._oData[I]=H[I];}}}};YAHOO.widget.Record._nCount=0;YAHOO.widget.Record.prototype={_nCount:null,_sId:null,_oData:null,getCount:function(){return this._nCount;},getId:function(){return this._sId;},getData:function(H){if(G.isString(H)){return this._oData[H];}else{return this._oData;}},setData:function(H,I){this._oData[H]=I;}};})();(function(){var H=YAHOO.lang,A=YAHOO.util,E=YAHOO.widget,B=YAHOO.env.ua,C=A.Dom,G=A.Event,F=A.DataSourceBase;YAHOO.widget.DataTable=function(I,M,O,K){var L=E.DataTable;if(K&&K.scrollable){return new YAHOO.widget.ScrollingDataTable(I,M,O,K);}this._nIndex=L._nCount;this._sId="yui-dt"+this._nIndex;this._oChainRender=new YAHOO.util.Chain();this._oChainRender.subscribe("end",this._onRenderChainEnd,this,true);this._initConfigs(K);this._initDataSource(O);if(!this._oDataSource){return;}this._initColumnSet(M);if(!this._oColumnSet){return;}this._initRecordSet();if(!this._oRecordSet){}L.superclass.constructor.call(this,I,this.configs);var Q=this._initDomElements(I);if(!Q){return;}this.showTableMessage(this.get("MSG_LOADING"),L.CLASS_LOADING);this._initEvents();L._nCount++;L._nCurrentCount++;var N={success:this.onDataReturnSetRows,failure:this.onDataReturnSetRows,scope:this,argument:this.getState()};var P=this.get("initialLoad");if(P===true){this._oDataSource.sendRequest(this.get("initialRequest"),N);}else{if(P===false){this.showTableMessage(this.get("MSG_EMPTY"),L.CLASS_EMPTY);}else{var J=P||{};N.argument=J.argument||{};this._oDataSource.sendRequest(J.request,N);}}};var D=E.DataTable;H.augmentObject(D,{CLASS_DATATABLE:"yui-dt",CLASS_LINER:"yui-dt-liner",CLASS_LABEL:"yui-dt-label",CLASS_MESSAGE:"yui-dt-message",CLASS_MASK:"yui-dt-mask",CLASS_DATA:"yui-dt-data",CLASS_COLTARGET:"yui-dt-coltarget",CLASS_RESIZER:"yui-dt-resizer",CLASS_RESIZERLINER:"yui-dt-resizerliner",CLASS_RESIZERPROXY:"yui-dt-resizerproxy",CLASS_EDITOR:"yui-dt-editor",CLASS_PAGINATOR:"yui-dt-paginator",CLASS_PAGE:"yui-dt-page",CLASS_DEFAULT:"yui-dt-default",CLASS_PREVIOUS:"yui-dt-previous",CLASS_NEXT:"yui-dt-next",CLASS_FIRST:"yui-dt-first",CLASS_LAST:"yui-dt-last",CLASS_EVEN:"yui-dt-even",CLASS_ODD:"yui-dt-odd",CLASS_SELECTED:"yui-dt-selected",CLASS_HIGHLIGHTED:"yui-dt-highlighted",CLASS_HIDDEN:"yui-dt-hidden",CLASS_DISABLED:"yui-dt-disabled",CLASS_EMPTY:"yui-dt-empty",CLASS_LOADING:"yui-dt-loading",CLASS_ERROR:"yui-dt-error",CLASS_EDITABLE:"yui-dt-editable",CLASS_DRAGGABLE:"yui-dt-draggable",CLASS_RESIZEABLE:"yui-dt-resizeable",CLASS_SCROLLABLE:"yui-dt-scrollable",CLASS_SORTABLE:"yui-dt-sortable",CLASS_ASC:"yui-dt-asc",CLASS_DESC:"yui-dt-desc",CLASS_BUTTON:"yui-dt-button",CLASS_CHECKBOX:"yui-dt-checkbox",CLASS_DROPDOWN:"yui-dt-dropdown",CLASS_RADIO:"yui-dt-radio",_nCount:0,_nCurrentCount:0,_elDynStyleNode:null,_bDynStylesFallback:(B.ie&&(B.ie<7))?true:false,_oDynStyles:{},_elColumnDragTarget:null,_elColumnResizerProxy:null,_cloneObject:function(L){if(!H.isValue(L)){return L;
}var N={};if(L instanceof YAHOO.widget.BaseCellEditor){N=L;}else{if(H.isFunction(L)){N=L;}else{if(H.isArray(L)){var M=[];for(var K=0,J=L.length;K<J;K++){M[K]=D._cloneObject(L[K]);}N=M;}else{if(H.isObject(L)){for(var I in L){if(H.hasOwnProperty(L,I)){if(H.isValue(L[I])&&H.isObject(L[I])||H.isArray(L[I])){N[I]=D._cloneObject(L[I]);}else{N[I]=L[I];}}}}else{N=L;}}}}return N;},_destroyColumnDragTargetEl:function(){if(D._elColumnDragTarget){var I=D._elColumnDragTarget;YAHOO.util.Event.purgeElement(I);I.parentNode.removeChild(I);D._elColumnDragTarget=null;}},_initColumnDragTargetEl:function(){if(!D._elColumnDragTarget){var I=document.createElement("div");I.className=D.CLASS_COLTARGET;I.style.display="none";document.body.insertBefore(I,document.body.firstChild);D._elColumnDragTarget=I;}return D._elColumnDragTarget;},_destroyColumnResizerProxyEl:function(){if(D._elColumnResizerProxy){var I=D._elColumnResizerProxy;YAHOO.util.Event.purgeElement(I);I.parentNode.removeChild(I);D._elColumnResizerProxy=null;}},_initColumnResizerProxyEl:function(){if(!D._elColumnResizerProxy){var I=document.createElement("div");I.id="yui-dt-colresizerproxy";I.className=D.CLASS_RESIZERPROXY;document.body.insertBefore(I,document.body.firstChild);D._elColumnResizerProxy=I;}return D._elColumnResizerProxy;},formatButton:function(I,J,K,M){var L=H.isValue(M)?M:"Click";I.innerHTML='<button type="button" class="'+D.CLASS_BUTTON+'">'+L+"</button>";},formatCheckbox:function(I,J,K,M){var L=M;L=(L)?' checked="checked"':"";I.innerHTML='<input type="checkbox"'+L+' class="'+D.CLASS_CHECKBOX+'" />';},formatCurrency:function(I,J,K,L){I.innerHTML=A.Number.format(L,K.currencyOptions||this.get("currencyOptions"));},formatDate:function(I,K,L,M){var J=L.dateOptions||this.get("dateOptions");I.innerHTML=A.Date.format(M,J,J.locale);},formatDropdown:function(K,R,P,I){var Q=(H.isValue(I))?I:R.getData(P.field),S=(H.isArray(P.dropdownOptions))?P.dropdownOptions:null,J,O=K.getElementsByTagName("select");if(O.length===0){J=document.createElement("select");J.className=D.CLASS_DROPDOWN;J=K.appendChild(J);G.addListener(J,"change",this._onDropdownChange,this);}J=O[0];if(J){J.innerHTML="";if(S){for(var M=0;M<S.length;M++){var N=S[M];var L=document.createElement("option");L.value=(H.isValue(N.value))?N.value:N;L.innerHTML=(H.isValue(N.text))?N.text:(H.isValue(N.label))?N.label:N;L=J.appendChild(L);if(L.value==Q){L.selected=true;}}}else{J.innerHTML='<option selected value="'+Q+'">'+Q+"</option>";}}else{K.innerHTML=H.isValue(I)?I:"";}},formatEmail:function(I,J,K,L){if(H.isString(L)){I.innerHTML='<a href="mailto:'+L+'">'+L+"</a>";}else{I.innerHTML=H.isValue(L)?L:"";}},formatLink:function(I,J,K,L){if(H.isString(L)){I.innerHTML='<a href="'+L+'">'+L+"</a>";}else{I.innerHTML=H.isValue(L)?L:"";}},formatNumber:function(I,J,K,L){I.innerHTML=A.Number.format(L,K.numberOptions||this.get("numberOptions"));},formatRadio:function(I,J,K,M){var L=M;L=(L)?' checked="checked"':"";I.innerHTML='<input type="radio"'+L+' name="'+this.getId()+"-col-"+K.getSanitizedKey()+'"'+' class="'+D.CLASS_RADIO+'" />';},formatText:function(I,J,L,M){var K=(H.isValue(M))?M:"";I.innerHTML=K.toString().replace(/&/g,"&#38;").replace(/</g,"&#60;").replace(/>/g,"&#62;");},formatTextarea:function(J,K,M,N){var L=(H.isValue(N))?N:"",I="<textarea>"+L+"</textarea>";J.innerHTML=I;},formatTextbox:function(J,K,M,N){var L=(H.isValue(N))?N:"",I='<input type="text" value="'+L+'" />';J.innerHTML=I;},formatDefault:function(I,J,K,L){I.innerHTML=L===undefined||L===null||(typeof L==="number"&&isNaN(L))?"&#160;":L.toString();},validateNumber:function(J){var I=J*1;if(H.isNumber(I)){return I;}else{return undefined;}}});D.Formatter={button:D.formatButton,checkbox:D.formatCheckbox,currency:D.formatCurrency,"date":D.formatDate,dropdown:D.formatDropdown,email:D.formatEmail,link:D.formatLink,"number":D.formatNumber,radio:D.formatRadio,text:D.formatText,textarea:D.formatTextarea,textbox:D.formatTextbox,defaultFormatter:D.formatDefault};H.extend(D,A.Element,{initAttributes:function(I){I=I||{};D.superclass.initAttributes.call(this,I);this.setAttributeConfig("summary",{value:"",validator:H.isString,method:function(J){if(this._elTable){this._elTable.summary=J;}}});this.setAttributeConfig("selectionMode",{value:"standard",validator:H.isString});this.setAttributeConfig("sortedBy",{value:null,validator:function(J){if(J){return(H.isObject(J)&&J.key);}else{return(J===null);}},method:function(K){var R=this.get("sortedBy");this._configs.sortedBy.value=K;var J,O,M,Q;if(this._elThead){if(R&&R.key&&R.dir){J=this._oColumnSet.getColumn(R.key);O=J.getKeyIndex();var U=J.getThEl();C.removeClass(U,R.dir);this.formatTheadCell(J.getThLinerEl().firstChild,J,K);}if(K){M=(K.column)?K.column:this._oColumnSet.getColumn(K.key);Q=M.getKeyIndex();var V=M.getThEl();if(K.dir&&((K.dir=="asc")||(K.dir=="desc"))){var P=(K.dir=="desc")?D.CLASS_DESC:D.CLASS_ASC;C.addClass(V,P);}else{var L=K.dir||D.CLASS_ASC;C.addClass(V,L);}this.formatTheadCell(M.getThLinerEl().firstChild,M,K);}}if(this._elTbody){this._elTbody.style.display="none";var S=this._elTbody.rows,T;for(var N=S.length-1;N>-1;N--){T=S[N].childNodes;if(T[O]){C.removeClass(T[O],R.dir);}if(T[Q]){C.addClass(T[Q],K.dir);}}this._elTbody.style.display="";}this._clearTrTemplateEl();}});this.setAttributeConfig("paginator",{value:null,validator:function(J){return J===null||J instanceof E.Paginator;},method:function(){this._updatePaginator.apply(this,arguments);}});this.setAttributeConfig("caption",{value:null,validator:H.isString,method:function(J){this._initCaptionEl(J);}});this.setAttributeConfig("draggableColumns",{value:false,validator:H.isBoolean,method:function(J){if(this._elThead){if(J){this._initDraggableColumns();}else{this._destroyDraggableColumns();}}}});this.setAttributeConfig("renderLoopSize",{value:0,validator:H.isNumber});this.setAttributeConfig("formatRow",{value:null,validator:H.isFunction});this.setAttributeConfig("generateRequest",{value:function(K,N){K=K||{pagination:null,sortedBy:null};var M=(K.sortedBy)?K.sortedBy.key:N.getColumnSet().keys[0].getKey();
var J=(K.sortedBy&&K.sortedBy.dir===YAHOO.widget.DataTable.CLASS_DESC)?"desc":"asc";var O=(K.pagination)?K.pagination.recordOffset:0;var L=(K.pagination)?K.pagination.rowsPerPage:null;return"sort="+M+"&dir="+J+"&startIndex="+O+((L!==null)?"&results="+L:"");},validator:H.isFunction});this.setAttributeConfig("initialRequest",{value:null});this.setAttributeConfig("initialLoad",{value:true});this.setAttributeConfig("dynamicData",{value:false,validator:H.isBoolean});this.setAttributeConfig("MSG_EMPTY",{value:"No records found.",validator:H.isString});this.setAttributeConfig("MSG_LOADING",{value:"Loading...",validator:H.isString});this.setAttributeConfig("MSG_ERROR",{value:"Data error.",validator:H.isString});this.setAttributeConfig("MSG_SORTASC",{value:"Click to sort ascending",validator:H.isString,method:function(K){if(this._elThead){for(var L=0,M=this.getColumnSet().keys,J=M.length;L<J;L++){if(M[L].sortable&&this.getColumnSortDir(M[L])===D.CLASS_ASC){M[L]._elThLabel.firstChild.title=K;}}}}});this.setAttributeConfig("MSG_SORTDESC",{value:"Click to sort descending",validator:H.isString,method:function(K){if(this._elThead){for(var L=0,M=this.getColumnSet().keys,J=M.length;L<J;L++){if(M[L].sortable&&this.getColumnSortDir(M[L])===D.CLASS_DESC){M[L]._elThLabel.firstChild.title=K;}}}}});this.setAttributeConfig("currencySymbol",{value:"$",validator:H.isString});this.setAttributeConfig("currencyOptions",{value:{prefix:this.get("currencySymbol"),decimalPlaces:2,decimalSeparator:".",thousandsSeparator:","}});this.setAttributeConfig("dateOptions",{value:{format:"%m/%d/%Y",locale:"en"}});this.setAttributeConfig("numberOptions",{value:{decimalPlaces:0,thousandsSeparator:","}});},_bInit:true,_nIndex:null,_nTrCount:0,_nTdCount:0,_sId:null,_oChainRender:null,_elContainer:null,_elMask:null,_elTable:null,_elCaption:null,_elColgroup:null,_elThead:null,_elTbody:null,_elMsgTbody:null,_elMsgTr:null,_elMsgTd:null,_oDataSource:null,_oColumnSet:null,_oRecordSet:null,_oCellEditor:null,_sFirstTrId:null,_sLastTrId:null,_elTrTemplate:null,_aDynFunctions:[],clearTextSelection:function(){var I;if(window.getSelection){I=window.getSelection();}else{if(document.getSelection){I=document.getSelection();}else{if(document.selection){I=document.selection;}}}if(I){if(I.empty){I.empty();}else{if(I.removeAllRanges){I.removeAllRanges();}else{if(I.collapse){I.collapse();}}}}},_focusEl:function(I){I=I||this._elTbody;setTimeout(function(){try{I.focus();}catch(J){}},0);},_repaintGecko:(B.gecko)?function(J){J=J||this._elContainer;var I=J.parentNode;var K=J.nextSibling;I.insertBefore(I.removeChild(J),K);}:function(){},_repaintOpera:(B.opera)?function(){if(B.opera){document.documentElement.className+=" ";document.documentElement.className.trim();}}:function(){},_repaintWebkit:(B.webkit)?function(J){J=J||this._elContainer;var I=J.parentNode;var K=J.nextSibling;I.insertBefore(I.removeChild(J),K);}:function(){},_initConfigs:function(I){if(!I||!H.isObject(I)){I={};}this.configs=I;},_initColumnSet:function(M){var L,J,I;if(this._oColumnSet){for(J=0,I=this._oColumnSet.keys.length;J<I;J++){L=this._oColumnSet.keys[J];D._oDynStyles["."+this.getId()+"-col-"+L.getSanitizedKey()+" ."+D.CLASS_LINER]=undefined;if(L.editor&&L.editor.unsubscribeAll){L.editor.unsubscribeAll();}}this._oColumnSet=null;this._clearTrTemplateEl();}if(H.isArray(M)){this._oColumnSet=new YAHOO.widget.ColumnSet(M);}else{if(M instanceof YAHOO.widget.ColumnSet){this._oColumnSet=M;}}var K=this._oColumnSet.keys;for(J=0,I=K.length;J<I;J++){L=K[J];if(L.editor&&L.editor.subscribe){L.editor.subscribe("showEvent",this._onEditorShowEvent,this,true);L.editor.subscribe("keydownEvent",this._onEditorKeydownEvent,this,true);L.editor.subscribe("revertEvent",this._onEditorRevertEvent,this,true);L.editor.subscribe("saveEvent",this._onEditorSaveEvent,this,true);L.editor.subscribe("cancelEvent",this._onEditorCancelEvent,this,true);L.editor.subscribe("blurEvent",this._onEditorBlurEvent,this,true);L.editor.subscribe("blockEvent",this._onEditorBlockEvent,this,true);L.editor.subscribe("unblockEvent",this._onEditorUnblockEvent,this,true);}}},_initDataSource:function(I){this._oDataSource=null;if(I&&(I instanceof F)){this._oDataSource=I;}else{var J=null;var N=this._elContainer;var K=0;if(N.hasChildNodes()){var M=N.childNodes;for(K=0;K<M.length;K++){if(M[K].nodeName&&M[K].nodeName.toLowerCase()=="table"){J=M[K];break;}}if(J){var L=[];for(;K<this._oColumnSet.keys.length;K++){L.push({key:this._oColumnSet.keys[K].key});}this._oDataSource=new F(J);this._oDataSource.responseType=F.TYPE_HTMLTABLE;this._oDataSource.responseSchema={fields:L};}}}},_initRecordSet:function(){if(this._oRecordSet){this._oRecordSet.reset();}else{this._oRecordSet=new YAHOO.widget.RecordSet();}},_initDomElements:function(I){this._initContainerEl(I);this._initTableEl(this._elContainer);this._initColgroupEl(this._elTable);this._initTheadEl(this._elTable);this._initMsgTbodyEl(this._elTable);this._initTbodyEl(this._elTable);if(!this._elContainer||!this._elTable||!this._elColgroup||!this._elThead||!this._elTbody||!this._elMsgTbody){return false;}else{return true;}},_destroyContainerEl:function(I){C.removeClass(I,D.CLASS_DATATABLE);G.purgeElement(I,true);I.innerHTML="";this._elContainer=null;this._elColgroup=null;this._elThead=null;this._elTbody=null;},_initContainerEl:function(J){J=C.get(J);if(J&&J.nodeName&&(J.nodeName.toLowerCase()=="div")){this._destroyContainerEl(J);C.addClass(J,D.CLASS_DATATABLE);G.addListener(J,"focus",this._onTableFocus,this);G.addListener(J,"dblclick",this._onTableDblclick,this);this._elContainer=J;var I=document.createElement("div");I.className=D.CLASS_MASK;I.style.display="none";this._elMask=J.appendChild(I);}},_destroyTableEl:function(){var I=this._elTable;if(I){G.purgeElement(I,true);I.parentNode.removeChild(I);this._elCaption=null;this._elColgroup=null;this._elThead=null;this._elTbody=null;}},_initCaptionEl:function(I){if(this._elTable&&I){if(!this._elCaption){this._elCaption=this._elTable.createCaption();}this._elCaption.innerHTML=I;
}else{if(this._elCaption){this._elCaption.parentNode.removeChild(this._elCaption);}}},_initTableEl:function(I){if(I){this._destroyTableEl();this._elTable=I.appendChild(document.createElement("table"));this._elTable.summary=this.get("summary");if(this.get("caption")){this._initCaptionEl(this.get("caption"));}}},_destroyColgroupEl:function(){var I=this._elColgroup;if(I){var J=I.parentNode;G.purgeElement(I,true);J.removeChild(I);this._elColgroup=null;}},_initColgroupEl:function(R){if(R){this._destroyColgroupEl();var K=this._aColIds||[],Q=this._oColumnSet.keys,L=0,O=K.length,I,N,P=document.createDocumentFragment(),M=document.createElement("col");for(L=0,O=Q.length;L<O;L++){N=Q[L];I=P.appendChild(M.cloneNode(false));}var J=R.insertBefore(document.createElement("colgroup"),R.firstChild);J.appendChild(P);this._elColgroup=J;}},_insertColgroupColEl:function(I){if(H.isNumber(I)&&this._elColgroup){var J=this._elColgroup.childNodes[I]||null;this._elColgroup.insertBefore(document.createElement("col"),J);}},_removeColgroupColEl:function(I){if(H.isNumber(I)&&this._elColgroup&&this._elColgroup.childNodes[I]){this._elColgroup.removeChild(this._elColgroup.childNodes[I]);}},_reorderColgroupColEl:function(K,J){if(H.isArray(K)&&H.isNumber(J)&&this._elColgroup&&(this._elColgroup.childNodes.length>K[K.length-1])){var I,M=[];for(I=K.length-1;I>-1;I--){M.push(this._elColgroup.removeChild(this._elColgroup.childNodes[K[I]]));}var L=this._elColgroup.childNodes[J]||null;for(I=M.length-1;I>-1;I--){this._elColgroup.insertBefore(M[I],L);}}},_destroyTheadEl:function(){var J=this._elThead;if(J){var I=J.parentNode;G.purgeElement(J,true);this._destroyColumnHelpers();I.removeChild(J);this._elThead=null;}},_initTheadEl:function(S){S=S||this._elTable;if(S){this._destroyTheadEl();var N=(this._elColgroup)?S.insertBefore(document.createElement("thead"),this._elColgroup.nextSibling):S.appendChild(document.createElement("thead"));G.addListener(N,"focus",this._onTheadFocus,this);G.addListener(N,"keydown",this._onTheadKeydown,this);G.addListener(N,"mouseover",this._onTableMouseover,this);G.addListener(N,"mouseout",this._onTableMouseout,this);G.addListener(N,"mousedown",this._onTableMousedown,this);G.addListener(N,"mouseup",this._onTableMouseup,this);G.addListener(N,"click",this._onTheadClick,this);var U=this._oColumnSet,Q,O,M,K;var T=U.tree;var L;for(O=0;O<T.length;O++){var J=N.appendChild(document.createElement("tr"));for(M=0;M<T[O].length;M++){Q=T[O][M];L=J.appendChild(document.createElement("th"));this._initThEl(L,Q);}if(O===0){C.addClass(J,D.CLASS_FIRST);}if(O===(T.length-1)){C.addClass(J,D.CLASS_LAST);}}var I=U.headers[0]||[];for(O=0;O<I.length;O++){C.addClass(C.get(this.getId()+"-th-"+I[O]),D.CLASS_FIRST);}var P=U.headers[U.headers.length-1]||[];for(O=0;O<P.length;O++){C.addClass(C.get(this.getId()+"-th-"+P[O]),D.CLASS_LAST);}if(B.webkit&&B.webkit<420){var R=this;setTimeout(function(){N.style.display="";},0);N.style.display="none";}this._elThead=N;this._initColumnHelpers();}},_initThEl:function(M,L){M.id=this.getId()+"-th-"+L.getSanitizedKey();M.innerHTML="";M.rowSpan=L.getRowspan();M.colSpan=L.getColspan();L._elTh=M;var I=M.appendChild(document.createElement("div"));I.id=M.id+"-liner";I.className=D.CLASS_LINER;L._elThLiner=I;var J=I.appendChild(document.createElement("span"));J.className=D.CLASS_LABEL;if(L.abbr){M.abbr=L.abbr;}if(L.hidden){this._clearMinWidth(L);}M.className=this._getColumnClassNames(L);if(L.width){var K=(L.minWidth&&(L.width<L.minWidth))?L.minWidth:L.width;if(D._bDynStylesFallback){M.firstChild.style.overflow="hidden";M.firstChild.style.width=K+"px";}else{this._setColumnWidthDynStyles(L,K+"px","hidden");}}this.formatTheadCell(J,L,this.get("sortedBy"));L._elThLabel=J;},formatTheadCell:function(I,M,K){var Q=M.getKey();var P=H.isValue(M.label)?M.label:Q;if(M.sortable){var N=this.getColumnSortDir(M,K);var J=(N===D.CLASS_DESC);if(K&&(M.key===K.key)){J=!(K.dir===D.CLASS_DESC);}var L=this.getId()+"-href-"+M.getSanitizedKey();var O=(J)?this.get("MSG_SORTDESC"):this.get("MSG_SORTASC");I.innerHTML='<a href="'+L+'" title="'+O+'" class="'+D.CLASS_SORTABLE+'">'+P+"</a>";}else{I.innerHTML=P;}},_destroyDraggableColumns:function(){var K,L;for(var J=0,I=this._oColumnSet.tree[0].length;J<I;J++){K=this._oColumnSet.tree[0][J];if(K._dd){K._dd=K._dd.unreg();C.removeClass(K.getThEl(),D.CLASS_DRAGGABLE);}}},_initDraggableColumns:function(){this._destroyDraggableColumns();if(A.DD){var L,M,J;for(var K=0,I=this._oColumnSet.tree[0].length;K<I;K++){L=this._oColumnSet.tree[0][K];M=L.getThEl();C.addClass(M,D.CLASS_DRAGGABLE);J=D._initColumnDragTargetEl();L._dd=new YAHOO.widget.ColumnDD(this,L,M,J);}}else{}},_destroyResizeableColumns:function(){var J=this._oColumnSet.keys;for(var K=0,I=J.length;K<I;K++){if(J[K]._ddResizer){J[K]._ddResizer=J[K]._ddResizer.unreg();C.removeClass(J[K].getThEl(),D.CLASS_RESIZEABLE);}}},_initResizeableColumns:function(){this._destroyResizeableColumns();if(A.DD){var O,J,M,P,I,Q,L;for(var K=0,N=this._oColumnSet.keys.length;K<N;K++){O=this._oColumnSet.keys[K];if(O.resizeable){J=O.getThEl();C.addClass(J,D.CLASS_RESIZEABLE);M=O.getThLinerEl();P=J.appendChild(document.createElement("div"));P.className=D.CLASS_RESIZERLINER;P.appendChild(M);I=P.appendChild(document.createElement("div"));I.id=J.id+"-resizer";I.className=D.CLASS_RESIZER;O._elResizer=I;Q=D._initColumnResizerProxyEl();O._ddResizer=new YAHOO.util.ColumnResizer(this,O,J,I,Q);L=function(R){G.stopPropagation(R);};G.addListener(I,"click",L);}}}else{}},_destroyColumnHelpers:function(){this._destroyDraggableColumns();this._destroyResizeableColumns();},_initColumnHelpers:function(){if(this.get("draggableColumns")){this._initDraggableColumns();}this._initResizeableColumns();},_destroyTbodyEl:function(){var I=this._elTbody;if(I){var J=I.parentNode;G.purgeElement(I,true);J.removeChild(I);this._elTbody=null;}},_initTbodyEl:function(J){if(J){this._destroyTbodyEl();var I=J.appendChild(document.createElement("tbody"));I.tabIndex=0;I.className=D.CLASS_DATA;G.addListener(I,"focus",this._onTbodyFocus,this);
G.addListener(I,"mouseover",this._onTableMouseover,this);G.addListener(I,"mouseout",this._onTableMouseout,this);G.addListener(I,"mousedown",this._onTableMousedown,this);G.addListener(I,"mouseup",this._onTableMouseup,this);G.addListener(I,"keydown",this._onTbodyKeydown,this);G.addListener(I,"keypress",this._onTableKeypress,this);G.addListener(I,"click",this._onTbodyClick,this);if(B.ie){I.hideFocus=true;}this._elTbody=I;}},_destroyMsgTbodyEl:function(){var I=this._elMsgTbody;if(I){var J=I.parentNode;G.purgeElement(I,true);J.removeChild(I);this._elTbody=null;}},_initMsgTbodyEl:function(L){if(L){var K=document.createElement("tbody");K.className=D.CLASS_MESSAGE;var J=K.appendChild(document.createElement("tr"));J.className=D.CLASS_FIRST+" "+D.CLASS_LAST;this._elMsgTr=J;var M=J.appendChild(document.createElement("td"));M.colSpan=this._oColumnSet.keys.length||1;M.className=D.CLASS_FIRST+" "+D.CLASS_LAST;this._elMsgTd=M;K=L.insertBefore(K,this._elTbody);var I=M.appendChild(document.createElement("div"));I.className=D.CLASS_LINER;this._elMsgTbody=K;}},_initEvents:function(){this._initColumnSort();YAHOO.util.Event.addListener(document,"click",this._onDocumentClick,this);this.subscribe("paginatorChange",function(){this._handlePaginatorChange.apply(this,arguments);});this.subscribe("initEvent",function(){this.renderPaginator();});this._initCellEditing();},_initColumnSort:function(){this.subscribe("theadCellClickEvent",this.onEventSortColumn);var I=this.get("sortedBy");if(I){if(I.dir=="desc"){this._configs.sortedBy.value.dir=D.CLASS_DESC;}else{if(I.dir=="asc"){this._configs.sortedBy.value.dir=D.CLASS_ASC;}}}},_initCellEditing:function(){this.subscribe("editorBlurEvent",function(){this.onEditorBlurEvent.apply(this,arguments);});this.subscribe("editorBlockEvent",function(){this.onEditorBlockEvent.apply(this,arguments);});this.subscribe("editorUnblockEvent",function(){this.onEditorUnblockEvent.apply(this,arguments);});},_getColumnClassNames:function(L,K){var I;if(H.isString(L.className)){I=[L.className];}else{if(H.isArray(L.className)){I=L.className;}else{I=[];}}I[I.length]=this.getId()+"-col-"+L.getSanitizedKey();I[I.length]="yui-dt-col-"+L.getSanitizedKey();var J=this.get("sortedBy")||{};if(L.key===J.key){I[I.length]=J.dir||"";}if(L.hidden){I[I.length]=D.CLASS_HIDDEN;}if(L.selected){I[I.length]=D.CLASS_SELECTED;}if(L.sortable){I[I.length]=D.CLASS_SORTABLE;}if(L.resizeable){I[I.length]=D.CLASS_RESIZEABLE;}if(L.editor){I[I.length]=D.CLASS_EDITABLE;}if(K){I=I.concat(K);}return I.join(" ");},_clearTrTemplateEl:function(){this._elTrTemplate=null;},_getTrTemplateEl:function(T,N){if(this._elTrTemplate){return this._elTrTemplate;}else{var P=document,R=P.createElement("tr"),K=P.createElement("td"),J=P.createElement("div");K.appendChild(J);var S=document.createDocumentFragment(),Q=this._oColumnSet.keys,M;var O;for(var L=0,I=Q.length;L<I;L++){M=K.cloneNode(true);M=this._formatTdEl(Q[L],M,L,(L===I-1));S.appendChild(M);}R.appendChild(S);this._elTrTemplate=R;return R;}},_formatTdEl:function(M,O,P,L){var S=this._oColumnSet;var I=S.headers,J=I[P],N="",U;for(var K=0,T=J.length;K<T;K++){U=this._sId+"-th-"+J[K]+" ";N+=U;}O.headers=N;var R=[];if(P===0){R[R.length]=D.CLASS_FIRST;}if(L){R[R.length]=D.CLASS_LAST;}O.className=this._getColumnClassNames(M,R);O.firstChild.className=D.CLASS_LINER;if(M.width&&D._bDynStylesFallback){var Q=(M.minWidth&&(M.width<M.minWidth))?M.minWidth:M.width;O.firstChild.style.overflow="hidden";O.firstChild.style.width=Q+"px";}return O;},_addTrEl:function(K){var J=this._getTrTemplateEl();var I=J.cloneNode(true);return this._updateTrEl(I,K);},_updateTrEl:function(J,N){var M=this.get("formatRow")?this.get("formatRow").call(this,J,N):true;if(M){J.style.display="none";var O=J.childNodes,K;for(var L=0,I=O.length;L<I;++L){K=O[L];this.formatCell(O[L].firstChild,N,this._oColumnSet.keys[L]);}J.style.display="";}J.id=N.getId();return J;},_deleteTrEl:function(I){var J;if(!H.isNumber(I)){J=C.get(I).sectionRowIndex;}else{J=I;}if(H.isNumber(J)&&(J>-2)&&(J<this._elTbody.rows.length)){return this._elTbody.removeChild(this.getTrEl(I));}else{return null;}},_unsetFirstRow:function(){if(this._sFirstTrId){C.removeClass(this._sFirstTrId,D.CLASS_FIRST);this._sFirstTrId=null;}},_setFirstRow:function(){this._unsetFirstRow();var I=this.getFirstTrEl();if(I){C.addClass(I,D.CLASS_FIRST);this._sFirstTrId=I.id;}},_unsetLastRow:function(){if(this._sLastTrId){C.removeClass(this._sLastTrId,D.CLASS_LAST);this._sLastTrId=null;}},_setLastRow:function(){this._unsetLastRow();var I=this.getLastTrEl();if(I){C.addClass(I,D.CLASS_LAST);this._sLastTrId=I.id;}},_setRowStripes:function(S,K){var L=this._elTbody.rows,P=0,R=L.length,O=[],Q=0,M=[],I=0;if((S!==null)&&(S!==undefined)){var N=this.getTrEl(S);if(N){P=N.sectionRowIndex;if(H.isNumber(K)&&(K>1)){R=P+K;}}}for(var J=P;J<R;J++){if(J%2){O[Q++]=L[J];}else{M[I++]=L[J];}}if(O.length){C.replaceClass(O,D.CLASS_EVEN,D.CLASS_ODD);}if(M.length){C.replaceClass(M,D.CLASS_ODD,D.CLASS_EVEN);}},_setSelections:function(){var K=this.getSelectedRows();var M=this.getSelectedCells();if((K.length>0)||(M.length>0)){var L=this._oColumnSet,J;for(var I=0;I<K.length;I++){J=C.get(K[I]);if(J){C.addClass(J,D.CLASS_SELECTED);}}for(I=0;I<M.length;I++){J=C.get(M[I].recordId);if(J){C.addClass(J.childNodes[L.getColumn(M[I].columnKey).getKeyIndex()],D.CLASS_SELECTED);}}}},_onRenderChainEnd:function(){this.hideTableMessage();if(this._elTbody.rows.length===0){this.showTableMessage(this.get("MSG_EMPTY"),D.CLASS_EMPTY);}var I=this;setTimeout(function(){if((I instanceof D)&&I._sId){if(I._bInit){I._bInit=false;I.fireEvent("initEvent");}I.fireEvent("renderEvent");I.fireEvent("refreshEvent");I.validateColumnWidths();I.fireEvent("postRenderEvent");}},0);},_onDocumentClick:function(L,J){var M=G.getTarget(L);var I=M.nodeName.toLowerCase();if(!C.isAncestor(J._elContainer,M)){J.fireEvent("tableBlurEvent");if(J._oCellEditor){if(J._oCellEditor.getContainerEl){var K=J._oCellEditor.getContainerEl();if(!C.isAncestor(K,M)&&(K.id!==M.id)){J._oCellEditor.fireEvent("blurEvent",{editor:J._oCellEditor});
}}else{if(J._oCellEditor.isActive){if(!C.isAncestor(J._oCellEditor.container,M)&&(J._oCellEditor.container.id!==M.id)){J.fireEvent("editorBlurEvent",{editor:J._oCellEditor});}}}}}},_onTableFocus:function(J,I){I.fireEvent("tableFocusEvent");},_onTheadFocus:function(J,I){I.fireEvent("theadFocusEvent");I.fireEvent("tableFocusEvent");},_onTbodyFocus:function(J,I){I.fireEvent("tbodyFocusEvent");I.fireEvent("tableFocusEvent");},_onTableMouseover:function(L,J){var M=G.getTarget(L);var I=M.nodeName.toLowerCase();var K=true;while(M&&(I!="table")){switch(I){case"body":return;case"a":break;case"td":K=J.fireEvent("cellMouseoverEvent",{target:M,event:L});break;case"span":if(C.hasClass(M,D.CLASS_LABEL)){K=J.fireEvent("theadLabelMouseoverEvent",{target:M,event:L});K=J.fireEvent("headerLabelMouseoverEvent",{target:M,event:L});}break;case"th":K=J.fireEvent("theadCellMouseoverEvent",{target:M,event:L});K=J.fireEvent("headerCellMouseoverEvent",{target:M,event:L});break;case"tr":if(M.parentNode.nodeName.toLowerCase()=="thead"){K=J.fireEvent("theadRowMouseoverEvent",{target:M,event:L});K=J.fireEvent("headerRowMouseoverEvent",{target:M,event:L});}else{K=J.fireEvent("rowMouseoverEvent",{target:M,event:L});}break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableMouseoverEvent",{target:(M||J._elContainer),event:L});},_onTableMouseout:function(L,J){var M=G.getTarget(L);var I=M.nodeName.toLowerCase();var K=true;while(M&&(I!="table")){switch(I){case"body":return;case"a":break;case"td":K=J.fireEvent("cellMouseoutEvent",{target:M,event:L});break;case"span":if(C.hasClass(M,D.CLASS_LABEL)){K=J.fireEvent("theadLabelMouseoutEvent",{target:M,event:L});K=J.fireEvent("headerLabelMouseoutEvent",{target:M,event:L});}break;case"th":K=J.fireEvent("theadCellMouseoutEvent",{target:M,event:L});K=J.fireEvent("headerCellMouseoutEvent",{target:M,event:L});break;case"tr":if(M.parentNode.nodeName.toLowerCase()=="thead"){K=J.fireEvent("theadRowMouseoutEvent",{target:M,event:L});K=J.fireEvent("headerRowMouseoutEvent",{target:M,event:L});}else{K=J.fireEvent("rowMouseoutEvent",{target:M,event:L});}break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableMouseoutEvent",{target:(M||J._elContainer),event:L});},_onTableMousedown:function(L,J){var M=G.getTarget(L);var I=M.nodeName.toLowerCase();var K=true;while(M&&(I!="table")){switch(I){case"body":return;case"a":break;case"td":K=J.fireEvent("cellMousedownEvent",{target:M,event:L});break;case"span":if(C.hasClass(M,D.CLASS_LABEL)){K=J.fireEvent("theadLabelMousedownEvent",{target:M,event:L});K=J.fireEvent("headerLabelMousedownEvent",{target:M,event:L});}break;case"th":K=J.fireEvent("theadCellMousedownEvent",{target:M,event:L});K=J.fireEvent("headerCellMousedownEvent",{target:M,event:L});break;case"tr":if(M.parentNode.nodeName.toLowerCase()=="thead"){K=J.fireEvent("theadRowMousedownEvent",{target:M,event:L});K=J.fireEvent("headerRowMousedownEvent",{target:M,event:L});}else{K=J.fireEvent("rowMousedownEvent",{target:M,event:L});}break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableMousedownEvent",{target:(M||J._elContainer),event:L});},_onTableMouseup:function(L,J){var M=G.getTarget(L);var I=M.nodeName.toLowerCase();var K=true;while(M&&(I!="table")){switch(I){case"body":return;case"a":break;case"td":K=J.fireEvent("cellMouseupEvent",{target:M,event:L});break;case"span":if(C.hasClass(M,D.CLASS_LABEL)){K=J.fireEvent("theadLabelMouseupEvent",{target:M,event:L});K=J.fireEvent("headerLabelMouseupEvent",{target:M,event:L});}break;case"th":K=J.fireEvent("theadCellMouseupEvent",{target:M,event:L});K=J.fireEvent("headerCellMouseupEvent",{target:M,event:L});break;case"tr":if(M.parentNode.nodeName.toLowerCase()=="thead"){K=J.fireEvent("theadRowMouseupEvent",{target:M,event:L});K=J.fireEvent("headerRowMouseupEvent",{target:M,event:L});}else{K=J.fireEvent("rowMouseupEvent",{target:M,event:L});}break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableMouseupEvent",{target:(M||J._elContainer),event:L});},_onTableDblclick:function(L,J){var M=G.getTarget(L);var I=M.nodeName.toLowerCase();var K=true;while(M&&(I!="table")){switch(I){case"body":return;case"td":K=J.fireEvent("cellDblclickEvent",{target:M,event:L});break;case"span":if(C.hasClass(M,D.CLASS_LABEL)){K=J.fireEvent("theadLabelDblclickEvent",{target:M,event:L});K=J.fireEvent("headerLabelDblclickEvent",{target:M,event:L});}break;case"th":K=J.fireEvent("theadCellDblclickEvent",{target:M,event:L});K=J.fireEvent("headerCellDblclickEvent",{target:M,event:L});break;case"tr":if(M.parentNode.nodeName.toLowerCase()=="thead"){K=J.fireEvent("theadRowDblclickEvent",{target:M,event:L});K=J.fireEvent("headerRowDblclickEvent",{target:M,event:L});}else{K=J.fireEvent("rowDblclickEvent",{target:M,event:L});}break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableDblclickEvent",{target:(M||J._elContainer),event:L});},_onTheadKeydown:function(L,J){var M=G.getTarget(L);var I=M.nodeName.toLowerCase();var K=true;while(M&&(I!="table")){switch(I){case"body":return;case"input":case"textarea":break;case"thead":K=J.fireEvent("theadKeyEvent",{target:M,event:L});break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableKeyEvent",{target:(M||J._elContainer),event:L});},_onTbodyKeydown:function(M,K){var J=K.get("selectionMode");if(J=="standard"){K._handleStandardSelectionByKey(M);}else{if(J=="single"){K._handleSingleSelectionByKey(M);}else{if(J=="cellblock"){K._handleCellBlockSelectionByKey(M);}else{if(J=="cellrange"){K._handleCellRangeSelectionByKey(M);}else{if(J=="singlecell"){K._handleSingleCellSelectionByKey(M);}}}}}if(K._oCellEditor){if(K._oCellEditor.fireEvent){K._oCellEditor.fireEvent("blurEvent",{editor:K._oCellEditor});}else{if(K._oCellEditor.isActive){K.fireEvent("editorBlurEvent",{editor:K._oCellEditor});
}}}var N=G.getTarget(M);var I=N.nodeName.toLowerCase();var L=true;while(N&&(I!="table")){switch(I){case"body":return;case"tbody":L=K.fireEvent("tbodyKeyEvent",{target:N,event:M});break;default:break;}if(L===false){return;}else{N=N.parentNode;if(N){I=N.nodeName.toLowerCase();}}}K.fireEvent("tableKeyEvent",{target:(N||K._elContainer),event:M});},_onTableKeypress:function(K,J){if(B.opera||(navigator.userAgent.toLowerCase().indexOf("mac")!==-1)&&(B.webkit<420)){var I=G.getCharCode(K);if(I==40){G.stopEvent(K);}else{if(I==38){G.stopEvent(K);}}}},_onTheadClick:function(L,J){if(J._oCellEditor){if(J._oCellEditor.fireEvent){J._oCellEditor.fireEvent("blurEvent",{editor:J._oCellEditor});}else{if(J._oCellEditor.isActive){J.fireEvent("editorBlurEvent",{editor:J._oCellEditor});}}}var M=G.getTarget(L),I=M.nodeName.toLowerCase(),K=true;while(M&&(I!="table")){switch(I){case"body":return;case"input":var N=M.type.toLowerCase();if(N=="checkbox"){K=J.fireEvent("theadCheckboxClickEvent",{target:M,event:L});}else{if(N=="radio"){K=J.fireEvent("theadRadioClickEvent",{target:M,event:L});}else{if((N=="button")||(N=="image")||(N=="submit")||(N=="reset")){K=J.fireEvent("theadButtonClickEvent",{target:M,event:L});}}}break;case"a":K=J.fireEvent("theadLinkClickEvent",{target:M,event:L});break;case"button":K=J.fireEvent("theadButtonClickEvent",{target:M,event:L});break;case"span":if(C.hasClass(M,D.CLASS_LABEL)){K=J.fireEvent("theadLabelClickEvent",{target:M,event:L});K=J.fireEvent("headerLabelClickEvent",{target:M,event:L});}break;case"th":K=J.fireEvent("theadCellClickEvent",{target:M,event:L});K=J.fireEvent("headerCellClickEvent",{target:M,event:L});break;case"tr":K=J.fireEvent("theadRowClickEvent",{target:M,event:L});K=J.fireEvent("headerRowClickEvent",{target:M,event:L});break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableClickEvent",{target:(M||J._elContainer),event:L});},_onTbodyClick:function(L,J){if(J._oCellEditor){if(J._oCellEditor.fireEvent){J._oCellEditor.fireEvent("blurEvent",{editor:J._oCellEditor});}else{if(J._oCellEditor.isActive){J.fireEvent("editorBlurEvent",{editor:J._oCellEditor});}}}var M=G.getTarget(L),I=M.nodeName.toLowerCase(),K=true;while(M&&(I!="table")){switch(I){case"body":return;case"input":var N=M.type.toLowerCase();if(N=="checkbox"){K=J.fireEvent("checkboxClickEvent",{target:M,event:L});}else{if(N=="radio"){K=J.fireEvent("radioClickEvent",{target:M,event:L});}else{if((N=="button")||(N=="image")||(N=="submit")||(N=="reset")){K=J.fireEvent("buttonClickEvent",{target:M,event:L});}}}break;case"a":K=J.fireEvent("linkClickEvent",{target:M,event:L});break;case"button":K=J.fireEvent("buttonClickEvent",{target:M,event:L});break;case"td":K=J.fireEvent("cellClickEvent",{target:M,event:L});break;case"tr":K=J.fireEvent("rowClickEvent",{target:M,event:L});break;default:break;}if(K===false){return;}else{M=M.parentNode;if(M){I=M.nodeName.toLowerCase();}}}J.fireEvent("tableClickEvent",{target:(M||J._elContainer),event:L});},_onDropdownChange:function(J,I){var K=G.getTarget(J);I.fireEvent("dropdownChangeEvent",{event:J,target:K});},configs:null,getId:function(){return this._sId;},toString:function(){return"DataTable instance "+this._sId;},getDataSource:function(){return this._oDataSource;},getColumnSet:function(){return this._oColumnSet;},getRecordSet:function(){return this._oRecordSet;},getState:function(){return{totalRecords:this.get("paginator")?this.get("paginator").get("totalRecords"):this._oRecordSet.getLength(),pagination:this.get("paginator")?this.get("paginator").getState():null,sortedBy:this.get("sortedBy"),selectedRows:this.getSelectedRows(),selectedCells:this.getSelectedCells()};},getContainerEl:function(){return this._elContainer;},getTableEl:function(){return this._elTable;},getTheadEl:function(){return this._elThead;},getTbodyEl:function(){return this._elTbody;},getMsgTbodyEl:function(){return this._elMsgTbody;},getMsgTdEl:function(){return this._elMsgTd;},getTrEl:function(K){if(K instanceof YAHOO.widget.Record){return document.getElementById(K.getId());}else{if(H.isNumber(K)){var J=this._elTbody.rows;return((K>-1)&&(K<J.length))?J[K]:null;}else{var I=(H.isString(K))?document.getElementById(K):K;if(I&&(I.ownerDocument==document)){if(I.nodeName.toLowerCase()!="tr"){I=C.getAncestorByTagName(I,"tr");}return I;}}}return null;},getFirstTrEl:function(){return this._elTbody.rows[0]||null;},getLastTrEl:function(){var I=this._elTbody.rows;if(I.length>0){return I[I.length-1]||null;}},getNextTrEl:function(K){var I=this.getTrIndex(K);if(I!==null){var J=this._elTbody.rows;if(I<J.length-1){return J[I+1];}}return null;},getPreviousTrEl:function(K){var I=this.getTrIndex(K);if(I!==null){var J=this._elTbody.rows;if(I>0){return J[I-1];}}return null;},getTdLinerEl:function(I){var J=this.getTdEl(I);return J.firstChild||null;},getTdEl:function(I){var N;var L=C.get(I);if(L&&(L.ownerDocument==document)){if(L.nodeName.toLowerCase()!="td"){N=C.getAncestorByTagName(L,"td");}else{N=L;}return N;}else{if(I){var M,K;if(H.isString(I.columnKey)&&H.isString(I.recordId)){M=this.getRecord(I.recordId);var O=this.getColumn(I.columnKey);if(O){K=O.getKeyIndex();}}if(I.record&&I.column&&I.column.getKeyIndex){M=I.record;K=I.column.getKeyIndex();}var J=this.getTrEl(M);if((K!==null)&&J&&J.cells&&J.cells.length>0){return J.cells[K]||null;}}}return null;},getFirstTdEl:function(J){var I=this.getTrEl(J)||this.getFirstTrEl();if(I&&(I.cells.length>0)){return I.cells[0];}return null;},getLastTdEl:function(J){var I=this.getTrEl(J)||this.getLastTrEl();if(I&&(I.cells.length>0)){return I.cells[I.cells.length-1];}return null;},getNextTdEl:function(I){var M=this.getTdEl(I);if(M){var K=M.cellIndex;var J=this.getTrEl(M);if(K<J.cells.length-1){return J.cells[K+1];}else{var L=this.getNextTrEl(J);if(L){return L.cells[0];}}}return null;},getPreviousTdEl:function(I){var M=this.getTdEl(I);if(M){var K=M.cellIndex;var J=this.getTrEl(M);if(K>0){return J.cells[K-1];}else{var L=this.getPreviousTrEl(J);
if(L){return this.getLastTdEl(L);}}}return null;},getAboveTdEl:function(I){var K=this.getTdEl(I);if(K){var J=this.getPreviousTrEl(K);if(J){return J.cells[K.cellIndex];}}return null;},getBelowTdEl:function(I){var K=this.getTdEl(I);if(K){var J=this.getNextTrEl(K);if(J){return J.cells[K.cellIndex];}}return null;},getThLinerEl:function(J){var I=this.getColumn(J);return(I)?I.getThLinerEl():null;},getThEl:function(K){var L;if(K instanceof YAHOO.widget.Column){var J=K;L=J.getThEl();if(L){return L;}}else{var I=C.get(K);if(I&&(I.ownerDocument==document)){if(I.nodeName.toLowerCase()!="th"){L=C.getAncestorByTagName(I,"th");}else{L=I;}return L;}}return null;},getTrIndex:function(M){var L;if(M instanceof YAHOO.widget.Record){L=this._oRecordSet.getRecordIndex(M);if(L===null){return null;}}else{if(H.isNumber(M)){L=M;}}if(H.isNumber(L)){if((L>-1)&&(L<this._oRecordSet.getLength())){var K=this.get("paginator");if(K){var J=K.getPageRecords();if(J&&L>=J[0]&&L<=J[1]){return L-J[0];}else{return null;}}else{return L;}}else{return null;}}else{var I=this.getTrEl(M);if(I&&(I.ownerDocument==document)&&(I.parentNode==this._elTbody)){return I.sectionRowIndex;}}return null;},initializeTable:function(){this._bInit=true;this._oRecordSet.reset();var I=this.get("paginator");if(I){I.set("totalRecords",0);}this._unselectAllTrEls();this._unselectAllTdEls();this._aSelections=null;this._oAnchorRecord=null;this._oAnchorCell=null;this.set("sortedBy",null);},_runRenderChain:function(){this._oChainRender.run();},render:function(){this._oChainRender.stop();var O,M,L,P,I;var R=this.get("paginator");if(R){I=this._oRecordSet.getRecords(R.getStartIndex(),R.getRowsPerPage());}else{I=this._oRecordSet.getRecords();}var J=this._elTbody,N=this.get("renderLoopSize"),Q=I.length;if(Q>0){J.style.display="none";while(J.lastChild){J.removeChild(J.lastChild);}J.style.display="";this._oChainRender.add({method:function(U){if((this instanceof D)&&this._sId){var T=U.nCurrentRecord,W=((U.nCurrentRecord+U.nLoopLength)>Q)?Q:(U.nCurrentRecord+U.nLoopLength),S,V;J.style.display="none";for(;T<W;T++){S=C.get(I[T].getId());S=S||this._addTrEl(I[T]);V=J.childNodes[T]||null;J.insertBefore(S,V);}J.style.display="";U.nCurrentRecord=T;}},scope:this,iterations:(N>0)?Math.ceil(Q/N):1,argument:{nCurrentRecord:0,nLoopLength:(N>0)?N:Q},timeout:(N>0)?0:-1});this._oChainRender.add({method:function(S){if((this instanceof D)&&this._sId){while(J.rows.length>Q){J.removeChild(J.lastChild);}this._setFirstRow();this._setLastRow();this._setRowStripes();this._setSelections();}},scope:this,timeout:(N>0)?0:-1});}else{var K=J.rows.length;if(K>0){this._oChainRender.add({method:function(T){if((this instanceof D)&&this._sId){var S=T.nCurrent,V=T.nLoopLength,U=(S-V<0)?-1:S-V;J.style.display="none";for(;S>U;S--){J.deleteRow(-1);}J.style.display="";T.nCurrent=S;}},scope:this,iterations:(N>0)?Math.ceil(K/N):1,argument:{nCurrent:K,nLoopLength:(N>0)?N:K},timeout:(N>0)?0:-1});}}this._runRenderChain();},disable:function(){var I=this._elTable;var J=this._elMask;J.style.width=I.offsetWidth+"px";J.style.height=I.offsetHeight+"px";J.style.display="";this.fireEvent("disableEvent");},undisable:function(){this._elMask.style.display="none";this.fireEvent("undisableEvent");},destroy:function(){var J=this.toString();this._oChainRender.stop();D._destroyColumnDragTargetEl();D._destroyColumnResizerProxyEl();this._destroyColumnHelpers();var L;for(var K=0,I=this._oColumnSet.flat.length;K<I;K++){L=this._oColumnSet.flat[K].editor;if(L&&L.destroy){L.destroy();this._oColumnSet.flat[K].editor=null;}}this._oRecordSet.unsubscribeAll();this.unsubscribeAll();G.removeListener(document,"click",this._onDocumentClick);this._destroyContainerEl(this._elContainer);for(var M in this){if(H.hasOwnProperty(this,M)){this[M]=null;}}D._nCurrentCount--;if(D._nCurrentCount<1){if(D._elDynStyleNode){document.getElementsByTagName("head")[0].removeChild(D._elDynStyleNode);D._elDynStyleNode=null;}}},showTableMessage:function(J,I){var K=this._elMsgTd;if(H.isString(J)){K.firstChild.innerHTML=J;}if(H.isString(I)){K.className=I;}this._elMsgTbody.style.display="";this.fireEvent("tableMsgShowEvent",{html:J,className:I});},hideTableMessage:function(){if(this._elMsgTbody.style.display!="none"){this._elMsgTbody.style.display="none";this._elMsgTbody.parentNode.style.width="";this.fireEvent("tableMsgHideEvent");}},focus:function(){this.focusTbodyEl();},focusTheadEl:function(){this._focusEl(this._elThead);},focusTbodyEl:function(){this._focusEl(this._elTbody);},onShow:function(){this.validateColumnWidths();for(var L=this._oColumnSet.keys,K=0,I=L.length,J;K<I;K++){J=L[K];if(J._ddResizer){J._ddResizer.resetResizerEl();}}},getRecordIndex:function(L){var K;if(!H.isNumber(L)){if(L instanceof YAHOO.widget.Record){return this._oRecordSet.getRecordIndex(L);}else{var J=this.getTrEl(L);if(J){K=J.sectionRowIndex;}}}else{K=L;}if(H.isNumber(K)){var I=this.get("paginator");if(I){return I.get("recordOffset")+K;}else{return K;}}return null;},getRecord:function(K){var J=this._oRecordSet.getRecord(K);if(!J){var I=this.getTrEl(K);if(I){J=this._oRecordSet.getRecord(this.getRecordIndex(I.sectionRowIndex));}}if(J instanceof YAHOO.widget.Record){return this._oRecordSet.getRecord(J);}else{return null;}},getColumn:function(L){var N=this._oColumnSet.getColumn(L);if(!N){var M=this.getTdEl(L);if(M){N=this._oColumnSet.getColumn(M.cellIndex);}else{M=this.getThEl(L);if(M){var J=this._oColumnSet.flat;for(var K=0,I=J.length;K<I;K++){if(J[K].getThEl().id===M.id){N=J[K];}}}}}if(!N){}return N;},getColumnById:function(I){return this._oColumnSet.getColumnById(I);},getColumnSortDir:function(K,L){if(K.sortOptions&&K.sortOptions.defaultOrder){if(K.sortOptions.defaultOrder=="asc"){K.sortOptions.defaultDir=D.CLASS_ASC;}else{if(K.sortOptions.defaultOrder=="desc"){K.sortOptions.defaultDir=D.CLASS_DESC;}}}var J=(K.sortOptions&&K.sortOptions.defaultDir)?K.sortOptions.defaultDir:D.CLASS_ASC;var I=false;L=L||this.get("sortedBy");if(L&&(L.key===K.key)){I=true;if(L.dir){J=(L.dir===D.CLASS_ASC)?D.CLASS_DESC:D.CLASS_ASC;
}else{J=(J===D.CLASS_ASC)?D.CLASS_DESC:D.CLASS_ASC;}}return J;},doBeforeSortColumn:function(J,I){this.showTableMessage(this.get("MSG_LOADING"),D.CLASS_LOADING);return true;},sortColumn:function(M,J){if(M&&(M instanceof YAHOO.widget.Column)){if(!M.sortable){C.addClass(this.getThEl(M),D.CLASS_SORTABLE);}if(J&&(J!==D.CLASS_ASC)&&(J!==D.CLASS_DESC)){J=null;}var N=J||this.getColumnSortDir(M);var L=this.get("sortedBy")||{};var T=(L.key===M.key)?true:false;var P=this.doBeforeSortColumn(M,N);if(P){if(this.get("dynamicData")){var S=this.getState();if(S.pagination){S.pagination.recordOffset=0;}S.sortedBy={key:M.key,dir:N};var K=this.get("generateRequest")(S,this);this.unselectAllRows();this.unselectAllCells();var R={success:this.onDataReturnSetRows,failure:this.onDataReturnSetRows,argument:S,scope:this};this._oDataSource.sendRequest(K,R);}else{var I=(M.sortOptions&&H.isFunction(M.sortOptions.sortFunction))?M.sortOptions.sortFunction:null;if(!T||J||I){var Q=(M.sortOptions&&M.sortOptions.field)?M.sortOptions.field:M.field;I=I||function(V,U,X){var W=YAHOO.util.Sort.compare(V.getData(Q),U.getData(Q),X);if(W===0){return YAHOO.util.Sort.compare(V.getCount(),U.getCount(),X);}else{return W;}};this._oRecordSet.sortRecords(I,((N==D.CLASS_DESC)?true:false));}else{this._oRecordSet.reverseRecords();}var O=this.get("paginator");if(O){O.setPage(1,true);}this.render();this.set("sortedBy",{key:M.key,dir:N,column:M});}this.fireEvent("columnSortEvent",{column:M,dir:N});return;}}},setColumnWidth:function(J,I){if(!(J instanceof YAHOO.widget.Column)){J=this.getColumn(J);}if(J){if(H.isNumber(I)){I=(I>J.minWidth)?I:J.minWidth;J.width=I;this._setColumnWidth(J,I+"px");this.fireEvent("columnSetWidthEvent",{column:J,width:I});}else{if(I===null){J.width=I;this._setColumnWidth(J,"auto");this.validateColumnWidths(J);this.fireEvent("columnUnsetWidthEvent",{column:J});}}this._clearTrTemplateEl();}else{}},_setColumnWidth:function(J,I,K){if(J&&(J.getKeyIndex()!==null)){K=K||(((I==="")||(I==="auto"))?"visible":"hidden");if(!D._bDynStylesFallback){this._setColumnWidthDynStyles(J,I,K);}else{this._setColumnWidthDynFunction(J,I,K);}}else{}},_setColumnWidthDynStyles:function(M,L,N){var J=D._elDynStyleNode,K;if(!J){J=document.createElement("style");J.type="text/css";J=document.getElementsByTagName("head").item(0).appendChild(J);D._elDynStyleNode=J;}if(J){var I="."+this.getId()+"-col-"+M.getSanitizedKey()+" ."+D.CLASS_LINER;if(this._elTbody){this._elTbody.style.display="none";}K=D._oDynStyles[I];if(!K){if(J.styleSheet&&J.styleSheet.addRule){J.styleSheet.addRule(I,"overflow:"+N);J.styleSheet.addRule(I,"width:"+L);K=J.styleSheet.rules[J.styleSheet.rules.length-1];D._oDynStyles[I]=K;}else{if(J.sheet&&J.sheet.insertRule){J.sheet.insertRule(I+" {overflow:"+N+";width:"+L+";}",J.sheet.cssRules.length);K=J.sheet.cssRules[J.sheet.cssRules.length-1];D._oDynStyles[I]=K;}}}else{K.style.overflow=N;K.style.width=L;}if(this._elTbody){this._elTbody.style.display="";}}if(!K){D._bDynStylesFallback=true;this._setColumnWidthDynFunction(M,L);}},_setColumnWidthDynFunction:function(O,J,P){if(J=="auto"){J="";}var I=this._elTbody?this._elTbody.rows.length:0;if(!this._aDynFunctions[I]){var N,M,L;var Q=["var colIdx=oColumn.getKeyIndex();","oColumn.getThLinerEl().style.overflow="];for(N=I-1,M=2;N>=0;--N){Q[M++]="this._elTbody.rows[";Q[M++]=N;Q[M++]="].cells[colIdx].firstChild.style.overflow=";}Q[M]="sOverflow;";Q[M+1]="oColumn.getThLinerEl().style.width=";for(N=I-1,L=M+2;N>=0;--N){Q[L++]="this._elTbody.rows[";Q[L++]=N;Q[L++]="].cells[colIdx].firstChild.style.width=";}Q[L]="sWidth;";this._aDynFunctions[I]=new Function("oColumn","sWidth","sOverflow",Q.join(""));}var K=this._aDynFunctions[I];if(K){K.call(this,O,J,P);}},validateColumnWidths:function(N){var K=this._elColgroup;var P=K.cloneNode(true);var O=false;var M=this._oColumnSet.keys;var J;if(N&&!N.hidden&&!N.width&&(N.getKeyIndex()!==null)){J=N.getThLinerEl();if((N.minWidth>0)&&(J.offsetWidth<N.minWidth)){P.childNodes[N.getKeyIndex()].style.width=N.minWidth+(parseInt(C.getStyle(J,"paddingLeft"),10)|0)+(parseInt(C.getStyle(J,"paddingRight"),10)|0)+"px";O=true;}else{if((N.maxAutoWidth>0)&&(J.offsetWidth>N.maxAutoWidth)){this._setColumnWidth(N,N.maxAutoWidth+"px","hidden");}}}else{for(var L=0,I=M.length;L<I;L++){N=M[L];if(!N.hidden&&!N.width){J=N.getThLinerEl();if((N.minWidth>0)&&(J.offsetWidth<N.minWidth)){P.childNodes[L].style.width=N.minWidth+(parseInt(C.getStyle(J,"paddingLeft"),10)|0)+(parseInt(C.getStyle(J,"paddingRight"),10)|0)+"px";O=true;}else{if((N.maxAutoWidth>0)&&(J.offsetWidth>N.maxAutoWidth)){this._setColumnWidth(N,N.maxAutoWidth+"px","hidden");}}}}}if(O){K.parentNode.replaceChild(P,K);this._elColgroup=P;}},_clearMinWidth:function(I){if(I.getKeyIndex()!==null){this._elColgroup.childNodes[I.getKeyIndex()].style.width="";}},_restoreMinWidth:function(I){if(I.minWidth&&(I.getKeyIndex()!==null)){this._elColgroup.childNodes[I.getKeyIndex()].style.width=I.minWidth+"px";}},hideColumn:function(N){if(!(N instanceof YAHOO.widget.Column)){N=this.getColumn(N);}if(N&&!N.hidden&&N.getTreeIndex()!==null){var O=this.getTbodyEl().rows;var I=O.length;var M=this._oColumnSet.getDescendants(N);for(var L=0;L<M.length;L++){var K=M[L];K.hidden=true;C.addClass(K.getThEl(),D.CLASS_HIDDEN);var P=K.getKeyIndex();if(P!==null){this._clearMinWidth(N);for(var J=0;J<I;J++){C.addClass(O[J].cells[P],D.CLASS_HIDDEN);}}this.fireEvent("columnHideEvent",{column:K});}this._repaintOpera();this._clearTrTemplateEl();}else{}},showColumn:function(N){if(!(N instanceof YAHOO.widget.Column)){N=this.getColumn(N);}if(N&&N.hidden&&(N.getTreeIndex()!==null)){var O=this.getTbodyEl().rows;var I=O.length;var M=this._oColumnSet.getDescendants(N);for(var L=0;L<M.length;L++){var K=M[L];K.hidden=false;C.removeClass(K.getThEl(),D.CLASS_HIDDEN);var P=K.getKeyIndex();if(P!==null){this._restoreMinWidth(N);for(var J=0;J<I;J++){C.removeClass(O[J].cells[P],D.CLASS_HIDDEN);}}this.fireEvent("columnShowEvent",{column:K});}this._clearTrTemplateEl();}else{}},removeColumn:function(O){if(!(O instanceof YAHOO.widget.Column)){O=this.getColumn(O);
}if(O){var L=O.getTreeIndex();if(L!==null){var N,Q,P=O.getKeyIndex();if(P===null){var T=[];var I=this._oColumnSet.getDescendants(O);for(N=0,Q=I.length;N<Q;N++){var R=I[N].getKeyIndex();if(R!==null){T[T.length]=R;}}if(T.length>0){P=T;}}else{P=[P];}if(P!==null){P.sort(function(V,U){return YAHOO.util.Sort.compare(V,U);});this._destroyTheadEl();var J=this._oColumnSet.getDefinitions();O=J.splice(L,1)[0];this._initColumnSet(J);this._initTheadEl();for(N=P.length-1;N>-1;N--){this._removeColgroupColEl(P[N]);}var S=this._elTbody.rows;if(S.length>0){var M=this.get("renderLoopSize"),K=S.length;this._oChainRender.add({method:function(X){if((this instanceof D)&&this._sId){var W=X.nCurrentRow,U=M>0?Math.min(W+M,S.length):S.length,Y=X.aIndexes,V;for(;W<U;++W){for(V=Y.length-1;V>-1;V--){S[W].removeChild(S[W].childNodes[Y[V]]);}}X.nCurrentRow=W;}},iterations:(M>0)?Math.ceil(K/M):1,argument:{nCurrentRow:0,aIndexes:P},scope:this,timeout:(M>0)?0:-1});this._runRenderChain();}this.fireEvent("columnRemoveEvent",{column:O});return O;}}}},insertColumn:function(Q,R){if(Q instanceof YAHOO.widget.Column){Q=Q.getDefinition();}else{if(Q.constructor!==Object){return;}}var W=this._oColumnSet;if(!H.isValue(R)||!H.isNumber(R)){R=W.tree[0].length;}this._destroyTheadEl();var Y=this._oColumnSet.getDefinitions();Y.splice(R,0,Q);this._initColumnSet(Y);this._initTheadEl();W=this._oColumnSet;var M=W.tree[0][R];var O,S,V=[];var K=W.getDescendants(M);for(O=0,S=K.length;O<S;O++){var T=K[O].getKeyIndex();if(T!==null){V[V.length]=T;}}if(V.length>0){var X=V.sort(function(c,Z){return YAHOO.util.Sort.compare(c,Z);})[0];for(O=V.length-1;O>-1;O--){this._insertColgroupColEl(V[O]);}var U=this._elTbody.rows;if(U.length>0){var N=this.get("renderLoopSize"),L=U.length;var J=[],P;for(O=0,S=V.length;O<S;O++){var I=V[O];P=this._getTrTemplateEl().childNodes[O].cloneNode(true);P=this._formatTdEl(this._oColumnSet.keys[I],P,I,(I===this._oColumnSet.keys.length-1));J[I]=P;}this._oChainRender.add({method:function(c){if((this instanceof D)&&this._sId){var b=c.nCurrentRow,a,e=c.descKeyIndexes,Z=N>0?Math.min(b+N,U.length):U.length,d;for(;b<Z;++b){d=U[b].childNodes[X]||null;for(a=e.length-1;a>-1;a--){U[b].insertBefore(c.aTdTemplates[e[a]].cloneNode(true),d);}}c.nCurrentRow=b;}},iterations:(N>0)?Math.ceil(L/N):1,argument:{nCurrentRow:0,aTdTemplates:J,descKeyIndexes:V},scope:this,timeout:(N>0)?0:-1});this._runRenderChain();}this.fireEvent("columnInsertEvent",{column:Q,index:R});return M;}},reorderColumn:function(P,Q){if(!(P instanceof YAHOO.widget.Column)){P=this.getColumn(P);}if(P&&YAHOO.lang.isNumber(Q)){var Y=P.getTreeIndex();if((Y!==null)&&(Y!==Q)){var O,R,K=P.getKeyIndex(),J,U=[],S;if(K===null){J=this._oColumnSet.getDescendants(P);for(O=0,R=J.length;O<R;O++){S=J[O].getKeyIndex();if(S!==null){U[U.length]=S;}}if(U.length>0){K=U;}}else{K=[K];}if(K!==null){K.sort(function(c,Z){return YAHOO.util.Sort.compare(c,Z);});this._destroyTheadEl();var V=this._oColumnSet.getDefinitions();var I=V.splice(Y,1)[0];V.splice(Q,0,I);this._initColumnSet(V);this._initTheadEl();var M=this._oColumnSet.tree[0][Q];var X=M.getKeyIndex();if(X===null){U=[];J=this._oColumnSet.getDescendants(M);for(O=0,R=J.length;O<R;O++){S=J[O].getKeyIndex();if(S!==null){U[U.length]=S;}}if(U.length>0){X=U;}}else{X=[X];}var W=X.sort(function(c,Z){return YAHOO.util.Sort.compare(c,Z);})[0];this._reorderColgroupColEl(K,W);var T=this._elTbody.rows;if(T.length>0){var N=this.get("renderLoopSize"),L=T.length;this._oChainRender.add({method:function(c){if((this instanceof D)&&this._sId){var b=c.nCurrentRow,a,e,d,Z=N>0?Math.min(b+N,T.length):T.length,g=c.aIndexes,f;for(;b<Z;++b){e=[];f=T[b];for(a=g.length-1;a>-1;a--){e.push(f.removeChild(f.childNodes[g[a]]));}d=f.childNodes[W]||null;for(a=e.length-1;a>-1;a--){f.insertBefore(e[a],d);}}c.nCurrentRow=b;}},iterations:(N>0)?Math.ceil(L/N):1,argument:{nCurrentRow:0,aIndexes:K},scope:this,timeout:(N>0)?0:-1});this._runRenderChain();}this.fireEvent("columnReorderEvent",{column:M});return M;}}}},selectColumn:function(K){K=this.getColumn(K);if(K&&!K.selected){if(K.getKeyIndex()!==null){K.selected=true;var L=K.getThEl();C.addClass(L,D.CLASS_SELECTED);var J=this.getTbodyEl().rows;var I=this._oChainRender;I.add({method:function(M){if((this instanceof D)&&this._sId&&J[M.rowIndex]&&J[M.rowIndex].cells[M.cellIndex]){C.addClass(J[M.rowIndex].cells[M.cellIndex],D.CLASS_SELECTED);}M.rowIndex++;},scope:this,iterations:J.length,argument:{rowIndex:0,cellIndex:K.getKeyIndex()}});this._clearTrTemplateEl();this._elTbody.style.display="none";this._runRenderChain();this._elTbody.style.display="";this.fireEvent("columnSelectEvent",{column:K});}else{}}},unselectColumn:function(K){K=this.getColumn(K);if(K&&K.selected){if(K.getKeyIndex()!==null){K.selected=false;var L=K.getThEl();C.removeClass(L,D.CLASS_SELECTED);var J=this.getTbodyEl().rows;var I=this._oChainRender;I.add({method:function(M){if((this instanceof D)&&this._sId&&J[M.rowIndex]&&J[M.rowIndex].cells[M.cellIndex]){C.removeClass(J[M.rowIndex].cells[M.cellIndex],D.CLASS_SELECTED);}M.rowIndex++;},scope:this,iterations:J.length,argument:{rowIndex:0,cellIndex:K.getKeyIndex()}});this._clearTrTemplateEl();this._elTbody.style.display="none";this._runRenderChain();this._elTbody.style.display="";this.fireEvent("columnUnselectEvent",{column:K});}else{}}},getSelectedColumns:function(M){var J=[];var K=this._oColumnSet.keys;for(var L=0,I=K.length;L<I;L++){if(K[L].selected){J[J.length]=K[L];}}return J;},highlightColumn:function(I){var L=this.getColumn(I);if(L&&(L.getKeyIndex()!==null)){var M=L.getThEl();C.addClass(M,D.CLASS_HIGHLIGHTED);var K=this.getTbodyEl().rows;var J=this._oChainRender;J.add({method:function(N){if((this instanceof D)&&this._sId&&K[N.rowIndex]&&K[N.rowIndex].cells[N.cellIndex]){C.addClass(K[N.rowIndex].cells[N.cellIndex],D.CLASS_HIGHLIGHTED);}N.rowIndex++;},scope:this,iterations:K.length,argument:{rowIndex:0,cellIndex:L.getKeyIndex()},timeout:-1});this._elTbody.style.display="none";this._runRenderChain();this._elTbody.style.display="";
this.fireEvent("columnHighlightEvent",{column:L});}else{}},unhighlightColumn:function(I){var L=this.getColumn(I);if(L&&(L.getKeyIndex()!==null)){var M=L.getThEl();C.removeClass(M,D.CLASS_HIGHLIGHTED);var K=this.getTbodyEl().rows;var J=this._oChainRender;J.add({method:function(N){if((this instanceof D)&&this._sId&&K[N.rowIndex]&&K[N.rowIndex].cells[N.cellIndex]){C.removeClass(K[N.rowIndex].cells[N.cellIndex],D.CLASS_HIGHLIGHTED);}N.rowIndex++;},scope:this,iterations:K.length,argument:{rowIndex:0,cellIndex:L.getKeyIndex()},timeout:-1});this._elTbody.style.display="none";this._runRenderChain();this._elTbody.style.display="";this.fireEvent("columnUnhighlightEvent",{column:L});}else{}},addRow:function(O,K){if(H.isNumber(K)&&(K<0||K>this._oRecordSet.getLength())){return;}if(O&&H.isObject(O)){var M=this._oRecordSet.addRecord(O,K);if(M){var I;var J=this.get("paginator");if(J){var N=J.get("totalRecords");if(N!==E.Paginator.VALUE_UNLIMITED){J.set("totalRecords",N+1);}I=this.getRecordIndex(M);var L=(J.getPageRecords())[1];if(I<=L){this.render();}this.fireEvent("rowAddEvent",{record:M});return;}else{I=this.getTrIndex(M);if(H.isNumber(I)){this._oChainRender.add({method:function(R){if((this instanceof D)&&this._sId){var S=R.record;var P=R.recIndex;var T=this._addTrEl(S);if(T){var Q=(this._elTbody.rows[P])?this._elTbody.rows[P]:null;this._elTbody.insertBefore(T,Q);if(P===0){this._setFirstRow();}if(Q===null){this._setLastRow();}this._setRowStripes();this.hideTableMessage();this.fireEvent("rowAddEvent",{record:S});}}},argument:{record:M,recIndex:I},scope:this,timeout:(this.get("renderLoopSize")>0)?0:-1});this._runRenderChain();return;}}}}},addRows:function(K,N){if(H.isNumber(N)&&(N<0||N>this._oRecordSet.getLength())){return;}if(H.isArray(K)){var O=this._oRecordSet.addRecords(K,N);if(O){var S=this.getRecordIndex(O[0]);var R=this.get("paginator");if(R){var P=R.get("totalRecords");if(P!==E.Paginator.VALUE_UNLIMITED){R.set("totalRecords",P+O.length);}var Q=(R.getPageRecords())[1];if(S<=Q){this.render();}this.fireEvent("rowsAddEvent",{records:O});return;}else{var M=this.get("renderLoopSize");var J=S+K.length;var I=(J-S);var L=(S>=this._elTbody.rows.length);this._oChainRender.add({method:function(X){if((this instanceof D)&&this._sId){var Y=X.aRecords,W=X.nCurrentRow,V=X.nCurrentRecord,T=M>0?Math.min(W+M,J):J,Z=document.createDocumentFragment(),U=(this._elTbody.rows[W])?this._elTbody.rows[W]:null;for(;W<T;W++,V++){Z.appendChild(this._addTrEl(Y[V]));}this._elTbody.insertBefore(Z,U);X.nCurrentRow=W;X.nCurrentRecord=V;}},iterations:(M>0)?Math.ceil(J/M):1,argument:{nCurrentRow:S,nCurrentRecord:0,aRecords:O},scope:this,timeout:(M>0)?0:-1});this._oChainRender.add({method:function(U){var T=U.recIndex;if(T===0){this._setFirstRow();}if(U.isLast){this._setLastRow();}this._setRowStripes();this.fireEvent("rowsAddEvent",{records:O});},argument:{recIndex:S,isLast:L},scope:this,timeout:-1});this._runRenderChain();this.hideTableMessage();return;}}}},updateRow:function(T,J){var Q=T;if(!H.isNumber(Q)){Q=this.getRecordIndex(T);}if(H.isNumber(Q)&&(Q>=0)){var R=this._oRecordSet,P=R.getRecord(Q);if(P){var N=this._oRecordSet.setRecord(J,Q),I=this.getTrEl(P),O=P?P.getData():null;if(N){var S=this._aSelections||[],M=0,K=P.getId(),L=N.getId();for(;M<S.length;M++){if((S[M]===K)){S[M]=L;}else{if(S[M].recordId===K){S[M].recordId=L;}}}this._oChainRender.add({method:function(){if((this instanceof D)&&this._sId){var V=this.get("paginator");if(V){var U=(V.getPageRecords())[0],W=(V.getPageRecords())[1];if((Q>=U)||(Q<=W)){this.render();}}else{if(I){this._updateTrEl(I,N);}else{this.getTbodyEl().appendChild(this._addTrEl(N));}}this.fireEvent("rowUpdateEvent",{record:N,oldData:O});}},scope:this,timeout:(this.get("renderLoopSize")>0)?0:-1});this._runRenderChain();return;}}}return;},updateRows:function(V,K){if(H.isArray(K)){var O=V,J=this._oRecordSet;if(!H.isNumber(V)){O=this.getRecordIndex(V);}if(H.isNumber(O)&&(O>=0)&&(O<J.getLength())){var Z=O+K.length,W=J.getRecords(O,K.length),b=J.setRecords(K,O);if(b){var Q=this._aSelections||[],Y=0,X,T,U;for(;Y<Q.length;Y++){for(X=0;X<W.length;X++){U=W[X].getId();if((Q[Y]===U)){Q[Y]=b[X].getId();}else{if(Q[Y].recordId===U){Q[Y].recordId=b[X].getId();}}}}var a=this.get("paginator");if(a){var P=(a.getPageRecords())[0],M=(a.getPageRecords())[1];if((O>=P)||(Z<=M)){this.render();}this.fireEvent("rowsAddEvent",{newRecords:b,oldRecords:W});return;}else{var I=this.get("renderLoopSize"),R=K.length,L=this._elTbody.rows.length,S=(Z>=L),N=(Z>L);this._oChainRender.add({method:function(f){if((this instanceof D)&&this._sId){var g=f.aRecords,e=f.nCurrentRow,d=f.nDataPointer,c=I>0?Math.min(e+I,O+g.length):O+g.length;for(;e<c;e++,d++){if(N&&(e>=L)){this._elTbody.appendChild(this._addTrEl(g[d]));}else{this._updateTrEl(this._elTbody.rows[e],g[d]);}}f.nCurrentRow=e;f.nDataPointer=d;}},iterations:(I>0)?Math.ceil(R/I):1,argument:{nCurrentRow:O,aRecords:b,nDataPointer:0,isAdding:N},scope:this,timeout:(I>0)?0:-1});this._oChainRender.add({method:function(d){var c=d.recIndex;if(c===0){this._setFirstRow();}if(d.isLast){this._setLastRow();}this._setRowStripes();this.fireEvent("rowsAddEvent",{newRecords:b,oldRecords:W});},argument:{recIndex:O,isLast:S},scope:this,timeout:-1});this._runRenderChain();this.hideTableMessage();return;}}}}},deleteRow:function(R){var J=(H.isNumber(R))?R:this.getRecordIndex(R);if(H.isNumber(J)){var S=this.getRecord(J);if(S){var L=this.getTrIndex(J);var O=S.getId();var Q=this._aSelections||[];for(var M=Q.length-1;M>-1;M--){if((H.isString(Q[M])&&(Q[M]===O))||(H.isObject(Q[M])&&(Q[M].recordId===O))){Q.splice(M,1);}}var K=this._oRecordSet.deleteRecord(J);if(K){var P=this.get("paginator");if(P){var N=P.get("totalRecords"),I=P.getPageRecords();if(N!==E.Paginator.VALUE_UNLIMITED){P.set("totalRecords",N-1);}if(!I||J<=I[1]){this.render();}this._oChainRender.add({method:function(){if((this instanceof D)&&this._sId){this.fireEvent("rowDeleteEvent",{recordIndex:J,oldData:K,trElIndex:L});}},scope:this,timeout:(this.get("renderLoopSize")>0)?0:-1});
this._runRenderChain();}else{if(H.isNumber(L)){this._oChainRender.add({method:function(){if((this instanceof D)&&this._sId){var T=(L==this.getLastTrEl().sectionRowIndex);this._deleteTrEl(L);if(this._elTbody.rows.length>0){if(L===0){this._setFirstRow();}if(T){this._setLastRow();}if(L!=this._elTbody.rows.length){this._setRowStripes(L);}}this.fireEvent("rowDeleteEvent",{recordIndex:J,oldData:K,trElIndex:L});}},scope:this,timeout:(this.get("renderLoopSize")>0)?0:-1});this._runRenderChain();return;}}}}}return null;},deleteRows:function(X,R){var K=(H.isNumber(X))?X:this.getRecordIndex(X);if(H.isNumber(K)){var Y=this.getRecord(K);if(Y){var L=this.getTrIndex(K);var T=Y.getId();var W=this._aSelections||[];for(var P=W.length-1;P>-1;P--){if((H.isString(W[P])&&(W[P]===T))||(H.isObject(W[P])&&(W[P].recordId===T))){W.splice(P,1);}}var M=K;var V=K;if(R&&H.isNumber(R)){M=(R>0)?K+R-1:K;V=(R>0)?K:K+R+1;R=(R>0)?R:R*-1;if(V<0){V=0;R=M-V+1;}}else{R=1;}var O=this._oRecordSet.deleteRecords(V,R);if(O){var U=this.get("paginator"),Q=this.get("renderLoopSize");if(U){var S=U.get("totalRecords"),J=U.getPageRecords();if(S!==E.Paginator.VALUE_UNLIMITED){U.set("totalRecords",S-O.length);}if(!J||V<=J[1]){this.render();}this._oChainRender.add({method:function(Z){if((this instanceof D)&&this._sId){this.fireEvent("rowsDeleteEvent",{recordIndex:V,oldData:O,count:R});}},scope:this,timeout:(Q>0)?0:-1});this._runRenderChain();return;}else{if(H.isNumber(L)){var N=V;var I=R;this._oChainRender.add({method:function(b){if((this instanceof D)&&this._sId){var a=b.nCurrentRow,Z=(Q>0)?(Math.max(a-Q,N)-1):N-1;for(;a>Z;--a){this._deleteTrEl(a);}b.nCurrentRow=a;}},iterations:(Q>0)?Math.ceil(R/Q):1,argument:{nCurrentRow:M},scope:this,timeout:(Q>0)?0:-1});this._oChainRender.add({method:function(){if(this._elTbody.rows.length>0){this._setFirstRow();this._setLastRow();this._setRowStripes();}this.fireEvent("rowsDeleteEvent",{recordIndex:V,oldData:O,count:R});},scope:this,timeout:-1});this._runRenderChain();return;}}}}}return null;},formatCell:function(L,K,M){if(!K){K=this.getRecord(L);}if(!M){M=this.getColumn(L.parentNode.cellIndex);}if(K&&M){var I=M.field;var N=K.getData(I);var J=typeof M.formatter==="function"?M.formatter:D.Formatter[M.formatter+""]||D.Formatter.defaultFormatter;if(J){J.call(this,L,K,M,N);}else{L.innerHTML=N;}this.fireEvent("cellFormatEvent",{record:K,column:M,key:M.key,el:L});}else{}},updateCell:function(J,L,N){L=(L instanceof YAHOO.widget.Column)?L:this.getColumn(L);if(L&&L.getKey()&&(J instanceof YAHOO.widget.Record)){var K=L.getKey(),M=J.getData(K);this._oRecordSet.updateRecordValue(J,K,N);var I=this.getTdEl({record:J,column:L});if(I){this._oChainRender.add({method:function(){if((this instanceof D)&&this._sId){this.formatCell(I.firstChild);this.fireEvent("cellUpdateEvent",{record:J,column:L,oldData:M});}},scope:this,timeout:(this.get("renderLoopSize")>0)?0:-1});this._runRenderChain();}else{this.fireEvent("cellUpdateEvent",{record:J,column:L,oldData:M});}}},_updatePaginator:function(J){var I=this.get("paginator");if(I&&J!==I){I.unsubscribe("changeRequest",this.onPaginatorChangeRequest,this,true);}if(J){J.subscribe("changeRequest",this.onPaginatorChangeRequest,this,true);}},_handlePaginatorChange:function(K){if(K.prevValue===K.newValue){return;}var M=K.newValue,L=K.prevValue,J=this._defaultPaginatorContainers();if(L){if(L.getContainerNodes()[0]==J[0]){L.set("containers",[]);}L.destroy();if(J[0]){if(M&&!M.getContainerNodes().length){M.set("containers",J);}else{for(var I=J.length-1;I>=0;--I){if(J[I]){J[I].parentNode.removeChild(J[I]);}}}}}if(!this._bInit){this.render();}if(M){this.renderPaginator();}},_defaultPaginatorContainers:function(L){var J=this._sId+"-paginator0",K=this._sId+"-paginator1",I=C.get(J),M=C.get(K);if(L&&(!I||!M)){if(!I){I=document.createElement("div");I.id=J;C.addClass(I,D.CLASS_PAGINATOR);this._elContainer.insertBefore(I,this._elContainer.firstChild);}if(!M){M=document.createElement("div");M.id=K;C.addClass(M,D.CLASS_PAGINATOR);this._elContainer.appendChild(M);}}return[I,M];},renderPaginator:function(){var I=this.get("paginator");if(!I){return;}if(!I.getContainerNodes().length){I.set("containers",this._defaultPaginatorContainers(true));}I.render();},doBeforePaginatorChange:function(I){this.showTableMessage(this.get("MSG_LOADING"),D.CLASS_LOADING);return true;},onPaginatorChangeRequest:function(L){var J=this.doBeforePaginatorChange(L);if(J){if(this.get("dynamicData")){var I=this.getState();I.pagination=L;var K=this.get("generateRequest")(I,this);this.unselectAllRows();this.unselectAllCells();var M={success:this.onDataReturnSetRows,failure:this.onDataReturnSetRows,argument:I,scope:this};this._oDataSource.sendRequest(K,M);}else{L.paginator.setStartIndex(L.recordOffset,true);L.paginator.setRowsPerPage(L.rowsPerPage,true);this.render();}}else{}},_elLastHighlightedTd:null,_aSelections:null,_oAnchorRecord:null,_oAnchorCell:null,_unselectAllTrEls:function(){var I=C.getElementsByClassName(D.CLASS_SELECTED,"tr",this._elTbody);C.removeClass(I,D.CLASS_SELECTED);},_getSelectionTrigger:function(){var L=this.get("selectionMode");var K={};var O,I,J,N,M;if((L=="cellblock")||(L=="cellrange")||(L=="singlecell")){O=this.getLastSelectedCell();if(!O){return null;}else{I=this.getRecord(O.recordId);J=this.getRecordIndex(I);N=this.getTrEl(I);M=this.getTrIndex(N);if(M===null){return null;}else{K.record=I;K.recordIndex=J;K.el=this.getTdEl(O);K.trIndex=M;K.column=this.getColumn(O.columnKey);K.colKeyIndex=K.column.getKeyIndex();K.cell=O;return K;}}}else{I=this.getLastSelectedRecord();if(!I){return null;}else{I=this.getRecord(I);J=this.getRecordIndex(I);N=this.getTrEl(I);M=this.getTrIndex(N);if(M===null){return null;}else{K.record=I;K.recordIndex=J;K.el=N;K.trIndex=M;return K;}}}},_getSelectionAnchor:function(K){var J=this.get("selectionMode");var L={};var M,O,I;if((J=="cellblock")||(J=="cellrange")||(J=="singlecell")){var N=this._oAnchorCell;if(!N){if(K){N=this._oAnchorCell=K.cell;}else{return null;}}M=this._oAnchorCell.record;O=this._oRecordSet.getRecordIndex(M);
I=this.getTrIndex(M);if(I===null){if(O<this.getRecordIndex(this.getFirstTrEl())){I=0;}else{I=this.getRecordIndex(this.getLastTrEl());}}L.record=M;L.recordIndex=O;L.trIndex=I;L.column=this._oAnchorCell.column;L.colKeyIndex=L.column.getKeyIndex();L.cell=N;return L;}else{M=this._oAnchorRecord;if(!M){if(K){M=this._oAnchorRecord=K.record;}else{return null;}}O=this.getRecordIndex(M);I=this.getTrIndex(M);if(I===null){if(O<this.getRecordIndex(this.getFirstTrEl())){I=0;}else{I=this.getRecordIndex(this.getLastTrEl());}}L.record=M;L.recordIndex=O;L.trIndex=I;return L;}},_handleStandardSelectionByMouse:function(J){var I=J.target;var L=this.getTrEl(I);if(L){var O=J.event;var R=O.shiftKey;var N=O.ctrlKey||((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&O.metaKey);var Q=this.getRecord(L);var K=this._oRecordSet.getRecordIndex(Q);var P=this._getSelectionAnchor();var M;if(R&&N){if(P){if(this.isSelected(P.record)){if(P.recordIndex<K){for(M=P.recordIndex+1;M<=K;M++){if(!this.isSelected(M)){this.selectRow(M);}}}else{for(M=P.recordIndex-1;M>=K;M--){if(!this.isSelected(M)){this.selectRow(M);}}}}else{if(P.recordIndex<K){for(M=P.recordIndex+1;M<=K-1;M++){if(this.isSelected(M)){this.unselectRow(M);}}}else{for(M=K+1;M<=P.recordIndex-1;M++){if(this.isSelected(M)){this.unselectRow(M);}}}this.selectRow(Q);}}else{this._oAnchorRecord=Q;if(this.isSelected(Q)){this.unselectRow(Q);}else{this.selectRow(Q);}}}else{if(R){this.unselectAllRows();if(P){if(P.recordIndex<K){for(M=P.recordIndex;M<=K;M++){this.selectRow(M);}}else{for(M=P.recordIndex;M>=K;M--){this.selectRow(M);}}}else{this._oAnchorRecord=Q;this.selectRow(Q);}}else{if(N){this._oAnchorRecord=Q;if(this.isSelected(Q)){this.unselectRow(Q);}else{this.selectRow(Q);}}else{this._handleSingleSelectionByMouse(J);return;}}}}},_handleStandardSelectionByKey:function(M){var I=G.getCharCode(M);if((I==38)||(I==40)){var K=M.shiftKey;var J=this._getSelectionTrigger();if(!J){return null;}G.stopEvent(M);var L=this._getSelectionAnchor(J);if(K){if((I==40)&&(L.recordIndex<=J.trIndex)){this.selectRow(this.getNextTrEl(J.el));}else{if((I==38)&&(L.recordIndex>=J.trIndex)){this.selectRow(this.getPreviousTrEl(J.el));}else{this.unselectRow(J.el);}}}else{this._handleSingleSelectionByKey(M);}}},_handleSingleSelectionByMouse:function(K){var L=K.target;var J=this.getTrEl(L);if(J){var I=this.getRecord(J);this._oAnchorRecord=I;this.unselectAllRows();this.selectRow(I);}},_handleSingleSelectionByKey:function(L){var I=G.getCharCode(L);if((I==38)||(I==40)){var J=this._getSelectionTrigger();if(!J){return null;}G.stopEvent(L);var K;if(I==38){K=this.getPreviousTrEl(J.el);if(K===null){K=this.getFirstTrEl();}}else{if(I==40){K=this.getNextTrEl(J.el);if(K===null){K=this.getLastTrEl();}}}this.unselectAllRows();this.selectRow(K);this._oAnchorRecord=this.getRecord(K);}},_handleCellBlockSelectionByMouse:function(Y){var Z=Y.target;var J=this.getTdEl(Z);if(J){var X=Y.event;var O=X.shiftKey;var K=X.ctrlKey||((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&X.metaKey);var Q=this.getTrEl(J);var P=this.getTrIndex(Q);var T=this.getColumn(J);var U=T.getKeyIndex();var S=this.getRecord(Q);var b=this._oRecordSet.getRecordIndex(S);var N={record:S,column:T};var R=this._getSelectionAnchor();var M=this.getTbodyEl().rows;var L,I,a,W,V;if(O&&K){if(R){if(this.isSelected(R.cell)){if(R.recordIndex===b){if(R.colKeyIndex<U){for(W=R.colKeyIndex+1;W<=U;W++){this.selectCell(Q.cells[W]);}}else{if(U<R.colKeyIndex){for(W=U;W<R.colKeyIndex;W++){this.selectCell(Q.cells[W]);}}}}else{if(R.recordIndex<b){L=Math.min(R.colKeyIndex,U);I=Math.max(R.colKeyIndex,U);for(W=R.trIndex;W<=P;W++){for(V=L;V<=I;V++){this.selectCell(M[W].cells[V]);}}}else{L=Math.min(R.trIndex,U);I=Math.max(R.trIndex,U);for(W=R.trIndex;W>=P;W--){for(V=I;V>=L;V--){this.selectCell(M[W].cells[V]);}}}}}else{if(R.recordIndex===b){if(R.colKeyIndex<U){for(W=R.colKeyIndex+1;W<U;W++){this.unselectCell(Q.cells[W]);}}else{if(U<R.colKeyIndex){for(W=U+1;W<R.colKeyIndex;W++){this.unselectCell(Q.cells[W]);}}}}if(R.recordIndex<b){for(W=R.trIndex;W<=P;W++){a=M[W];for(V=0;V<a.cells.length;V++){if(a.sectionRowIndex===R.trIndex){if(V>R.colKeyIndex){this.unselectCell(a.cells[V]);}}else{if(a.sectionRowIndex===P){if(V<U){this.unselectCell(a.cells[V]);}}else{this.unselectCell(a.cells[V]);}}}}}else{for(W=P;W<=R.trIndex;W++){a=M[W];for(V=0;V<a.cells.length;V++){if(a.sectionRowIndex==P){if(V>U){this.unselectCell(a.cells[V]);}}else{if(a.sectionRowIndex==R.trIndex){if(V<R.colKeyIndex){this.unselectCell(a.cells[V]);}}else{this.unselectCell(a.cells[V]);}}}}}this.selectCell(J);}}else{this._oAnchorCell=N;if(this.isSelected(N)){this.unselectCell(N);}else{this.selectCell(N);}}}else{if(O){this.unselectAllCells();if(R){if(R.recordIndex===b){if(R.colKeyIndex<U){for(W=R.colKeyIndex;W<=U;W++){this.selectCell(Q.cells[W]);}}else{if(U<R.colKeyIndex){for(W=U;W<=R.colKeyIndex;W++){this.selectCell(Q.cells[W]);}}}}else{if(R.recordIndex<b){L=Math.min(R.colKeyIndex,U);I=Math.max(R.colKeyIndex,U);for(W=R.trIndex;W<=P;W++){for(V=L;V<=I;V++){this.selectCell(M[W].cells[V]);}}}else{L=Math.min(R.colKeyIndex,U);I=Math.max(R.colKeyIndex,U);for(W=P;W<=R.trIndex;W++){for(V=L;V<=I;V++){this.selectCell(M[W].cells[V]);}}}}}else{this._oAnchorCell=N;this.selectCell(N);}}else{if(K){this._oAnchorCell=N;if(this.isSelected(N)){this.unselectCell(N);}else{this.selectCell(N);}}else{this._handleSingleCellSelectionByMouse(Y);}}}}},_handleCellBlockSelectionByKey:function(N){var I=G.getCharCode(N);var S=N.shiftKey;if((I==9)||!S){this._handleSingleCellSelectionByKey(N);return;}if((I>36)&&(I<41)){var T=this._getSelectionTrigger();if(!T){return null;}G.stopEvent(N);var Q=this._getSelectionAnchor(T);var J,R,K,P,L;var O=this.getTbodyEl().rows;var M=T.el.parentNode;if(I==40){if(Q.recordIndex<=T.recordIndex){L=this.getNextTrEl(T.el);if(L){R=Q.colKeyIndex;K=T.colKeyIndex;if(R>K){for(J=R;J>=K;J--){P=L.cells[J];this.selectCell(P);}}else{for(J=R;J<=K;J++){P=L.cells[J];this.selectCell(P);}}}}else{R=Math.min(Q.colKeyIndex,T.colKeyIndex);K=Math.max(Q.colKeyIndex,T.colKeyIndex);
for(J=R;J<=K;J++){this.unselectCell(M.cells[J]);}}}else{if(I==38){if(Q.recordIndex>=T.recordIndex){L=this.getPreviousTrEl(T.el);if(L){R=Q.colKeyIndex;K=T.colKeyIndex;if(R>K){for(J=R;J>=K;J--){P=L.cells[J];this.selectCell(P);}}else{for(J=R;J<=K;J++){P=L.cells[J];this.selectCell(P);}}}}else{R=Math.min(Q.colKeyIndex,T.colKeyIndex);K=Math.max(Q.colKeyIndex,T.colKeyIndex);for(J=R;J<=K;J++){this.unselectCell(M.cells[J]);}}}else{if(I==39){if(Q.colKeyIndex<=T.colKeyIndex){if(T.colKeyIndex<M.cells.length-1){R=Q.trIndex;K=T.trIndex;if(R>K){for(J=R;J>=K;J--){P=O[J].cells[T.colKeyIndex+1];this.selectCell(P);}}else{for(J=R;J<=K;J++){P=O[J].cells[T.colKeyIndex+1];this.selectCell(P);}}}}else{R=Math.min(Q.trIndex,T.trIndex);K=Math.max(Q.trIndex,T.trIndex);for(J=R;J<=K;J++){this.unselectCell(O[J].cells[T.colKeyIndex]);}}}else{if(I==37){if(Q.colKeyIndex>=T.colKeyIndex){if(T.colKeyIndex>0){R=Q.trIndex;K=T.trIndex;if(R>K){for(J=R;J>=K;J--){P=O[J].cells[T.colKeyIndex-1];this.selectCell(P);}}else{for(J=R;J<=K;J++){P=O[J].cells[T.colKeyIndex-1];this.selectCell(P);}}}}else{R=Math.min(Q.trIndex,T.trIndex);K=Math.max(Q.trIndex,T.trIndex);for(J=R;J<=K;J++){this.unselectCell(O[J].cells[T.colKeyIndex]);}}}}}}}},_handleCellRangeSelectionByMouse:function(W){var X=W.target;var I=this.getTdEl(X);if(I){var V=W.event;var M=V.shiftKey;var J=V.ctrlKey||((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)&&V.metaKey);var O=this.getTrEl(I);var N=this.getTrIndex(O);var R=this.getColumn(I);var S=R.getKeyIndex();var Q=this.getRecord(O);var Z=this._oRecordSet.getRecordIndex(Q);var L={record:Q,column:R};var P=this._getSelectionAnchor();var K=this.getTbodyEl().rows;var Y,U,T;if(M&&J){if(P){if(this.isSelected(P.cell)){if(P.recordIndex===Z){if(P.colKeyIndex<S){for(U=P.colKeyIndex+1;U<=S;U++){this.selectCell(O.cells[U]);}}else{if(S<P.colKeyIndex){for(U=S;U<P.colKeyIndex;U++){this.selectCell(O.cells[U]);}}}}else{if(P.recordIndex<Z){for(U=P.colKeyIndex+1;U<O.cells.length;U++){this.selectCell(O.cells[U]);}for(U=P.trIndex+1;U<N;U++){for(T=0;T<K[U].cells.length;T++){this.selectCell(K[U].cells[T]);}}for(U=0;U<=S;U++){this.selectCell(O.cells[U]);}}else{for(U=S;U<O.cells.length;U++){this.selectCell(O.cells[U]);}for(U=N+1;U<P.trIndex;U++){for(T=0;T<K[U].cells.length;T++){this.selectCell(K[U].cells[T]);}}for(U=0;U<P.colKeyIndex;U++){this.selectCell(O.cells[U]);}}}}else{if(P.recordIndex===Z){if(P.colKeyIndex<S){for(U=P.colKeyIndex+1;U<S;U++){this.unselectCell(O.cells[U]);}}else{if(S<P.colKeyIndex){for(U=S+1;U<P.colKeyIndex;U++){this.unselectCell(O.cells[U]);}}}}if(P.recordIndex<Z){for(U=P.trIndex;U<=N;U++){Y=K[U];for(T=0;T<Y.cells.length;T++){if(Y.sectionRowIndex===P.trIndex){if(T>P.colKeyIndex){this.unselectCell(Y.cells[T]);}}else{if(Y.sectionRowIndex===N){if(T<S){this.unselectCell(Y.cells[T]);}}else{this.unselectCell(Y.cells[T]);}}}}}else{for(U=N;U<=P.trIndex;U++){Y=K[U];for(T=0;T<Y.cells.length;T++){if(Y.sectionRowIndex==N){if(T>S){this.unselectCell(Y.cells[T]);}}else{if(Y.sectionRowIndex==P.trIndex){if(T<P.colKeyIndex){this.unselectCell(Y.cells[T]);}}else{this.unselectCell(Y.cells[T]);}}}}}this.selectCell(I);}}else{this._oAnchorCell=L;if(this.isSelected(L)){this.unselectCell(L);}else{this.selectCell(L);}}}else{if(M){this.unselectAllCells();if(P){if(P.recordIndex===Z){if(P.colKeyIndex<S){for(U=P.colKeyIndex;U<=S;U++){this.selectCell(O.cells[U]);}}else{if(S<P.colKeyIndex){for(U=S;U<=P.colKeyIndex;U++){this.selectCell(O.cells[U]);}}}}else{if(P.recordIndex<Z){for(U=P.trIndex;U<=N;U++){Y=K[U];for(T=0;T<Y.cells.length;T++){if(Y.sectionRowIndex==P.trIndex){if(T>=P.colKeyIndex){this.selectCell(Y.cells[T]);}}else{if(Y.sectionRowIndex==N){if(T<=S){this.selectCell(Y.cells[T]);}}else{this.selectCell(Y.cells[T]);}}}}}else{for(U=N;U<=P.trIndex;U++){Y=K[U];for(T=0;T<Y.cells.length;T++){if(Y.sectionRowIndex==N){if(T>=S){this.selectCell(Y.cells[T]);}}else{if(Y.sectionRowIndex==P.trIndex){if(T<=P.colKeyIndex){this.selectCell(Y.cells[T]);}}else{this.selectCell(Y.cells[T]);}}}}}}}else{this._oAnchorCell=L;this.selectCell(L);}}else{if(J){this._oAnchorCell=L;if(this.isSelected(L)){this.unselectCell(L);}else{this.selectCell(L);}}else{this._handleSingleCellSelectionByMouse(W);}}}}},_handleCellRangeSelectionByKey:function(M){var I=G.getCharCode(M);var Q=M.shiftKey;if((I==9)||!Q){this._handleSingleCellSelectionByKey(M);return;}if((I>36)&&(I<41)){var R=this._getSelectionTrigger();if(!R){return null;}G.stopEvent(M);var P=this._getSelectionAnchor(R);var J,K,O;var N=this.getTbodyEl().rows;var L=R.el.parentNode;if(I==40){K=this.getNextTrEl(R.el);if(P.recordIndex<=R.recordIndex){for(J=R.colKeyIndex+1;J<L.cells.length;J++){O=L.cells[J];this.selectCell(O);}if(K){for(J=0;J<=R.colKeyIndex;J++){O=K.cells[J];this.selectCell(O);}}}else{for(J=R.colKeyIndex;J<L.cells.length;J++){this.unselectCell(L.cells[J]);}if(K){for(J=0;J<R.colKeyIndex;J++){this.unselectCell(K.cells[J]);}}}}else{if(I==38){K=this.getPreviousTrEl(R.el);if(P.recordIndex>=R.recordIndex){for(J=R.colKeyIndex-1;J>-1;J--){O=L.cells[J];this.selectCell(O);}if(K){for(J=L.cells.length-1;J>=R.colKeyIndex;J--){O=K.cells[J];this.selectCell(O);}}}else{for(J=R.colKeyIndex;J>-1;J--){this.unselectCell(L.cells[J]);}if(K){for(J=L.cells.length-1;J>R.colKeyIndex;J--){this.unselectCell(K.cells[J]);}}}}else{if(I==39){K=this.getNextTrEl(R.el);if(P.recordIndex<R.recordIndex){if(R.colKeyIndex<L.cells.length-1){O=L.cells[R.colKeyIndex+1];this.selectCell(O);}else{if(K){O=K.cells[0];this.selectCell(O);}}}else{if(P.recordIndex>R.recordIndex){this.unselectCell(L.cells[R.colKeyIndex]);if(R.colKeyIndex<L.cells.length-1){}else{}}else{if(P.colKeyIndex<=R.colKeyIndex){if(R.colKeyIndex<L.cells.length-1){O=L.cells[R.colKeyIndex+1];this.selectCell(O);}else{if(R.trIndex<N.length-1){O=K.cells[0];this.selectCell(O);}}}else{this.unselectCell(L.cells[R.colKeyIndex]);}}}}else{if(I==37){K=this.getPreviousTrEl(R.el);if(P.recordIndex<R.recordIndex){this.unselectCell(L.cells[R.colKeyIndex]);if(R.colKeyIndex>0){}else{}}else{if(P.recordIndex>R.recordIndex){if(R.colKeyIndex>0){O=L.cells[R.colKeyIndex-1];
this.selectCell(O);}else{if(R.trIndex>0){O=K.cells[K.cells.length-1];this.selectCell(O);}}}else{if(P.colKeyIndex>=R.colKeyIndex){if(R.colKeyIndex>0){O=L.cells[R.colKeyIndex-1];this.selectCell(O);}else{if(R.trIndex>0){O=K.cells[K.cells.length-1];this.selectCell(O);}}}else{this.unselectCell(L.cells[R.colKeyIndex]);if(R.colKeyIndex>0){}else{}}}}}}}}}},_handleSingleCellSelectionByMouse:function(N){var O=N.target;var K=this.getTdEl(O);if(K){var J=this.getTrEl(K);var I=this.getRecord(J);var M=this.getColumn(K);var L={record:I,column:M};this._oAnchorCell=L;this.unselectAllCells();this.selectCell(L);}},_handleSingleCellSelectionByKey:function(M){var I=G.getCharCode(M);if((I==9)||((I>36)&&(I<41))){var K=M.shiftKey;var J=this._getSelectionTrigger();if(!J){return null;}var L;if(I==40){L=this.getBelowTdEl(J.el);if(L===null){L=J.el;}}else{if(I==38){L=this.getAboveTdEl(J.el);if(L===null){L=J.el;}}else{if((I==39)||(!K&&(I==9))){L=this.getNextTdEl(J.el);if(L===null){return;}}else{if((I==37)||(K&&(I==9))){L=this.getPreviousTdEl(J.el);if(L===null){return;}}}}}G.stopEvent(M);this.unselectAllCells();this.selectCell(L);this._oAnchorCell={record:this.getRecord(L),column:this.getColumn(L)};}},getSelectedTrEls:function(){return C.getElementsByClassName(D.CLASS_SELECTED,"tr",this._elTbody);},selectRow:function(O){var N,I;if(O instanceof YAHOO.widget.Record){N=this._oRecordSet.getRecord(O);I=this.getTrEl(N);}else{if(H.isNumber(O)){N=this.getRecord(O);I=this.getTrEl(N);}else{I=this.getTrEl(O);N=this.getRecord(I);}}if(N){var M=this._aSelections||[];var L=N.getId();var K=-1;if(M.indexOf){K=M.indexOf(L);}else{for(var J=M.length-1;J>-1;J--){if(M[J]===L){K=J;break;}}}if(K>-1){M.splice(K,1);}M.push(L);this._aSelections=M;if(!this._oAnchorRecord){this._oAnchorRecord=N;}if(I){C.addClass(I,D.CLASS_SELECTED);}this.fireEvent("rowSelectEvent",{record:N,el:I});}else{}},unselectRow:function(O){var I=this.getTrEl(O);var N;if(O instanceof YAHOO.widget.Record){N=this._oRecordSet.getRecord(O);}else{if(H.isNumber(O)){N=this.getRecord(O);}else{N=this.getRecord(I);}}if(N){var M=this._aSelections||[];var L=N.getId();var K=-1;if(M.indexOf){K=M.indexOf(L);}else{for(var J=M.length-1;J>-1;J--){if(M[J]===L){K=J;break;}}}if(K>-1){M.splice(K,1);this._aSelections=M;C.removeClass(I,D.CLASS_SELECTED);this.fireEvent("rowUnselectEvent",{record:N,el:I});return;}}},unselectAllRows:function(){var J=this._aSelections||[],L,K=[];for(var I=J.length-1;I>-1;I--){if(H.isString(J[I])){L=J.splice(I,1);K[K.length]=this.getRecord(H.isArray(L)?L[0]:L);}}this._aSelections=J;this._unselectAllTrEls();this.fireEvent("unselectAllRowsEvent",{records:K});},_unselectAllTdEls:function(){var I=C.getElementsByClassName(D.CLASS_SELECTED,"td",this._elTbody);C.removeClass(I,D.CLASS_SELECTED);},getSelectedTdEls:function(){return C.getElementsByClassName(D.CLASS_SELECTED,"td",this._elTbody);},selectCell:function(I){var O=this.getTdEl(I);if(O){var N=this.getRecord(O);var L=this.getColumn(O.cellIndex).getKey();if(N&&L){var M=this._aSelections||[];var K=N.getId();for(var J=M.length-1;J>-1;J--){if((M[J].recordId===K)&&(M[J].columnKey===L)){M.splice(J,1);break;}}M.push({recordId:K,columnKey:L});this._aSelections=M;if(!this._oAnchorCell){this._oAnchorCell={record:N,column:this.getColumn(L)};}C.addClass(O,D.CLASS_SELECTED);this.fireEvent("cellSelectEvent",{record:N,column:this.getColumn(O.cellIndex),key:this.getColumn(O.cellIndex).getKey(),el:O});return;}}},unselectCell:function(I){var N=this.getTdEl(I);if(N){var M=this.getRecord(N);var K=this.getColumn(N.cellIndex).getKey();if(M&&K){var L=this._aSelections||[];var O=M.getId();for(var J=L.length-1;J>-1;J--){if((L[J].recordId===O)&&(L[J].columnKey===K)){L.splice(J,1);this._aSelections=L;C.removeClass(N,D.CLASS_SELECTED);this.fireEvent("cellUnselectEvent",{record:M,column:this.getColumn(N.cellIndex),key:this.getColumn(N.cellIndex).getKey(),el:N});return;}}}}},unselectAllCells:function(){var J=this._aSelections||[];for(var I=J.length-1;I>-1;I--){if(H.isObject(J[I])){J.splice(I,1);}}this._aSelections=J;this._unselectAllTdEls();this.fireEvent("unselectAllCellsEvent");},isSelected:function(N){if(N&&(N.ownerDocument==document)){return(C.hasClass(this.getTdEl(N),D.CLASS_SELECTED)||C.hasClass(this.getTrEl(N),D.CLASS_SELECTED));}else{var M,J,I;var L=this._aSelections;if(L&&L.length>0){if(N instanceof YAHOO.widget.Record){M=N;}else{if(H.isNumber(N)){M=this.getRecord(N);}}if(M){J=M.getId();if(L.indexOf){if(L.indexOf(J)>-1){return true;}}else{for(I=L.length-1;I>-1;I--){if(L[I]===J){return true;}}}}else{if(N.record&&N.column){J=N.record.getId();var K=N.column.getKey();for(I=L.length-1;I>-1;I--){if((L[I].recordId===J)&&(L[I].columnKey===K)){return true;}}}}}}return false;},getSelectedRows:function(){var I=[];var K=this._aSelections||[];for(var J=0;J<K.length;J++){if(H.isString(K[J])){I.push(K[J]);}}return I;},getSelectedCells:function(){var J=[];var K=this._aSelections||[];for(var I=0;I<K.length;I++){if(K[I]&&H.isObject(K[I])){J.push(K[I]);}}return J;},getLastSelectedRecord:function(){var J=this._aSelections;if(J&&J.length>0){for(var I=J.length-1;I>-1;I--){if(H.isString(J[I])){return J[I];}}}},getLastSelectedCell:function(){var J=this._aSelections;if(J&&J.length>0){for(var I=J.length-1;I>-1;I--){if(J[I].recordId&&J[I].columnKey){return J[I];}}}},highlightRow:function(K){var I=this.getTrEl(K);if(I){var J=this.getRecord(I);C.addClass(I,D.CLASS_HIGHLIGHTED);this.fireEvent("rowHighlightEvent",{record:J,el:I});return;}},unhighlightRow:function(K){var I=this.getTrEl(K);if(I){var J=this.getRecord(I);C.removeClass(I,D.CLASS_HIGHLIGHTED);this.fireEvent("rowUnhighlightEvent",{record:J,el:I});return;}},highlightCell:function(I){var L=this.getTdEl(I);if(L){if(this._elLastHighlightedTd){this.unhighlightCell(this._elLastHighlightedTd);}var K=this.getRecord(L);var J=this.getColumn(L.cellIndex).getKey();C.addClass(L,D.CLASS_HIGHLIGHTED);this._elLastHighlightedTd=L;this.fireEvent("cellHighlightEvent",{record:K,column:this.getColumn(L.cellIndex),key:this.getColumn(L.cellIndex).getKey(),el:L});
return;}},unhighlightCell:function(I){var K=this.getTdEl(I);if(K){var J=this.getRecord(K);C.removeClass(K,D.CLASS_HIGHLIGHTED);this._elLastHighlightedTd=null;this.fireEvent("cellUnhighlightEvent",{record:J,column:this.getColumn(K.cellIndex),key:this.getColumn(K.cellIndex).getKey(),el:K});return;}},getCellEditor:function(){return this._oCellEditor;},showCellEditor:function(P,Q,L){P=this.getTdEl(P);if(P){L=this.getColumn(P);if(L&&L.editor){var J=this._oCellEditor;if(J){if(this._oCellEditor.cancel){this._oCellEditor.cancel();}else{if(J.isActive){this.cancelCellEditor();}}}if(L.editor instanceof YAHOO.widget.BaseCellEditor){J=L.editor;var N=J.attach(this,P);if(N){J.move();N=this.doBeforeShowCellEditor(J);if(N){J.show();this._oCellEditor=J;}}}else{if(!Q||!(Q instanceof YAHOO.widget.Record)){Q=this.getRecord(P);}if(!L||!(L instanceof YAHOO.widget.Column)){L=this.getColumn(P);}if(Q&&L){if(!this._oCellEditor||this._oCellEditor.container){this._initCellEditorEl();}J=this._oCellEditor;J.cell=P;J.record=Q;J.column=L;J.validator=(L.editorOptions&&H.isFunction(L.editorOptions.validator))?L.editorOptions.validator:null;J.value=Q.getData(L.key);J.defaultValue=null;var K=J.container;var O=C.getX(P);var M=C.getY(P);if(isNaN(O)||isNaN(M)){O=P.offsetLeft+C.getX(this._elTbody.parentNode)-this._elTbody.scrollLeft;M=P.offsetTop+C.getY(this._elTbody.parentNode)-this._elTbody.scrollTop+this._elThead.offsetHeight;}K.style.left=O+"px";K.style.top=M+"px";this.doBeforeShowCellEditor(this._oCellEditor);K.style.display="";G.addListener(K,"keydown",function(S,R){if((S.keyCode==27)){R.cancelCellEditor();R.focusTbodyEl();}else{R.fireEvent("editorKeydownEvent",{editor:R._oCellEditor,event:S});}},this);var I;if(H.isString(L.editor)){switch(L.editor){case"checkbox":I=D.editCheckbox;break;case"date":I=D.editDate;break;case"dropdown":I=D.editDropdown;break;case"radio":I=D.editRadio;break;case"textarea":I=D.editTextarea;break;case"textbox":I=D.editTextbox;break;default:I=null;}}else{if(H.isFunction(L.editor)){I=L.editor;}}if(I){I(this._oCellEditor,this);if(!L.editorOptions||!L.editorOptions.disableBtns){this.showCellEditorBtns(K);}J.isActive=true;this.fireEvent("editorShowEvent",{editor:J});return;}}}}}},_initCellEditorEl:function(){var I=document.createElement("div");I.id=this._sId+"-celleditor";I.style.display="none";I.tabIndex=0;C.addClass(I,D.CLASS_EDITOR);var K=C.getFirstChild(document.body);if(K){I=C.insertBefore(I,K);}else{I=document.body.appendChild(I);}var J={};J.container=I;J.value=null;J.isActive=false;this._oCellEditor=J;},doBeforeShowCellEditor:function(I){return true;},saveCellEditor:function(){if(this._oCellEditor){if(this._oCellEditor.save){this._oCellEditor.save();}else{if(this._oCellEditor.isActive){var I=this._oCellEditor.value;var J=this._oCellEditor.record.getData(this._oCellEditor.column.key);if(this._oCellEditor.validator){I=this._oCellEditor.value=this._oCellEditor.validator.call(this,I,J,this._oCellEditor);if(I===null){this.resetCellEditor();this.fireEvent("editorRevertEvent",{editor:this._oCellEditor,oldData:J,newData:I});return;}}this._oRecordSet.updateRecordValue(this._oCellEditor.record,this._oCellEditor.column.key,this._oCellEditor.value);this.formatCell(this._oCellEditor.cell.firstChild);this._oChainRender.add({method:function(){this.validateColumnWidths();},scope:this});this._oChainRender.run();this.resetCellEditor();this.fireEvent("editorSaveEvent",{editor:this._oCellEditor,oldData:J,newData:I});}}}},cancelCellEditor:function(){if(this._oCellEditor){if(this._oCellEditor.cancel){this._oCellEditor.cancel();}else{if(this._oCellEditor.isActive){this.resetCellEditor();this.fireEvent("editorCancelEvent",{editor:this._oCellEditor});}}}},destroyCellEditor:function(){if(this._oCellEditor){this._oCellEditor.destroy();this._oCellEditor=null;}},_onEditorShowEvent:function(I){this.fireEvent("editorShowEvent",I);},_onEditorKeydownEvent:function(I){this.fireEvent("editorKeydownEvent",I);},_onEditorRevertEvent:function(I){this.fireEvent("editorRevertEvent",I);},_onEditorSaveEvent:function(I){this.fireEvent("editorSaveEvent",I);},_onEditorCancelEvent:function(I){this.fireEvent("editorCancelEvent",I);},_onEditorBlurEvent:function(I){this.fireEvent("editorBlurEvent",I);},_onEditorBlockEvent:function(I){this.fireEvent("editorBlockEvent",I);},_onEditorUnblockEvent:function(I){this.fireEvent("editorUnblockEvent",I);},onEditorBlurEvent:function(I){if(I.editor.disableBtns){if(I.editor.save){I.editor.save();}}else{if(I.editor.cancel){I.editor.cancel();}}},onEditorBlockEvent:function(I){this.disable();},onEditorUnblockEvent:function(I){this.undisable();},doBeforeLoadData:function(I,J,K){return true;},onEventSortColumn:function(K){var I=K.event;var M=K.target;var J=this.getThEl(M)||this.getTdEl(M);if(J){var L=this.getColumn(J);if(L.sortable){G.stopEvent(I);this.sortColumn(L);}}else{}},onEventSelectColumn:function(I){this.selectColumn(I.target);},onEventHighlightColumn:function(I){if(!C.isAncestor(I.target,G.getRelatedTarget(I.event))){this.highlightColumn(I.target);}},onEventUnhighlightColumn:function(I){if(!C.isAncestor(I.target,G.getRelatedTarget(I.event))){this.unhighlightColumn(I.target);}},onEventSelectRow:function(J){var I=this.get("selectionMode");if(I=="single"){this._handleSingleSelectionByMouse(J);}else{this._handleStandardSelectionByMouse(J);}},onEventSelectCell:function(J){var I=this.get("selectionMode");if(I=="cellblock"){this._handleCellBlockSelectionByMouse(J);}else{if(I=="cellrange"){this._handleCellRangeSelectionByMouse(J);}else{this._handleSingleCellSelectionByMouse(J);}}},onEventHighlightRow:function(I){if(!C.isAncestor(I.target,G.getRelatedTarget(I.event))){this.highlightRow(I.target);}},onEventUnhighlightRow:function(I){if(!C.isAncestor(I.target,G.getRelatedTarget(I.event))){this.unhighlightRow(I.target);}},onEventHighlightCell:function(I){if(!C.isAncestor(I.target,G.getRelatedTarget(I.event))){this.highlightCell(I.target);}},onEventUnhighlightCell:function(I){if(!C.isAncestor(I.target,G.getRelatedTarget(I.event))){this.unhighlightCell(I.target);
}},onEventFormatCell:function(I){var L=I.target;var J=this.getTdEl(L);if(J){var K=this.getColumn(J.cellIndex);this.formatCell(J.firstChild,this.getRecord(J),K);}else{}},onEventShowCellEditor:function(I){this.showCellEditor(I.target);},onEventSaveCellEditor:function(I){if(this._oCellEditor){if(this._oCellEditor.save){this._oCellEditor.save();}else{this.saveCellEditor();}}},onEventCancelCellEditor:function(I){if(this._oCellEditor){if(this._oCellEditor.cancel){this._oCellEditor.cancel();}else{this.cancelCellEditor();}}},onDataReturnInitializeTable:function(I,J,K){if((this instanceof D)&&this._sId){this.initializeTable();this.onDataReturnSetRows(I,J,K);}},onDataReturnReplaceRows:function(M,L,N){if((this instanceof D)&&this._sId){this.fireEvent("dataReturnEvent",{request:M,response:L,payload:N});var J=this.doBeforeLoadData(M,L,N),K=this.get("paginator"),I=0;if(J&&L&&!L.error&&H.isArray(L.results)){this._oRecordSet.reset();if(this.get("dynamicData")){if(N&&N.pagination&&H.isNumber(N.pagination.recordOffset)){I=N.pagination.recordOffset;}else{if(K){I=K.getStartIndex();}}}this._oRecordSet.setRecords(L.results,I|0);this._handleDataReturnPayload(M,L,N);this.render();}else{if(J&&L.error){this.showTableMessage(this.get("MSG_ERROR"),D.CLASS_ERROR);}}}},onDataReturnAppendRows:function(J,K,L){if((this instanceof D)&&this._sId){this.fireEvent("dataReturnEvent",{request:J,response:K,payload:L});var I=this.doBeforeLoadData(J,K,L);if(I&&K&&!K.error&&H.isArray(K.results)){this.addRows(K.results);this._handleDataReturnPayload(J,K,L);}else{if(I&&K.error){this.showTableMessage(this.get("MSG_ERROR"),D.CLASS_ERROR);}}}},onDataReturnInsertRows:function(J,K,L){if((this instanceof D)&&this._sId){this.fireEvent("dataReturnEvent",{request:J,response:K,payload:L});var I=this.doBeforeLoadData(J,K,L);if(I&&K&&!K.error&&H.isArray(K.results)){this.addRows(K.results,(L?L.insertIndex:0));this._handleDataReturnPayload(J,K,L);}else{if(I&&K.error){this.showTableMessage(this.get("MSG_ERROR"),D.CLASS_ERROR);}}}},onDataReturnUpdateRows:function(J,K,L){if((this instanceof D)&&this._sId){this.fireEvent("dataReturnEvent",{request:J,response:K,payload:L});var I=this.doBeforeLoadData(J,K,L);if(I&&K&&!K.error&&H.isArray(K.results)){this.updateRows((L?L.updateIndex:0),K.results);this._handleDataReturnPayload(J,K,L);}else{if(I&&K.error){this.showTableMessage(this.get("MSG_ERROR"),D.CLASS_ERROR);}}}},onDataReturnSetRows:function(M,L,N){if((this instanceof D)&&this._sId){this.fireEvent("dataReturnEvent",{request:M,response:L,payload:N});var J=this.doBeforeLoadData(M,L,N),K=this.get("paginator"),I=0;if(J&&L&&!L.error&&H.isArray(L.results)){if(this.get("dynamicData")){if(N&&N.pagination&&H.isNumber(N.pagination.recordOffset)){I=N.pagination.recordOffset;}else{if(K){I=K.getStartIndex();}}this._oRecordSet.reset();}this._oRecordSet.setRecords(L.results,I|0);this._handleDataReturnPayload(M,L,N);this.render();}else{if(J&&L.error){this.showTableMessage(this.get("MSG_ERROR"),D.CLASS_ERROR);}}}else{}},handleDataReturnPayload:function(J,I,K){return K;},_handleDataReturnPayload:function(K,J,L){L=this.handleDataReturnPayload(K,J,L);if(L){var I=this.get("paginator");if(I){if(this.get("dynamicData")){if(E.Paginator.isNumeric(L.totalRecords)){I.set("totalRecords",L.totalRecords);}}else{I.set("totalRecords",this._oRecordSet.getLength());}if(H.isObject(L.pagination)){I.set("rowsPerPage",L.pagination.rowsPerPage);I.set("recordOffset",L.pagination.recordOffset);}}if(L.sortedBy){this.set("sortedBy",L.sortedBy);}else{if(L.sorting){this.set("sortedBy",L.sorting);}}}},showCellEditorBtns:function(K){var L=K.appendChild(document.createElement("div"));C.addClass(L,D.CLASS_BUTTON);var J=L.appendChild(document.createElement("button"));C.addClass(J,D.CLASS_DEFAULT);J.innerHTML="OK";G.addListener(J,"click",function(N,M){M.onEventSaveCellEditor(N,M);M.focusTbodyEl();},this,true);var I=L.appendChild(document.createElement("button"));I.innerHTML="Cancel";G.addListener(I,"click",function(N,M){M.onEventCancelCellEditor(N,M);M.focusTbodyEl();},this,true);},resetCellEditor:function(){var I=this._oCellEditor.container;I.style.display="none";G.purgeElement(I,true);I.innerHTML="";this._oCellEditor.value=null;this._oCellEditor.isActive=false;},getBody:function(){return this.getTbodyEl();},getCell:function(I){return this.getTdEl(I);},getRow:function(I){return this.getTrEl(I);},refreshView:function(){this.render();},select:function(J){if(!H.isArray(J)){J=[J];}for(var I=0;I<J.length;I++){this.selectRow(J[I]);}},onEventEditCell:function(I){this.onEventShowCellEditor(I);},_syncColWidths:function(){this.validateColumnWidths();}});D.prototype.onDataReturnSetRecords=D.prototype.onDataReturnSetRows;D.prototype.onPaginatorChange=D.prototype.onPaginatorChangeRequest;D.formatTheadCell=function(){};D.editCheckbox=function(){};D.editDate=function(){};D.editDropdown=function(){};D.editRadio=function(){};D.editTextarea=function(){};D.editTextbox=function(){};})();(function(){var C=YAHOO.lang,F=YAHOO.util,E=YAHOO.widget,A=YAHOO.env.ua,D=F.Dom,J=F.Event,I=F.DataSourceBase,G=E.DataTable,B=E.Paginator;E.ScrollingDataTable=function(N,M,K,L){L=L||{};if(L.scrollable){L.scrollable=false;}E.ScrollingDataTable.superclass.constructor.call(this,N,M,K,L);this.subscribe("columnShowEvent",this._onColumnChange);};var H=E.ScrollingDataTable;C.augmentObject(H,{CLASS_HEADER:"yui-dt-hd",CLASS_BODY:"yui-dt-bd"});C.extend(H,G,{_elHdContainer:null,_elHdTable:null,_elBdContainer:null,_elBdThead:null,_elTmpContainer:null,_elTmpTable:null,_bScrollbarX:null,initAttributes:function(K){K=K||{};H.superclass.initAttributes.call(this,K);this.setAttributeConfig("width",{value:null,validator:C.isString,method:function(L){if(this._elHdContainer&&this._elBdContainer){this._elHdContainer.style.width=L;this._elBdContainer.style.width=L;this._syncScrollX();this._syncScrollOverhang();}}});this.setAttributeConfig("height",{value:null,validator:C.isString,method:function(L){if(this._elHdContainer&&this._elBdContainer){this._elBdContainer.style.height=L;
this._syncScrollX();this._syncScrollY();this._syncScrollOverhang();}}});this.setAttributeConfig("COLOR_COLUMNFILLER",{value:"#F2F2F2",validator:C.isString,method:function(L){this._elHdContainer.style.backgroundColor=L;}});},_initDomElements:function(K){this._initContainerEl(K);if(this._elContainer&&this._elHdContainer&&this._elBdContainer){this._initTableEl();if(this._elHdTable&&this._elTable){this._initColgroupEl(this._elHdTable);this._initTheadEl(this._elHdTable,this._elTable);this._initTbodyEl(this._elTable);this._initMsgTbodyEl(this._elTable);}}if(!this._elContainer||!this._elTable||!this._elColgroup||!this._elThead||!this._elTbody||!this._elMsgTbody||!this._elHdTable||!this._elBdThead){return false;}else{return true;}},_destroyContainerEl:function(K){D.removeClass(K,G.CLASS_SCROLLABLE);H.superclass._destroyContainerEl.call(this,K);this._elHdContainer=null;this._elBdContainer=null;},_initContainerEl:function(L){H.superclass._initContainerEl.call(this,L);if(this._elContainer){L=this._elContainer;D.addClass(L,G.CLASS_SCROLLABLE);var K=document.createElement("div");K.style.width=this.get("width")||"";K.style.backgroundColor=this.get("COLOR_COLUMNFILLER");D.addClass(K,H.CLASS_HEADER);this._elHdContainer=K;L.appendChild(K);var M=document.createElement("div");M.style.width=this.get("width")||"";M.style.height=this.get("height")||"";D.addClass(M,H.CLASS_BODY);J.addListener(M,"scroll",this._onScroll,this);this._elBdContainer=M;L.appendChild(M);}},_initCaptionEl:function(K){},_destroyHdTableEl:function(){var K=this._elHdTable;if(K){J.purgeElement(K,true);K.parentNode.removeChild(K);this._elBdThead=null;}},_initTableEl:function(){if(this._elHdContainer){this._destroyHdTableEl();this._elHdTable=this._elHdContainer.appendChild(document.createElement("table"));}H.superclass._initTableEl.call(this,this._elBdContainer);},_initTheadEl:function(L,K){L=L||this._elHdTable;K=K||this._elTable;this._initBdTheadEl(K);H.superclass._initTheadEl.call(this,L);},_initThEl:function(L,K){H.superclass._initThEl.call(this,L,K);L.id=this.getId()+"-fixedth-"+K.getSanitizedKey();},_destroyBdTheadEl:function(){var K=this._elBdThead;if(K){var L=K.parentNode;J.purgeElement(K,true);L.removeChild(K);this._elBdThead=null;this._destroyColumnHelpers();}},_initBdTheadEl:function(S){if(S){this._destroyBdTheadEl();var O=S.insertBefore(document.createElement("thead"),S.firstChild);var U=this._oColumnSet,T=U.tree,N,K,R,P,M,L,Q;for(P=0,L=T.length;P<L;P++){K=O.appendChild(document.createElement("tr"));for(M=0,Q=T[P].length;M<Q;M++){R=T[P][M];N=K.appendChild(document.createElement("th"));this._initBdThEl(N,R,P,M);}}this._elBdThead=O;}},_initBdThEl:function(N,M){N.id=this.getId()+"-th-"+M.getSanitizedKey();N.rowSpan=M.getRowspan();N.colSpan=M.getColspan();if(M.abbr){N.abbr=M.abbr;}var L=M.getKey();var K=C.isValue(M.label)?M.label:L;N.innerHTML=K;},_initTbodyEl:function(K){H.superclass._initTbodyEl.call(this,K);K.style.marginTop=(this._elTbody.offsetTop>0)?"-"+this._elTbody.offsetTop+"px":0;},_focusEl:function(L){L=L||this._elTbody;var K=this;this._storeScrollPositions();setTimeout(function(){setTimeout(function(){try{L.focus();K._restoreScrollPositions();}catch(M){}},0);},0);},_runRenderChain:function(){this._storeScrollPositions();this._oChainRender.run();},_storeScrollPositions:function(){this._nScrollTop=this._elBdContainer.scrollTop;this._nScrollLeft=this._elBdContainer.scrollLeft;},_restoreScrollPositions:function(){if(this._nScrollTop){this._elBdContainer.scrollTop=this._nScrollTop;this._nScrollTop=null;}if(this._nScrollLeft){this._elBdContainer.scrollLeft=this._nScrollLeft;this._nScrollLeft=null;}},_validateColumnWidth:function(N,K){if(!N.width&&!N.hidden){var P=N.getThEl();if(N._calculatedWidth){this._setColumnWidth(N,"auto","visible");}if(P.offsetWidth!==K.offsetWidth){var M=(P.offsetWidth>K.offsetWidth)?N.getThLinerEl():K.firstChild;var L=Math.max(0,(M.offsetWidth-(parseInt(D.getStyle(M,"paddingLeft"),10)|0)-(parseInt(D.getStyle(M,"paddingRight"),10)|0)),N.minWidth);var O="visible";if((N.maxAutoWidth>0)&&(L>N.maxAutoWidth)){L=N.maxAutoWidth;O="hidden";}this._elTbody.style.display="none";this._setColumnWidth(N,L+"px",O);N._calculatedWidth=L;this._elTbody.style.display="";}}},validateColumnWidths:function(S){var U=this._oColumnSet.keys,W=U.length,L=this.getFirstTrEl();if(A.ie){this._setOverhangValue(1);}if(U&&L&&(L.childNodes.length===W)){var M=this.get("width");if(M){this._elHdContainer.style.width="";this._elBdContainer.style.width="";}this._elContainer.style.width="";if(S&&C.isNumber(S.getKeyIndex())){this._validateColumnWidth(S,L.childNodes[S.getKeyIndex()]);}else{var T,K=[],O,Q,R;for(Q=0;Q<W;Q++){S=U[Q];if(!S.width&&!S.hidden&&S._calculatedWidth){K[K.length]=S;}}this._elTbody.style.display="none";for(Q=0,R=K.length;Q<R;Q++){this._setColumnWidth(K[Q],"auto","visible");}this._elTbody.style.display="";K=[];for(Q=0;Q<W;Q++){S=U[Q];T=L.childNodes[Q];if(!S.width&&!S.hidden){var N=S.getThEl();if(N.offsetWidth!==T.offsetWidth){var V=(N.offsetWidth>T.offsetWidth)?S.getThLinerEl():T.firstChild;var P=Math.max(0,(V.offsetWidth-(parseInt(D.getStyle(V,"paddingLeft"),10)|0)-(parseInt(D.getStyle(V,"paddingRight"),10)|0)),S.minWidth);var X="visible";if((S.maxAutoWidth>0)&&(P>S.maxAutoWidth)){P=S.maxAutoWidth;X="hidden";}K[K.length]=[S,P,X];}}}this._elTbody.style.display="none";for(Q=0,R=K.length;Q<R;Q++){O=K[Q];this._setColumnWidth(O[0],O[1]+"px",O[2]);O[0]._calculatedWidth=O[1];}this._elTbody.style.display="";}if(M){this._elHdContainer.style.width=M;this._elBdContainer.style.width=M;}}this._syncScroll();this._restoreScrollPositions();},_syncScroll:function(){this._syncScrollX();this._syncScrollY();this._syncScrollOverhang();if(A.opera){this._elHdContainer.scrollLeft=this._elBdContainer.scrollLeft;if(!this.get("width")){document.body.style+="";}}},_syncScrollY:function(){var K=this._elTbody,L=this._elBdContainer;if(!this.get("width")){this._elContainer.style.width=(L.scrollHeight>L.clientHeight)?(K.parentNode.clientWidth+19)+"px":(K.parentNode.clientWidth+2)+"px";
}},_syncScrollX:function(){var K=this._elTbody,L=this._elBdContainer;if(!this.get("height")&&(A.ie)){L.style.height=(L.scrollWidth>L.offsetWidth)?(K.parentNode.offsetHeight+18)+"px":K.parentNode.offsetHeight+"px";}if(this._elTbody.rows.length===0){this._elMsgTbody.parentNode.style.width=this.getTheadEl().parentNode.offsetWidth+"px";}else{this._elMsgTbody.parentNode.style.width="";}},_syncScrollOverhang:function(){var L=this._elBdContainer,K=1;if((L.scrollHeight>L.clientHeight)&&(L.scrollWidth>L.clientWidth)){K=18;}this._setOverhangValue(K);},_setOverhangValue:function(N){var P=this._oColumnSet.headers[this._oColumnSet.headers.length-1]||[],L=P.length,K=this._sId+"-fixedth-",O=N+"px solid "+this.get("COLOR_COLUMNFILLER");this._elThead.style.display="none";for(var M=0;M<L;M++){D.get(K+P[M]).style.borderRight=O;}this._elThead.style.display="";},getHdContainerEl:function(){return this._elHdContainer;},getBdContainerEl:function(){return this._elBdContainer;},getHdTableEl:function(){return this._elHdTable;},getBdTableEl:function(){return this._elTable;},disable:function(){var K=this._elMask;K.style.width=this._elBdContainer.offsetWidth+"px";K.style.height=this._elHdContainer.offsetHeight+this._elBdContainer.offsetHeight+"px";K.style.display="";this.fireEvent("disableEvent");},removeColumn:function(M){var K=this._elHdContainer.scrollLeft;var L=this._elBdContainer.scrollLeft;M=H.superclass.removeColumn.call(this,M);this._elHdContainer.scrollLeft=K;this._elBdContainer.scrollLeft=L;return M;},insertColumn:function(N,L){var K=this._elHdContainer.scrollLeft;var M=this._elBdContainer.scrollLeft;var O=H.superclass.insertColumn.call(this,N,L);this._elHdContainer.scrollLeft=K;this._elBdContainer.scrollLeft=M;return O;},reorderColumn:function(N,L){var K=this._elHdContainer.scrollLeft;var M=this._elBdContainer.scrollLeft;var O=H.superclass.reorderColumn.call(this,N,L);this._elHdContainer.scrollLeft=K;this._elBdContainer.scrollLeft=M;return O;},setColumnWidth:function(L,K){L=this.getColumn(L);if(L){if(C.isNumber(K)){K=(K>L.minWidth)?K:L.minWidth;L.width=K;this._setColumnWidth(L,K+"px");this._syncScroll();this.fireEvent("columnSetWidthEvent",{column:L,width:K});}else{if(K===null){L.width=K;this._setColumnWidth(L,"auto");this.validateColumnWidths(L);this.fireEvent("columnUnsetWidthEvent",{column:L});}}this._clearTrTemplateEl();}else{}},showTableMessage:function(O,K){var P=this._elMsgTd;if(C.isString(O)){P.firstChild.innerHTML=O;}if(C.isString(K)){D.addClass(P.firstChild,K);}var N=this.getTheadEl();var L=N.parentNode;var M=L.offsetWidth;this._elMsgTbody.parentNode.style.width=this.getTheadEl().parentNode.offsetWidth+"px";this._elMsgTbody.style.display="";this.fireEvent("tableMsgShowEvent",{html:O,className:K});},_onColumnChange:function(K){var L=(K.column)?K.column:(K.editor)?K.editor.column:null;this._storeScrollPositions();this.validateColumnWidths(L);},_onScroll:function(M,L){L._elHdContainer.scrollLeft=L._elBdContainer.scrollLeft;if(L._oCellEditor&&L._oCellEditor.isActive){L.fireEvent("editorBlurEvent",{editor:L._oCellEditor});L.cancelCellEditor();}var N=J.getTarget(M);var K=N.nodeName.toLowerCase();L.fireEvent("tableScrollEvent",{event:M,target:N});},_onTheadKeydown:function(N,L){if(J.getCharCode(N)===9){setTimeout(function(){if((L instanceof H)&&L._sId){L._elBdContainer.scrollLeft=L._elHdContainer.scrollLeft;}},0);}var O=J.getTarget(N);var K=O.nodeName.toLowerCase();var M=true;while(O&&(K!="table")){switch(K){case"body":return;case"input":case"textarea":break;case"thead":M=L.fireEvent("theadKeyEvent",{target:O,event:N});break;default:break;}if(M===false){return;}else{O=O.parentNode;if(O){K=O.nodeName.toLowerCase();}}}L.fireEvent("tableKeyEvent",{target:(O||L._elContainer),event:N});}});})();(function(){var C=YAHOO.lang,F=YAHOO.util,E=YAHOO.widget,B=YAHOO.env.ua,D=F.Dom,I=F.Event,H=E.DataTable;E.BaseCellEditor=function(K,J){this._sId=this._sId||"yui-ceditor"+YAHOO.widget.BaseCellEditor._nCount++;this._sType=K;this._initConfigs(J);this._initEvents();this.render();};var A=E.BaseCellEditor;C.augmentObject(A,{_nCount:0,CLASS_CELLEDITOR:"yui-ceditor"});A.prototype={_sId:null,_sType:null,_oDataTable:null,_oColumn:null,_oRecord:null,_elTd:null,_elContainer:null,_elCancelBtn:null,_elSaveBtn:null,_initConfigs:function(K){if(K&&YAHOO.lang.isObject(K)){for(var J in K){if(J){this[J]=K[J];}}}},_initEvents:function(){this.createEvent("showEvent");this.createEvent("keydownEvent");this.createEvent("invalidDataEvent");this.createEvent("revertEvent");this.createEvent("saveEvent");this.createEvent("cancelEvent");this.createEvent("blurEvent");this.createEvent("blockEvent");this.createEvent("unblockEvent");},asyncSubmitter:null,value:null,defaultValue:null,validator:null,resetInvalidData:true,isActive:false,LABEL_SAVE:"Save",LABEL_CANCEL:"Cancel",disableBtns:false,toString:function(){return"CellEditor instance "+this._sId;},getId:function(){return this._sId;},getDataTable:function(){return this._oDataTable;},getColumn:function(){return this._oColumn;},getRecord:function(){return this._oRecord;},getTdEl:function(){return this._elTd;},getContainerEl:function(){return this._elContainer;},destroy:function(){this.unsubscribeAll();var K=this.getColumn();if(K){K.editor=null;}var J=this.getContainerEl();I.purgeElement(J,true);J.parentNode.removeChild(J);},render:function(){if(this._elContainer){YAHOO.util.Event.purgeElement(this._elContainer,true);this._elContainer.innerHTML="";}var J=document.createElement("div");J.id=this.getId()+"-container";J.style.display="none";J.tabIndex=0;J.className=H.CLASS_EDITOR;document.body.insertBefore(J,document.body.firstChild);this._elContainer=J;I.addListener(J,"keydown",function(M,K){if((M.keyCode==27)){var L=I.getTarget(M);if(L.nodeName&&L.nodeName.toLowerCase()==="select"){L.blur();}K.cancel();}K.fireEvent("keydownEvent",{editor:this,event:M});},this);this.renderForm();if(!this.disableBtns){this.renderBtns();}this.doAfterRender();},renderBtns:function(){var L=this.getContainerEl().appendChild(document.createElement("div"));
L.className=H.CLASS_BUTTON;var K=L.appendChild(document.createElement("button"));K.className=H.CLASS_DEFAULT;K.innerHTML=this.LABEL_SAVE;I.addListener(K,"click",function(M){this.save();},this,true);this._elSaveBtn=K;var J=L.appendChild(document.createElement("button"));J.innerHTML=this.LABEL_CANCEL;I.addListener(J,"click",function(M){this.cancel();},this,true);this._elCancelBtn=J;},attach:function(N,L){if(N instanceof YAHOO.widget.DataTable){this._oDataTable=N;L=N.getTdEl(L);if(L){this._elTd=L;var M=N.getColumn(L);if(M){this._oColumn=M;var J=N.getRecord(L);if(J){this._oRecord=J;var K=J.getData(this.getColumn().getKey());this.value=(K!==undefined)?K:this.defaultValue;return true;}}}}return false;},move:function(){var M=this.getContainerEl(),L=this.getTdEl(),J=D.getX(L),N=D.getY(L);if(isNaN(J)||isNaN(N)){var K=this.getDataTable().getTbodyEl();J=L.offsetLeft+D.getX(K.parentNode)-K.scrollLeft;N=L.offsetTop+D.getY(K.parentNode)-K.scrollTop+this.getDataTable().getTheadEl().offsetHeight;}M.style.left=J+"px";M.style.top=N+"px";},show:function(){this.resetForm();this.isActive=true;this.getContainerEl().style.display="";this.focus();this.fireEvent("showEvent",{editor:this});},block:function(){this.fireEvent("blockEvent",{editor:this});},unblock:function(){this.fireEvent("unblockEvent",{editor:this});},save:function(){var K=this.getInputValue();var L=K;if(this.validator){L=this.validator.call(this.getDataTable(),K,this.value,this);if(L===undefined){if(this.resetInvalidData){this.resetForm();}this.fireEvent("invalidDataEvent",{editor:this,oldData:this.value,newData:K});return;}}var M=this;var J=function(O,N){var P=M.value;if(O){M.value=N;M.getDataTable().updateCell(M.getRecord(),M.getColumn(),N);M.getContainerEl().style.display="none";M.isActive=false;M.getDataTable()._oCellEditor=null;M.fireEvent("saveEvent",{editor:M,oldData:P,newData:M.value});}else{M.resetForm();M.fireEvent("revertEvent",{editor:M,oldData:P,newData:N});}M.unblock();};this.block();if(C.isFunction(this.asyncSubmitter)){this.asyncSubmitter.call(this,J,L);}else{J(true,L);}},cancel:function(){if(this.isActive){this.getContainerEl().style.display="none";this.isActive=false;this.getDataTable()._oCellEditor=null;this.fireEvent("cancelEvent",{editor:this});}else{}},renderForm:function(){},doAfterRender:function(){},handleDisabledBtns:function(){},resetForm:function(){},focus:function(){},getInputValue:function(){}};C.augmentProto(A,F.EventProvider);E.CheckboxCellEditor=function(J){this._sId="yui-checkboxceditor"+YAHOO.widget.BaseCellEditor._nCount++;E.CheckboxCellEditor.superclass.constructor.call(this,"checkbox",J);};C.extend(E.CheckboxCellEditor,A,{checkboxOptions:null,checkboxes:null,value:null,renderForm:function(){if(C.isArray(this.checkboxOptions)){var M,N,P,K,L,J;for(L=0,J=this.checkboxOptions.length;L<J;L++){M=this.checkboxOptions[L];N=C.isValue(M.value)?M.value:M;P=this.getId()+"-chk"+L;this.getContainerEl().innerHTML+='<input type="checkbox"'+' id="'+P+'"'+' value="'+N+'" />';K=this.getContainerEl().appendChild(document.createElement("label"));K.htmlFor=P;K.innerHTML=C.isValue(M.label)?M.label:M;}var O=[];for(L=0;L<J;L++){O[O.length]=this.getContainerEl().childNodes[L*2];}this.checkboxes=O;if(this.disableBtns){this.handleDisabledBtns();}}else{}},handleDisabledBtns:function(){I.addListener(this.getContainerEl(),"click",function(J){if(I.getTarget(J).tagName.toLowerCase()==="input"){this.save();}},this,true);},resetForm:function(){var N=C.isArray(this.value)?this.value:[this.value];for(var M=0,L=this.checkboxes.length;M<L;M++){this.checkboxes[M].checked=false;for(var K=0,J=N.length;K<J;K++){if(this.checkboxes[M].value===N[K]){this.checkboxes[M].checked=true;}}}},focus:function(){this.checkboxes[0].focus();},getInputValue:function(){var J=[];for(var L=0,K=this.checkboxes.length;L<K;L++){if(this.checkboxes[L].checked){J[J.length]=this.checkboxes[L].value;}}return J;}});C.augmentObject(E.CheckboxCellEditor,A);E.DateCellEditor=function(J){this._sId="yui-dateceditor"+YAHOO.widget.BaseCellEditor._nCount++;E.DateCellEditor.superclass.constructor.call(this,"date",J);};C.extend(E.DateCellEditor,A,{calendar:null,calendarOptions:null,defaultValue:new Date(),renderForm:function(){if(YAHOO.widget.Calendar){var K=this.getContainerEl().appendChild(document.createElement("div"));K.id=this.getId()+"-dateContainer";var L=new YAHOO.widget.Calendar(this.getId()+"-date",K.id,this.calendarOptions);L.render();K.style.cssFloat="none";if(B.ie){var J=this.getContainerEl().appendChild(document.createElement("div"));J.style.clear="both";}this.calendar=L;if(this.disableBtns){this.handleDisabledBtns();}}else{}},handleDisabledBtns:function(){this.calendar.selectEvent.subscribe(function(J){this.save();},this,true);},resetForm:function(){var K=this.value;var J=(K.getMonth()+1)+"/"+K.getDate()+"/"+K.getFullYear();this.calendar.cfg.setProperty("selected",J,false);this.calendar.render();},focus:function(){},getInputValue:function(){return this.calendar.getSelectedDates()[0];}});C.augmentObject(E.DateCellEditor,A);E.DropdownCellEditor=function(J){this._sId="yui-dropdownceditor"+YAHOO.widget.BaseCellEditor._nCount++;E.DropdownCellEditor.superclass.constructor.call(this,"dropdown",J);};C.extend(E.DropdownCellEditor,A,{dropdownOptions:null,dropdown:null,renderForm:function(){var M=this.getContainerEl().appendChild(document.createElement("select"));M.style.zoom=1;this.dropdown=M;if(C.isArray(this.dropdownOptions)){var N,L;for(var K=0,J=this.dropdownOptions.length;K<J;K++){N=this.dropdownOptions[K];L=document.createElement("option");L.value=(C.isValue(N.value))?N.value:N;L.innerHTML=(C.isValue(N.label))?N.label:N;L=M.appendChild(L);}if(this.disableBtns){this.handleDisabledBtns();}}},handleDisabledBtns:function(){I.addListener(this.dropdown,"change",function(J){this.save();},this,true);},resetForm:function(){for(var K=0,J=this.dropdown.options.length;K<J;K++){if(this.value===this.dropdown.options[K].value){this.dropdown.options[K].selected=true;}}},focus:function(){this.getDataTable()._focusEl(this.dropdown);
},getInputValue:function(){return this.dropdown.options[this.dropdown.options.selectedIndex].value;}});C.augmentObject(E.DropdownCellEditor,A);E.RadioCellEditor=function(J){this._sId="yui-radioceditor"+YAHOO.widget.BaseCellEditor._nCount++;E.RadioCellEditor.superclass.constructor.call(this,"radio",J);};C.extend(E.RadioCellEditor,A,{radios:null,radioOptions:null,renderForm:function(){if(C.isArray(this.radioOptions)){var J,K,Q,N;for(var M=0,O=this.radioOptions.length;M<O;M++){J=this.radioOptions[M];K=C.isValue(J.value)?J.value:J;Q=this.getId()+"-radio"+M;this.getContainerEl().innerHTML+='<input type="radio"'+' name="'+this.getId()+'"'+' value="'+K+'"'+' id="'+Q+'" />';N=this.getContainerEl().appendChild(document.createElement("label"));N.htmlFor=Q;N.innerHTML=(C.isValue(J.label))?J.label:J;}var P=[],R;for(var L=0;L<O;L++){R=this.getContainerEl().childNodes[L*2];P[P.length]=R;}this.radios=P;if(this.disableBtns){this.handleDisabledBtns();}}else{}},handleDisabledBtns:function(){I.addListener(this.getContainerEl(),"click",function(J){if(I.getTarget(J).tagName.toLowerCase()==="input"){this.save();}},this,true);},resetForm:function(){for(var L=0,K=this.radios.length;L<K;L++){var J=this.radios[L];if(this.value===J.value){J.checked=true;return;}}},focus:function(){for(var K=0,J=this.radios.length;K<J;K++){if(this.radios[K].checked){this.radios[K].focus();return;}}},getInputValue:function(){for(var K=0,J=this.radios.length;K<J;K++){if(this.radios[K].checked){return this.radios[K].value;}}}});C.augmentObject(E.RadioCellEditor,A);E.TextareaCellEditor=function(J){this._sId="yui-textareaceditor"+YAHOO.widget.BaseCellEditor._nCount++;E.TextareaCellEditor.superclass.constructor.call(this,"textarea",J);};C.extend(E.TextareaCellEditor,A,{textarea:null,renderForm:function(){var J=this.getContainerEl().appendChild(document.createElement("textarea"));this.textarea=J;if(this.disableBtns){this.handleDisabledBtns();}},handleDisabledBtns:function(){I.addListener(this.textarea,"blur",function(J){this.save();},this,true);},move:function(){this.textarea.style.width=this.getTdEl().offsetWidth+"px";this.textarea.style.height="3em";YAHOO.widget.TextareaCellEditor.superclass.move.call(this);},resetForm:function(){this.textarea.value=this.value;},focus:function(){this.getDataTable()._focusEl(this.textarea);this.textarea.select();},getInputValue:function(){return this.textarea.value;}});C.augmentObject(E.TextareaCellEditor,A);E.TextboxCellEditor=function(J){this._sId="yui-textboxceditor"+YAHOO.widget.BaseCellEditor._nCount++;E.TextboxCellEditor.superclass.constructor.call(this,"textbox",J);};C.extend(E.TextboxCellEditor,A,{textbox:null,renderForm:function(){var J;if(B.webkit>420){J=this.getContainerEl().appendChild(document.createElement("form")).appendChild(document.createElement("input"));}else{J=this.getContainerEl().appendChild(document.createElement("input"));}J.type="text";this.textbox=J;I.addListener(J,"keypress",function(K){if((K.keyCode===13)){YAHOO.util.Event.preventDefault(K);this.save();}},this,true);if(this.disableBtns){this.handleDisabledBtns();}},move:function(){this.textbox.style.width=this.getTdEl().offsetWidth+"px";E.TextboxCellEditor.superclass.move.call(this);},resetForm:function(){this.textbox.value=C.isValue(this.value)?this.value.toString():"";},focus:function(){this.getDataTable()._focusEl(this.textbox);this.textbox.select();},getInputValue:function(){return this.textbox.value;}});C.augmentObject(E.TextboxCellEditor,A);H.Editors={checkbox:E.CheckboxCellEditor,"date":E.DateCellEditor,dropdown:E.DropdownCellEditor,radio:E.RadioCellEditor,textarea:E.TextareaCellEditor,textbox:E.TextboxCellEditor};E.CellEditor=function(K,J){if(K&&H.Editors[K]){C.augmentObject(A,H.Editors[K]);return new H.Editors[K](J);}else{return new A(null,J);}};var G=E.CellEditor;C.augmentObject(G,A);})();YAHOO.register("datatable",YAHOO.widget.DataTable,{version:"2.7.0",build:"1796"});

YAHOO.widget.DataTable.prototype.getTdEl=function(cell){var Dom=YAHOO.util.Dom,lang=YAHOO.lang,elCell,el=Dom.get(cell);if(el&&(el.ownerDocument==document)){if(el.nodeName.toLowerCase()!="td"){elCell=Dom.getAncestorByTagName(el,"td");}
else{elCell=el;}
if(elCell&&(elCell.parentNode.parentNode==this._elTbody)){return elCell;}}
else if(cell){var oRecord,nColKeyIndex;if(lang.isString(cell.columnKey)&&lang.isString(cell.recordId)){oRecord=this.getRecord(cell.recordId);var oColumn=this.getColumn(cell.columnKey);if(oColumn){nColKeyIndex=oColumn.getKeyIndex();}}
if(cell.record&&cell.column&&cell.column.getKeyIndex){oRecord=cell.record;nColKeyIndex=cell.column.getKeyIndex();}
var elRow=this.getTrEl(oRecord);if((nColKeyIndex!==null)&&elRow&&elRow.cells&&elRow.cells.length>0){return elRow.cells[nColKeyIndex]||null;}}
return null;};YAHOO.widget.DataTable.prototype.sortColumn=function(oColumn,sDir){var sSortDir=sDir||this.getColumnSortDir(oColumn);this.set("sortedBy",{key:oColumn.key,dir:sSortDir,column:oColumn});this.fireEvent("columnSortEvent",{column:oColumn,dir:sSortDir});};YAHOO.widget.DataTable.prototype.formatTheadCell=function(elCellLabel,oColumn,oSortedBy){var sKey=oColumn.getKey();var sLabel=YAHOO.lang.isValue(oColumn.label)?oColumn.label:sKey;var DT=YAHOO.widget.DataTable;if(oColumn.sortable){var sSortClass=this.getColumnSortDir(oColumn,oSortedBy);var bDesc=(sSortClass===DT.CLASS_DESC);if(oSortedBy&&(oColumn.key===oSortedBy.key)){bDesc=!(oSortedBy.dir===DT.CLASS_DESC);}
var sHref=this.getId()+"-href-"+oColumn.getSanitizedKey();var sTitle=(bDesc)?this.get("MSG_SORTDESC"):this.get("MSG_SORTASC");if(elCellLabel.firstChild){elCellLabel.firstChild.title=sTitle;}else{elCellLabel.innerHTML="<a href=\""+sHref+"\" title=\""+sTitle+"\" class=\""+DT.CLASS_SORTABLE+"\">"+sLabel+"</a>";}}
else{elCellLabel.innerHTML=sLabel;}};
/*
Copyright (c) 2009, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.7.0
*/
(function(){function A(E){var I=A.VALUE_UNLIMITED,H=YAHOO.lang,F,B,C,D,G;E=H.isObject(E)?E:{};this.initConfig();this.initEvents();this.set("rowsPerPage",E.rowsPerPage,true);if(A.isNumeric(E.totalRecords)){this.set("totalRecords",E.totalRecords,true);}this.initUIComponents();for(F in E){if(H.hasOwnProperty(E,F)){this.set(F,E[F],true);}}B=this.get("initialPage");C=this.get("totalRecords");D=this.get("rowsPerPage");if(B>1&&D!==I){G=(B-1)*D;if(C===I||G<C){this.set("recordOffset",G,true);}}}YAHOO.lang.augmentObject(A,{id:0,ID_BASE:"yui-pg",VALUE_UNLIMITED:-1,TEMPLATE_DEFAULT:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}",TEMPLATE_ROWS_PER_PAGE:"{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}",ui:{},isNumeric:function(B){return isFinite(+B);},toNumber:function(B){return isFinite(+B)?+B:null;}},true);A.prototype={_containers:[],_batch:false,_pageChanged:false,_state:null,initConfig:function(){var C=A.VALUE_UNLIMITED,B=YAHOO.lang;this.setAttributeConfig("rowsPerPage",{value:0,validator:A.isNumeric,setter:A.toNumber});this.setAttributeConfig("containers",{value:null,validator:function(F){if(!B.isArray(F)){F=[F];}for(var E=0,D=F.length;E<D;++E){if(B.isString(F[E])||(B.isObject(F[E])&&F[E].nodeType===1)){continue;}return false;}return true;},method:function(D){D=YAHOO.util.Dom.get(D);if(!B.isArray(D)){D=[D];}this._containers=D;}});this.setAttributeConfig("totalRecords",{value:0,validator:A.isNumeric,setter:A.toNumber});this.setAttributeConfig("recordOffset",{value:0,validator:function(E){var D=this.get("totalRecords");if(A.isNumeric(E)){E=+E;return D===C||D>E||(D===0&&E===0);}return false;},setter:A.toNumber});this.setAttributeConfig("initialPage",{value:1,validator:A.isNumeric,setter:A.toNumber});this.setAttributeConfig("template",{value:A.TEMPLATE_DEFAULT,validator:B.isString});this.setAttributeConfig("containerClass",{value:"yui-pg-container",validator:B.isString});this.setAttributeConfig("alwaysVisible",{value:true,validator:B.isBoolean});this.setAttributeConfig("updateOnChange",{value:false,validator:B.isBoolean});this.setAttributeConfig("id",{value:A.id++,readOnly:true});this.setAttributeConfig("rendered",{value:false,readOnly:true});},initUIComponents:function(){var D=A.ui,C,B;for(C in D){if(YAHOO.lang.hasOwnProperty(D,C)){B=D[C];if(YAHOO.lang.isObject(B)&&YAHOO.lang.isFunction(B.init)){B.init(this);}}}},initEvents:function(){this.createEvent("render");this.createEvent("rendered");this.createEvent("changeRequest");this.createEvent("pageChange");this.createEvent("beforeDestroy");this.createEvent("destroy");this._selfSubscribe();},_selfSubscribe:function(){this.subscribe("totalRecordsChange",this.updateVisibility,this,true);this.subscribe("alwaysVisibleChange",this.updateVisibility,this,true);this.subscribe("totalRecordsChange",this._handleStateChange,this,true);this.subscribe("recordOffsetChange",this._handleStateChange,this,true);this.subscribe("rowsPerPageChange",this._handleStateChange,this,true);this.subscribe("totalRecordsChange",this._syncRecordOffset,this,true);},_syncRecordOffset:function(E){var B=E.newValue,D,C;if(E.prevValue!==B){if(B!==A.VALUE_UNLIMITED){D=this.get("rowsPerPage");if(D&&this.get("recordOffset")>=B){C=this.getState({totalRecords:E.prevValue,recordOffset:this.get("recordOffset")});this.set("recordOffset",C.before.recordOffset);this._firePageChange(C);}}}},_handleStateChange:function(C){if(C.prevValue!==C.newValue){var D=this._state||{},B;D[C.type.replace(/Change$/,"")]=C.prevValue;B=this.getState(D);if(B.page!==B.before.page){if(this._batch){this._pageChanged=true;}else{this._firePageChange(B);}}}},_firePageChange:function(B){if(YAHOO.lang.isObject(B)){var C=B.before;delete B.before;this.fireEvent("pageChange",{type:"pageChange",prevValue:B.page,newValue:C.page,prevState:B,newState:C});}},render:function(){if(this.get("rendered")){return;}var N=this.get("totalRecords"),G=YAHOO.util.Dom,O=this.get("template"),Q=this.get("containerClass"),I,K,M,H,F,E,P,D,C,B,L,J;if(N!==A.VALUE_UNLIMITED&&N<this.get("rowsPerPage")&&!this.get("alwaysVisible")){return;}O=O.replace(/\{([a-z0-9_ \-]+)\}/gi,'<span class="yui-pg-ui $1"></span>');for(I=0,K=this._containers.length;I<K;++I){M=this._containers[I];H=A.ID_BASE+this.get("id")+"-"+I;if(!M){continue;}M.style.display="none";G.addClass(M,Q);M.innerHTML=O;F=G.getElementsByClassName("yui-pg-ui","span",M);for(E=0,P=F.length;E<P;++E){D=F[E];C=D.parentNode;B=D.className.replace(/\s*yui-pg-ui\s+/g,"");L=A.ui[B];if(YAHOO.lang.isFunction(L)){J=new L(this);if(YAHOO.lang.isFunction(J.render)){C.replaceChild(J.render(H),D);}}}M.style.display="";}if(this._containers.length){this.setAttributeConfig("rendered",{value:true});this.fireEvent("render",this.getState());this.fireEvent("rendered",this.getState());}},destroy:function(){this.fireEvent("beforeDestroy");this.fireEvent("destroy");this.setAttributeConfig("rendered",{value:false});},updateVisibility:function(G){var C=this.get("alwaysVisible"),I,H,E,F,D,B;if(G.type==="alwaysVisibleChange"||!C){I=this.get("totalRecords");H=true;E=this.get("rowsPerPage");F=this.get("rowsPerPageOptions");if(YAHOO.lang.isArray(F)){for(D=0,B=F.length;D<B;++D){E=Math.min(E,F[D]);}}if(I!==A.VALUE_UNLIMITED&&I<=E){H=false;}H=H||C;for(D=0,B=this._containers.length;D<B;++D){YAHOO.util.Dom.setStyle(this._containers[D],"display",H?"":"none");}}},getContainerNodes:function(){return this._containers;},getTotalPages:function(){var B=this.get("totalRecords"),C=this.get("rowsPerPage");if(!C){return null;}if(B===A.VALUE_UNLIMITED){return A.VALUE_UNLIMITED;}return Math.ceil(B/C);},hasPage:function(C){if(!YAHOO.lang.isNumber(C)||C<1){return false;}var B=this.getTotalPages();return(B===A.VALUE_UNLIMITED||B>=C);},getCurrentPage:function(){var B=this.get("rowsPerPage");if(!B||!this.get("totalRecords")){return 0;}return Math.floor(this.get("recordOffset")/B)+1;},hasNextPage:function(){var B=this.getCurrentPage(),C=this.getTotalPages();return B&&(C===A.VALUE_UNLIMITED||B<C);
},getNextPage:function(){return this.hasNextPage()?this.getCurrentPage()+1:null;},hasPreviousPage:function(){return(this.getCurrentPage()>1);},getPreviousPage:function(){return(this.hasPreviousPage()?this.getCurrentPage()-1:1);},getPageRecords:function(E){if(!YAHOO.lang.isNumber(E)){E=this.getCurrentPage();}var D=this.get("rowsPerPage"),C=this.get("totalRecords"),F,B;if(!E||!D){return null;}F=(E-1)*D;if(C!==A.VALUE_UNLIMITED){if(F>=C){return null;}B=Math.min(F+D,C)-1;}else{B=F+D-1;}return[F,B];},setPage:function(C,B){if(this.hasPage(C)&&C!==this.getCurrentPage()){if(this.get("updateOnChange")||B){this.set("recordOffset",(C-1)*this.get("rowsPerPage"));}else{this.fireEvent("changeRequest",this.getState({"page":C}));}}},getRowsPerPage:function(){return this.get("rowsPerPage");},setRowsPerPage:function(C,B){if(A.isNumeric(C)&&+C>0&&+C!==this.get("rowsPerPage")){if(this.get("updateOnChange")||B){this.set("rowsPerPage",C);}else{this.fireEvent("changeRequest",this.getState({"rowsPerPage":+C}));}}},getTotalRecords:function(){return this.get("totalRecords");},setTotalRecords:function(C,B){if(A.isNumeric(C)&&+C>=0&&+C!==this.get("totalRecords")){if(this.get("updateOnChange")||B){this.set("totalRecords",C);}else{this.fireEvent("changeRequest",this.getState({"totalRecords":+C}));}}},getStartIndex:function(){return this.get("recordOffset");},setStartIndex:function(C,B){if(A.isNumeric(C)&&+C>=0&&+C!==this.get("recordOffset")){if(this.get("updateOnChange")||B){this.set("recordOffset",C);}else{this.fireEvent("changeRequest",this.getState({"recordOffset":+C}));}}},getState:function(H){var J=A.VALUE_UNLIMITED,F=Math,G=F.max,I=F.ceil,D,B,E;function C(M,K,L){if(M<=0||K===0){return 0;}if(K===J||K>M){return M-(M%L);}return K-(K%L||L);}D={paginator:this,totalRecords:this.get("totalRecords"),rowsPerPage:this.get("rowsPerPage"),records:this.getPageRecords()};D.recordOffset=C(this.get("recordOffset"),D.totalRecords,D.rowsPerPage);D.page=I(D.recordOffset/D.rowsPerPage)+1;if(!H){return D;}B={paginator:this,before:D,rowsPerPage:H.rowsPerPage||D.rowsPerPage,totalRecords:(A.isNumeric(H.totalRecords)?G(H.totalRecords,J):+D.totalRecords)};if(B.totalRecords===0){B.recordOffset=B.page=0;}else{E=A.isNumeric(H.page)?(H.page-1)*B.rowsPerPage:A.isNumeric(H.recordOffset)?+H.recordOffset:D.recordOffset;B.recordOffset=C(E,B.totalRecords,B.rowsPerPage);B.page=I(B.recordOffset/B.rowsPerPage)+1;}B.records=[B.recordOffset,B.recordOffset+B.rowsPerPage-1];if(B.totalRecords!==J&&B.recordOffset<B.totalRecords&&B.records&&B.records[1]>B.totalRecords-1){B.records[1]=B.totalRecords-1;}return B;},setState:function(C){if(YAHOO.lang.isObject(C)){this._state=this.getState({});C={page:C.page,rowsPerPage:C.rowsPerPage,totalRecords:C.totalRecords,recordOffset:C.recordOffset};if(C.page&&C.recordOffset===undefined){C.recordOffset=(C.page-1)*(C.rowsPerPage||this.get("rowsPerPage"));}this._batch=true;this._pageChanged=false;for(var B in C){if(C.hasOwnProperty(B)){this.set(B,C[B]);}}this._batch=false;if(this._pageChanged){this._pageChanged=false;this._firePageChange(this.getState(this._state));}}}};YAHOO.lang.augmentProto(A,YAHOO.util.AttributeProvider);YAHOO.widget.Paginator=A;})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.CurrentPageReport=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("pageReportTemplateChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("pageReportClassChange",this.update,this,true);};B.ui.CurrentPageReport.init=function(C){C.setAttributeConfig("pageReportClass",{value:"yui-pg-current",validator:A.isString});C.setAttributeConfig("pageReportTemplate",{value:"({currentPage} of {totalPages})",validator:A.isString});C.setAttributeConfig("pageReportValueGenerator",{value:function(F){var E=F.getCurrentPage(),D=F.getPageRecords();return{"currentPage":D?E:0,"totalPages":F.getTotalPages(),"startIndex":D?D[0]:0,"endIndex":D?D[1]:0,"startRecord":D?D[0]+1:0,"endRecord":D?D[1]+1:0,"totalRecords":F.get("totalRecords")};},validator:A.isFunction});};B.ui.CurrentPageReport.sprintf=function(D,C){return D.replace(/\{([\w\s\-]+)\}/g,function(E,F){return(F in C)?C[F]:"";});};B.ui.CurrentPageReport.prototype={span:null,render:function(C){this.span=document.createElement("span");this.span.id=C+"-page-report";this.span.className=this.paginator.get("pageReportClass");this.update();return this.span;},update:function(C){if(C&&C.prevValue===C.newValue){return;}this.span.innerHTML=B.ui.CurrentPageReport.sprintf(this.paginator.get("pageReportTemplate"),this.paginator.get("pageReportValueGenerator")(this.paginator));},destroy:function(){this.span.parentNode.removeChild(this.span);this.span=null;}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.PageLinks=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("pageLinksChange",this.rebuild,this,true);C.subscribe("pageLinkClassChange",this.rebuild,this,true);C.subscribe("currentPageClassChange",this.rebuild,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("pageLinksContainerClassChange",this.rebuild,this,true);};B.ui.PageLinks.init=function(C){C.setAttributeConfig("pageLinkClass",{value:"yui-pg-page",validator:A.isString});C.setAttributeConfig("currentPageClass",{value:"yui-pg-current-page",validator:A.isString});C.setAttributeConfig("pageLinksContainerClass",{value:"yui-pg-pages",validator:A.isString});C.setAttributeConfig("pageLinks",{value:10,validator:B.isNumeric});C.setAttributeConfig("pageLabelBuilder",{value:function(D,E){return D;},validator:A.isFunction});};B.ui.PageLinks.calculateRange=function(E,F,D){var I=B.VALUE_UNLIMITED,H,C,G;if(!E||D===0||F===0||(F===I&&D===I)){return[0,-1];}if(F!==I){D=D===I?F:Math.min(D,F);
}H=Math.max(1,Math.ceil(E-(D/2)));if(F===I){C=H+D-1;}else{C=Math.min(F,H+D-1);}G=D-(C-H+1);H=Math.max(1,H-G);return[H,C];};B.ui.PageLinks.prototype={current:0,container:null,render:function(C){var D=this.paginator;this.container=document.createElement("span");this.container.id=C+"-pages";this.container.className=D.get("pageLinksContainerClass");YAHOO.util.Event.on(this.container,"click",this.onClick,this,true);this.update({newValue:null,rebuild:true});return this.container;},update:function(J){if(J&&J.prevValue===J.newValue){return;}var E=this.paginator,I=E.getCurrentPage();if(this.current!==I||!I||J.rebuild){var L=E.get("pageLabelBuilder"),H=B.ui.PageLinks.calculateRange(I,E.getTotalPages(),E.get("pageLinks")),D=H[0],F=H[1],K="",C,G;C='<a href="#" class="'+E.get("pageLinkClass")+'" page="';for(G=D;G<=F;++G){if(G===I){K+='<span class="'+E.get("currentPageClass")+" "+E.get("pageLinkClass")+'">'+L(G,E)+"</span>";}else{K+=C+G+'">'+L(G,E)+"</a>";}}this.container.innerHTML=K;}},rebuild:function(C){C.rebuild=true;this.update(C);},destroy:function(){YAHOO.util.Event.purgeElement(this.container,true);this.container.parentNode.removeChild(this.container);this.container=null;},onClick:function(D){var C=YAHOO.util.Event.getTarget(D);if(C&&YAHOO.util.Dom.hasClass(C,this.paginator.get("pageLinkClass"))){YAHOO.util.Event.stopEvent(D);this.paginator.setPage(parseInt(C.getAttribute("page"),10));}}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.FirstPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("firstPageLinkLabelChange",this.update,this,true);C.subscribe("firstPageLinkClassChange",this.update,this,true);};B.ui.FirstPageLink.init=function(C){C.setAttributeConfig("firstPageLinkLabel",{value:"&lt;&lt;&nbsp;first",validator:A.isString});C.setAttributeConfig("firstPageLinkClass",{value:"yui-pg-first",validator:A.isString});};B.ui.FirstPageLink.prototype={current:null,link:null,span:null,render:function(D){var E=this.paginator,F=E.get("firstPageLinkClass"),C=E.get("firstPageLinkLabel");this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=D+"-first-link";this.link.href="#";this.link.className=F;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-first-span";this.span.className=F;this.span.innerHTML=C;this.current=E.getCurrentPage()>1?this.link:this.span;return this.current;},update:function(D){if(D&&D.prevValue===D.newValue){return;}var C=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()>1){if(C&&this.current===this.span){C.replaceChild(this.link,this.current);this.current=this.link;}}else{if(C&&this.current===this.link){C.replaceChild(this.span,this.current);this.current=this.span;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(1);}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.LastPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("lastPageLinkLabelChange",this.update,this,true);C.subscribe("lastPageLinkClassChange",this.update,this,true);};B.ui.LastPageLink.init=function(C){C.setAttributeConfig("lastPageLinkLabel",{value:"last&nbsp;&gt;&gt;",validator:A.isString});C.setAttributeConfig("lastPageLinkClass",{value:"yui-pg-last",validator:A.isString});};B.ui.LastPageLink.prototype={current:null,link:null,span:null,na:null,render:function(D){var F=this.paginator,G=F.get("lastPageLinkClass"),C=F.get("lastPageLinkLabel"),E=F.getTotalPages();this.link=document.createElement("a");this.span=document.createElement("span");this.na=this.span.cloneNode(false);this.link.id=D+"-last-link";this.link.href="#";this.link.className=G;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-last-span";this.span.className=G;this.span.innerHTML=C;this.na.id=D+"-last-na";switch(E){case B.VALUE_UNLIMITED:this.current=this.na;break;case F.getCurrentPage():this.current=this.span;break;default:this.current=this.link;}return this.current;},update:function(D){if(D&&D.prevValue===D.newValue){return;}var C=this.current?this.current.parentNode:null,E=this.link;if(C){switch(this.paginator.getTotalPages()){case B.VALUE_UNLIMITED:E=this.na;break;case this.paginator.getCurrentPage():E=this.span;break;}if(this.current!==E){C.replaceChild(E,this.current);this.current=E;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(this.paginator.getTotalPages());}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.NextPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("nextPageLinkLabelChange",this.update,this,true);C.subscribe("nextPageLinkClassChange",this.update,this,true);};B.ui.NextPageLink.init=function(C){C.setAttributeConfig("nextPageLinkLabel",{value:"next&nbsp;&gt;",validator:A.isString});C.setAttributeConfig("nextPageLinkClass",{value:"yui-pg-next",validator:A.isString});};B.ui.NextPageLink.prototype={current:null,link:null,span:null,render:function(D){var F=this.paginator,G=F.get("nextPageLinkClass"),C=F.get("nextPageLinkLabel"),E=F.getTotalPages();this.link=document.createElement("a");this.span=document.createElement("span");
this.link.id=D+"-next-link";this.link.href="#";this.link.className=G;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-next-span";this.span.className=G;this.span.innerHTML=C;this.current=F.getCurrentPage()===E?this.span:this.link;return this.current;},update:function(E){if(E&&E.prevValue===E.newValue){return;}var D=this.paginator.getTotalPages(),C=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()!==D){if(C&&this.current===this.span){C.replaceChild(this.link,this.current);this.current=this.link;}}else{if(this.current===this.link){if(C){C.replaceChild(this.span,this.current);this.current=this.span;}}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(this.paginator.getNextPage());}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.PreviousPageLink=function(C){this.paginator=C;C.subscribe("recordOffsetChange",this.update,this,true);C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("totalRecordsChange",this.update,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("previousPageLinkLabelChange",this.update,this,true);C.subscribe("previousPageLinkClassChange",this.update,this,true);};B.ui.PreviousPageLink.init=function(C){C.setAttributeConfig("previousPageLinkLabel",{value:"&lt;&nbsp;prev",validator:A.isString});C.setAttributeConfig("previousPageLinkClass",{value:"yui-pg-previous",validator:A.isString});};B.ui.PreviousPageLink.prototype={current:null,link:null,span:null,render:function(D){var E=this.paginator,F=E.get("previousPageLinkClass"),C=E.get("previousPageLinkLabel");this.link=document.createElement("a");this.span=document.createElement("span");this.link.id=D+"-prev-link";this.link.href="#";this.link.className=F;this.link.innerHTML=C;YAHOO.util.Event.on(this.link,"click",this.onClick,this,true);this.span.id=D+"-prev-span";this.span.className=F;this.span.innerHTML=C;this.current=E.getCurrentPage()>1?this.link:this.span;return this.current;},update:function(D){if(D&&D.prevValue===D.newValue){return;}var C=this.current?this.current.parentNode:null;if(this.paginator.getCurrentPage()>1){if(C&&this.current===this.span){C.replaceChild(this.link,this.current);this.current=this.link;}}else{if(C&&this.current===this.link){C.replaceChild(this.span,this.current);this.current=this.span;}}},destroy:function(){YAHOO.util.Event.purgeElement(this.link);this.current.parentNode.removeChild(this.current);this.link=this.span=null;},onClick:function(C){YAHOO.util.Event.stopEvent(C);this.paginator.setPage(this.paginator.getPreviousPage());}};})();(function(){var B=YAHOO.widget.Paginator,A=YAHOO.lang;B.ui.RowsPerPageDropdown=function(C){this.paginator=C;C.subscribe("rowsPerPageChange",this.update,this,true);C.subscribe("rowsPerPageOptionsChange",this.rebuild,this,true);C.subscribe("totalRecordsChange",this._handleTotalRecordsChange,this,true);C.subscribe("destroy",this.destroy,this,true);C.subscribe("rowsPerPageDropdownClassChange",this.rebuild,this,true);};B.ui.RowsPerPageDropdown.init=function(C){C.setAttributeConfig("rowsPerPageOptions",{value:[],validator:A.isArray});C.setAttributeConfig("rowsPerPageDropdownClass",{value:"yui-pg-rpp-options",validator:A.isString});};B.ui.RowsPerPageDropdown.prototype={select:null,all:null,render:function(C){this.select=document.createElement("select");this.select.id=C+"-rpp";this.select.className=this.paginator.get("rowsPerPageDropdownClass");this.select.title="Rows per page";YAHOO.util.Event.on(this.select,"change",this.onChange,this,true);this.rebuild();return this.select;},rebuild:function(J){var C=this.paginator,E=this.select,K=C.get("rowsPerPageOptions"),D,I,F,G,H;this.all=null;for(G=0,H=K.length;G<H;++G){I=K[G];D=E.options[G]||E.appendChild(document.createElement("option"));F=A.isValue(I.value)?I.value:I;D.innerHTML=A.isValue(I.text)?I.text:I;if(A.isString(F)&&F.toLowerCase()==="all"){this.all=D;D.value=C.get("totalRecords");}else{D.value=F;}}while(E.options.length>K.length){E.removeChild(E.firstChild);}this.update();},update:function(G){if(G&&G.prevValue===G.newValue){return;}var F=this.paginator.get("rowsPerPage")+"",D=this.select.options,E,C;for(E=0,C=D.length;E<C;++E){if(D[E].value===F){D[E].selected=true;break;}}},onChange:function(C){this.paginator.setRowsPerPage(parseInt(this.select.options[this.select.selectedIndex].value,10));},_handleTotalRecordsChange:function(C){if(!this.all||(C&&C.prevValue===C.newValue)){return;}this.all.value=C.newValue;if(this.all.selected){this.paginator.set("rowsPerPage",C.newValue);}},destroy:function(){YAHOO.util.Event.purgeElement(this.select);this.select.parentNode.removeChild(this.select);this.select=null;}};})();YAHOO.register("paginator",YAHOO.widget.Paginator,{version:"2.7.0",build:"1796"});
