function CourseExtraParticipantForm(n,t,i,r,u){var f=this;if(f.Options.CourseId=n,f.Options.ExtraParticipantRequiredFieldsText=u,f.Options.CourseDisplayModifier=t,f.Options.EnrollmentStatistics=r,f.Options.ExtraParticipantCustomFieldRequired=extraParticipantCustomFieldLabelRequired,Ext.merge(f.Options,i),u!=undefined&&u!=null&&u!="all"&&u!=""&&(f.Options.ExtraParticipantRequiredFields.firstname=u.toLowerCase().indexOf("first")>-1?!0:!1,f.Options.ExtraParticipantRequiredFields.lastname=u.toLowerCase().indexOf("last")>-1?!0:!1,f.Options.ExtraParticipantRequiredFields.email=u.toLowerCase().indexOf("email")>-1?!0:!1,f.Options.ExtraParticipantRequiredFields.customfield=u.toLowerCase().indexOf("custom")>-1?extraParticipantCustomFieldLabelRequired:extraParticipantCustomFieldLabelRequired),f.Options.EnrollmentStatistics.SpaceAvailable<1&&f.Options.EnrollmentStatistics.WaitSpaceAvailable<1){config.showWarning("We apologize for the inconvenience but the course you are trying to add with the pricing option does not have at least one available spaces.","Not enough space available in course");window.LAYOUT.UnmaskLayout();return}Ext.onDocumentReady(function(){f.ShowForm()})}function CourseListingType(n,t,i){var r=this;Ext.isDefined(i)&&(r.renderTitles=i);r.CourseSearch=n;r.ContainerId=t;r.Container=Ext.get(t);r.DevelopmentMode=window.LAYOUT.Options.developmentMode;r.Render();window.COURSELISTINGTYPE=r}function CourseLocationGenerator(){}function CourseSearch(n){var t=this,i,u,e,r,f;if(window.CourseSearchInstance=this,window.COURSESEARCH=this,t.ViewListType=window.LAYOUT.Options.layoutConfiguration.SearchColumns.DefaultView,i=UrlHelper.getUrlVars(),!isNaN(i.courseid)){u=i.courseid;r=UrlHelper.getUrlWithoutVariable("courseid");history.pushState&&history.pushState(null,null,r);Ext.onDocumentReady(function(){t.ShowCourseDetails(u)})}if(!isNaN(i.showMembership)){e=i.showMembership;r=UrlHelper.getUrlWithoutVariable("showMembership");history.pushState&&history.pushState(null,null,r);Ext.onDocumentReady(function(){t.ShowMembershipDetails()})}t.Hash=new HashManager({cookie:"CourseSearch",enableCookies:!1});typeof n!="undefined"&&(t.PageSize=typeof n.defaultPageSize=="undefined"?10:n.defaultPageSize,t.showPublicAnncmnt=typeof n.showPublicAnncmnt=="undefined"?!1:n.showPublicAnncmnt);Ext.isDefined(n)&&Ext.isDefined(n.resultElementId)&&(t.ResultElement=Ext.get(n.resultElementId));window.onpopstate=Ext.bind(function(n){if(adminmode_call!="true"&&n.state!=null){var i=t.Hash.decompressString(n.state);t.Hash.state.viewState=Ext.decode(i);t.loadSerializedData();t.Invoke();cslc.Init()}});t.loadSerializedData();f=location.pathname.toLowerCase().indexOf("/browseinternal")>-1;t.CourseInternal=f?!0:!1}function CourseSearchDateFilter(n){var t=this;Ext.merge(t.Options,n);t.CourseSearch=t.Options.courseSearch;t.Render()}function CourseSearchKeyword(n,t,i){var r=this,s,u,f;Ext.merge(r.Options,i);r.ClearElementImage="Images/Icons/glyph2/Icons16x16/Delete.png";r.CourseSearch=n;r.KeywordContainerId=t;r.KeywordContainer=Ext.get(t);var h=window.LAYOUT.Options.buttonLabels.Search,e=config.getUrl("Images/Icons/glyph2/Icons24x24/Search 1.png"),c=config.getUrl("Images/Icons/glyph2/Icons24x24/Delete.png"),o=400,l=o;r.Keyword=Ext.create("Ext.form.field.Text",{id:"SearchCourseText",title:"Enter keyword here to search",renderTo:r.KeywordContainer,emptyText:h,width:o,style:{float:"left"},fieldStyle:{lineHeight:"26px",fontSize:"20px",paddingRight:"26px"},value:r.CourseSearch.Text});s=Ext.DomHelper;u=s.append(r.KeywordContainerId,{tag:"div",style:"z-index: 10; cursor: pointer; width: 26px; height: 32px; position: absolute; left: "+(l-26)+"px; background-position: 0px 4px; background-repeat: no-repeat; background-image: url("+e+") ",id:"course-search-keyword-click-placeholder"},!0);u.on("click",function(){var n=Ext.String.trim(r.Keyword.getValue());n.length>0?r.Keyword.setValue(" "):f(!0)});f=function(n){typeof n=="undefined"&&(n=!1);var t=Ext.String.trim(r.Keyword.getValue());t.length>0?u.setStyle({backgroundImage:"url('"+c+"')"}):u.setStyle({backgroundImage:"url('"+e+"')"});n&&(t!=r.CourseSearch.Text&&window.COURSESEARCHLEFTCATEGORY.Reset(!1),r.CourseSearch.ResetPage(),r.CourseSearch.Text=t,r.CourseSearch.Invoke())};f(!1);r.Keyword.on("change",f,r,{buffer:500})}function CourseSearchLayoutComposer(n){var t=this;t.Options=Ext.merge(t.Options,n);t.Options.selectedLayout!=null&&(t.Settings=t.Options.selectedLayout);Ext.onDocumentReady(function(){t.initializeState();t.renderComponents();window.LAYOUT.DecideAdminMode()&&config.showInfo("Default empty layout loaded. You may manage your layouts now.")});window.LAYOUTCOMPOSER=t}function CourseSearchLeftCategory(n,t,i){var r=this;window.cslc=r;window.COURSESEARCHLEFTCATEGORY=r;r.CourseSearch=n;r.MainContainer=t;Ext.isDefined(i)&&i==!1&&r.construct()}CourseExtraParticipantForm.prototype.constructor=CourseExtraParticipantForm;CourseExtraParticipantForm.prototype.Options={ExtraParticipantCollectionEnabled:!1,ExtraParticipantRequiredFieldsText:"all",ExtraParticipantLabel:null,ExtraParticipantCollectCustomField:!1,ExtraParticipantCustomFieldLabel:null,CourseId:null,CourseDisplayModifier:null,EnrollmentStatistics:{SpaceAvailable:null,WaitSpaceAvailable:null,AvailableRosterCount:null,EnrolledRosterCount:null,EnrollmentStatus:null,MaxEnrolledRosterCount:null,MaxWaitingRosterCount:null,Status:null,TotalRosterCount:null,WaitingRosterCount:null},ExtraParticipantRequiredFields:{firstname:!0,lastname:!0,email:!0,customfield:extraParticipantCustomFieldLabelRequired}};CourseExtraParticipantForm.prototype.ShowForm=function(){var n=this,h=null,t,f,v,e;h=n.Options.ExtraParticipantRequiredFieldsText!="all"&&n.Options.ExtraParticipantRequiredFieldsText!=""?"CourseExtraParticipantValidatedConfigs":n.Options.ExtraParticipantCollectCustomField?"CourseExtraParticipantValidatedCustomField":"CourseExtraParticipantValidatedRegular";var y="[data-course-id='"+n.Options.CourseId+"']",p=Ext.select(y).first(),w=p.getAttribute("data-course-name"),b=Ext.String.capitalize(n.Options.ExtraParticipantLabel)+" members for "+w+" (excluding yourself)",c=Ext.create("Ext.Button",{text:'<div style="font-size:14px;">Add new '+n.Options.ExtraParticipantLabel+" member<\/div>",icon:config.getUrl("images/icons/famfamfam/user_add.png"),handler:function(){var i;n.Options.ExtraParticipantRequiredFieldsText!="all"&&n.Options.ExtraParticipantRequiredFieldsText!=""?(i=CourseExtraParticipantValidatedConfigs.create({validators:[{type:"length",field:"StudentFirst",min:0,max:50},{type:"length",field:"StudentLast",min:1,max:50},{type:"email",field:"StudentEmail"},{type:"length",field:"StudentEmail",min:5,max:100},]}),t.add(i)):(i=n.Options.ExtraParticipantCollectCustomField?CourseExtraParticipantValidatedCustomField.create({}):CourseExtraParticipantValidatedRegular.create({}),t.add(i))}}),i=n.Options.EnrollmentStatistics.SpaceAvailable,r=n.Options.EnrollmentStatistics.WaitSpaceAvailable,k='<img style="vertical-align: top;" src="'+config.getUrl("images/icons/famfamfam/information.png")+'"/> Space available: {0}',d='<img style="vertical-align: top;" src="'+config.getUrl("images/icons/famfamfam/information.png")+'"/> Wait space available: {0}',u=function(n,t){if(t)return t=="spaceAvailable"?k.replace("{0}",n):d.replace("{0}",n)},l=Ext.create("Ext.toolbar.TextItem",{text:'<div style="font-size:14px;">'+u(i,"spaceAvailable")+"<\/div>"}),a=Ext.create("Ext.toolbar.TextItem",{text:'<div style="font-size:14px;">'+u(r,"spaceWait")+"<\/div>",hidden:r==0?!0:!1}),g=Ext.create("Ext.toolbar.Toolbar",{frame:!1,border:0,region:"north",height:28,items:[l,{xtype:"tbfill"},a,{xtype:"tbfill"},c]}),o=[],s=Ext.create("Ext.Button",{height:30,text:'<div style="font-size:14px;">Add course with members to cart<\/div>',handler:function(){var f=t.count();if(f<1){Ext.MessageBox.show({title:"Missing participant!",msg:"Please enter at least one participant!",buttons:Ext.MessageBox.OK,icon:Ext.window.MessageBox.WARNING});return}var i=!1,u=[],r="";t.each(function(t){var f=t.validate();if(!f.isValid()){i=!0;return}if(n.Options.ExtraParticipantRequiredFields.firstname&&t.data.StudentFirst==""){i=!0;r="First name";return}if(n.Options.ExtraParticipantRequiredFields.lastname&&t.data.StudentLast==""){r=" Last name";i=!0;return}if(n.Options.ExtraParticipantRequiredFields.email&&t.data.StudentEmail==""){i=!0;return}if(n.Options.ExtraParticipantCollectCustomField&&n.Options.ExtraParticipantRequiredFields.customfield&&t.data.CustomField2==""){r=n.Options.ExtraParticipantCustomFieldLabel;i=!0;return}u.push(t.data)});i?Ext.MessageBox.show({title:"Validation error!",msg:"Field ("+r+") is missing! Please make sure all member fields are filled out with valid data!",buttons:Ext.MessageBox.OK,icon:Ext.window.MessageBox.WARNING}):(e.destroy(),cart.AddCourse(n.Options.CourseId,n.Options.CourseDisplayModifier,u))},icon:config.getUrl("images/icons/famfamfam/user_go.png"),disabled:!0}),nt=Ext.create("Ext.Button",{height:30,text:'<div style="font-size:14px;">Cancel<\/div>',handler:function(){e.destroy()},icon:config.getUrl("images/icons/glyph2/icons16x16/cancel.png")});o.push(s);o.push(nt);t=Ext.create("Ext.data.Store",{xtype:"store",autoLoad:!0,model:h,proxy:{type:"memory",reader:{type:"json",rootProperty:"CourseExtraParticipant"}}});t.on("datachanged",function(){var e=t.count(),n,f;e<1?s.setDisabled(!0):s.setDisabled(!1);n=i>0?i-e:r-e;n=n-1;c.setDisabled(n<1);f="";i>0?(f=u(Math.max(0,n),"spaceAvailable"),l.setText('<div style="font-size:14px;">'+f+"<\/div>")):i==0&&r>0&&(f=u(Math.max(0,n),"spaceWait"),a.setText('<div style="font-size:14px;">'+f+"<\/div>"))});f=[{text:'<div style="font-size:14px;">First name<\/div>',dataIndex:"StudentFirst",flex:1,editor:{xtype:"textfield",minLength:1,maxLength:50,allowBlank:!n.Options.ExtraParticipantRequiredFields.firstname}},{text:'<div style="font-size:14px;">Last name<\/div>',dataIndex:"StudentLast",flex:1,editor:{xtype:"textfield",minLength:1,maxLength:50,allowBlank:!n.Options.ExtraParticipantRequiredFields.lastname}},{text:'<div style="font-size:14px;">E-mail<\/div>',dataIndex:"StudentEmail",flex:1,editor:{xtype:"textfield",minLength:5,maxLength:100,allowBlank:!n.Options.ExtraParticipantRequiredFields.email,vtype:"email"}}];n.Options.ExtraParticipantCollectCustomField&&f.push({text:'<div style="font-size:14px;">'+n.Options.ExtraParticipantCustomFieldLabel+"<\/div>",flex:1,dataIndex:"CustomField2",editor:{xtype:"textfield",minLength:1,maxLength:50,allowBlank:extraParticipantCustomFieldLabelRequired==!0?!1:!0}});f.push({xtype:"actioncolumn",width:25,items:[{icon:config.getUrl("images/icons/famfamfam/delete.png"),tooltip:"Delete",handler:function(n,i){Ext.MessageBox.show({title:"Confirm Delete",msg:"If you click OK, the record you have selected will be deleted.",buttons:Ext.MessageBox.OKCANCEL,icon:Ext.window.MessageBox.WARNING,fn:function(n){n=="ok"&&t.removeAt(i)}})}}]});v=Ext.create("Ext.grid.Panel",{layout:"fit",selType:"cellmodel",plugins:[{ptype:"cellediting",clicksToEdit:1}],viewConfig:{emptyText:'<div style="font-size:14px;">There are no '+n.Options.ExtraParticipantLabel+" members assigned.<\/div>",deferEmptyText:!1},listeners:{edit:function(n,t){t.record.commit()}},frame:!1,border:0,region:"center",cls:"extrprtCSS",store:t,columns:f});e=new Ext.Window({icon:config.getUrl("images/icons/famfamfam/user_suit.png"),title:'<div style="font-size:14px;">'+b+"<\/div>",listeners:{afterrender:function(n){var t=n.header;t.setHeight(30)}},width:800,height:500,layout:"fit",frame:!1,modal:!0,items:[{xtype:"panel",frame:!1,border:0,layout:"border",items:[g,v]}],buttons:o});e.show()};CourseListingType.constructor=CourseListingType;CourseListingType.ConstructForLayout=function(n,t){var i=n.getLayoutContainerComponentContainerId(t.container);return new CourseListingType(n.State.courseSearch,i)};CourseListingType.prototype.CourseSearch=null;CourseListingType.prototype.ContainerId=null;CourseListingType.prototype.Container=null;CourseListingType.prototype.DevelopmentMode=!1;CourseListingType.prototype.TileJulyViewImage="Images/Icons/glyph2/Icons24x24/square.png";CourseListingType.prototype.GridViewImage="Images/Icons/glyph2/Icons24x24/column-1.png";CourseListingType.prototype.GridElement=null;CourseListingType.prototype.TileJulyElement=null;CourseListingType.prototype.renderTitles=!0;CourseListingType.prototype.Render=function(){var n=this,t,i,r,f,u,e;if(n.Container.setHtml(""),t=0,window.LAYOUT.Options.layoutConfiguration.SearchColumns.GridViewEnabled&&t++,window.LAYOUT.Options.layoutConfiguration.SearchColumns.TileJulyViewEnabled&&t++,t<2){n.Container.enableDisplayMode();n.Container.hide();return}if(n.Container.show(),i=Ext.DomHelper,window.LAYOUT.Options.layoutConfiguration.SearchColumns.GridViewEnabled){r=[{tag:"img",src:config.getUrl(n.GridViewImage)}];n.renderTitles&&r.push({tag:"span",html:"Grid"});f={tag:"div",id:"view-type-grid",cls:"view-type-item"+(n.CourseSearch.ViewListType=="Grid"?" active":""),title:"View the course list as a grid",style:"cursor: pointer",children:r};n.GridElement=i.append(n.Container,f,!0);n.GridElement.on("click",function(){n.TileJulyElement.removeCls("active");n.GridElement.addCls("active");n.CourseSearch.ViewListType="Grid";n.CourseSearch.Invoke()})}if(window.LAYOUT.Options.layoutConfiguration.SearchColumns.TileJulyViewEnabled){u=[{tag:"img",src:config.getUrl(n.TileJulyViewImage)}];n.renderTitles&&u.push({tag:"span",html:"Tile"});e={tag:"div",id:"view-type-tile-july",cls:"view-type-item"+(n.CourseSearch.ViewListType=="TileJuly"?" active":""),style:"cursor: pointer",title:"View the course list as tile",children:u};n.TileJulyElement=i.append(n.Container,e,!0);n.TileJulyElement.on("click",function(){n.GridElement.removeCls("active");n.TileJulyElement.addCls("active");n.CourseSearch.ViewListType="TileJuly";n.CourseSearch.Invoke()})}};CourseLocationGenerator.constructor=CourseLocationGenerator;CourseLocationGenerator.prototype.generate=function(n,t,i,r){var a=this,s,h,u,e,c;r=Ext.merge({offset:[42,-8],extraCssClass:""},r);for(s in n)Ext.isObject(n[s])||(n[s]=Ext.String.trim(n[s]+""));var l=new Address,o=l.getAddressString(n),f="course-location-generator-map-"+Math.floor(Math.random()*1e4+1)+"-"+Math.floor(Math.random()*1e4+1);if(n.location||o||o!=""||n.location!=""){if(h=n.location,Ext.isEmpty(h)&&(h=o),u="",Ext.isEmpty(o)||(u+="<a href=\"javascript:window.CourseSearchInstance.ShowMapPanel('"+f+"');\">"),u+=h,Ext.isEmpty(o)||(u+="<\/a>",u+='<input type="hidden" id="cslocation'+f+'" value="'+n.location+'" />',u+='<input type="hidden" id="csstreet'+f+'" value="'+n.street+'" />',u+='<input type="hidden" id="cscity'+f+'" value="'+n.city+'" />',u+='<input type="hidden" id="csstate'+f+'" value="'+n.state+'" />',u+='<input type="hidden" id="cszip'+f+'" value="'+n.zip+'" />',u+='<input type="hidden" id="cscountry'+f+'" value="'+n.country+'" />',u+='<input type="hidden" id="addressString'+f+'" value="'+o+'" />'),u=="null")return;if(t.setHtml(u),e=o,Ext.isEmpty(n.locationadditionalinfo)||n.locationadditionalinfo=="null"||(e+="<br/>"+n.locationadditionalinfo),Ext.isEmpty(n.locationurl)||n.locationurl=="null"||(e+='<br/><a target="_blank" href="'+n.locationurl+'">Location Url<\/a>'),Ext.isEmpty(n.room)||n.room=="null"||(e+="<br/>Room: "+n.room),Ext.isObject(n.roomdirection)&&(e+="<br/>"+n.roomdirection.RoomDirectionsTitle+": "+n.roomdirection.RoomDirectionsInfo),e=="")return;e+="<br/>";i.setStyle("cursor","pointer");c=GSMUTOOLTIP.CreateTooltip({target:t,trigger:i,offset:r.offset,extraCssClass:r.extraCssClass});c.add({xtype:"container",html:e});c.getEl().appendChild({tag:"div",style:"height:200px; width:300px;",html:"loading...",id:f})}else i.hide()};CourseSearch.prototype.CourseVariables={CourseID:0,CourseName:"",CourseNum:"",CourseDescription:""};CourseSearch.constructor=CourseSearch;CourseSearch.ConstructForLayout=function(n,t){var i=n.getLayoutContainerComponentContainerId(t.container);return n.State.courseSearch.SetResultElementId(i),n.State.courseSearch.Invoke(),n.State.courseSearch};CourseSearch.prototype.Defaults={ClearElementImage:"Images/Icons/glyph2/Icons16x16/delete.png"};CourseSearch.prototype.IsLoading=!1;CourseSearch.prototype.ResultElement=null;CourseSearch.prototype.ViewListType="Grid";CourseSearch.prototype.Hash=null;CourseSearch.prototype.Page=1;CourseSearch.prototype.PageSize=20;CourseSearch.prototype.OrderByField="SystemDefault";CourseSearch.prototype.OrderByDirection="Ascending";CourseSearch.prototype.CourseActiveState="Current";CourseSearch.prototype.MainCategory="";CourseSearch.prototype.SubCategory="";CourseSearch.prototype.SubSubCategory="";CourseSearch.prototype.SubCategoryIsSubSub=!1;CourseSearch.prototype.Text="";CourseSearch.prototype.DateFrom=null;CourseSearch.prototype.DateUntil=null;CourseSearch.prototype.CourseInternal=!1;CourseSearch.prototype.CancelState="NotCancelled";CourseSearch.prototype.CoursePopout=0;CourseSearch.prototype.InitialRun=!0;CourseSearch.prototype.ActvViewListType=null;CourseSearch.prototype.showPublicAnncmnt=!1;CourseSearch.prototype.ShowCourseDetails=null;CourseSearch.prototype.ShowMembershipDetails=null;CourseSearch.prototype.docScrollTop=0;CourseSearch.prototype.loadSerializedData=function(){var n=this;n.EnsureViewListType();n.CancelState=n.Hash.getHashVar("CancelState",n.CancelState);n.MainCategory=n.Hash.getHashVar("MainCategory",n.MainCategory);n.SubCategory=n.Hash.getHashVar("SubCategory",n.SubCategory);n.SubCategoryIsSubSub=n.Hash.getHashVar("SubCategoryIsSubSub",n.SubCategoryIsSubSub);n.DateFrom=n.Hash.getHashVar("DateFrom",n.DateFrom);n.DateUntil=n.Hash.getHashVar("DateUntil",n.DateUntil);n.ViewListType=n.Hash.getHashVar("ViewListType",n.ViewListType);n.Page=n.Hash.getHashVar("Page",n.Page);n.PageSize=n.Hash.getHashVar("PageSize",n.PageSize);n.OrderByField=n.Hash.getHashVar("OrderByField",n.OrderByField);n.OrderByDirection=n.Hash.getHashVar("OrderByDirection",n.OrderByDirection);n.CourseActiveState=n.Hash.getHashVar("CourseActiveState",n.CourseActiveState);n.Text=n.Hash.getHashVar("Text",n.Text);n.CoursePopout=n.Hash.getHashVar("CoursePopout",n.CoursePopout)};CourseSearch.prototype.EnsureViewListType=function(){var n=this;window.LAYOUT.Options.layoutConfiguration.SearchColumns[n.ViewListType+"ViewEnabled"]||(window.LAYOUT.Options.layoutConfiguration.SearchColumns.GridViewEnabled?n.ViewListType="Grid":window.LAYOUT.Options.layoutConfiguration.SearchColumns.TileJulyViewEnabled&&(n.ViewListType="TileJuly"))};CourseSearch.prototype.serializeData=function(){var n=this;n.ViewListType=="Anncmnt"&&(n.ViewListType=n.ActvViewListType);n.EnsureViewListType();n.showPublicAnncmnt&&n.InitialRun&&(window.LAYOUT.Options.publicCourseListingFastLoad||n.Hash.state.stateIsValid||(n.ActvViewListType=n.ViewListType,n.ViewListType="Anncmnt"),n.InitialRun=!1);n.Hash.setHashVar("ViewListType",n.ViewListType);n.Hash.setHashVar("Page",n.Page);n.Hash.setHashVar("PageSize",n.PageSize);n.Hash.setHashVar("OrderByField",n.OrderByField);n.Hash.setHashVar("OrderByDirection",n.OrderByDirection);n.Hash.setHashVar("CourseActiveState",n.CourseActiveState);n.Hash.setHashVar("MainCategory",n.MainCategory);n.Hash.setHashVar("SubCategory",n.SubCategory);n.Hash.setHashVar("SubCategoryIsSubSub",n.SubCategoryIsSubSub);n.Hash.setHashVar("Text",n.Text);n.Hash.setHashVar("DateFrom",n.DateFrom);n.Hash.setHashVar("DateUntil",n.DateUntil);n.Hash.setHashVar("CancelState",n.CancelState);n.Hash.setHashVar("CoursePopout",n.CoursePopout);n.Hash.saveState()};CourseSearch.prototype.SetResultElementId=function(n){var t=this;t.ResultElement=Ext.get(n)};CourseSearch.prototype.Invoke=function(n){var t=this,i;t.IsLoading=!0;typeof n=="undefined"&&(n=!0);t.serializeData();t.CloseCourseDetailsWindow();t.ResultElement.mask("Loading");i=config.getUrl("public/course/list?page="+t.Page+"&pageSize="+t.PageSize+"&orderByField="+encodeURIComponent(t.OrderByField)+"&orderByDirection="+t.OrderByDirection+"&text="+encodeURIComponent(t.Text)+"&mainCategory="+encodeURIComponent(t.MainCategory)+"&subCategory="+encodeURIComponent(t.SubCategory)+"&subsubcattext="+encodeURIComponent(t.SubSubCategory)+"&subCategoryIsSubSub="+t.SubCategoryIsSubSub+"&state="+t.CourseActiveState+"&view="+t.ViewListType+"&from="+t.DateFrom+"&until="+t.DateUntil+"&courseInternal="+t.CourseInternal+"&CoursePopout="+t.CoursePopout+"&cancelState="+t.CancelState);Ext.Ajax.request({url:i,success:function(i){Ext.isDefined(cart)&&cart.resetMaterialData();t.ResultElement.unmask();n&&t.ResultElement.hide();t.ResultElement.setHtml(i.responseText,!0);n&&t.ResultElement.fadeIn();t.IsLoading=!1;Ext.select(".gsmu-tooltip-removable").remove();t.ShowCourseDetails(t.CoursePopout)}})};CourseSearch.prototype.ResetSearch=function(){var n=this;n.MainCategory="";n.SubCategory="";n.SubCategoryIsSubSub=!1;n.Page=1;n.Text="";n.DateFrom=null;n.DateUntil=null;n.CoursePopout=0};CourseSearch.prototype.ResetPage=function(){var n=this;n.Page=1};CourseSearch.prototype.Paginate=function(n,t){var i=this;i.Page=n;typeof t!="undefined"&&(i.PageSize=t);i.Invoke()};CourseSearch.prototype.Sort=function(n,t){var i=this;Ext.isDefined(t)&&(t!="Ascending"||t!="Descending")&&(t=i.OrderByDirection);typeof t!="undefined"?i.OrderByDirection=t:i.OrderByField==n&&(i.OrderByDirection=i.OrderByDirection=="Ascending"?"Descending":"Ascending");i.OrderByField=n;i.Invoke()};CourseSearch.prototype.ShowMapPanel=function(n){var t=this;setTimeout(function(){var i=new Address,t={location:$("#cslocation"+n).val(),street:$("#csstreet"+n).val(),city:$("#cscity"+n).val(),state:$("#csstate"+n).val(),zip:$("#cszip"+n).val(),country:$("#cscountry"+n).val()};i.verifyAddress(t,function(i,r){if(i){resultx=r[0].geometry.location;result=JSON.stringify(resultx);result=result.replace("(","");result=result.replace(")","");var u={zoom:10,center:new google.maps.LatLng(resultx.lat(),resultx.lng()),mapTypeId:google.maps.MapTypeId.ROADMAP},f=new google.maps.Map(document.getElementById(n),u),e=new google.maps.Marker({map:f,position:r[0].geometry.location,title:t.location})}else result="Unable to find address.",$("#"+n).html(result)})},1e3)};CourseSearch.prototype.ShowMembershipDetails=function(){var t=this,n;document.title="Membership";$(".page-title").html("Membership");history.pushState&&(n=UrlHelper.getUrlVars(),history.pushState(null,null,config.getUrl("membership")));Ext.Ajax.request({url:config.getUrl("public/Course/MembershipDetails"),success:function(n){cart.elementCheckoutContainer.setHtml(n.responseText,!0);cart.ShowCheckoutContainerDisplay()}})};CourseSearch.prototype.CloseMembershipDetailsWindow=function(){var t=this,n;history.pushState&&(n=UrlHelper.getUrlVars(),history.pushState(null,null,config.getUrl("public/course/browse")))};CourseSearch.prototype.ShowCourseDetails=function(n,t,i){var r=this,o;if(typeof i=="undefined"&&(i=!1),!isNaN(n)&&n!=0){r.CoursePopout=n;t!="calendar"&&t!="instructor"&&r.serializeData();var e=function(){var n="&nbsp;>&nbsp;<a href='javascript:window.CourseSearchInstance.CloseCourseDetailsWindow()'>"+r.MainCategory+"<\/a>&nbsp;>&nbsp;";return(n+="<a href='javascript:window.CourseSearchInstance.CloseCourseDetailsWindow()'>"+r.SubCategory+"<\/a>&nbsp;>&nbsp;",r.MainCategory.length<1)?"&nbsp;>&nbsp;<a href='javascript:window.CourseSearchInstance.CloseCourseDetailsWindow()'>All<\/a>&nbsp;>&nbsp;":n},f=Ext.create("Ext.form.Panel",{border:!1,frame:!1,bodyPadding:0,html:"",anchor:"100% 100%"}),u=Ext.getCmp("CourseDetailsWindow");u!=null&&u.destroy();history.pushState&&(o=UrlHelper.getUrlVars(),history.pushState(null,null,config.getUrl("public/Course/browse?courseid="+n)));u=Ext.create("Ext.window.Window",{id:"CourseDetailsWindow",modal:!0,border:!1,frame:!1,header:!1,layout:"anchor",y:10,tbar:!1,title:"Course details",width:100,autoScroll:!1,listeners:{close:function(){r.CoursePopout=0;t!="calendar"&&t!="instructor"&&r.serializeData()}},items:f});u.show();f.setLoading(!0);Ext.Ajax.request({url:config.getUrl("public/Course/CourseDetails"),params:{intCourseId:n},success:function(n){f.setLoading(!1);f.hide();u.setPosition(25,10);u.setWidth(document.documentElement.clientWidth-50);r.docScrollTop=$(document).scrollTop();$("html, body").animate({scrollTop:0},"slow");u.update(n.responseText,!0,function(){$("#s6").accordion();$("#coursetreebrowse").html(e);var n,t=new Address,r={street:$("#hdstreet").val(),city:$("#hdcity").val(),state:$("#hdstate").val(),zip:$("#hdzip").val(),country:$("#hdcountry").val()};t.verifyAddress(r,function(t,r){var u,f;t?($("#map-canvas").show(),resultx=r[0].geometry.location,result=JSON.stringify(resultx),result=result.replace("(",""),result=result.replace(")",""),u={zoom:10,center:new google.maps.LatLng(resultx.lat(),resultx.lng()),mapTypeId:google.maps.MapTypeId.ROADMAP},n=new google.maps.Map(document.getElementById("map-canvas"),u),f=new google.maps.Marker({map:n,position:r[0].geometry.location,title:$("#hdlocation").val()})):($("#map-canvas").hide(),result="Unable to find address: "+status);i&&top.window.LAYOUT.notify("There are options available for the course that you are required to make before you can add it to your cart. Please make your selection on the right and proceed by clicking the green button.")})})}})}};CourseSearch.prototype.CloseCourseDetailsWindow=function(){var t=this,i=Ext.getCmp("CourseDetailsWindow"),n;i?(i.close(),$("html, body").animate({scrollTop:t.docScrollTop},"slow")):(n=Ext.getCmp("CalendarCourseDetail"),n&&(n.close(),$("html, body").animate({scrollTop:t.docScrollTop},"slow")))};CourseSearch.prototype.CheckRequisite=function(){$("#chkRequisite").is(":checked")?$("#CourseRequisiteContainer").removeClass("course-widgetbox_error").addClass("course-widgetbox"):$("#CourseRequisiteContainer").removeClass("course-widgetbox").addClass("course-widgetbox_error")};CourseSearch.prototype.GetSpecificUrl=function(){Ext.MessageBox.show({title:"Copy the URL below:",msg:location.href,buttons:Ext.MessageBox.INFO})};CourseSearch.prototype.ShowCourseShareLinks=function(n,t){var u=this,i=Ext.getCmp("CourseDetailsWindow"),r;($("#divCourseLinkAction").css("display")!="block"||($("#divCourseLinkAction").slideUp("fast",function(){if($("#divCourseLinkAction").css("display","none"),i){var n=i.getHeight();i.setHeight(n-250)}}),$("#CourseLinkActioncmd").val()!=t))&&(i&&(r=i.getHeight(),i.setHeight(r+250)),Ext.Ajax.request({url:config.getUrl("public/Course/CourseLinkAction"),params:{intCourseId:n,cmd:t,urllnk:location.href},success:function(n){$("#divCourseLinkAction").html(n.responseText);$("#divCourseLinkAction").slideDown("fast",function(){t=="lk"&&($("#lnkinputbox").focus(function(){$(this).select()}),$("#lnkinputbox").focus());try{FB.XFBML.parse()}catch(n){}t=="ml"&&Recaptcha.create("6Lekt-MSAAAAAKR9JpvuXaae8IBNm4zeP0XOf1Sf","captchadiv",{tabindex:1,theme:"white",callback:Recaptcha.focus_response_field})})}}))};CourseSearchDateFilter.constructor=CourseSearchDateFilter;CourseSearchDateFilter.ConstructForLayout=function(n,t){var i=n.getLayoutContainerComponentContainerId(t.container);return new CourseSearchDateFilter({containerId:i,courseSearch:n.State.courseSearch})};CourseSearchDateFilter.prototype.Options={containerId:null,courseSearch:null};CourseSearchDateFilter.prototype.CourseSearch=null;CourseSearchDateFilter.prototype.ElementContainer=null;CourseSearchDateFilter.prototype.ClearFilterFrom=null;CourseSearchDateFilter.prototype.ClearFilterUntil=null;CourseSearchDateFilter.prototype.FilterFrom=null;CourseSearchDateFilter.prototype.FilterUntil=null;CourseSearchDateFilter.prototype.FilterFromContainer=null;CourseSearchDateFilter.prototype.FilterUntilContainer=null;CourseSearchDateFilter.prototype.Render=function(){var n=this,i,r,t;i=window.LAYOUT.Options.buttonLabels.SearchFrom!=""?window.LAYOUT.Options.buttonLabels.SearchFrom:"From";r=window.LAYOUT.Options.buttonLabels.SearchTo!=""?window.LAYOUT.Options.buttonLabels.SearchTo:"Until";n.ElementContainer=Ext.get(n.Options.containerId);n.FilterFromContainer=Ext.create("Ext.container.Container",{renderTo:n.ElementContainer,cls:"course-search-date-filter-container",layout:{type:"hbox"}});n.FilterFrom=Ext.create("Ext.form.field.Date",{emptyText:i,float:!0,value:n.CourseSearch.DateFrom});n.FilterFrom.on("change",function(t,i){i!=null&&i!=""?n.ClearFilterFrom.show():n.ClearFilterFrom.hide();n.FilterFrom.isValid()&&(n.FilterUntil.setMinValue(i),n.CourseSearch.DateFrom=Ext.Date.format(i,"n/j/Y"),n.CourseSearch.Invoke())},n.FilterFrom,{buffer:500});n.FilterFromContainer.add(n.FilterFrom);t="margin-left: 2px; position: relative !important; top: 3px !important; cursor: pointer;";n.ClearFilterFrom=n.FilterFromContainer.add({xtype:"box",autoEl:{tag:"img",src:config.getUrl(n.CourseSearch.Defaults.ClearElementImage),title:"Clear from date",style:t}});n.FilterUntilContainer=Ext.create("Ext.container.Container",{renderTo:n.ElementContainer,cls:"course-search-date-filter-container",layout:{type:"hbox"}});n.FilterUntil=Ext.create("Ext.form.field.Date",{emptyText:r,renderTo:n.ElementContainer,value:n.CourseSearch.DateUntil});n.FilterUntil.on("change",function(t,i){i!=null&&i!=""?n.ClearFilterUntil.show():n.ClearFilterUntil.hide();n.FilterUntil.isValid()&&(n.FilterFrom.setMaxValue(i),n.CourseSearch.DateUntil=Ext.Date.format(i,"n/j/Y"),n.CourseSearch.Invoke())},n.FilterUntil,{buffer:500});n.FilterUntilContainer.add(n.FilterUntil);n.ClearFilterUntil=n.FilterUntilContainer.add({xtype:"box",autoEl:{tag:"img",src:config.getUrl(n.CourseSearch.Defaults.ClearElementImage),title:"Clear until date",style:t}});n.FilterFromContainer.setWidth(n.FilterFromContainer.getWidth()+16);n.FilterUntilContainer.setWidth(n.FilterUntilContainer.getWidth()+16);n.ClearFilterFrom.hide();n.ClearFilterUntil.hide();n.ClearFilterFrom.getEl().on("click",function(){n.FilterFrom.setValue("")});n.ClearFilterUntil.getEl().on("click",function(){n.FilterUntil.setValue("")});(n.CourseSearch.DateFrom!=""||n.CourseSearch.DateUntil!="")&&(n.CourseSearch.DateFrom!=""&&n.CourseSearch.DateFrom!=null&&n.ClearFilterFrom.show(),n.CourseSearch.DateUntil!=""&&n.CourseSearch.DateUntil!=null&&n.ClearFilterUntil.show())};CourseSearchKeyword.constructor=CourseSearchKeyword;CourseSearchKeyword.ConstructForLayout=function(n,t){var i=n.getLayoutContainerComponentContainerId(t.container);return new CourseSearchKeyword(n.State.courseSearch,i)};CourseSearchKeyword.prototype.Options={};CourseSearchKeyword.prototype.CourseSearch=null;CourseSearchKeyword.prototype.KeywordContainerId=null;CourseSearchKeyword.prototype.KeywordContainer=null;CourseSearchKeyword.prototype.Keyword=null;CourseSearchKeyword.prototype.KeywordClearElement=null;CourseSearchLayoutComposer.constructor=CourseSearchLayoutComposer;CourseSearchLayoutComposer.prototype.Options={selectedLayout:null,courseSearch:null,displayMode:"normal",containerId:"composite-layout",contentContainerId:"composite-layout-content-container",editModeClass:"composite-layout-edit-mode",areaIds:{top:"composite-layout-top",left:"composite-layout-left",contentNavigation:"composite-layout-content-navigation",content:"composite-layout-content"},menuIds:{components:"layout-composer-menu-component-list"},icons:{layoutMenuIcon:"Images/Icons/FamFamFam/layout.png",layoutSaveMenuIcon:"Images/Icons/FamFamFam/layout_add.png",layoutLoadMenuIcon:"Images/Icons/FamFamFam/layout_edit.png",layoutSaveAsMenuIcon:"Images/Icons/FamFamFam/layout_link.png",layoutDeleteMenuIcon:"Images/Icons/FamFamFam/layout_delete.png",layoutEmptyMenuIcon:"Images/Icons/FamFamFam/picture_empty.png",visitLayoutIcon:"Images/Icons/FamFamFam/page_white_link.png",components:"Images/Icons/FamFamFam/box.png"}};CourseSearchLayoutComposer.prototype.VirginSettings={areas:{top:{components:[]},left:{components:[]},content:{components:[]},contentNavigation:{components:[]}}};CourseSearchLayoutComposer.prototype.Settings=CourseSearchLayoutComposer.prototype.VirginSettings;CourseSearchLayoutComposer.prototype.State={container:null,areas:{top:null,left:null,content:null,contentNavigation:null},contentContainer:null,courseSearch:null,componentObjects:null,compositeLayoutButton:null,layouts:null};CourseSearchLayoutComposer.prototype.clearLayout=function(){var n=this;n.clearLayoutArea("content",n.Settings.areas.content.components);n.clearLayoutArea("contentNavigation",n.Settings.areas.contentNavigation.components);n.clearLayoutArea("left",n.Settings.areas.left.components);n.clearLayoutArea("top",n.Settings.areas.top.components)};CourseSearchLayoutComposer.prototype.clearLayoutArea=function(n,t){for(var r,u=this,i=0;i<t.length;i++)r=t[i],u.componentCreator(n,r);t.length=0};CourseSearchLayoutComposer.prototype.addComponent=function(area,item){var self=this,options={container:self.getLayoutContainer(area,item)};Ext.get(options.container).set({"data-component-key":item.key});var constructorSpecs=item.className+".ConstructForLayout;",constructor=eval(constructorSpecs),object=constructor(self,options);return item.state.rendered=!0,item.state.containerId=options.container.id,item.state.area=area,object};CourseSearchLayoutComposer.prototype.removeComponent=function(n,t){var i=this;Ext.get(t.state.containerId).remove();t.state.rendered=!1;t.state.containerId=null;t.state.area=null};CourseSearchLayoutComposer.prototype.componentCreator=function(n,t){var i=this,u,r;return u=t.state.rendered==!0?i.removeComponent(n,t):i.addComponent(n,t),CourseSearchComponentRegistry.components[t.key]=t,r=Ext.getCmp(CourseSearchComponentRegistry.methods.getKey(t.key)),r&&r.setChecked(t.state.rendered),i.manageLayout(),u};CourseSearchLayoutComposer.prototype.updateComponentMenuStateBySettings=function(){var u=this;for(var n in CourseSearchComponentRegistry.components){var r=CourseSearchComponentRegistry.components[n],t=CourseSearchComponentRegistry.methods.getKey(n),i=Ext.getCmp(t);i?i.setChecked(r.state.rendered):log("LayoutComposer menu missing: "+t)}};CourseSearchLayoutComposer.prototype.manageLayout=function(){var n=this,t;n.readSettingsFromLayout();n.Settings.areas.left.components.length>0?(n.State.areas.left.addCls("has-left"),n.State.contentContainer.addCls("has-left")):(t=n.State.areas.left.hasCls("has-left"),n.State.areas.left.removeCls("has-left"),n.State.contentContainer.removeCls("has-left"),t&&n.State.courseSearch.Invoke())};CourseSearchLayoutComposer.prototype.renderComponents=function(){var t=this,f=[],i,r,n,u;for(i in t.Settings.areas)for(r in t.Settings.areas[i].components)n=t.Settings.areas[i].components[r],n.state.area=i,n.state.rendered=!1,u=t.componentCreator(i,n),f.push(n.key);for(r in CourseSearchComponentRegistry.components)n=CourseSearchComponentRegistry.components[r],Ext.isBoolean(n.required)&&n.required==!0&&!Ext.Array.contains(f,n.key)&&(n.state.rendered=!1,n.state.area=n.defaultPlacement,u=t.componentCreator(n.defaultPlacement,n),n.className=="CourseSearch"&&(t.State.courseSearch=u))};CourseSearchLayoutComposer.prototype.getLayoutContainer=function(n,t){var i=this,r=Ext.DomHelper,u={id:Ext.id(),tag:"div",cls:"composite-layout-component-container",children:[{id:Ext.id(),tag:"div",cls:"composite-layout-component-title",html:t.title},{id:Ext.id(),tag:"div",cls:"composite-layout-component"}]};return r.append(i.State.areas[n],u,!0)};CourseSearchLayoutComposer.prototype.getLayoutContainerComponentContainerId=function(n){var i=this,t=Ext.dom.Query.selectNode(".composite-layout-component",n.dom);return t.id};CourseSearchLayoutComposer.prototype.setDisplayMode=function(n){var t=this,u,i,r;Ext.isDefined(n)||(n=t.Options.displayMode);$(".composite-layout-area").sortable({connectWith:".composite-layout-area",placeholder:"composite-layout-placeholder",appendTo:document.body,cursor:"move",forceHelperSizeType:!0,forcePlaceholderSize:!0,handle:".composite-layout-component-title",item:"> .composite-layout-component-container",opacity:.5,revert:!0,scroll:!0,update:function(){}});n=="edit"?($(".composite-layout-area").sortable("enable"),$(".composite-layout-component-title").show(),t.State.container.addCls(t.Options.editModeClass),t.Options.displayMode="edit"):($(".composite-layout-component-title").hide(),$(".composite-layout-area").sortable("disable"),t.State.container.removeCls(t.Options.editModeClass),t.Options.displayMode="normal");u=t.isEditMode();i=t.State.compositeLayoutButton;u?(i.setText(CourseSearchComponentRegistry.variables.compositeSearchButtonTextOn),i.setTooltip(CourseSearchComponentRegistry.variables.compositeSearchEditModeInfo)):i!=null&&(i.setText(CourseSearchComponentRegistry.variables.compositeSearchButtonTextOff),i.setTooltip(CourseSearchComponentRegistry.variables.compositeSearchNonEditModeInfo));for(r in CourseSearchComponentRegistry.components){var f=CourseSearchComponentRegistry.components[r],e=CourseSearchComponentRegistry.methods.getKey(r),o=Ext.getCmp(e);f.disabled&&o.setDisabled(!0)}t.manageLayout()};CourseSearchLayoutComposer.prototype.switchDisplayMode=function(){var n=this;n.setDisplayMode(n.Options.displayMode=="edit"?"normal":"edit")};CourseSearchLayoutComposer.prototype.isEditMode=function(){var n=this;return n.Options.displayMode=="edit"};CourseSearchLayoutComposer.prototype.readSettingsFromLayout=function(){var t=this;t.Settings=t.VirginSettings;var n=null,i=function(n){for(var i=[],t=0;t<n.length;t++){var r=Ext.get(n[t]),u=r.getAttribute("data-component-key"),f=CourseSearchComponentRegistry.components[u];i.push(f)}return i};n=Ext.DomQuery.select("#composite-layout-top .composite-layout-component-container");t.Settings.areas.top.components=i(n);n=Ext.DomQuery.select("#composite-layout-left .composite-layout-component-container");t.Settings.areas.left.components=i(n);n=Ext.DomQuery.select("#composite-layout-content-navigation .composite-layout-component-container");t.Settings.areas.contentNavigation.components=i(n);n=Ext.DomQuery.select("#composite-layout-content .composite-layout-component-container");t.Settings.areas.content.components=i(n)};CourseSearchLayoutComposer.prototype.initializeState=function(){var n=this;n.State.courseSearch=new CourseSearch;n.State.container=Ext.get(n.Options.containerId);n.State.contentContainer=Ext.get(n.Options.contentContainerId);n.State.areas.content=Ext.get(n.Options.areaIds.content);n.State.areas.contentNavigation=Ext.get(n.Options.areaIds.contentNavigation);n.State.areas.left=Ext.get(n.Options.areaIds.left);n.State.areas.top=Ext.get(n.Options.areaIds.top)};CourseSearchLayoutComposer.prototype.setComponentDisplay=function(n){var t=this,i=t.findComponentInRegistryOrSettings(n);t.componentCreator(i.defaultPlacement,i)};CourseSearchLayoutComposer.prototype.findComponentInRegistryOrSettings=function(n){var i=this,t=null,r,f,u;for(r in i.Settings.areas){for(f in i.Settings.areas[r].components)if(u=i.Settings.areas[r].components[f],u.key==n){t=u;break}if(t!=null)break}return t==null&&(t=CourseSearchComponentRegistry.components[n]),t};CourseSearchLayoutComposer.prototype.getCompositeLayoutMenuItems=function(){var i=this,f=i.isEditMode(),r=[],n,t,u;for(n in CourseSearchComponentRegistry.components)t=CourseSearchComponentRegistry.components[n],u={xtype:"menucheckitem",text:t.title,tooltip:t.disabled?t.disabledInfo:undefined,tooltipType:"title",id:CourseSearchComponentRegistry.methods.getKey(n),layoutComponentId:n,handler:function(n){i.setComponentDisplay(n.initialConfig.layoutComponentId)}},r.push(u);return{text:"Search components",menu:r,icon:config.getUrl(i.Options.icons.components)}};CourseSearchLayoutComposer.prototype.renderAdminModeMenu=function(n){var t=this;typeof n=="undefined"&&(n=!1);var i=[],f={disabled:!1,text:"Layout actions",icon:config.getUrl(t.Options.icons.layoutMenuIcon),tooltip:"You can manage the different layouts here",tooltipType:"title",id:CourseSearchComponentRegistry.methods.getMainKey("layout-display"),menu:[{xtype:"menuitem",disabled:!1,icon:config.getUrl(t.Options.icons.layoutSaveMenuIcon),text:"Save current layout as new",tooltip:"Saves the current layout configuration as a new layout, after clicking this menu item, you may enter the name of the layout",tooltipType:"title",id:CourseSearchComponentRegistry.methods.getMainKey("layout-new"),handler:function(){Ext.MessageBox.prompt("Save current layout as new","Enter a name for this layout (can be an existing one also):",function(n,i){i=Ext.String.trim(i);n!="ok"||Ext.isEmpty(i)||t.setLayoutState(i,t.Settings,function(){t.updateAdminMenuComponentStates();config.showInfo("Layout saved.")})})}},{xtype:"menuitem",disabled:!1,icon:config.getUrl(t.Options.icons.layoutLoadMenuIcon),text:"Load an existing layout",tooltip:"Loads an existing layout from the database",tooltipType:"title",id:CourseSearchComponentRegistry.methods.getMainKey("layout-load")},{xtype:"menuitem",disabled:!1,icon:config.getUrl(t.Options.icons.layoutSaveAsMenuIcon),text:"Save current as existing layout",tooltip:"Saves the current layout to an existing layout in the database",tooltipType:"title",id:CourseSearchComponentRegistry.methods.getMainKey("layout-save")},{xtype:"menuitem",disabled:!1,icon:config.getUrl(t.Options.icons.layoutDeleteMenuIcon),text:"Delete an existing layout",tooltip:"Deletes an existing layout from the database",tooltipType:"title",id:CourseSearchComponentRegistry.methods.getMainKey("layout-delete")},{xtype:"menuitem",disabled:!1,icon:config.getUrl(t.Options.icons.layoutEmptyMenuIcon),text:"Clear current layout",tooltip:"Clears the current layout in the view and makes the areas empty",tooltipType:"title",id:CourseSearchComponentRegistry.methods.getMainKey("layout-clear"),handler:function(){t.clearLayout()}},{xtype:"menuitem",disabled:!1,icon:config.getUrl(t.Options.icons.visitLayoutIcon),text:"Visit layout",tooltip:"Loads the layout in a new window via its own, specific url",tooltipType:"title",id:CourseSearchComponentRegistry.methods.getMainKey("layout-visit")}]},r=n?"Ext.menu.CheckItem":"Ext.Button.button",u=Ext.create(r,{xtype:r,text:CourseSearchComponentRegistry.variables.compositeSearchButtonTextOff,enableToggle:!0,pressed:t.isEditMode(),checked:t.isEditMode(),icon:config.getUrl("Images/Icons/glyph2/Icons16x16/move-2.png"),tooltip:CourseSearchComponentRegistry.variables.compositeSearchNonEditModeInfo,tooltipType:"title",toggleHandler:function(){window.LAYOUTCOMPOSER.switchDisplayMode()},checkHandler:function(){window.LAYOUTCOMPOSER.switchDisplayMode()}});return i.push(u),i.push(t.getCompositeLayoutMenuItems()),i.push(f),t.State.compositeLayoutButton=u,i};CourseSearchLayoutComposer.prototype.updateAdminMenuComponentStates=function(){var n=this,t=Ext.getCmp(CourseSearchComponentRegistry.methods.getMainKey("layout-display"));t.setDisabled(!0);n.listLayouts(function(i){n.updateLayoutMenu(i,"layout-load",function(t,i){config.showInfo("Layout loaded.");n.clearLayout();n.Settings=Ext.decode(i);n.renderComponents()});n.updateLayoutMenu(i,"layout-save",function(t){n.setLayoutState(t,n.Settings,function(){config.showInfo("Layout saved.");n.updateAdminMenuComponentStates()})});n.updateLayoutMenu(i,"layout-visit",function(n){window.open(config.getUrl("public/course/layout/"+n),"_blank")});n.updateLayoutMenu(i,"layout-delete",function(t){Ext.MessageBox.show({title:"Confirm",msg:"Are you sure to delete this layout?",buttons:Ext.Msg.OKCANCEL,buttonAlign:"right",icon:Ext.MessageBox.QUESTION,fn:function(i){i=="ok"&&n.deleteLayout(t,function(){config.showInfo("Layout deleted.");n.updateAdminMenuComponentStates()})}})});t.setDisabled(!1)})};CourseSearchLayoutComposer.prototype.updateLayoutMenu=function(n,t,i){var o=this,u=Ext.getCmp(CourseSearchComponentRegistry.methods.getMainKey(t)),r,f,e;if(Object.keys(n).length==0){u.setMenu([{xtype:"menuitem",disabled:!0,text:"No layouts in the database"}],!0);return}r=[];for(f in n)e={xtype:"menuitem",text:f,handler:function(t){i(t.text,n[t.text])}},r.push(e);u.setMenu(r,!0)};CourseSearchLayoutComposer.prototype.listLayouts=function(n){var t=this;Ext.Ajax.request({url:config.getUrl("public/layout/listlayouts"),success:function(i){var r=Ext.decode(Ext.decode(i.responseText));t.State.layouts=r;Ext.isFunction(n)&&n(r)}})};CourseSearchLayoutComposer.prototype.setLayoutState=function(n,t,i){var u=this,r=Ext.encode(t);Ext.Ajax.request({url:config.getUrl("public/layout/setlayoutstate"),params:{id:n,state:r},success:function(){Ext.isFunction(i)&&i()}})};CourseSearchLayoutComposer.prototype.deleteLayout=function(n,t){var i=this;Ext.Ajax.request({url:config.getUrl("public/layout/deletelayout"),params:{id:n},success:function(){Ext.isFunction(t)&&t()}})};CourseSearchLayoutComposer.prototype.postMenuRender=function(){var n=this;n.updateComponentMenuStateBySettings();n.updateAdminMenuComponentStates();n.setDisplayMode()};CourseSearchLeftCategory.constructor=CourseSearchLeftCategory;CourseSearchLeftCategory.ConstructForLayout=function(n,t){Ext.Ajax.request({url:config.getUrl("public/category/leftcategories"),params:{cancelState:self.CourseSearch.CancelState,courseInternal:self.CourseSearch.CourseInternal},success:function(n){var r=t.container.down(".composite-layout-component");r.setHtml(n.responseText);i.Init()}});t.container.addCls("grad_stud_left");var i=new CourseSearchLeftCategory(n.State.courseSearch,t.container,!0);return i};CourseSearchLeftCategory.prototype.construct=function(){var n=this;window.LAYOUT.Options.publicCourseListingFastLoad?n.Init():(n.MainContainer.mask("Loading categories..."),Ext.Ajax.request({url:config.getUrl("public/category/leftcategories"),params:{cancelState:n.CourseSearch.CancelState,courseInternal:n.CourseSearch.CourseInternal},success:function(t){n.MainContainer.unmask();var i=n.MainContainer;i.setHtml(t.responseText);n.Init()}}))};CourseSearchLeftCategory.prototype.ClearImage="Images/Icons/famfamfam/cross.png";CourseSearchLeftCategory.prototype.MainContainer=null;CourseSearchLeftCategory.prototype.CurrentTip=null;CourseSearchLeftCategory.prototype.useTip=!1;CourseSearchLeftCategory.prototype.OpenMainCategories={};CourseSearchLeftCategory.prototype.ActiveCourseCategoryIndex=null;CourseSearchLeftCategory.prototype.ActiveCourseCategoryIsSubSub=null;CourseSearchLeftCategory.prototype.CourseSearch=null;CourseSearchLeftCategory.prototype.TipHideTimeout=null;CourseSearchLeftCategory.prototype.TipHide=function(){var n=this;n.CurrentTip!=null&&(n.TipHideTimeout=setTimeout(function(){n.CurrentTip.hide()},500))};CourseSearchLeftCategory.prototype.TipShow=function(){var n=this;clearTimeout(n.TipHideTimeout);n.CurrentTip!=null&&n.CurrentTip.show()};CourseSearchLeftCategory.prototype.Init=function(){var n=this,t;if(n.useTip)n.MainContainer.on("mouseover",function(){n.TipShow()}).on("mouseout",function(){n.TipHide()}).on("mousemove",function(){n.TipShow()});n.OpenMaincategories=n.CourseSearch.Hash.getHashVar("OpenMainCategories",{});n.ActiveCourseCategoryIndex=n.CourseSearch.Hash.getHashVar("ActiveCourseCategoryIndex",null);n.ActiveCourseCategoryIsSubSub=n.CourseSearch.Hash.getHashVar("ActiveCourseCategoryIsSubSub",!1);for(t in n.OpenMaincategories)n.ShowCategory(t);window.LAYOUT.Options.publicCourseListingFastLoad||n.CourseSearch.MainCategory!=""&&n.CourseSearch.SubCategory!=""&&n.ActiveCourseCategoryIndex!=null&&n.FilterByCategory(n.CourseSearch.MainCategory,n.CourseSearch.SubCategory,n.ActiveCourseCategoryIndex,n.ActiveCourseCategoryIsSubSub?n.ActiveCourseCategoryIndex:-1,!0,!0)};CourseSearchLeftCategory.prototype.ShowCategory=function(n){var t=this,r=Ext.get("grad_stud_left_"+n),i=$("#grad_stud_left_menu_"+n),u;r.hasCls("grad_stud_left_li_open")?(r.removeCls("grad_stud_left_li_open"),$("#main_sub_plusminus_"+n).html("+"),i!=null&&i.slideUp(),delete t.OpenMainCategories[n]):(r.addCls("grad_stud_left_li_open"),i!=null&&(i.slideDown(),u=$("#grad_stud_left_menu_"+n+" .subsub"),u.hide(),$("#main_sub_plusminus_"+n).html("&ndash;")),t.OpenMainCategories[n]=!0);t.CourseSearch.Hash.setHashVar("OpenMainCategories",t.OpenMainCategories)};CourseSearchLeftCategory.prototype.FilterByCategory=function(n,t,i,r,u,f,e){var o=this,s,p,a,v,y;typeof f=="undefined"&&(f=!1);typeof u=="undefined"&&(u=!1);typeof r=="undefined"&&(r=-1);s=null;s=r<0?!1:!0;o.CourseSearch.Hash.setHashVar("ActiveCourseCategoryIndex",i);o.CourseSearch.Hash.setHashVar("ActiveCourseCategoryIsSubSub",s);o.CourseSearch.Hash.saveState();o.ActiveCourseCategoryIndex=i;o.ActiveCourseCategoryIsSubSub=s;$(".left-category-active").removeClass("left-category-active");$(".course-search-leftcategory-showall").removeClass("course-search-leftcategory-showall-active");var h=$("#SubCatID"+i+"-plus"),c=$("#SubCatID"+i+"-minus"),l=$("#SubCatID"+i);if(s?(c.show(),h.hide(),l.show(),a=$('[id="grad_stud_left_menu_subsub_'+i+"_"+r+'"]'),a.show(),a.addClass("left-category-active")):(l.addClass("left-category-active"),l.hasClass("left-category-subcategory-parent")&&(p=$('[id^="grad_stud_left_menu_subsub_'+i+'_"]'),f&&(h.show(),c.hide()),$.each(p,function(){var t=$(this).data("subsubcategory-index"),n=$('[id="grad_stud_left_menu_subsub_'+i+"_"+t+'"]');n.is(":visible")?f||(n.slideUp(),c.hide(),h.show()):f||(n.slideDown(),h.hide(),c.show())}))),o.CurrentCategoryElement==null){if(o.useTip){v='<span class="course-search-leftcategory-title">'+n+"/"+t+'<\/span> <span class="course-search-leftcategory-close" onclick="window.cslc.Reset();"><img src="'+config.getUrl(o.ClearImage)+'" title="Clear category filter"><\/span>';o.CurrentTip!=null&&o.CurrentTip.destroy();o.CurrentTip=Ext.create("Ext.tip.ToolTip",{target:o.MainContainer,html:v,anchor:"left",autoHide:!1,autoShow:!0,title:"Selected category",style:{whiteSpace:"nowrap"}});o.CurrentTip.hide();y=o.CurrentTip.getEl();y.on("mouseover",function(){o.TipShow()});y.on("mouseout",function(){o.TipHide()})}}else o.CurrentCategoryElement.html(v);o.CourseSearch.MainCategory=n;o.CourseSearch.SubCategory=t;o.CourseSearch.SubCategoryIsSubSub=s;o.CourseSearch.SubSubCategory=e;o.CourseSearch.Page=1;u||o.Invoke()};CourseSearchLeftCategory.prototype.Invoke=function(){var n=this;n.CourseSearch.Invoke()};CourseSearchLeftCategory.prototype.Reset=function(n){var t=this;typeof n=="undefined"&&(n=!0);$(".course-search-leftcategory-showall").addClass("course-search-leftcategory-showall-active");$(".left-category-active").removeClass("left-category-active");t.CurrentCategoryElement!=null&&t.CurrentCategoryElement.html("");t.CurrentTip!=null&&(t.CurrentTip.destroy(),t.CurrentTip=null);t.CourseSearch.MainCategory="";t.CourseSearch.SubCategory="";t.CourseSearch.SubCategoryIsSubSub=!1;n&&t.Invoke()}