sfcw_location={name:"live",url:"https://widget.fetchcourses.ie",fetch_url:"https://www.fetchcourses.ie",service_url:"https://service.fetchcourses.ie/service/fetchcourse.svc/json",bundle:"sfcw_init"},sfcw=function(){var f={},e=!1,c="https://maps.googleapis.com/maps/api/js?key={key}&libraries=visualization&callback=sfcw.map.initAllMaps",l="AIzaSyDGK2uki8UUoiO_2C9s--Atvdd7ys6DrU8",r=sfcw_location.url,u=null,o=null,a=null;f.add_jquery=function(){if(typeof jQuery=="undefined"){n("jQuery is undefined - loading");var t=document.createElement("script");t.type="text/javascript",t.src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js",document.getElementsByTagName("head")[0].appendChild(t)}else n("jQuery is already defined"),typeof $=="undefined"&&(n("BUT $ is undefined"),$=jQuery)},f.load_the_widget=function(){var h;$=jQuery;var d=t("data-style-url"),f=t("data-providerid"),g=t("data-media-url"),nt=t("data-keyword"),w=t("data-flags"),tt=t("data-callback"),i=t("data-map"),s=t("data-googleapikey"),b=t("data-media"),k=t("data-style");u=r.concat("/content/html/"),o=r.concat("/content/css/"),a=r.concat("/content/js/"),v(w),h=d,k!=null&&(h=o.concat("style_".concat(k,".css"))),h!=null&&h!=""&&y(h),n("Loading the HTML sections"),p(w,i,function(){n("loading the widget..."),$.getScript(r.concat("/widget"),function(){var u,t;n("Widget loaded..."),(i=="integrated"||i=="independent"||i=="both")&&(n("mapOption ".concat(i)),sfcw.map.enableLogging(e),i=="integrated"&&(sfcw.map.mode=sfcw.map.MODE_INTEGRATED),i=="independent"&&(sfcw.map.mode=sfcw.map.MODE_INDEPENDENT),i=="both"&&(sfcw.map.mode=sfcw.map.MODE_INTEGRATED|sfcw.map.MODE_INDEPENDENT),(s==null||s=="")&&(s=l),sfcw.map.googleApiKey=s,u=c.replace(/{key}/i,s),n(f),f!=null&&f!=""&&(sfcw.map.providerIds=f),$.getScript(u)),sfcw.widget.init(f,nt,w,tt),t=g,b!=null&&b!=""&&(t=r.concat("/content/js/media_".concat(b,".js"))),t!=null&&$.getScript(t)})})};var v=function(n){var t=new Date;i(n,"bs4")?$("head").append('<link rel="stylesheet" type="text/css" href="'.concat(r,"/content/css/widget_bs4.css?nocache=".concat(t.getMilliseconds(),'" />'))):$("head").append('<link rel="stylesheet" type="text/css" href="'.concat(r,"/content/css/widget_bs3.css?nocache=".concat(t.getMilliseconds(),'" />')))},y=function(n){var t=new Date;$("head").append('<link rel="stylesheet" type="text/css" href="'.concat(n,"?nocache=",t.getMilliseconds(),'" />'))},p=function(t,r,f){var e=[],h=i(t,"bs4"),o,c;if(h?(n("Using Bootstrap 4"),i(t,"nosection1")||e.push(u.concat("widget_section_bs4_search.html")),i(t,"nosection2")||e.push(u.concat("widget_section_bs4_result.html")),i(t,"nosection3")||e.push(u.concat("widget_section_bs4_details.html"))):(i(t,"nosection1")||e.push(u.concat("widget_section_search.html")),i(t,"nosection2")||e.push(u.concat("widget_section_result.html")),i(t,"nosection3")||e.push(u.concat("widget_section_details.html"))),e.length==0){n("No HTML to load"),f!=null&&f();return}if(o=$("#sfcw"),o==null){n("Cannot find SFCW div for widget");return}o.empty(),c=i(t,"narrow"),s(e,0,c,h,f)},s=function(t,i,r,u,f){var e=new Date;$.ajax({url:t[i].concat("?nocache=",e.getMilliseconds()),type:"get",dataType:"html",success:function(n){var e=w(n,r,u);$("#sfcw").append(e),i<t.length-1?s(t,i+1,r,u,f):f!=null&&f()},error:function(t){n("loadHtmlSection load error"),n(t)}})},w=function(t,i,u){var o=["col-sm-5","col-md-5"],s=["col-md-4","col-lg-12"],h=["col-md-8","col-lg-12"],c=["col-sm-2","col-md-2"],e=["col-md-3","col-lg-12 hidden-sm hidden-xs"],l=["col-md-9","col-lg-12"],f;return u&&(e=["col-md-3","col-lg-12 hidden-sm-down"]),f=0,i&&(f=1,n("narrow option")),t=t.replace(/{col_main}/gi,o[f]),t=t.replace(/{col_form_label}/gi,s[f]),t=t.replace(/{col_form_control}/gi,h[f]),t=t.replace(/{col_btn}/gi,c[f]),t=t.replace(/{col_form_btn_label}/gi,e[f]),t=t.replace(/{col_form_btn_control}/gi,l[f]),t=t.replace(/{url_widget}/gi,r)},n=function(n){e&&(typeof n=="string"?window.console&&console.log("sfcw::".concat(n)):window.console&&console.log(n))},t=function(n){var t=null;return t=h(document.head.getElementsByTagName("script"),n),t==null&&(t=h(document.body.getElementsByTagName("script"),n)),t},h=function(n,t){var i=null;return n==null?null:($.each(n,function(){this.src!=null&&this.src.indexOf(sfcw_location.bundle)!=-1&&this.attributes!=null&&$.each(this.attributes,function(){this.nodeName!=null&&this.nodeName.toLowerCase()==t.toLowerCase()&&(i=this.value)})}),i)},i=function(n,t){return n==null||n==""?!1:n.toLowerCase().indexOf(t.toLowerCase())==-1?!1:!0},b=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 f}(),sfcw.add_jquery(),window.onload=sfcw.load_the_widget,function(n){if(typeof define=="function"&&define.amd)define(n);else if(typeof exports=="object")module.exports=n();else{var i=window.Cookies,t=window.Cookies=n();t.noConflict=function(){return window.Cookies=i,t}}}(function(){function n(){for(var n=0,r={},t,i;n<arguments.length;n++){t=arguments[n];for(i in t)r[i]=t[i]}return r}function t(i){function r(t,u,f){var o,h,l,e,s;if(typeof document!="undefined"){if(arguments.length>1){f=n({path:"/"},r.defaults,f),typeof f.expires=="number"&&(h=new Date,h.setMilliseconds(h.getMilliseconds()+f.expires*864e5),f.expires=h);try{o=JSON.stringify(u),/^[\{\[]/.test(o)&&(u=o)}catch(y){}return u=i.write?i.write(u,t):encodeURIComponent(String(u)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",u,f.expires?"; expires="+f.expires.toUTCString():"",f.path?"; path="+f.path:"",f.domain?"; domain="+f.domain:"",f.secure?"; secure":""].join("")}t||(o={});for(var a=document.cookie?document.cookie.split("; "):[],v=/(%[0-9A-Z]{2})+/g,c=0;c<a.length;c++){l=a[c].split("="),e=l.slice(1).join("="),e.charAt(0)==='"'&&(e=e.slice(1,-1));try{if(s=l[0].replace(v,decodeURIComponent),e=i.read?i.read(e,s):i(e,s)||e.replace(v,decodeURIComponent),this.json)try{e=JSON.parse(e)}catch(y){}if(t===s){o=e;break}t||(o[s]=e)}catch(y){}}return o}}return r.set=r,r.get=function(n){return r.call(r,n)},r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,i){r(t,"",n(i,{expires:-1}))},r.withConverter=t,r}return t(function(){})})