var Master=function(){this.LoginRepository=new LoginRepository;this.anthorLogout="anchorLogout";this.show_login_div="show_login_div";this.logindifferentuser="logindifferentuser";this.message="message";this.SubscriptionMatrix=new SubscriptionMatrix;this.UserManagement=new UserManagement;this.PaymentGateway=new PaymentGateway;this.PaymentResponse=new PaymentResponse;this.SearchResult=new SearchResult;this.ChangePassword=new ChangePassword;this.Home=new Home;this.Video=new Video;this.Channel=new Channel;this.Event=new Event;this.Series=new Series;this.UserAccessReport=new UserAccessReport;this.CMS=new CMS;this.UserGeneratedContent=new UserGeneratedContent;this.MARCRecord=new MARCRecord;this.LandingPage=new LandingPage;this.MessageViewModel=new MessageViewModel;this.Error=new Error;this.Init=function(){var b={key:"Landing",value:"Landing",funName:a.LoadHomeFromBreacrum,hLevel:0};jQuery.support.cors=true;Breadcrumb.add(b);a.LoginRepository.getSessionIdForBrowserAndGetLogonIdExistsForSession();a.LoginRepository.getChannelMenu();a.LoginRepository.getServicesMenu();a.LoginRepository.IsRestrictedUser();if(sessionStorage.getItem("IsIPLogin")=="true")$("#IPLoginUser").css("display","block");else $("#IPLoginUser").css("display","none");a.BindLogout();a.InitRoutes()};this.LoadHomeFromBreacrum=function(){location.href="?landing"};this.LoadView=function(){$.get("../ViewInjQuery/home.html",function(a){$("#viewContent").html(a)})};this.UnbindLogout=function(){$("#"+a.anthorLogout).unbind("click")};this.BindLogout=function(){a.UnbindLogout();$("#"+a.anthorLogout).bind("click",function(){$("#BuySubscription").show();var b={user:{logonId:BrowserStorage.getLogonId()}};if(!IsNullOrEmpty(b.logonId)){a.LoginRepository.logOut(b,Application.Root.BaseURL);sessionStorage.setItem("withindex",-1)}else{location.href=Application.Login.BaseURL;sessionStorage.setItem("withindex",-1)}return false})};this.LoggedInAsDifferentUser=function(b){var c={Data:{user:{LogonId:BrowserStorage.getLogonId()}}};sessionStorage.setItem("IsIPLogin",false);b.configuration.controller.arguments[0].routeName.toString()=="additionalLogin"&&sessionStorage.setItem("LogonId",BrowserStorage.getLogonId());a.LoginRepository.logOut(c.Data,b.configuration.templateUrl,b.configuration.controller.arguments[0].routeName.toString())};this.Logout=function(){CloseMobileMenu();ClearSearchField();var b={Data:{user:{LogonId:BrowserStorage.getLogonId()}}};if(!IsNullOrEmpty(b.Data.user.LogonId))a.LoginRepository.logOut(b.Data,rootPath+Application.Root.BaseURL);else location.href=Application.Login.BaseURL};this.WelcomeMenu=function(d,f,c){CloseMobileMenu();if(!IsNullOrEmpty(sessionStorage.getItem("LogonId"))){var b="";if(c)b=$(c).attr("data-routename")||$(c).attr("data-innerRouteName");else if(IsHistoryImplemented)b=History.getState().data.routeName;else b=getRoutename();BrowserStorage.setRedireceLocation(b);BrowserStorage.setRedireceFrom(b);$("#searchContent").val("");a.LoginRepository.validateCorporateAdminBasedOnLogonId(d,f,c)}else{var e=new MessageViewModel;e.CreateWarningMessage("Your session has expired. Please try again.","overlayId","okButtonId",function(){$("#okButtonId").unbind();$("#okButtonId").bind("click",function(){if(d.routeName==Application.UserAccessNotification.BaseURL){sessionStorage.setItem("RedirectLocation",d.routeName);location.href="view/"+Application.Login.BaseURL}else{sessionStorage.setItem("RefreshPage","1");History.back()}})});e.ShowOverLay()}ClearSearchField()};this.callfaq=function(){};this.InitRoutes=function(){RouteProvider.when("home",{templateUrl:"View/home.html",controller:a.Home.GetVideos,isPartial:true}).when("landing",{templateUrl:"View/landing.html",controller:a.LandingPage.GetVideoAndTranscriptVideoCount,isPartial:true}).when("paymentsuccess",{templateUrl:"View/OrderPaymentSuccess.html",controller:function(){},isPartial:true,isURLWithQueryString:true}).when("paymentfail",{templateUrl:"View/OrderPaymentFail.html",controller:function(){},isPartial:true,isURLWithQueryString:true}).when("landscapesearchResult",{templateUrl:"View/Search.html",controller:a.SearchResult.GetSearchResult,isPartial:false}).when("evilandscapesearchResult",{templateUrl:"View/Search.html",controller:a.SearchResult.GetSearchResult,isPartial:false}).when("searchBySorting",{templateUrl:"View/Search.html",controller:a.SearchResult.SearchBySorting,isPartial:false}).when("searchBySeriesSorting",{templateUrl:"View/Series.html",controller:a.Series.SearchBySeriesSorting,isPartial:false}).when("potraitsearchResult",{templateUrl:"View/Search.html",controller:a.SearchResult.GetSearchResult,isPartial:false}).when("popular",{templateUrl:"View/Search.html",controller:a.SearchResult.GetSearchOutput,isPartial:true,routeParam:"channelid"}).when("latest",{templateUrl:"View/Search.html",controller:a.SearchResult.GetSearchOutput,isPartial:true,routeParam:"channelid"}).when("forthComing",{templateUrl:"View/Search.html",controller:a.SearchResult.GetSearchOutput,isPartial:true,routeParam:"channelid"}).when("searchResult",{templateUrl:"View/Search.html",controller:a.SearchResult.GetSearchOutput,isPartial:true}).when("event",{templateUrl:"View/event.html",controller:a.Event.GetCurrentEventVideo,isPartial:true,routeParam:"eventid"}).when("eventpageAccessId",{templateUrl:"View/event.html",controller:a.Event.GetCurrentEventVideoById,isPartial:true}).when("PremiumEventAccessId",{templateUrl:"View/event.html",controller:a.Event.GetCurrentEventVideo,isPartial:true,routeParam:"eventid"}).when("EventVideoAccessId",{templateUrl:"View/event.html",controller:a.Event.GetCurrentEventVideoById,isPartial:true}).when("eventlivepage",{templateUrl:"View/event.html",controller:a.Event.LiveEventVideoPlay,isPartial:true,isURLWithQueryString:true}).when("mySubscription",{templateUrl:"View/Subscription.html",controller:a.SubscriptionMatrix.InitMySubscriptionPage,isPartial:true}).when("userGeneratedContent",{templateUrl:"View/UserGeneratedContent.html",controller:a.UserGeneratedContent.Initilize,isPartial:true}).when("VideoRequest",{templateUrl:"View/VideoRequest.html",controller:function(){var a=new ClientVideoRequest;a.Initilize()},isPartial:true}).when("text1search",{templateUrl:"View/Search.html",controller:a.SearchResult.Gettext,isPartial:true}).when("VideoId",{templateUrl:"View/video.html",controller:a.Video.GetVideoById,routeParam:"videono",isPartial:true,updateURL:true}).when("SpeakerAccessId",{templateUrl:"View/video.html",controller:a.Video.GetVideoById,isPartial:true}).when("EventSpeakerAccessId",{templateUrl:"View/event.html",controller:a.Event.GetCurrentEventVideoById,isPartial:true}).when("EventAccessId",{templateUrl:"View/video.html",controller:a.Video.GetVideoById,isPartial:true}).when("VideoAccessId",{templateUrl:"View/video.html",controller:a.Video.GetVideoById,isPartial:true}).when("SeriesSpeakerAccessId",{templateUrl:"View/Series.html",controller:a.Series.GetCurrentSeriesVideo,isPartial:true}).when("SeriesEventAccessId",{templateUrl:"View/Series.html",controller:a.Series.GetCurrentSeriesVideo,isPartial:true}).when("SeriesVideoAccessId",{templateUrl:"View/Series.html",controller:a.Series.GetCurrentSeriesVideo,isPartial:true}).when("JiscVideo",{templateUrl:"View/home.html",controller:a.Home.ShowPopup,isPartial:true,updateURL:false}).when("JiscVideoSearch",{templateUrl:"View/Search.html",controller:a.SearchResult.ShowPopup,isPartial:true,updateURL:false}).when("downloadvideos",{templateUrl:"View/video.html",controller:a.Video.DownloadVideo,isPartial:false}).when("SpeakerDetail",{templateUrl:"View/home.html",controller:a.Video.GetSpeakerDetail,isPartial:false}).when("postcomment",{templateUrl:"",controller:a.Video.PostComment,isPartial:false}).when("Channel",{templateUrl:"View/Channel.html",controller:a.Channel.GetChannelVideos,routeParam:"name",isPartial:true}).when("JiscVideoChannel",{templateUrl:"View/Channel.html",controller:a.Channel.ShowPopup,isPartial:true,updateURL:false}).when("logout",{templateUrl:"View/home.html",controller:a.Logout,isPartial:true}).when("loggedInAsDifferentUser",{templateUrl:"View/LoginNew.html",controller:a.LoggedInAsDifferentUser,isPartial:false}).when("orderConfirmation",{templateUrl:"View/OrderConfirmation.html",controller:OrderConfirmation,isPartial:true}).when("buySubscription",{templateUrl:"View/SubscriptionMatrix.html",controller:a.SubscriptionMatrix.InitSubscriptionMatrix,isPartial:true,updateURL:true,routeParam:"buySubscription"}).when("additionalLogin",{templateUrl:"View/LoginCorporate.html",controller:a.LoggedInAsDifferentUser,isPartial:false}).when("UserManagement",{templateUrl:"View/UserManagement.html",controller:a.WelcomeMenu,isPartial:true}).when("LogoMgmt",{templateUrl:"View/LogoMgmt.html",controller:a.UserManagement.ShowLogoPage,isPartial:true}).when("daywisevideoschedule",{templateUrl:"",controller:a.Event.GetEventVideoDayWise,isPartial:false,updateURL:false}).when("sendremindermail",{templateUrl:"",controller:a.Event.SendMail,isPartial:false,updateURL:false}).when("eventvideoid",{templateUrl:"View/Event.html",controller:a.Event.GetCurrentEventVideoById,isPartial:true,routeParam:"videono",updateURL:true}).when("address",{templateUrl:"View/Address.html",controller:a.PaymentGateway.GetPaymentGateway,isPartial:true,updateURL:true}).when("changePassword",{templateUrl:"View/ChangePassword.html",controller:a.ChangePassword.showChangePassword,isPartial:true}).when("facetsCheckBox",{templateUrl:"View/searchResult.html",controller:a.SearchResult.GetSearchResultForFacets,isPartial:false}).when("systemUsageReport",{templateUrl:"View/_IframeForReport.html",controller:a.WelcomeMenu,isPartial:false}).when("likevideo",{templateUrl:"View/video.html",controller:function(){a.Video.VideoLiked()},isPartial:false}).when("dislikevideo",{templateUrl:"View/video.html",controller:function(){a.Video.VideoDisLiked()},isPartial:false}).when("viewvideo",{templateUrl:"View/video.html",controller:function(){a.Video.VideoViewed()},isPartial:false}).when("likeeventvideo",{templateUrl:"View/event.html",controller:function(){a.Event.VideoLiked()},isPartial:false}).when("dislikeeventvideo",{templateUrl:"View/event.html",controller:function(){a.Event.VideoDisLiked()},isPartial:false}).when("searchFacets",{templateUrl:"View/Search.html",controller:a.SearchResult.SearchFacets,isPartial:false}).when("userAccessReport",{templateUrl:"View/_UserAccessReport.html",controller:a.WelcomeMenu,isPartial:false}).when("userAccessNotification",{templateUrl:"View/_UserAccessReport.html",controller:a.WelcomeMenu,isPartial:false}).when("GenerateReport",{templateUrl:"",controller:a.UserAccessReport.GenerateReport,isPartial:false,updateURL:false}).when("activityGrid",{templateUrl:"",controller:a.UserAccessReport.ShowHideActivityGrid,isPartial:false}).when("gridPager",{templateUrl:"",controller:a.UserAccessReport.GridPager,isPartial:false}).when("VideoAccessCode",{templateUrl:"View/video.html",controller:a.Video.GetVideoById,isPartial:true}).when("DownloadAttachment",{templateUrl:"View/video.html",controller:a.Video.DownloadAttachment,isPartial:false,updateURL:false}).when("columnheader",{templateUrl:"",controller:a.UserAccessReport.Columnheader,isPartial:false}).when("ExportReportToPDF",{templateUrl:"",controller:a.UserAccessReport.ExportReportToPDF,isPartial:false,updateURL:false}).when("ExportReportToWord",{templateUrl:"",controller:a.UserAccessReport.ExportReportToWord,isPartial:false,updateURL:false}).when("ExportReportToExcel",{templateUrl:"",controller:a.UserAccessReport.ExportReportToExcel,isPartial:false,updateURL:false}).when("help",{templateUrl:"View/CMSHelp.html",controller:a.CMS.GetViewInformation,isPartial:true,routeParam:"pagename"}).when("services",{templateUrl:"View/CMSHelp.html",controller:a.CMS.GetViewInformation,isPartial:true,routeParam:"pagename"}).when("pagination",{templateUrl:"View/Search.html",controller:a.SearchResult.PageSearch,isPartial:false,updateURL:true,routeParam:"pagenumber"}).when("series",{templateUrl:"View/Series.html",controller:a.Series.GetCurrentSeriesVideo,isPartial:true,routeParam:"seriesid"}).when("seriesvideoid",{templateUrl:"View/Series.html",controller:a.Series.GetCurrentSeriesVideoId,isPartial:true,routeParam:"videono",updateURL:true}).when("BuyChannel",{templateUrl:"View/SubscriptionMatrix.html",controller:a.SubscriptionMatrix.InitSubscriptionMatrix,isPartial:true,routeParam:"BuyChannel"}).when("FAQ",{templateUrl:"View/FAQ.html",controller:this.callfaq,isPartial:true}).when("MARCRecord",{templateUrl:"View/MARCRecord.html",controller:this.MARCRecord.InitMarcRecords,isPartial:true}).when("MyClips",{templateUrl:"View/MyClips.html",controller:function(){var a=new MyClips;a.Initilize()},isPartial:true}).when("searchBySorting",{templateUrl:"View/Search.html",controller:a.SearchResult.SearchBySorting,isPartial:false}).otherwise({redirectTo:"landing"}).apply()};var a=this};function SearchTextboxValidation(){if($("#evisearchtextbox").val()==""){$("#btnEviSearch").removeAttr("data-innerroutename");_this.MessageViewModel.CreateInfoMessage("Please enter text for search.","overlayId","okButtonId");_this.MessageViewModel.ShowOverLay()}else $("#btnEviSearch").attr("data-innerroutename","evilandscapesearchResult")}function unbindCalender(){$("#searchtextbox").datepicker("destroy");$("#mobsearchtxtbox").datepicker("destroy");$("#searchtextbox").val("");$("#mobsearchtxtbox").val("");$("#Search_button").html('All categories<svg version="1.1" class="searchArrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16.8 21" xml:space="preserve"><path id="Master_arrow_small" d="M2.2,10.4L6.8,15V0H10v15l4.6-4.6l2.2,2.2L8.4,21L0,12.6L2.2,10.4z" /></svg>');$("#search_param").val("All categories")}$("document").ready(function(){$(".category").click(function(){$("#selectedCategory").attr("data-value",$(this).attr("data-value"));$("#selectedCategory").html($.trim($(this).text()))});var d=new Master;d.Init();$("#searchtextbox").unbind("keyup");$("#searchtextbox").bind("keyup",function(){$("#mobsearchtxtbox").val($("#searchtextbox").val())});$("#searchtextbox").unbind("keypress");$("#searchtextbox").bind("keypress",function(a){var b=a.which;if(b==13){a.preventDefault();if($("#chkSearch").is(":checked"))$("#btnSearchNew").trigger("click");else $("[data-innerroutename='landscapesearchResult']").click()}});$("#mobsearchtxtbox").unbind("keypress");$("#mobsearchtxtbox").bind("keypress",function(a){var b=a.which;if(b==13){a.preventDefault();if($("#chkSearchMob").is(":checked"))$("#btnSearchNewMob").trigger("click");else $("[data-innerroutename='potraitsearchResult']").click()}});$("#chkSearch").change(function(){if($("#chkSearch").is(":checked")){localStorage.setItem("eviSearchToggle","true");localStorage.setItem("SearchTerm",$("#searchtextbox").val());$("#btnSearchNew").removeAttr("data-innerroutename");$("#btnSearchNew").attr("data-innerroutename","evilandscapesearchResult");$("#btnSearchNewMob").removeAttr("data-innerroutename");$("#btnSearchNewMob").attr("data-innerroutename","evilandscapesearchResult");$("#chkSearchMob").prop("checked",true);$("#search_param").val("All categories");$("#Search_button").html('All categories<svg version="1.1" class="searchArrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16.8 21" xml:space="preserve"><path id="Master_arrow_small" d="M2.2,10.4L6.8,15V0H10v15l4.6-4.6l2.2,2.2L8.4,21L0,12.6L2.2,10.4z" /></svg>');$("#Mobile-btn").html('All categories<svg version="1.1" class="searchArrowMob" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16.8 21" xml:space="preserve"><path id="Master_arrow_small" d="M2.2,10.4L6.8,15V0H10v15l4.6-4.6l2.2,2.2L8.4,21L0,12.6L2.2,10.4z" /></svg>');$("#searchtextbox").datepicker("destroy");$("#Search_button").attr("disabled","disabled");$("#btnSearchNew").removeClass("searchbtnEVIoff").addClass("searchbtnEVIon");$("#btnSearchNewMob").removeClass("searchbtnEVIoff").addClass("searchbtnEVIon");$("#Mobile-btn").attr("disabled","disabled");$(".onoffswitch-switch").removeClass("orange-background").addClass("white-background")}else{localStorage.setItem("eviSearchToggle","false");$("#btnSearchNew").removeAttr("data-innerroutename");$("#btnSearchNew").attr("data-innerroutename","landscapesearchResult");$("#btnSearchNewMob").removeAttr("data-innerroutename");$("#btnSearchNewMob").attr("data-innerroutename","potraitsearchResult");$("#btnSearchNewMob").removeClass("searchbtnEVIon").addClass("searchbtnEVIoff");$("#btnSearchNew").removeClass("searchbtnEVIon").addClass("searchbtnEVIoff");$("#Search_button").removeAttr("disabled");$("#Mobile-btn").removeAttr("disabled");$("#chkSearchMob").prop("checked",false);$(".onoffswitch-switch").removeClass("white-background").addClass("orange-background")}});$("#chkSearchMob").change(function(){if($("#chkSearchMob").is(":checked")){localStorage.setItem("eviSearchToggle","true");localStorage.setItem("SearchTerm",$("#mobsearchtxtbox").val());$("#btnSearchNew").removeAttr("data-innerroutename");$("#btnSearchNew").attr("data-innerroutename","evilandscapesearchResult");$("#chkSearch").prop("checked",true);$("#btnSearchNewMob").removeAttr("data-innerroutename");$("#btnSearchNewMob").attr("data-innerroutename","evilandscapesearchResult");$("#btnSearchNew").removeClass("searchbtnEVIoff").addClass("searchbtnEVIon");$("#btnSearchNewMob").removeClass("searchbtnEVIoff").addClass("searchbtnEVIon");$("#search_param").val("All categories");$("#Search_button").html('All categories<svg version="1.1" class="searchArrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16.8 21" xml:space="preserve"><path id="Master_arrow_small" d="M2.2,10.4L6.8,15V0H10v15l4.6-4.6l2.2,2.2L8.4,21L0,12.6L2.2,10.4z" /></svg>');$("#Mobile-btn").html('All categories<svg version="1.1" class="searchArrowMob" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16.8 21" xml:space="preserve"><path id="Master_arrow_small" d="M2.2,10.4L6.8,15V0H10v15l4.6-4.6l2.2,2.2L8.4,21L0,12.6L2.2,10.4z" /></svg>');$("#mobsearchtxtbox").datepicker("destroy");$("#Search_button").attr("disabled","disabled");$("#Mobile-btn").attr("disabled","disabled");$(".onoffswitch-switch").removeClass("orange-background").addClass("white-background")}else{localStorage.setItem("eviSearchToggle","false");$("#btnSearchNewMob").removeAttr("data-innerroutename");$("#btnSearchNewMob").attr("data-innerroutename","potraitsearchResult");$("#btnSearchNewMob").removeClass("searchbtnEVIon").addClass("searchbtnEVIoff");$("#btnSearchNew").removeClass("searchbtnEVIon").addClass("searchbtnEVIoff");$("#btnSearchNew").removeAttr("data-innerroutename");$("#btnSearchNew").attr("data-innerroutename","landscapesearchResult");$("#Search_button").removeAttr("disabled");$("#Mobile-btn").removeAttr("disabled");$("#chkSearch").prop("checked",false);$(".onoffswitch-switch").removeClass("white-background").addClass("orange-background")}});$("#mobsearchtxtbox").unbind("keyup");$("#mobsearchtxtbox").bind("keyup",function(){$("#searchtextbox").val($("#mobsearchtxtbox").val())});var e=new Date,c=e.getFullYear(),b=parseInt(c)-20,a=parseInt(c)+10;$("#searchDorpdown li").click(function(){if($(this).text()=="Date"){$("#searchtextbox").val("");$("#searchtextbox").datepicker({changeMonth:true,changeYear:true,showButtonPanel:true,dateFormat:"MM yy",yearRange:b+":"+a}).focus(function(){var a=$(this);$(".ui-datepicker-calendar").detach();$(".ui-datepicker-current").css("display","none");$(".ui-datepicker-close").click(function(){var b=$("#ui-datepicker-div .ui-datepicker-month :selected").val(),c=$("#ui-datepicker-div .ui-datepicker-year :selected").val();a.datepicker("setDate",new Date(c,b,1));$("#searchicon").click()})})}else if($(this).text()=="CPD"){$("#searchtextbox").val("[ALL]");$("#mobsearchtxtbox").val("[ALL]")}else{$("#searchtextbox").datepicker("destroy");$("#search_param").val("All categories");$("#searchtextbox").val("");$("#mobsearchtxtbox").val("")}});$("#searchDorpdownMobile li").click(function(){if($(this).text()=="Date"){$("#mobsearchtxtbox").val("");$("#mobsearchtxtbox").datepicker({changeMonth:true,changeYear:true,showButtonPanel:true,dateFormat:"MM yy",yearRange:b+":"+a}).focus(function(){var a=$(this);$(".ui-datepicker-calendar").detach();$(".ui-datepicker-current").css("display","none");$(".ui-datepicker-close").click(function(){var b=$("#ui-datepicker-div .ui-datepicker-month :selected").val(),c=$("#ui-datepicker-div .ui-datepicker-year :selected").val();a.datepicker("setDate",new Date(c,b,1));$("#mobsearchicon").click()})})}else if($(this).text()=="CPD")$("#mobsearchtxtbox").val("[ALL]");else{$("#mobsearchtxtbox").datepicker("destroy");$("#search_param").val("All categories");$("#mobsearchtxtbox").val("")}});$("#Text1").unbind("keypress");$("#Text1").bind("keypress",function(b){var a=b.which;a==13&&$("[data-innerroutename='text1search']").click()});GetWebPortalConfigSettings();!BrowserStorage.getDataCollection()&&BrowserStorage.setDataCollection([]);!BrowserStorage.setFacetsCheckedCollection()&&BrowserStorage.setFacetsCheckedCollection([])})