var fiwaw_linked_image_url = "http://widget.wildatlanticway.com/images/wild-atlantic-way-200-1.jpg";
var fiwaw_ambassador_widget_url = "http://widget.wildatlanticway.com/stage2/westcorkmusicliteraryfestival";
var fiwaw_css_href = "http://widget.wildatlanticway.com/site_includes/jqNiftyModal.css";
//----------------------------------------------------------
// Failte Ireland Wild Atlantic Way Widget Overlay Embed Call
// OSD.ie : 2013 - 2014
// - Checks for jQuery library and if undefined load library
// - Use jQuery noConflict
// - Load jqNiftyModal overlay library & CSS
// - Update default HTML img
// - Bind click to show widget in overlay
//----------------------------------------------------------
document.write("");
(function() {
// Localize jQuery variable
var wawjQuery;
var ie;
var gen_image = false;
/******** Load jQuery if not present *********/
//if (true) {
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.9.1') {
//console.log("01. Check : jQuery");
var script_tag = document.createElement('script');
script_tag.setAttribute("type", "text/javascript");
//script_tag.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js");
script_tag.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js");
if (script_tag.readyState) {
script_tag.onreadystatechange = function () { // For old versions of IE
if (this.readyState == 'complete' || this.readyState == 'loaded') {
scriptLoadHandler();
}
};
} else { // Other browsers
script_tag.onload = scriptLoadHandler;
}
// Try to find the head, otherwise default to the documentElement
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
//console.log("02. jQuery added to DOM");
} else {
// The jQuery version on the window is the one we want to use
wawjQuery = window.jQuery;
FIWAWmain();
}
/******** Called once jQuery has loaded ******/
function scriptLoadHandler() {
// Restore $ and window.jQuery to their previous values and store the
// new jQuery in our local jQuery variable
wawjQuery = window.jQuery.noConflict(true);
//console.log("03. jQuery noConflict");
//console.log("04. IE:"+ie);
// Call our main function
FIWAWmain();
}
/******** IE Checker ******/
//----------------------------------------------------------
//A short snippet for detecting versions of IE in JavaScript
//without resorting to user-agent sniffing
//----------------------------------------------------------
//If you're not in IE (or IE version is less than 5) then:
//ie === undefined
//If you're in IE (>=5) then you can determine which version:
//ie === 7; // IE7
//Thus, to detect IE:
//if (ie) {}
//And to detect the version:
//ie === 6 // IE6
//ie > 7 // IE8, IE9 ...
//ie < 9 // Anything less than IE9
//----------------------------------------------------------
//UPDATE: Now using Live NodeList idea from @jdalton
var ie = (function(){
var undef,
v = 3,
div = document.createElement('div'),
all = div.getElementsByTagName('i');
while (
div.innerHTML = '',
all[0]
);
return v > 4 ? v : undef;
}());
/******** Main function ********/
function FIWAWmain() {
// Include jqNiftyModal JS
if ((ie == "8") || (ie == "7") || (ie == "6")) {
(function(e){"use strict";var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;var b={init:function(m){t=this,t.jqNiftyModal.settings=e.extend({},t.jqNiftyModal.defaults,m),n=e("body"),r="body",i=t.jqNiftyModal.settings.TargetType,s="jqNMODefaultClass",o="jqNMMDefaultClass",u="."+s,a="."+o,f=t.jqNiftyModal.settings.Callback,l="",c="",t.jqNiftyModal.settings.OverlayClass+=" "+s,t.jqNiftyModal.settings.ModalClass+=" "+o,h=t.jqNiftyModal.settings.AnimateToCenterDelay,p=t.jqNiftyModal.settings.OpenCloseAnimationsDelay;t.jqNiftyModal.settings.ChainLoading=t.jqNiftyModal.settings.NestedModals?false:true;v=w.isHtml(t)?true:false;if(v||i=="element"){d=v?t:e(t.jqNiftyModal.settings.Target+":eq(-1)");if(!w.isHtml(d)||!d.length){return false}d=t.jqNiftyModal.settings.CloneTarget?d.clone(true):d.children().clone(true);d=e(d)}else if(i=="url"||i=="page"){d=t.jqNiftyModal.settings.Target}else if(i=="text"){d=e("