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="AIzaSyBp6RxdPRUGo4l88RgzNzjY0VH9U48Da3c",i=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/2.2.3/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 s;$=jQuery;var k=t("data-style-url"),u=t("data-providerid"),d=t("data-media-url"),g=t("data-keyword"),h=t("data-flags"),nt=t("data-callback"),r=t("data-map"),f=t("data-googleapikey"),a=t("data-media"),w=t("data-style");b(h),v(h),s=k,w!=null&&(s=o.concat("style_".concat(w,".css"))),s!=null&&s!=""&&y(s),n("Loading the HTML sections"),p(h,r,function(){n("loading the widget..."),$.getScript(i.concat("/widget"),function(){var o,t;n("Widget loaded..."),(r=="integrated"||r=="independent"||r=="both")&&(n("mapOption ".concat(r)),sfcw.map.enableLogging(e),r=="integrated"&&(sfcw.map.mode=sfcw.map.MODE_INTEGRATED),r=="independent"&&(sfcw.map.mode=sfcw.map.MODE_INDEPENDENT),r=="both"&&(sfcw.map.mode=sfcw.map.MODE_INTEGRATED|sfcw.map.MODE_INDEPENDENT),(f==null||f=="")&&(f=l),sfcw.map.googleApiKey=f,o=c.replace(/{key}/i,f),n(u),u!=null&&u!=""&&(sfcw.map.providerIds=u),$.getScript(o)),sfcw.widget.init(u,g,h,nt),t=d,a!=null&&a!=""&&(t=i.concat("/content/js/media_".concat(a,".js"))),t!=null&&$.getScript(t)})})};var v=function(n){var t=new Date;r(n,"bs4")?$("head").append('<link rel="stylesheet" type="text/css" href="'.concat(i,"/content/css/sfcw_bs4.css?nocache=".concat(t.getMilliseconds(),'" />'))):$("head").append('<link rel="stylesheet" type="text/css" href="'.concat(i,"/content/css/sfcw.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,i,f){var e=[],h=r(t,"bs4"),o,c;if(h?(n("Using Bootstrap 4"),r(t,"nosection1")||e.push(u.concat("widget_section_bs4_search.html")),r(t,"nosection2")||e.push(u.concat("widget_section_bs4_result.html")),r(t,"nosection3")||e.push(u.concat("widget_section_bs4_details.html"))):(r(t,"nosection1")||e.push(u.concat("widget_section_search.html")),r(t,"nosection2")||e.push(u.concat("widget_section_result.html")),r(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=r(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,r,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,r&&(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,i)},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)},r=function(n,t){return n==null||n==""?!1:n.toLowerCase().indexOf(t.toLowerCase())==-1?!1:!0},k=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},b=function(t){u=i.concat("/content/html/"),o=i.concat("/content/css/"),a=i.concat("/content/js/"),n("set_widget_url"),n(t),n(i)};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(){})})