typeof sfcw=="undefined"&&(sfcw={}),sfcw.api=function(n){var t={},c=!1,p="https://service.fetchcourses.ie/service/fetchcourse.svc/json",r=p,f,i,h;sfcw_location&&sfcw_location.service_url&&(r=sfcw_location.service_url),t.lastErrorMessage="",t.searchParameters={},t.searchParametersAdvanced={};var e="",s=function(){t.searchParameters={AreaId:"0",CategoryId:"0",ISCEDId:"0",DateFrom:null,Keywords:"",LocationId:"0",ProviderId:"0",TargetAwardId:"0"},t.searchParametersAdvanced={AreaIds:"0",CategoryIds:"0",ISCEDIds:"0",LocationIds:"0",ProviderIds:"0",TargetAwardIds:"0",TargetAwardingBodyIds:"0",DateFrom:null,Keywords:"",TargetGroupId:"0",VenueId:"0",Latitude:0,Longitude:0,RangeMeters:0,TransportRouteName:null,TransportRouteOperator:null}},l=function(r,u,e){return i("call_referenceList"),n.ajax({url:h(r),type:"get",dataType:"json",success:function(n){var i=n.ResponseInfo;i!=null&&(i.ResponseCode==0?(e!=null&&u&&e(n.ReferenceList),e==null||u||e(n)):(t.lastErrorMessage=i.ResponseMessage,e!=null&&e(null)))},error:function(n,r,u){i("api call error"),i(u),i(r),t.lastErrorMessage=f(n,r,u),e!=null&&e(null)}})},a=function(r,u,e){return i("call_referenceList_html"),n.ajax({url:h(r),type:"get",dataType:"html",success:function(n){e!=null&&e(n)},error:function(n,r,u){i("html api call error"),t.lastErrorMessage=f(n,r,u),e!=null&&e(null)}})},v=function(r,u,e){return i("postGeneral"),n.ajax({url:r,type:"post",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(u),success:function(n){e(n)},error:function(n,r,u){i("postGeneral call error"),t.lastErrorMessage=f(n,r,u),e!=null&&e(null)}})},y=function(r,u,e){return i("postGeneral_html"),n.ajax({url:r,type:"post",dataType:"html",contentType:"application/json; charset=utf-8",data:JSON.stringify(u),success:function(n){e(n)},error:function(n,r,u){i("postGeneral_html call error"),t.lastErrorMessage=f(n,r,u),e!=null&&e(null)}})},u=l,o=v;return t.demoXmlMode=function(){u=a,o=y,r=sfcw_location.service_url.replace("/json","/xml"),e="html"},t.demoJsonMode=function(){u=a,o=y,r=sfcw_location.service_url.replace("/json","/xml"),e="html"},t.demoOff=function(){u=l,o=v,r=sfcw_location.service_url,e=""},t.getISCEDList=function(n){return i("GetISCEDList"),u(r.concat("/GetISCEDList"),!0,function(t){n!=null&&n(t)})},t.getTargetGroupList=function(n){return i("GetTargetGroupList"),u(r.concat("/GetTargetGroupList"),!0,function(t){n!=null&&n(t)})},t.getDeliveryCriteriaList=function(n){return i("GetDeliveryCriteriaList"),u(r.concat("/GetDeliveryCriteriaList"),!0,function(t){n!=null&&n(t)})},t.getCourseCategoryList=function(n){return i("GetCourseCategoryList"),u(r.concat("/GetCourseCategoryList"),!0,function(t){n!=null&&n(t)})},t.getAwardingBodyList=function(n){return i("GetAwardingBodyList"),u(r.concat("/GetAwardingBodyList"),!0,function(t){n!=null&&n(t)})},t.getAwardList=function(n,t){return i("GetAwardList"),u(r.concat("/GetAwardList/",n),!0,function(n){t!=null&&t(n)})},t.getAreaList=function(n){return i("GetAreaList"),u(r.concat("/GetAreaList"),!0,function(t){n!=null&&n(t)})},t.getLocationByAreaList=function(n,t){return i("GetLocationByAreaList"),u(r.concat("/GetLocationByAreaList/",n),!0,function(n){t!=null&&t(n)})},t.getProviderList=function(n){return i("GetProviderList"),u(r.concat("/GetProviderList"),!0,function(t){n!=null&&n(t)})},t.getActiveCourseLocationList=function(n,t,f){i("GetActiveCourseLocationList"),(n==null||n=="")&&(n="0"),(t==null||t=="")&&(t="0");var e=r.concat("/GetActiveCourseLocationList/",n,"/",t);return u(e,!0,function(n){f!=null&&f(n)})},t.searchCourseListSummary=function(u,o,h,c){i("SearchCourseListSummary"),h!=null&&(s(),h.AreaId!=null&&(t.searchParameters.AreaId=h.AreaId),h.CategoryId!=null&&(t.searchParameters.CategoryId=h.CategoryId),h.ISCEDId!=null&&(t.searchParameters.ISCEDId=h.ISCEDId),h.DateFrom!=null&&(t.searchParameters.DateFrom=h.DateFrom),h.Keywords!=null&&(t.searchParameters.Keywords=h.Keywords),h.LocationId!=null&&(t.searchParameters.LocationId=h.LocationId),h.ProviderId!=null&&(t.searchParameters.ProviderId=h.ProviderId),h.TargetAwardId!=null&&(t.searchParameters.TargetAwardId=h.TargetAwardId));var l=r.concat("/SearchCourseListSummary/",t.searchParameters.ProviderId,"/",t.searchParameters.Keywords,"/",u,"/",o,"/",t.searchParameters.TargetAwardId,"/",t.searchParameters.AreaId,"/",t.searchParameters.LocationId,"/",t.searchParameters.CategoryId,"/",t.searchParameters.ISCEDId,"/",t.searchParameters.DateFrom);return console.log(t.searchParameters),e==""?n.ajax({url:l,type:"get",contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){if(console.log(n),n.ResponseInfo!=null&&n.ResponseInfo.ResponseCode!=0){i("SearchCourseListSummary: ".concat(n.ResponseInfo.ResponseMessage)),c!=null&&c(null);return}c!=null&&c(n)},error:function(n,r,u){i("searchCourseListSummary error"),t.lastErrorMessage=f(n,r,u),c!=null&&c(null)}}):n.ajax({url:l,type:"get",contentType:"application/json; charset=utf-8",dataType:"html",success:function(n){c!=null&&c(n)},error:function(n,r,u){i("searchCourseListSummary error"),t.lastErrorMessage=f(n,r,u),c!=null&&c(null)}})},t.searchCourseListSummaryAdvanced=function(n,u,f,h){i("SearchCourseListSummaryAdvanced");var c=r.concat("/SearchCourseListSummaryAdvanced/",n,"/",u);return f!=null&&(s(),f.DateFrom!=null&&(t.searchParametersAdvanced.DateFrom=f.DateFrom),f.Keywords!=null&&(t.searchParametersAdvanced.Keywords=f.Keywords),f.TargetGroupId!=null&&(t.searchParametersAdvanced.TargetGroupId=f.TargetGroupId),f.VenueId!=null&&(t.searchParametersAdvanced.VenueId=f.VenueId),f.DeliveryModeId!=null&&(t.searchParametersAdvanced.DeliveryModeId=f.DeliveryModeId),f.ProviderIds!=null&&(t.searchParametersAdvanced.ProviderIds=f.ProviderIds),f.AreaIds!=null&&(t.searchParametersAdvanced.AreaIds=f.AreaIds),f.LocationIds!=null&&(t.searchParametersAdvanced.LocationIds=f.LocationIds),f.CategoryIds!=null&&(t.searchParametersAdvanced.CategoryIds=f.CategoryIds),f.ISCEDIds!=null&&(t.searchParametersAdvanced.ISCEDIds=f.ISCEDIds),f.TargetAwardIds!=null&&(t.searchParametersAdvanced.TargetAwardIds=f.TargetAwardIds),f.TargetAwardingBodyIds!=null&&(t.searchParametersAdvanced.TargetAwardingBodyIds=f.TargetAwardingBodyIds),f.AreaId!=null&&(t.searchParametersAdvanced.AreaId=f.AreaId),f.LocationId!=null&&(t.searchParametersAdvanced.LocationId=f.LocationId),f.CategoryId!=null&&(t.searchParametersAdvanced.CategoryId=f.CategoryId),f.ISCEDId!=null&&(t.searchParametersAdvanced.ISCEDId=f.ISCEDId),f.TargetAwardId!=null&&(t.searchParametersAdvanced.TargetAwardId=f.TargetAwardId),f.TargetAwardingBodyId!=null&&(t.searchParametersAdvanced.TargetAwardingBodyId=f.TargetAwardingBodyId),f.Latitude!=null&&(t.searchParametersAdvanced.Latitude=f.Latitude),f.Longitude!=null&&(t.searchParametersAdvanced.Longitude=f.Longitude),f.RangeMeters!=null&&(t.searchParametersAdvanced.RangeMeters=f.RangeMeters),f.TransportRouteOperator!=null&&f.TransportRouteOperator!="aaame"&&(f.TransportRouteName!=null&&(t.searchParametersAdvanced.TransportRouteName=f.TransportRouteName),f.TransportRouteOperator!=null&&(t.searchParametersAdvanced.TransportRouteOperator=f.TransportRouteOperator)),f.IsCourseContracted!=null&&(t.searchParametersAdvanced.IsCourseContracted=f.IsCourseContracted)),i(t.searchParametersAdvanced),o(c,t.searchParametersAdvanced,function(n){if(n!=null){if(e=="html"){h!=null&&h(n);return}var t=n.SearchCourseListSummaryAdvancedResult,i=t.ResponseInfo;if(i!=null&&i.ResponseCode==0&&h!=null){h(t);return}}h!=null&&h(null)})},t.searchCourseReturnCourseId=function(n,u,f,h){i("SearchCourseReturnCourseId");var c=r.concat("/SearchCourseReturnCourseId/");return f!=null&&(s(),f.DateFrom!=null&&(t.searchParametersAdvanced.DateFrom=f.DateFrom),f.Keywords!=null&&(t.searchParametersAdvanced.Keywords=f.Keywords),f.ProviderId!=null&&(t.searchParametersAdvanced.ProviderId=f.ProviderId),f.TargetGroupId!=null&&(t.searchParametersAdvanced.TargetGroupId=f.TargetGroupId),f.DeliveryModeId!=null&&(t.searchParametersAdvanced.DeliveryModeId=f.DeliveryModeId),f.VenueId!=null&&(t.searchParametersAdvanced.VenueId=f.VenueId),f.ProviderIds!=null&&(t.searchParametersAdvanced.ProviderIds=f.ProviderIds),f.AreaIds!=null&&(t.searchParametersAdvanced.AreaIds=f.AreaIds),f.LocationIds!=null&&(t.searchParametersAdvanced.LocationIds=f.LocationIds),f.CategoryIds!=null&&(t.searchParametersAdvanced.CategoryIds=f.CategoryIds),f.ISCEDIds!=null&&(t.searchParametersAdvanced.ISCEDIds=f.ISCEDIds),f.TargetAwardIds!=null&&(t.searchParametersAdvanced.TargetAwardIds=f.TargetAwardIds),f.TargetAwardingBodyIds!=null&&(t.searchParametersAdvanced.TargetAwardingBodyIds=f.TargetAwardingBodyIds),f.AreaId!=null&&(t.searchParametersAdvanced.AreaId=f.AreaId),f.LocationId!=null&&(t.searchParametersAdvanced.LocationId=f.LocationId),f.CategoryId!=null&&(t.searchParametersAdvanced.CategoryId=f.CategoryId),f.ISCEDId!=null&&(t.searchParametersAdvanced.ISCEDId=f.ISCEDId),f.TargetAwardId!=null&&(t.searchParametersAdvanced.TargetAwardId=f.TargetAwardId),f.TargetAwardingBodyId!=null&&(t.searchParametersAdvanced.TargetAwardingBodyId=f.TargetAwardingBodyId)),o(c,t.searchParametersAdvanced,function(n){if(n!=null){if(e!=""){h!=null&&h(n);return}var t=n.SearchCourseReturnCourseIdResult,i=t.ResponseInfo;if(i!=null&&i.ResponseCode==0&&h!=null){h(t);return}}h!=null&&h(null)})},t.getIndividualCourseDetail=function(n,t){return i("GetIndividualCourseDetail"),u(r.concat("/GetIndividualCourseDetail/",n,"/0"),!1,function(n){t!=null&&t(n)})},t.getVenueList=function(n,t,i){return u(r.concat("/GetVenueList/",n,"/",t),!1,function(n){i!=null&&(n?i(n.venues):i(null))})},t.getCourseList=function(n,r){return i("GetCourseList"),t.searchCourseListSummaryAdvanced(1,5e3,t.searchParametersAdvanced,function(n){n!=null?r(n.courses):r(null)})},t.getTransportRoutesAtLocation=function(n,t,f,e){i("getTransportRoutesAtLocation");var o=r.concat("/TransportRoutesAtLocation/",n,"/",t,"/",f);return u(o,!1,function(n){e!=null&&e(n)})},t.getTransportStopsOnRoute=function(n,t,f){i("getTransportStopsOnRoute");var e=r.concat("/TransportStopsOnRoute/",n,"/",t);return u(e,!1,function(n){f!=null&&f(n)})},f=function(n,t,i){return n.status==0?"error: ".concat(n.state()):n&&n.status?"".concat(n.status,": ",t,". (",i,")"):t.concat(" (",i,")")},i=function(n){c&&(typeof n=="string"?window.console&&console.log("sfcw.api::".concat(n)):window.console&&console.log(n))},t.enableLogging=function(n){c=n},h=function(n){return n.indexOf("GetIndividualCourseDetail")!=-1?n:n[n.length-1]!="/"?n.concat("/"):n},t}($),sfcw.map=function(n){function ui(i,r){t.ready&&(r==null&&(r=0),r==0&&lt(),u.length==0&&n(pt).each(function(){var t={center:{lat:-34.397,lng:150.644},zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1};u.push(new google.maps.Map(this,t)),c.push(null)}),c[r]!=null&&(c[r].setMap(null),c[r]=null),at(),c[r]=new google.maps.Marker({position:new google.maps.LatLng(i.VenueLocationLatitude,i.VenueLocationLongitude),map:u[r]}),google.maps.event.trigger(u[r],"resize"),u[r].setCenter(c[r].getPosition()),google.maps.event.trigger(u[r],"center_changed"))}var t={},tt=!1,r,y,at;t.googleApiKey="",t.providerIds="0",t.ready=!1,t.mode=0,t.position=null;var vt="https://maps.googleapis.com/maps/api/staticmap",i=sfcw_location.url,o=null,p="",w="",b="",u=[],c=[],s=[],e=null,a=[],h=[],it="",v=null,yt="#sfcw_map",pt=".sfcw-map-courseDetails",nt=".sfcw-map-venue",k=".sfcw-map-courses",d=".sfcw-map-course-heat",wt="sfcw-faded",bt="widget_map_venueInfo.html",kt="widget_map_courseInfo.html",dt="widget_map_heatInfo.html";t.MODE_DISABLED=0,t.MODE_INTEGRATED=1,t.MODE_INDEPENDENT=2;var rt=i.concat("/content/graphics/icon_free_parking.png"),ut=i.concat("/content/graphics/icon_parking.png"),ft=i.concat("/content/graphics/icon_wheelchair.png"),et=i.concat("/content/graphics/icon_canteen.png"),ot=i.concat("/content/graphics/icon_coffee.png"),st=i.concat("/content/graphics/icon_wifi.png"),g=[];t.PIN_BLANK=0,t.PIN_BUS=1,t.PIN_ME=2,t.PIN_BAC=3,t.PIN_TRAIN=4,t.PIN_LUASG=5,t.PIN_LUASR=6,t.PIN_DBIKE=7,r=null,y=null,t.initAllMaps=function(){o=new google.maps.InfoWindow({content:""}),g=oi();var u=n.ajax(i.concat("/content/html/",kt)),e=n.ajax(i.concat("/content/html/",bt)),s=n.ajax(i.concat("/content/html/",dt));n.when(u,e,s).done(function(i,u,e){w=i[0],p=u[0],b=e[0],f("Templates loaded"),t.ready=!0,t.mode&t.MODE_INDEPENDENT&&(f("Independent mode"),n(nt).length>0&&gt(),(n(k).length>0||n(d).length>0)&&(f("Initializing independent course/heat map(s)"),ht(function(){r.length>0&&(n(k).length>0&&ti(r),n(d).length>0&&ii(r,y))})))})};var ht=function(i){sfcw.api.getCourseList(t.providerIds,function(t){t!=null&&(r=[],y=[],n.each(t,function(){for(var t=-1,i=this,n=0;n<r.length;++n)if(r[n].VenueLocationLatitude==i.VenueLocationLatitude&&r[n].VenueLocationLongitude==i.VenueLocationLongitude){t=n;break}t==-1?(r.push(i),y.push(1)):y[t]++}),i&&i())})},gt=function(){f("initVenueMaps"),p==null&&(p="{title}"),sfcw.api.getVenueList(t.providerIds,0,function(t){var f,e,r,o,u,i,s;if(t!=null)for(f=new google.maps.LatLng(t[0].GEOLocation_Lat,t[0].GEOLocation_Lon),e={center:f,zoom:13,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1},r=0;r<n(nt).length;++r)for(o=n(nt).get(r),u=new google.maps.Map(o,e),i=0;i<t.length;++i)s=new google.maps.Marker({position:new google.maps.LatLng(t[i].GEOLocation_Lat,t[i].GEOLocation_Lon),title:t[i].Title,map:u}),ni(t[i],s,u)})},ni=function(n,t,i){var r="",u="",f="",e;n.Phone!=null&&n.Phone!=""&&(r="<a href='tel:".concat(n.Phone,"'>",n.Phone,"<\/a>")),n.Mobile!=null&&n.Mobile!=""&&(u="<a href='tel:".concat(n.Mobile,"'>",n.Mobile,"<\/a>")),n.Email!=null&&n.Email!=""&&(f="<a href='mailto:".concat(n.Email,"'>",n.Email,"<\/a>")),typeof sfcw.MEDIALOCATION_P1!="undefined",e=p.replace(/{title}/gi,n.Title).replace(/{add1}/gi,n.Address1).replace(/{add2}/gi,n.Address2).replace(/{add3}/gi,n.Address3).replace(/{add4}/gi,n.Address4).replace(/{county}/gi,n.CountyId).replace(/{PostCode}/gi,n.PostCode).replace(/{phone}/gi,r).replace(/{mobile}/gi,u).replace(/{email}/gi,f).replace(/{providerid}/gi,n.ProviderId).replace(/{providername}/gi,n.Title),google.maps.event.addListener(t,"click",function(){o.setContent(e),o.open(i,this)})},ti=function(i){var e,o,h,u,c,s,r,l;for(f("initCourseMaps"),w==null&&(w="{title}"),f("We have "+i.length+" locations"),e=new google.maps.LatLng(i[0].VenueLocationLatitude,i[0].VenueLocationLongitude),o=13,t.providerIds=="0"&&(e=new google.maps.LatLng(53.2734,-7.7783203100000264),o=7),h={center:e,zoom:o,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1},u=0;u<n(k).length;++u)for(c=n(k).get(u),s=new google.maps.Map(c,h),r=0;r<i.length;++r)l=new google.maps.Marker({position:new google.maps.LatLng(i[r].VenueLocationLatitude,i[r].VenueLocationLongitude),title:i[r].description,map:s}),ct(i[r],l,s)},ct=function(n,i,r){sfcw.api.getIndividualCourseDetail(n.CourseId,function(u){var f=w,e=[];u.VenueAddress!=null&&(e=u.VenueAddress.split(",")),e.length>0&&(f=f.replace(/{add1}/gi,e[0])),e.length>1&&(f=f.replace(/{add2}/gi,e[1])),e.length>2&&(f=f.replace(/{add3}/gi,e[2])),e.length>3&&(f=f.replace(/{add4}/gi,e[3])),e.length>4&&(f=f.replace(/{postcode}/gi,e[4])),f=f.replace(/{add1}/gi,"").replace(/{add2}/gi,"").replace(/{add3}/gi,"").replace(/{add4}/gi,"").replace(/{postcode}/gi,"");var s="",a="",h="",c="";u.CourseContactPhone!=null&&u.CourseContactPhone!=""&&(s="<a href='tel:".concat(u.CourseContactPhone,"'>",u.CourseContactPhone,"<\/a>")),u.CourseContactEmail!=null&&u.CourseContactEmail!=""&&(h="<a href='mailto:".concat(u.CourseContactEmail,"'>",u.CourseContactEmail,"<\/a>")),u.OnlineApplicationURL!=null&&u.OnlineApplicationURL!=""&&(c="<a href='".concat(u.OnlineApplicationURL,"'>",u.OnlineApplicationURL,"<\/a>")),f=f.replace(/{phone}/gi,s).replace(/{email}/gi,h).replace(/{web}/gi,c).replace(/{mobile}/gi,a);var v=l(u.VenueFacilities,"fp"),y=l(u.VenueFacilities,"pp"),p=l(u.VenueFacilities,"wa"),b=l(u.VenueFacilities,"ca"),k=l(u.VenueFacilities,"co"),d=l(u.VenueFacilities,"wi");f=f.replace(/{title}/gi,u.VenueName).replace(/{freeparking}/gi,v).replace(/{payparking}/gi,y).replace(/{wheelchairaccess}/gi,p).replace(/{canteen}/gi,b).replace(/{coffee}/gi,k).replace(/{wifi}/gi,d).replace(/{providername}/gi,u.VenueName),f=f.replace(/{providerid}/gi,t.providerIds).replace(/{venueId}/gi,n.VenueId),google.maps.event.addListener(i,"click",function(){o.setContent(f),o.open(r,this)})})},ii=function(t,i){var e,s,o,r,u;for(f("initHeatMaps"),b==null&&(b="{title}"),f("We have "+t.length+" locations"),e=new google.maps.LatLng(t[0].VenueLocationLatitude,t[0].VenueLocationLongitude),e=new google.maps.LatLng(53.2734,-7.7783203100000264),s={center:e,zoom:7,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1},o=[],r=0;r<t.length;++r)o.push({location:new google.maps.LatLng(t[r].VenueLocationLatitude,t[r].VenueLocationLongitude),weight:i[r]});for(u=0;u<n(d).length;++u){var h=n(d).get(u),c=new google.maps.Map(h,s),l=new google.maps.visualization.HeatmapLayer({data:o,radius:50});l.setMap(c)}},si=function(n,t,i){var r=b;r=r.replace(/{title}/gi,n.VenueName).replace(/{providername}/gi,n.VenueName).replace(/{providerid}/gi,n.providerId),google.maps.event.addListener(t,"click",function(){o.setContent(r),o.open(i,this)})},l=function(n,t){var r="",i="",u="",e=!1,f;switch(t.toLowerCase()){case"fp":r=rt,i="Free Parking",u="Free Parking";break;case"pp":r=ut,i="Pay Parking",u="Pay Parking";break;case"wa":r=ft,i="Wheelchair Access",u="Wheelchair Access";break;case"co":r=ot,i="Tea and Coffee Making Facilities",u="Tea/Coffee Making";break;case"wi":r=st,i="Wifi Available",u="Free Wifi";break;case"ca":r=et,i="Full Canteen",u="Full Canteen";break;default:return""}return(e=ri(n,u),!e)?"":(f='<img src="'+r+'" alt="'+i+'" width="26" height="26"',f+=e?' title="'.concat(i,'" />'):' title="'.concat(i,'" class="',wt,'" />'))},ri=function(t,i){return n.each(t,function(){if(this.FacilityDescription.toLowerCase()==i.toLowerCase())return!0}),!1};t.venueSearch=function(t,i){var r=n("#sfcw_map_input_keyword").val();sfcw.widget.searchProvider({Keywords:r,VenueId:t},i)},t.venueList=function(n,t){sfcw.widget.searchProvider({Keywords:"",VenueId:n},t)},t.showCourseDetailMap=function(n,t){setTimeout(function(){ui(n,t)},500)},t.getStaticCourseMapUrl=function(n){if(u==null||u.length==0)return"";n==null&&(n=0);var i=vt.concat("?size=600x600"),r=u[n].getCenter();return i+="&center=".concat(r.lat(),",",r.lng()),i+="&zoom=".concat(u[n].getZoom()),i+="&markers=".concat(r.lat(),",",r.lng()),i+="&key=".concat(t.googleApiKey)},t.showCourseResultsMap=function(i){ht(function(){var c,f,u,h;if(e==null){var l=n(yt).get(0),o=new google.maps.LatLng(53.2734,-7.7783203100000264),s=7;t.providerIds&&t.providerIds!=""&&t.providerIds!="0"&&t.providerIds.indexOf(",")==-1&&r.length>0?(o=new google.maps.LatLng(r[0].VenueLocationLatitude,r[0].VenueLocationLongitude),s=13):r.length>0&&(o=new google.maps.LatLng(r[0].VenueLocationLatitude,r[0].VenueLocationLongitude),s=10),c={center:o,zoom:s,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:!1},e=new google.maps.Map(l,c)}if(a.length>0)for(f=a.pop();f!=null;)f.setMap(null),f=null,f=a.pop();for(u=0;u<r.length;++u)h=new google.maps.Marker({position:new google.maps.LatLng(r[u].VenueLocationLatitude,r[u].VenueLocationLongitude),title:r[u].description,map:e}),a.push(h),ct(r[u],h,e);t.position!=null&&v==null&&t.markCurrentPosition(),google.maps.event.trigger(e,"resize"),e.setCenter(a[0].getPosition()),google.maps.event.trigger(e,"center_changed"),i&&i()})},t.markCurrentPosition=function(){t.position!=null&&(v!=null&&(v.setMap(null),v=null),v=new google.maps.Marker({position:new google.maps.LatLng(t.position.coords.latitude,t.position.coords.longitude),title:"My Location",map:e,icon:g[t.PIN_ME]}))},t.resultsMap_LoadTransportStops=function(n,i,r){if(t.ready){if(h!=null){if(r.toLowerCase()==it)return;lt()}else h=[];i&&i!=""&&r&&r!=""&&(it=r,sfcw.api.getTransportStopsOnRoute(i,r,function(t){f("result"),f(t),t!=null&&fi(n,t.Routes,r)}))}};var fi=function(t,i,r){i!=null&&(f("resultsMap_AddTransportStops"),n.each(i,function(n){var u=i[n],f=new google.maps.Marker({position:new google.maps.LatLng(parseFloat(u.Latitude),parseFloat(u.Longitude)),map:e,icon:g[t]});h.push(f),ei(u,f,e,r)}))},lt=function(){if(h!=null)for(var n=0;n<h.length;++n)h[n]!=null&&(h[n].setMap(null),h[n]=null)},ei=function(n,t,i,r){var u="<h2><strong>".concat(n.StopName,"<\/strong><\/h2>");u+="<p><strong>Route: ".concat(r,"<\/strong><\/p>"),u+="Stop Id: ".concat(n.Id,"<\/p>"),google.maps.event.addListener(t,"click",function(){o.setContent(u),o.open(i,this)})};t.courseMap_ShowTransportMarker=function(n,i,r){var f,e;t.ready&&(f=g[t.PIN_BLANK],s==null&&(s=[]),e=new google.maps.Marker({position:new google.maps.LatLng(parseFloat(n),parseFloat(i)),map:u[0],label:r,icon:f}),s.push(e))},at=function(){if(s!=null)for(var n=0;n<s.length;++n)s[n]!=null&&(s[n].setMap(null),s[n]=null)},t.enableLogging=function(n){tt=n};var oi=function(){return[i.concat("/content/graphics/google-pin-blank.png"),i.concat("/content/graphics/google-pin-bus.png"),i.concat("/content/graphics/google-pin-me.png"),i.concat("/content/graphics/google-pin-bac.png"),i.concat("/content/graphics/google-pin-train.png"),i.concat("/content/graphics/google-pin-luasg.png"),i.concat("/content/graphics/google-pin-luasr.png"),i.concat("/content/graphics/google-pin-dbike.png")]},hi=function(){rt=i.concat("/content/graphics/icon_free_parking.png"),ut=i.concat("/content/graphics/icon_parking.png"),ft=i.concat("/content/graphics/icon_wheelchair.png"),et=i.concat("/content/graphics/icon_canteen.png"),ot=i.concat("/content/graphics/icon_coffee.png"),st=i.concat("/content/graphics/icon_wifi.png")},f=function(n){tt&&(typeof n=="string"?window.console&&console.log("sfcw.map::".concat(n)):window.console&&console.log(n))},ci=function(n){var u=window.location.href,f=u.indexOf("?"),i,t,r;if(f==-1)return null;for(i=u.substring(f+1).split("&"),t=0;t<i.length;t++)if(r=i[t].split("="),r[0].toLowerCase()==n.toLowerCase())return r[1];return null};return t}($),sfcw.widget=function(n){var r={},w;r.version="1.7.3";var pt=!1,de="https://widget.fetchcourses.ie",sc="",hc=de,t=null,u=1,tt=10,h=20,c=null,f=[],s=-1,e=[],fu=0,wt=null,v="0",yi="0",y="",b=0;r.Course_Media=[];var ge=["Sun","Mon","Tue","Wed","Thur","Fri","Sat"],ct=[],lt=!0,it=!0,pi=!1,eu="",ut=!1,bt=!0,ft=!1;r.event_searchComplete=null,r.event_addFavouriteCourse=null,r.event_removeFavouriteCourse=null,r.event_courseView=null,r.event_resultView=null,r.event_applyNowClick=null,r.action_applyNowClick=null;var wi=null,bi=null,ou=null,su=null,hu=null,cu=null;r.MEDIALOCATION_P1=1,r.MEDIALOCATION_P2=2,r.MEDIALOCATION_P3=3,r.MEDIALOCATION_P4=4,r.MEDIALOCATION_P5=5,r.MEDIALOCATION_P6=6,r.MEDIATYPE_IMAGE=0,r.MEDIATYPE_VIDEO=1,r.MEDIATYPE_HTML=2,r.COOKIE_FAVOURITES="savedCourses";var et="#sfcw_section_overlay",no="#sfcw_section_search",kt="#sfcw_input_keyword",to="#sfcw_button_search",ki="#sfcw_select_category",rt="#sfcw_select_area",di="#sfcw_select_awardingBody",gi="#sfcw_select_award",nr="#sfcw_select_provider",tr="#sfcw_select_programme",dt="#sfcw_select_delivery",ot="#sfcw_select_sublocation",lu="#sfcw_fetchselect_area",ir="#sfcw_fetchselect_sublocation",au="#sfcw_fetchselect_awardingBody",vu="#sfcw_fetchselect_award",yu="#sfcw_fetchselect_category",pu="#sfcw_fetchselect_programme",wu=".sfcw-subsection-advancedSearch",at=".sfcw-el-showHideAdvanceSearch",bu="#sfcw_section_results",rr="#sfcw_result_listsubsection",ku="#sfcw_result_mapsubsection",du="#sfcw_result_favsubsection",gu="#sfcw_result_localsubsection",io="#sfcw_div_pages",ro="#sfcw_div_perpage",st="#sfcw_result_lazyLoader",cc=".sfcw-result-switcher",ur="#sfcw_btn_switcherList",gt="#sfcw_btn_switcherMap",p="#sfcw_btn_switcherFav",ni="#sfcw_btn_switcherLocal",fr=".sfcw-data-resultTotals",ti=".sfcw-table-results",er=".sfcw-div-legend",uo="#sfcw_clear_favourites",fo="#sfcw_div_transportFilter",lc=".sfcw-icon-transportFilter",ac=".sfcw-label-transportFilter",eo="#sfcw_btn_clearTransportfilter",nf="#sfcw_filter_transport_operator",tf="#sfcw_filter_transport_route",rf="#sfcw_div_venueFilter",uf=".sfcw-label-venueFilter",oo="#sfcw_btn_clearVenuefilter",ff=".sfcw-data-referenceCol",ef=".sfcw-data-titleCol",or=".sfcw-data-providerCol",sr=".sfcw-data-locationCol",of=".sfcw-data-dateCol",sf=".sfcw-data-categoryCol",hr=".sfcw-data-typeCol",cr="#sfcw_section_details",hf=".sfcw-course-colour",cf=".sfcw-course-colour-bck",ii=".sfcw-btn-prev",so=".sfcw-btn-close",ri=".sfcw-btn-next",ho=".sfcw-course-toolbar",co=".sfcw-data-mediaP1",lo=".sfcw-data-mediaP2",ao=".sfcw-data-mediaP3",vo=".sfcw-data-mediaP4",yo=".sfcw-data-mediaP5",po=".sfcw-data-mediaP6",wo=".sfcw-map-courseDetails",lr=".sfcw-data-courseId",bo=".sfcw-data-courseTitle",ko=".sfcw-data-courseDescription",go=".sfcw-data-learnerEducation",ns=".sfcw-data-learnerAptitude",ts=".sfcw-data-learnerPreviousExperience",is=".sfcw-table-courseModules",lf=".sfcw-data-learningOutcomes",af=".sfcw-data-furtherDetails",vf=".sfcw-data-targetAwardTitle",rs=".sfcw-data-providerName",us=".sfcw-data-venueName",yf=".sfcw-data-address",pf=".sfcw-data-providerGps",fs=".sfcw-table-dates",es=".sfcw-table-timeTable",os=".sfcw-ul-providerFacilities",wf=".sfcw-data-contactName",bf=".sfcw-data-contactPhone",kf=".sfcw-data-contactEmail",df=".sfcw-data-contactWeb",ss=".sfcw-data-accessAndProgression",hs=".sfcw-data-capacity",cs=".sfcw-data-courseCode",ls=".sfcw-data-courseFee",as=".sfcw-data-deliveryMode",vs=".sfcw-data-deliveryTime",ys=".sfcw-data-delivertType",ps=".sfcw-data-regFee",ws=".sfcw-data-hoursPerWeek",bs=".sfcw-data-tuitionType",ks=".sfcw-data-workPlacementDays",ds=".sfcw-data-workPlacementWeeks",vc=".sfcw-div-sidebar",gf=".sfcw-el-providerPhone",ne=".sfcw-el-providerEmail",te=".sfcw-el-providerWeb",ie=".sfcw-el-timeTable",re="#sfcw_div_fees",ue="#sfcw_div_furtherDetails",fe="#sfcw_div_learningOutcomes",ar="#sfcw_btn_addFav",vr="#sfcw_btn_removeFav",yc="#sfcw_btn_printCourse",gs=".sfcw-btn-applyForCourse",ui="#sfcw_result_localcards",yr="#sfcw_result_local_noroutes",ee="#sfcw_result_local_nogps",pr="#sfcw_result_local_seeking",nh="glyphicon-transport",fi="glyphicon-bus-32",ei="glyphicon-train-20",oe="glyphicon-walk-22",se="glyphicon-bicycle",vt="aaame",wr=1200,oi="bikes",pc="dublin";r.init=function(i,u,f,e){var p,h,s,w,c;(sfcw_location.name=="dev"||sfcw_location.name=="uat")&&(pt=!0),sfcw.api.enableLogging(pt),o("init('".concat(i,"', '",u,"', '",f,"')")),console.log(r.version),jQuery.fn.extend({safehtml:function(t){return this.each(function(){n(this).html(t)})}}),i!=null&&i!=""&&(v=i),nt(f,"hidesearch")&&n(no).hide(),dh(f),gh(f),nt(f,"noprovider")&&n(or).remove(),nt(f,"nolocation")&&n(sr).remove(),nt(f,"pagination")&&(it=!1),nt(f,"bs4")&&(ut=!0),nt(f,"nohistory")&&(bt=!1),nt(f,"loc")&&ut&&(ft=!0),y=li(f,"isced"),y&&y!=""&&(n(at).hide(),n(wu).hide()),nt(f,"iscontracted")&&(p=li(f,"iscontracted"),p=="1"&&(b=1),p=="0"&&(b=2)),h=a("sfcw-courseId"),n(ti.concat(" th")).each(function(){ct.push(rc(n(this)))}),t={ProviderIds:v,Keywords:a("sfcw-keyword"),ISCEDIds:a("sfcw-iscedid"),CategoryIds:a("sfcw-categoryid"),AreaIds:a("sfcw-areaid"),LocationIds:a("sfcw-locationid"),TargetAwardingBodyIds:a("sfcw-targetawardingbodyid"),TargetAwardIds:a("sfcw-targetawardid"),DeliveryModeId:a("sfcw-deliverymodeid"),ResultCount:0},u!=null&&t.Keywords==null&&(t.Keywords=u),y&&y!=""&&(t.ISCEDIds=y),b!=0&&(b==1&&(t.IsCourseContracted="1"),b==2&&(t.IsCourseContracted="0")),ih(function(){r.setFilters(t)}),fh(),h==null&&t.Keywords!=null&&dr(uu),th(),s="btn btn-xs btn-default",w="btn btn-xs btn-success",ut&&(s="btn btn-sm btn-default",w="btn btn-sm btn-success"),r.addCourseToolbarButton({id:"sfcw_btn_printCourse",cls:s,text:"Print",img:sfcw_location.url.concat("/content/graphics/icon_printer.png"),clickFn:function(){window.print()}}),r.addCourseToolbarButton({id:"sfcw_btn_removeFav",cls:s,style:"display: none;",text:"Remove",img:sfcw_location.url.concat("/content/graphics/star-set.png"),clickFn:function(){ai(!yt())}}),r.addCourseToolbarButton({id:"sfcw_btn_addFav",cls:s,text:"Save",img:sfcw_location.url.concat("/content/graphics/star-unset.png"),clickFn:function(){ai(!yt())}}),r.action_applyNowClick=function(n){r.fetchApplyForCourse(n)},r.addCourseToolbarButton({id:"sfcw_btn_applyNow",style:"display: none;",cls:w,text:"Apply Now",clickFn:function(n){r.action_applyNowClick!=null&&r.action_applyNowClick(n),r.event_applyNowClick!=null&&r.event_applyNowClick(n)}}),n(gs).click(function(t){t.preventDefault();var i=n(lr).html();r.action_applyNowClick!=null&&r.action_applyNowClick(i),r.event_applyNowClick!=null&&r.event_applyNowClick(i)}),wt=Cookies.noConflict(),fc(),e!=null&&e!=""&&window[e](),h!=null?l(h):(c=a("view"),c&&c!="0"&&g(c,!1))};var th=function(){n(to).click(function(){eh()}),it&&(n(st).show(),n(window).scroll(function(){uc()})),lt=!0,n(at).html("-- more search options --"),n(at).click(function(n){ae(),n.preventDefault()}),n("#sfcw_btn_courseLocalTransport").click(function(n){n.preventDefault(),ph()}),n(ii).click(function(n){n.preventDefault(),bh()}),n(so).click(function(n){n.preventDefault(),nu(),it&&f!=null&&f.length>15?ic(eu):ci()}),n(ri).click(function(n){n.preventDefault(),kh()});n(document).on("keypress",function(t){t.keyCode==27&&n(et).hide()});var i=n(rt),u=n(ot);if(i.length&&u.length)i.on("change",function(){u.empty(),br()});sfcw.map.mode&sfcw.map.MODE_INTEGRATED?n(gt).click(function(n){n.preventDefault(),g(1,!0)}):n(gt).hide(),n(ur).click(function(n){n.preventDefault(),g(0,!0)}),n(p).click(function(t){t.preventDefault(),n(p).hasClass("disabled")||g(2,!0)}),ft&&(n(ni).show(),n(ni).click(function(n){n.preventDefault(),g(3,!0)})),n(ar).click(function(n){n.preventDefault(),ai(!yt()),o(e)}),n(vr).click(function(n){n.preventDefault(),ai(!yt()),o(e)}),n(uo).click(function(t){t.preventDefault(),e=[],we(),he(),n(p).addClass("disabled"),r.event_removeFavouriteCourse!=null&&r.event_removeFavouriteCourse(-1)}),window.history&&window.history.pushState&&bt&&(window.onpopstate=function(n){if(n!=null&&n.state!=null&&n.state.courseId!=null)if(n.state.courseId=="-1"){var t=a("view");t&&t!=""||(t=0),g(t,!1)}else l(n.state.courseId,!1)}),n(eo).click(function(n){if(n.preventDefault(),!t)return null;t.TransportRouteName="",t.TransportRouteOperator="",t.Latitude=0,t.Longitude=0,t.RangeMeters=0,r.setFilters(t),r.search(t)}),n(oo).click(function(n){n.preventDefault(),gr(!1),r.search()})},ih=function(t){var i=null;i=v!="0"?sfcw.api.getActiveCourseLocationList("0",v):sfcw.api.getAreaList();var r=sfcw.api.getAwardingBodyList(),u=sfcw.api.getISCEDList(),f=sfcw.api.getAwardList(0),e=sfcw.api.getProviderList(),o=sfcw.api.getCourseCategoryList(),s=sfcw.api.getDeliveryCriteriaList();n.when(i,r,u,f,e,o,s).done(function(i,r,u,f,e,o,s){ht(n(rt),i[0].ReferenceList,!0),ht(n(di),r[0].ReferenceList,!0),rh(n(ki),u[0].ReferenceList,!0),uh(n(gi),f[0].ReferenceList,!0),ht(n(nr),e[0].ReferenceList,!0),ht(n(tr),o[0].ReferenceList,!0),ht(n(dt),s[0].ReferenceList,!0),br(function(){t!=null&&t()})})},ht=function(t,i,r){t.length&&(r&&t.append(n("<option />").val(0).text("All")),n.each(i,function(){t.append(n("<option />").val(this.Id).text(this.Description))}))},rh=function(t,i,r){i!=null&&(n.each(i,function(){if(this.Description=="Generic programmes and qualifications")return this.Description="Other General Learning",!1}),i.sort(function(n,t){return n.Description<t.Description?-1:n.Description>t.Description?1:0}),ht(t,i,r))},uh=function(t,i,r){t.length&&(r&&t.append(n("<option />").val(0).text("All")),n.each(i,function(){t.append(n("<option />").val(this.Id).text(this.Description.concat(" (",this.Code,")")))}))},br=function(t){var i=n(ot);if(!i.length){t!=null&&t();return}var r="0",u=v,f=n(rt);f.length&&(r=n(rt).val()),i.append(n("<option />").val(0).text("All")),sfcw.api.getActiveCourseLocationList(r,u,function(r){n.each(r,function(){i.append(n("<option />").val(this.Id).text(this.Description))}),t!=null&&t()})},fh=function(){var r=null,u=n(lu);u.length&&(wi=v!="0"?new fetchstore({getFnc:sfcw.api.getActiveCourseLocationList,getParams:["0",v]}):new fetchstore({getFnc:sfcw.api.getAreaList}),t.AreaIds!=null&&t.AreaIds!=""&&(r=t.AreaIds),u.fetchselect({store:wi,valueField:"Id",displayField:"Description",defaultAll:!1,selectedList:r,event_selectionChanged:function(t){var i=n(ir);i.length&&(t==null&&(t="0"),bi.getParameter=[t,"0"],i.fetchselect("refresh"))}}),r=null,u=n(ir),u.length&&(bi=new fetchstore({getFnc:sfcw.api.getActiveCourseLocationList,getParams:["0","0"]}),t.LocationIds!=null&&t.LocationIds!=""&&(r=t.LocationIds),u.fetchselect({store:bi,valueField:"Id",displayField:"Description",selectedList:r,defaultAll:!1}))),r=null,u=n(yu),u.length&&(ou=new fetchstore({getFnc:sfcw.api.getISCEDList}),t.ISCEDIds!=null&&t.ISCEDIds!=""&&(r=t.ISCEDIds),u.fetchselect({store:ou,valueField:"Id",displayField:"Description",selectedList:r})),r=null,u=n(pu),u.length&&(su=new fetchstore({getFnc:sfcw.api.getCourseCategoryList}),t.CategoryIds!=null&&t.CategoryIds!=""&&(r=t.CategoryIds),u.fetchselect({store:su,valueField:"Id",displayField:"Description",selectedList:r})),r=null,u=n(vu),u.length&&(hu=new fetchstore({getFnc:sfcw.api.getAwardList,getParams:0}),t.TargetAwardIds!=null&&t.TargetAwardIds!=""&&(r=t.TargetAwardIds),u.fetchselect({store:hu,valueField:"Id",displayField:"Description",selectedList:r})),r=null,u=n(au),u.length&&(cu=new fetchstore({getFnc:sfcw.api.getAwardingBodyList}),t.TargetAwardingBodyIds!=null&&t.TargetAwardingBodyIds!=""&&(r=t.TargetAwardingBodyIds),u.fetchselect({store:cu,valueField:"Id",displayField:"Description",selectedList:r}))},eh=function(){kr(),oc()||(gr(!1),dr(uu))},kr=function(){var u,o,i,f,e,r;t={Keywords:k(kt,""),ISCEDIds:k(ki,"0"),CategoryIds:k(tr,"0"),AreaIds:k(rt,"0"),LocationIds:k(ot,"0"),TargetAwardingBodyIds:k(di,"0"),TargetAwardIds:k(gi,"0"),DeliveryModeId:k(dt,"0"),Latitude:0,Longitude:0,RangeMeters:0,TransportRouteName:n(tf).val(),TransportRouteOperator:n(nf).val(),ResultCount:0},t.TransportRouteOperator==vt&&(t.Latitude=sfcw.map.position.coords.latitude,t.Longitude=sfcw.map.position.coords.longitude,t.RangeMeters=wr),t.ProviderIds=v,yi!="0"&&(t.ProviderIds=yi),u=n(nr),u.length&&(o=u.val(),o!="0"&&(t.ProviderIds=o)),u=n(ot),u.length||(v!=null&&v!="0"?(t.LocationIds=t.AreaIds,t.AreaIds="0"):t.LocationIds="0"),i=n(lu),i.length&&(f=i.fetchselect("getSelectedValues"),f&&f.length>0&&(t.AreaIds=f.join(", "))),i=n(ir),i.length&&(e=i.fetchselect("getSelectedValues"),e&&e.length>0&&(t.LocationIds=e.join(", "))),r=[],i=n(yu),i.length&&(r=i.fetchselect("getSelectedValues"),r&&r.length>0&&(t.ISCEDIds=r.join(", "))),y&&y!=""&&(t.ISCEDIds=y),i=n(pu),i.length&&(r=i.fetchselect("getSelectedValues"),r&&r.length>0&&(t.CategoryIds=r.join(", "))),i=n(vu),i.length&&(r=i.fetchselect("getSelectedValues"),r&&r.length>0&&(t.TargetAwardIds=r.join(", "))),i=n(au),i.length&&(r=i.fetchselect("getSelectedValues"),r&&r.length>0&&(t.TargetAwardingBodyIds=r.join(", "))),b!=0&&(b==1&&(t.IsCourseContracted="1"),b==2&&(t.IsCourseContracted="0"))},k=function(t,i){var r=n(t);return r.length?r.val():i},dr=function(i){u=1,n(cr).is(":visible")&&nu(),f=[];var e=n(ti.concat(" > tbody"));e.empty(),d(function(){i!=null&&i(),r.event_searchComplete!=null&&r.event_searchComplete(t)})},d=function(i){t==null&&(t={}),n(fr).html("Searching..."),n(st).html("Loading..."),it||n(et).show(),sfcw.api.searchCourseListSummaryAdvanced(u,tt,t,function(r){if(n(et).hide(),r!=null){oh(r.courses),u=r.pageCurrent,tt=r.pageSize,h=r.numberOfPages,it||(nc(),tc());var f="";f=r.totalCourses!=1?"".concat(r.totalCourses," courses found"):"".concat(r.totalCourses," course found"),n(fr).html(f),n(st).html(f),t.ResultCount=r.totalCourses,g(0,!0),i!=null&&i()}else n(fr).html(""),n(st).html("")})},g=function(i,f){var o="",e;n(cr).hide(),fu=i,n(rr).hide(),n(ku).hide(),n(du).hide(),n(gu).hide(),e="btn-default",ut&&(e="btn-secondary"),n(ur).removeClass("btn-primary").addClass(e),n(gt).removeClass("btn-primary").addClass(e),n(p).removeClass("btn-primary").addClass(e),n(ni).removeClass("btn-primary").addClass(e);switch(i){case 0:case"0":n(rr).show(),n(ur).addClass("btn-primary").removeClass(e),vi(!0),document.title="Course Finder";break;case 1:case"1":n(ku).show(),n(gt).addClass("btn-primary").removeClass(e),sfcw.map.showCourseResultsMap(function(){if(ft){if(!t.TransportRouteOperator||!t.TransportRouteName)return;var n=t.TransportRouteOperator.toLowerCase(),r=t.TransportRouteName.toLowerCase(),i=sfcw.map.PIN_BUS;n=="bac"&&(i=sfcw.map.PIN_BAC),n=="ir"&&(i=sfcw.map.PIN_TRAIN),n=="luas"&&r=="red"&&(i=sfcw.map.PIN_LUASR),n=="luas"&&r=="green"&&(i=sfcw.map.PIN_LUASG),n=="bikes"&&(i=sfcw.map.PIN_DBIKE),sfcw.map.resultsMap_LoadTransportStops(i,n,t.TransportRouteName)}vi(!0)}),document.title="Course Map";break;case 2:case"2":n(du).show(),n(p).addClass("btn-primary").removeClass(e),he(),vi(!1),document.title="Favourite Courses";break;case 3:case"3":n(gu).show(),n(ni).addClass("btn-primary").removeClass(e),vi(!1),document.title="Local Transport Connections",navigator.geolocation?sfcw.map.position==null&&(n(pr).show(),navigator.geolocation.getCurrentPosition(ke,function(t){n(pr).hide(),n(ee).show(),console.log(t.code)})):n(ee).show()}n(bu).show(),window.history&&window.history.pushState&&bt&&f&&(o="?search=".concat(u,"&view=",i),window.history.pushState({courseId:-1},"ignored",o)),r.event_resultView!=null&&r.event_resultView()},oh=function(t){var i="hidden-xs hidden-sm hidden-md",u="hidden-xs hidden-sm",e="hidden-xs",r;ut&&(i="hidden-md-down",u="hidden-sm-down",e="hidden-xs-down"),r=n(ti.concat(" > tbody")),it||(r.empty(),f=[]),n.each(t,function(){var c=this.CourseId,v=ru(c),t,a,o;$a_id=n("<a />",{id:v,href:"#",text:this.CourseId,on:{click:function(n){n.preventDefault(),l(c)}}}),$a_title=n("<a />",{href:"#",text:this.CourseTitle,on:{click:function(n){n.preventDefault(),l(c)}}});var y=hi(this.DateActualStart),h="",s="";if(this.DeliveryType!=null){h=this.DeliveryType.toLowerCase(),this.DeliveryTime!=null&&this.DeliveryTime.toLowerCase()=="evening"&&(h="evening");switch(h){case"parttime":s="P";break;case"fulltime":s="F";break;case"online":s="O";break;case"evening":s="E"}}for(t=[],o=0;o<ct.length;++o)switch(ct[o]){case ff:t.push(n("<td />",{"class":i}).append($a_id));break;case ef:t.push(n("<td />").append($a_title));break;case or:t.push(n("<td />",{"class":i}).text(this.CentreName));break;case sr:t.push(n("<td />",{"class":e}).text(this.CourseLocation));break;case of:t.push(n("<td />").text(y));break;case sf:t.push(n("<td />",{"class":u}).text(this.ISCEDDescription));break;case hr:t.push(n("<td />").append(n("<div />").text(s).addClass("type ".concat(h,"_bck"))));break;default:t.push(n("<td />"))}for(a=n("<tr />"),o=0;o<t.length;++o)a.append(t[o]);r.append(a),f.push(this.CourseId)})},he=function(){var t="hidden-xs hidden-sm hidden-md",r="hidden-xs hidden-sm",o="hidden-xs",s,i;ut&&(t="hidden-md-down",r="hidden-sm-down",o="hidden-xs-down"),s=n(ti.concat(" > tbody")),s.empty(),i=n(".sfcw-table-favourites".concat(" > tbody")),i.empty(),h=1,u=1,f=[],n.each(e,function(){var c=this.CourseId,v=ru(c),u,a,e;$a_id=n("<a />",{id:v,href:"#",text:this.CourseId,on:{click:function(n){n.preventDefault(),l(c)}}}),$a_title=n("<a />",{href:"#",text:this.CourseTitle,on:{click:function(n){n.preventDefault(),l(c)}}});var y=hi(this.DateActualStart),h="",s="";if(this.DeliveryType!=null){h=this.DeliveryType.toLowerCase(),this.DeliveryTime!=null&&this.DeliveryTime.toLowerCase()=="evening"&&(h="evening");switch(h){case"parttime":s="P";break;case"fulltime":s="F";break;case"online":s="O";break;case"evening":s="E"}}for(u=[],e=0;e<ct.length;++e)switch(ct[e]){case ff:u.push(n("<td />",{"class":t}).append($a_id));break;case ef:u.push(n("<td />").append($a_title));break;case or:u.push(n("<td />",{"class":t}).text(this.CentreName));break;case sr:u.push(n("<td />",{"class":o}).text(this.CourseLocation));break;case of:u.push(n("<td />").text(y));break;case sf:u.push(n("<td />",{"class":r}).text(this.ISCEDDescription));break;case hr:u.push(n("<td />").append(n("<div />").text(s).addClass("type ".concat(h,"_bck"))));break;default:u.push(n("<td />"))}for(a=n("<tr />"),e=0;e<u.length;++e)a.append(u[e]);i.append(a),f.push(this.CourseId)})},gr=function(t,i){t?(n(uf).safehtml(i),n(rf).slideDown()):(n(uf).empty(),n(rf).slideUp())},l=function(t,i){sh(t,function(){document.title=c.CourseTitle,r.event_courseView!=null&&r.event_courseView(t)}),s=-1;var u=0;n.each(f,function(){this==t&&(s=u),++u}),wh(),(i==null||i)&&window.history&&window.history.pushState&&bt&&window.history.pushState({courseId:t},"ignored","?sfcw-courseId=".concat(t)),ci()},nu=function(){g(fu,!0),ci()},sh=function(t,i){sfcw.api.getIndividualCourseDetail(t,function(r){o(r),r!=null&&(hh(r),n(bu).hide(),n(cr).show(),sfcw.map.mode&sfcw.map.MODE_INTEGRATED?sfcw.map.showCourseDetailMap(r):n(wo).hide(),eu=t),i!=null&&i()})},hh=function(t){var i,r,u;ce(t),lh(t),n(hf).removeClass("partime").removeClass("fulltime").removeClass("online").removeClass("evening"),n(cf).removeClass("partime_bck").removeClass("fulltime_bck").removeClass("online_bck").removeClass("evening_bck"),i=t.DeliveryType.toLowerCase(),t.DeliveryTime!=null&&t.DeliveryTime.toLowerCase()=="evening"&&(i="evening"),i!=null&&(r="".concat(i),u="".concat(i,"_bck"),n(hf).addClass(r),n(cf).addClass(u)),c=t,pe(yt()),t.IsOlcaEnabled?n("#sfcw_btn_applyNow").show():n("#sfcw_btn_applyNow").hide()},ce=function(t){var i,r,u,f,o,s,a,v,e,l,y,p,w;for(n(lr).safehtml(t.CourseId),n(bo).safehtml(t.CourseTitle),n(go).safehtml(t.LearnerEducation),n(ns).safehtml(t.LearnerAptitude),n(ts).safehtml(t.LearnerPreviousExperience),n(ss).safehtml(t.AccessTransferAndProgression),n(hs).safehtml(t.CourseCapacity),n(cs).safehtml(t.CourseCode),n(ls).safehtml(t.CourseFee),n(as).safehtml(t.DeliveryMode),n(vs).safehtml(t.DeliveryTime),n(ys).safehtml(t.DeliveryType),n(ps).safehtml(t.RegistrationFee),n(ws).safehtml(t.HoursPerWeek),n(bs).safehtml(t.TuitionType),n(ks).safehtml(t.WorkPlacementDays),n(ds).safehtml(t.WorkPlacementWeeks),i=t.CourseDescription,i!=null&&(i=i.replace(/[\uF0B7]/g,"* "),i=i.replace(/[\uE000-\uF8FF]/g,""),i=i.replace(/\n\r/g,"<br />"),i=i.replace(/\n/g,"<br />"),i=i.replace(/\r/g,"<br />")),n(ko).safehtml(i),r=n(is.concat(" > tbody")),r.empty(),n.each(t.Modules,function(){var t=this.ModuleTitle;this.awards==null?r.append(n("<tr />").append(n("<td />").text(t),n("<td />").text(""),n("<td />").text(""))):n.each(this.awards,function(){var u="",i="",f="",e="";this.AwardTitle!=null&&(u=this.AwardTitle),this.AwardCode!=null&&(i=this.AwardCode),this.AwardingBody!=null&&(f=this.AwardingBody),i!=null&&i!=""&&(e=u.concat(" (",i,")")),r.append(n("<tr />").append(n("<td />").text(t),n("<td />").text(e),n("<td />").text(f)))})}),u=t.LearningOutcomes,u&&u!=""?(u=u.replace(/\n/g,"<br />"),n(lf).safehtml(u),n(fe).show()):(n(lf).html(""),n(fe).hide()),f=t.FurtherDetails,f&&f!=""?(f=f.replace(/\n/g,"<br />"),n(af).safehtml(f),n(ue).show()):(n(af).html(""),n(ue).hide()),t.TargetAwardAchievable!=null&&t.TargetAwardAchievable.toLowerCase()!="yes"?n(vf).html("** See Course Content **"):n(vf).safehtml(t.TargetAwardTitle),n(rs).safehtml(t.CentreName),n(us).safehtml(t.VenueName),o=[],t.VenueAddress!=null&&(o=t.VenueAddress.split(",")),idx=0;idx<o.length&&idx<6;++idx)s=yf.concat(idx+1),n(s).safehtml(o[idx]);for(idx=o.length;idx<6;++idx)s=yf.concat(idx+1),n(s).empty();if(n(pf).empty(),n(".sfcw-course-transportLinks").hide(),t.VenueLocationLatitude!=null&&t.VenueLocationLongitude!=null){var h=t.VenueLocationLatitude.toString(),c=t.VenueLocationLongitude.toString(),b="(".concat(h.substr(0,h.indexOf(".")+5),", ",c.substr(0,c.indexOf(".")+5),")");n(pf).html("GPS ".concat(b)),ft&&(r=n("#sfcw_table_transport".concat(" > tbody")),r.empty(),h!="53.348489"&&c!="-6.231968"?(n(".sfcw-course-transportLinks").show(),n("#sfcw_btn_courseLocalTransport").show()):(n(".sfcw-course-transportLinks").hide(),n("#sfcw_btn_courseLocalTransport").hide()))}r=n(fs),r.empty(),t.DateActualStart!=null&&(a=hi(t.DateActualStart),r.append(n("<tr />").append(n("<td />").text("Start Date"),n("<td />").text(a)))),t.DateActualFinish!=null&&(v=hi(t.DateActualFinish),r.append(n("<tr />").append(n("<td />").text("End Date"),n("<td />").text(v)))),e="",t.DurationDays>0&&(e="".concat(t.DurationDays," Day")),t.DurationDays>1&&(e="".concat(t.DurationDays," Days")),t.DurationWeeks>0&&(e="".concat(t.DurationWeeks," Week")),t.DurationWeeks>1&&(e="".concat(t.DurationWeeks," Weeks")),r.append(n("<tr />").append(n("<td />").text("Duration"),n("<td />").text(e))),n(ie).hide(),t.Timetable!=null&&t.Timetable.length>0&&ch(t),l=n(os),l.empty(),t.VenueFacilities!=null&&n.each(t.VenueFacilities,function(){l.append(n("<li />").text(this.FacilityDescription))}),t.CourseContactFirstName!=null||t.CourseContactLastName!=null?n(wf).safehtml(t.CourseContactFirstName.concat(" ",t.CourseContactLastName)):n(wf).empty(),n(bf).empty(),t.CourseContactPhone!=null?(n(gf).show(),y=n("<a />",{href:"tel:".concat(t.CourseContactPhone),text:t.CourseContactPhone}),n(bf).append(y)):n(gf).hide(),n(kf).empty(),t.CourseContactEmail!=null?(n(ne).show(),p=n("<a />",{href:"mailto:".concat(t.CourseContactEmail),text:t.CourseContactEmail}),n(kf).append(p)):n(ne).hide(),n(df).empty(),t.OnlineApplicationURL!=null&&t.OnlineApplicationURL!=""?(n(te).show(),w=n("<a />",{href:t.OnlineApplicationURL,text:t.OnlineApplicationURL.substring(0,25).concat("...")}),n(df).append(w)):n(te).hide(),t.CourseFee>0?n(re).show():n(re).hide()},ch=function(t){var i=[{morning:!1,afternoon:!1,evening:!1},{morning:!1,afternoon:!1,evening:!1},{morning:!1,afternoon:!1,evening:!1},{morning:!1,afternoon:!1,evening:!1},{morning:!1,afternoon:!1,evening:!1},{morning:!1,afternoon:!1,evening:!1},{morning:!1,afternoon:!1,evening:!1},],r;for(n.each(t.Timetable,function(){var n=parseInt(this.DOW);i[n].morning=this.Morning,i[n].afternoon=this.Afternoon,i[n].evening=this.Evening}),r=n(es.concat(" > tbody")),r.empty(),day=1;day<7;++day)le(i,day,r);le(i,0,r),n(ie).show()},le=function(t,i,r){var u="<span class='glyphicon glyphicon-ok'><\/span>",s=n("<td />").text(ge[i]),f=n("<td />"),e=n("<td />"),o=n("<td />");t[i].morning&&f.html(u),t[i].afternoon&&e.html(u),t[i].evening&&o.html(u),r.append(n("<tr />").append(s,f,e,o))},lh=function(t){var i=[n(co).empty(),n(lo).empty(),n(ao).empty(),n(vo).empty(),n(yo).empty(),n(po).empty()];r.Course_Media.length!=0&&n.each(r.Course_Media,function(){this.courseId==t.CourseId&&(this.type==r.MEDIATYPE_IMAGE&&ah(t,this,i[this.position-1]),this.type==r.MEDIATYPE_VIDEO&&vh(this,i[this.position-1]),this.type==r.MEDIATYPE_HTML&&yh(this,i[this.position-1]))})},ah=function(t,i,r){r.append(n("<img />",{src:i.url,"class":"img-responsive",alt:t.CourseTitle,title:t.CourseTitle}))},vh=function(t,i){i.append(n("<div />",{"class":"embed-responsive embed-responsive-16by9"}).append(n("<iframe />",{"class":"embed-responsive-item",src:t.url})))},yh=function(t,i){o(t.url),n.ajax({url:t.url,type:"get",dataType:"html",success:function(n){i.append(n)},error:function(n){o("widget error loading custom content - HTML"),o(n)}})},ph=function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",r=0,t=[],i;ft&&(n("#sfcw_btn_courseLocalTransport > div").show(),n("#sfcw_btn_courseLocalTransport > span").hide(),i=n("#sfcw_table_transport".concat(" > tbody")),i.empty(),sfcw.api.getTransportRoutesAtLocation(c.VenueLocationLatitude,c.VenueLocationLongitude,wr,function(f){if(!f||!f.Routes||f.Routes.length==0){f||o(sfcw.api.lastErrorMessage),i.append(n("<tr />").append(n("<td />").text("None Found"))),n("#sfcw_btn_courseLocalTransport").hide(),n("#sfcw_btn_courseLocalTransport > div").hide(),n("#sfcw_btn_courseLocalTransport > span").show();return}var e=!1;n.each(f.Routes,function(i){var o=f.Routes[i],h=u[r],c=!0,l=n(ui.concat(" div[data-route='",o.RouteName,"']")),s;if(n.each(t,function(n){if(t[n].lat==o.Latitude&&t[n].lng==o.Longitude)return c=!1,t[n].description+="<br />".concat(o.RouteName),l.length>0&&(t[n].description+=" *",e=!0),!1}),c){s="Bus";switch(o.OperatorName.toLowerCase()){case"ir":if(o.RouteName.toLowerCase()=="dart")s="Train";else return!0;break;case"luas":s="Luas";break;case oi:s="Bike";break;case"bac":case"be":s="Bus";break;default:return!0}t.push({lat:o.Latitude,lng:o.Longitude,lbl:h,description:o.RouteName,operator:o.OperatorName,mode:s,distance:String(parseInt(o.Distance))}),sfcw.map.mode&sfcw.map.MODE_INTEGRATED&&sfcw.map.courseMap_ShowTransportMarker(o.Latitude,o.Longitude,h),++r}}),e&&i.append(n("<tr />").append(n("<td />",{colspan:"4"}).text("* Routes near my location"))),n.each(t,function(r){i.append(n("<tr />").append(n("<td />").text(t[r].lbl),n("<td />").text(t[r].mode),n("<td />").safehtml(t[r].description),n("<td />").text(t[r].distance+" meters")))}),n(".sfcw-course-transportLinks").show(),n("#sfcw_btn_courseLocalTransport").hide(),n("#sfcw_btn_courseLocalTransport > div").hide(),n("#sfcw_btn_courseLocalTransport > span").show()}))},wh=function(){s!=-1?(n(ii).show(),n(ri).show(),s==0&&u==1&&n(ii).hide(),s==f.length-1&&u==h&&n(ri).hide()):(n(ii).hide(),n(ri).hide())},bh=function(){s>0?(--s,l(f[s])):u>1&&(--u,d(function(){s=f.length-1,l(f[s])}))},kh=function(){s<f.length-1?(++s,l(f[s])):u<h&&(++u,d(function(){s=0,l(f[s])}))},dh=function(t){var e=[{cls:".legend_f",serviceId:"8"},{cls:".legend_p",serviceId:"9"},{cls:".legend_o",serviceId:"10"},{cls:".legend_e",serviceId:"5"}],i=li(t,"legend"),u,f;if(i!=null)if(i!=""){for(n.each(e,function(){n(this.cls).hide()}),u=0;u<i.length;++u)n(".legend_".concat(i[u])).show();n(er).show()}else n(er).hide(),n(hr).remove();else n(er).show();f=n(dt),f.length&&n.each(e,function(){var t=n(this.cls),i=this.serviceId;t.on("click",function(){f.val(i),r.search(null,uu),lt&&ae()});t.addClass("clickable")})},ae=function(){n(wu).slideToggle(400),lt?n(at).html("-- hide search options --"):n(at).html("-- more search options --"),lt=!lt},gh=function(n){var t=li(n,"pageSize");t!=null&&(t=="10"&&(tt=10),t=="25"&&(tt=25),t=="50"&&(tt=50))},nc=function(){var r=6,c=0,s=!1,f=1,l,e,t,o;for(h>r&&(s=!0,l=Math.round(r/2),f=u-l,e=h-f,e<r&&(f-=r-e),e=h-f,e==r&&(s=!1),f<1&&(f=1)),t=n(io),t.empty(),t.append(si(0)),t.append(si(1)),i=f;i<=h;i++)if(o=ve(i),t.append(o),++c,s&&c==r-1){h>r&&t.append(n("<span />").html("&nbsp;...&nbsp;")),o=ve(h),t.append(o);break}t.append(si(2)),t.append(si(3))},ve=function(t){var i=n("<input />",{type:"button",value:t,id:"sfcw_btn_page".concat(t),"class":"btn btn-default",on:{click:function(){u=this.value,d(null)}}});return u==t&&i.prop("disabled",!0),i},si=function(t){var i="",r=">",f;switch(t){case 0:i="_first",r="<<";break;case 1:i="_back",r="<";break;case 2:i="_forward",r=">";break;case 3:i="_last",r=">>"}f=n("<input />",{type:"button",value:r,id:"sfcw_btn_nav".concat(i),"class":"btn btn-default",on:{click:function(){this.value=="<"&&--u,this.value=="<<"&&(u=1),this.value==">"&&++u,this.value==">>"&&(u=h),d(null)}}});switch(t){case 0:case 1:u==1&&f.prop("disabled",!0);break;case 2:case 3:u==h&&f.prop("disabled",!0)}return f},tc=function(){var t=n(ro);t.empty(),t.append(tu(10)),t.append(tu(25)),t.append(tu(50))},tu=function(t){var i=n("<input />",{type:"button",value:t,id:"sfcw_btn_items".concat(t),"class":"btn",on:{click:function(){tt=this.value,d(null)}}});return tt==t?(i.addClass("btn-primary"),i.prop("disabled",!0)):i.addClass("btn-default"),i},hi=function(n){var i="",t;return n!=null&&(t=new Date(parseInt(n.substr(6))),i=iu(t.getDate()).concat("/",iu(t.getMonth()+1),"/",iu(t.getFullYear()))),i},iu=function(n){return n>9?n.toString():"0"+n},a=function(n){var t=window.location.href,r=t.indexOf("?"),u,f,i,e;if(r==-1)return null;for(u=t.indexOf("#"),t=u==-1?t.substr(r+1):t.substring(r+1,u),f=t.split("&"),i=0;i<f.length;i++)if(e=f[i].split("="),e[0].toLowerCase()==n.toLowerCase())return e[1];return null},ci=function(){var t=n("#sfcw_section_search"),i;t.length||(t=n("#sfcw")),i=t.offset().top,n(window).scrollTop(i)},ic=function(t){var i=n("#".concat(ru(t))),r;i.length&&(r=i.offset().top,n(window).scrollTop(r))},ru=function(n){return"sfcwcourse".concat(n)},o=function(n){pt&&(typeof n=="string"?window.console&&console.log("sfcw.widget::".concat(n)):window.console&&console.log(n))},rc=function(n){var i,r,t;if(n==null||(i=n.attr("class"),i==null||i==""))return null;for(r=i.split(" "),t=0;t<r.length;++t)if(r[t].substr(0,5).toLowerCase()=="sfcw-")return".".concat(r[t]);return null},wc=function(n){return n.replace(/\./g,"")},nt=function(n,t){return n==null||n==""?!1:n.toLowerCase().indexOf(t.toLowerCase())==-1?!1:!0},li=function(n,t){var i,r,f,u;return n==null||n==""?null:(i=n.toLowerCase().indexOf(t.toLowerCase()),i==-1)?null:(r=n.indexOf(";",i),r==-1)?null:(f=n.substring(i,r),u=f.split("="),u.length==1)?null:u[1]},uc=function(){n(rr).is(":visible")&&(pi||f!=null&&f.length!=0&&ye(n(st))&&u<h&&(++u,pi=!0,(t==null||t=={})&&kr(),d(function(){pi=!1})))},ye=function(t){if(t.length){var i=n(window).scrollTop(),u=i+n(window).height(),r=t.offset().top,f=r+t.height();return f<=u&&r>=i}},uu=function(){it&&ye(n(st))&&u<h&&(++u,d())},yt=function(){var t=!1;return n.each(e,function(){if(this.CourseId==c.CourseId)return t=!0,!1}),o(t),t},ai=function(t){var i;if(t)e.push(c),r.event_addFavouriteCourse!=null&&r.event_addFavouriteCourse(c.CourseId);else{for(i=n.inArray(c,e),i!=-1&&e.splice(i,1),i=0;i<e.length;++i)if(e[i].CourseId==c.CourseId){e.splice(i,1);break}r.event_removeFavouriteCourse!=null&&r.event_removeFavouriteCourse(c.CourseId)}pe(t),e.length==0?n(p).addClass("disabled"):n(p).removeClass("disabled"),we()},pe=function(t){t?(n(ar).hide(),n(vr).show()):(n(ar).show(),n(vr).hide())},we=function(){if(e.length>0){var t=[];n.each(e,function(){t.push(this.CourseId)}),wt.set(r.COOKIE_FAVOURITES,JSON.stringify(t),{expires:90,path:"/"})}else wt.remove(r.COOKIE_FAVOURITES,{path:"/"})},fc=function(){var n,t;e=[],n=wt.get(r.COOKIE_FAVOURITES),n!=null&&(t=JSON.parse(n),o(t),be(t,0))},be=function(t,i){o("loading fav course: "+t[i]),sfcw.api.getIndividualCourseDetail(t[i],function(r){if(r!=null&&e.push(r),i==t.length-1){e.length>0?n(p).removeClass("disabled"):n(p).addClass("disabled");return}++i,be(t,i)})},vi=function(i){var f=n(fo);if(!t||!t.TransportRouteName||!t.TransportRouteOperator||!i){f.slideUp();return}var e=n(".sfcw-icon-transportFilter"),o=n(".sfcw-label-transportFilter"),r="Showing courses on ",u=nh;switch(t.TransportRouteOperator.toLowerCase()){case"bac":case"be":u=fi,r="Showing courses on bus route ".concat(t.TransportRouteName);break;case"ir":t.TransportRouteName.toLowerCase()=="dart"&&(u=ei,r="Showing courses on the Dart line");break;case"luas":u=ei,r="Showing courses on the Luas ".concat(t.TransportRouteName," line");break;case vt:u=oe,r="Showing courses within 1.5K";break;case oi:u=se,r="Showing courses near Bike Stations"}e.removeClass().addClass("sfcw-icon-transportFilter glyphicon ".concat(u)),o.text(r),f.slideDown()},ke=function(t){n(pr).hide(),n(ui).empty(),sfcw.map.position=t,n(et).show(),sfcw.api.getTransportRoutesAtLocation(t.coords.latitude,t.coords.longitude,wr,function(t){if(o(t),!t||!t.Routes||t.Routes.length==0){t||o(sfcw.api.lastErrorMessage),n(yr).show(),n(et).hide();return}var i=0;n.each(t.Routes,function(n){if(t.Routes[n].CourseCount==0)return!0;i++;var r=fi;switch(t.Routes[n].OperatorName.toLowerCase()){case"bac":r=fi;break;case"be":r=fi;break;case"ir":if(t.Routes[n].RouteName.toLowerCase()=="dart")r=ei;else return!0;break;case"luas":r=ei;break;case vt:r=oe;break;case oi:r=se;break;default:return i--,!0}ec(r,t.Routes[n],function(){var i={TransportRouteName:t.Routes[n].RouteName,TransportRouteOperator:t.Routes[n].OperatorName};sfcw.widget.setFilters(i),sfcw.widget.search(i,function(){ci()})})}),i==0?n(yr).show():n(yr).hide(),n(et).hide()})},ec=function(t,i,r){var e=n("<div />",{"class":"col-sm-6 col-md-4"}),l=n("<div />").append(n("<span />",{src:t,"class":"glyphicon ".concat(t)})),u=i.RouteName,c;i.OperatorName==vt&&(u="Walking"),i.OperatorName==oi&&(u=i.RouteName=="dublin"?"Dublin Bikes":"Bike Share");var a=n("<div />").append(n("<h4 />",{"class":"pl-3",text:u})),v=n("<a />",{href:"#",text:"View Courses",on:{click:function(n){n.preventDefault(),r()}}}),y="".concat(i.CourseCount," Courses<br/ >"),o=n("<div />",{"class":"ml-auto"}).append(y);o.append(v);var s=n("<div />",{"class":"card-footer"}),f=i.StopName,h="<br />".concat(parseInt(i.Distance)," meters away");f==""&&(f=i.StopId),i.OperatorName==vt&&(f="My Location",h="<br />".concat(" Within 1.5K from here")),s.append(f.concat(h)),c=n("<div />",{"class":"card","data-route":i.RouteName,"data-op":i.OperatorName}).append(n("<div />",{"class":"card-block"}).append(n("<div />",{"class":"d-flex justify-content-start align-items-center"}).append(l).append(a).append(o))).append(s),e.append(c),n(ui).append(e)},oc=function(){var r,i,e;if(!ft||t.Keywords==null||t.Keywords==""||(r=t.Keywords.indexOf("="),i=t.Keywords.indexOf(";"),r==-1||i==-1))return!1;var s=t.Keywords.substr(0,r).trim(),u=t.Keywords.substring(r+1,i).trim(),f=t.Keywords.substr(i+1,t.Keywords.length-i+1);o(s),o(u),o(f),n(kt).val("");switch(s.toLowerCase()){case"":return!1;case"loc":return e={coords:{latitude:parseFloat(u),longitude:parseFloat(f)}},n(ui).html(""),o(e),ke(e),sfcw.map.markCurrentPosition(),!0;case"route":return sfcw.map.resultsMap_LoadTransportStops(sfcw.map.PIN_BUS,u,f),!0;default:return!0}return!0};return r.showCourse=function(n){l(n)},r.search=function(i,r){if(kr(),i!=null)for(var u in i)u.toLocaleLowerCase()!="providerid"&&(t[u]=i[u]);n(kt).val(t.Keywords),dr(r)},r.searchProvider=function(n,t,i){n==null&&(n={Keywords:""}),n.ProviderIds!=null&&(yi=n.ProviderIds),gr(!0,t),r.search(n,i)},r.showResults=function(){nu()},r.searchParameters=function(){return t},r.setFilters=function(t){var i,r,u;t!=null&&(t.Keywords!=null&&(i=n(kt),i.length&&i.val(t.Keywords)),t.ISCEDIds!=null&&w(ki,t.ISCEDIds),t.TargetAwardingBodyIds!=null&&w(di,t.TargetAwardingBodyIds),t.TargetAwardIds!=null&&w(gi,t.TargetAwardIds),t.ProviderIds!=null&&w(nr,t.ProviderIds),t.CategoryIds!=null&&w(tr,t.CategoryIds),t.DeliveryModeId!=null&&w(dt,t.DeliveryModeId),t.AreaIds!=null&&(r=n(ot),u=n(rt),w(rt,t.AreaIds),u.length&&r.length&&(r.empty(),br(function(){t.LocationIds!=null&&w(ot,t.LocationIds)}))),n(nf).val(t.TransportRouteOperator),n(tf).val(t.TransportRouteName))},w=function(t,i){var r=n(t);r.length&&r.val(i)},r.setCourseObject=function(n){n!=null&&(c=n),ce(c)},r.getCourseObject=function(){return c},r.enableLogging=function(n){pt=n},r.addCourseToolbarButton=function(t){var u=n(ho),f="btn btn-xs btn-default",i,r;t.cls==null&&(t.cls=f),i="12",t.cls.indexOf("btn-lg")!=-1&&(i="24"),t.cls.indexOf("btn-md")!=-1&&(i="18"),t.cls.indexOf("btn-sm")!=-1&&(i="14"),r=n("<button />",{id:t.id,"class":t.cls,style:t.style,on:{click:function(i){i.preventDefault();var r=n(lr).html();t.clickFn&&t.clickFn(r)}}}),t.img&&(r.append(n("<img />",{src:t.img,width:i,height:i,border:0})),t.text="&nbsp;"+t.text),r.append(t.text),u.append(r),u.append(n("<span />").html("&nbsp;"))},r.fetchApplyForCourse=function(n){var t=sfcw_location.fetch_url.concat("/hub/start?actionName=home&hash=applications/new/",n);window.open(t,"fetch")},r}($)