/*
Copyright 2012-2013 Silktide Ltd.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
*/
var cc =
{
version: '1.0.10',
jqueryversionrequired: '1.4.4',
initobj: false,
ismobile: false,
setupcomplete: false,
allasked: false,
checkedlocal: false,
frommodal: false,
hassetupmobile: false,
noclosewin: false,
closingmodal: false,
jqueryattempts: 0,
reloadkey: false,
forcereload: false,
allagree: true,
refreshOnConsent: true,
hideallsitesbutton: false,
cookies: {},
uniqelemid: 0,
executionblock: 0,
defaultCookies: { social: {}, analytics: {}},
cookieAnalytics: ['_ga', '_gat' ,'__utmt' ,'__utma' ,'__utmb' ,'__utmc' ,'__utmz'],
approved: {},
onlyshowbanneronce: false,
scriptdelay: 800,
bindfunctions: {},
eumemberstates: [
"BE",//"Belgium"
"BG",//"Bulgaria"
"CZ",//"Czech Republic"
"DK",//"Denmark"
"DE",//"Germany"
"EE",//"Estonia"
"IE",//"Ireland"
"EL",//"Grecia"
"GR",//"Greece"
"ES",//"Spain"
"FR",//"France"
"IT",//"Italy"
"CY",//"Cyprus"
"LV",//"Latvia"
"LT",//"Lithuania"
"LU",//"Luxembourg"
"HU",//"Hungary"
"MT",//"Malta"
"NL",//"Netherlands" (Paesi Bassi-Olanda)
"AT",//"Austria"
"PL",//"Poland"
"PT",//"Portugal"
"RO",//"Romania"
"SI",//"Slovenia"
"SK",//"Slovakia"
"FI",//"Finland"
"SE",//"Sweden"
"UK",// "Regno Unito"
"GB",// "United Kingdom"
"EU" //"Europe"
],
noteumemberstates: [
"A1",//"Anonymous Proxy"
"A2",//"Satellite Provider"
"O1",//"Other Country"
"AD",//"Andorra"
"AE",//"United Arab Emirates"
"AF",//"Afghanistan"
"AG",//"Antigua and Barbuda"
"AI",//"Anguilla"
"AL",//"Albania"
"AN",// antille olandesi
"AM",//"Armenia"
"AO",//"Angola"
"AP",//"Asia/Pacific Region"
"AQ",//"Antarctica"
"AR",//"Argentina"
"AS",//"American Samoa"
"AU",//"Australia"
"AW",//"Aruba"
"AX",//"Aland Islands"
"AZ",//"Azerbaijan"
"BA",//"Bosnia and Herzegovina"
"BB",//"Barbados"
"BD",//"Bangladesh"
"BF",//"Burkina Faso"
"BH",//"Bahrain"
"BI",//"Burundi"
"BJ",//"Benin"
"BL",//"Saint Bartelemey"
"BM",//"Bermuda"
"BN",//"Brunei Darussalam"
"BO",//"Bolivia"
"BQ",//"Bonaire, Saint Eustatius and Saba"
"BR",//"Brazil"
"BS",//"Bahamas"
"BT",//"Bhutan"
"BV",//"Bouvet Island"
"BW",//"Botswana"
"BY",//"Belarus"
"BZ",//"Belize"
"CA",//"Canada"
"CC",//"Cocos (Keeling) Islands"
"CD",//"Congo, The Democratic Republic of the"
"CF",//"Central African Republic"
"CG",//"Congo"
"CH",//"Switzerland"
"CI",//"Cote d'Ivoire"
"CK",//"Cook Islands"
"CL",//"Chile"
"CM",//"Cameroon"
"CN",//"China"
"CO",//"Colombia"
"CR",//"Costa Rica"
"CS",//"Serbia e Montenegro"
"CU",//"Cuba"
"CV",//"Cape Verde"
"CW",//"Curacao"
"CX",//"Christmas Island"
"DJ",//"Djibouti"
"DM",//"Dominica"
"DO",//"Dominican Republic"
"DZ",//"Algeria"
"EC",//"Ecuador"
"EG",//"Egypt"
"EH",//"Western Sahara"
"ER",//"Eritrea"
"ET",//"Ethiopia"
"FJ",//"Fiji"
"FK",//"Falkland Islands (Malvinas)"
"FM",//"Micronesia, Federated States of"
"FO",//"Faroe Islands"
"GA",//"Gabon"
"GD",//"Grenada"
"GE",//"Georgia"
"GF",//"French Guiana"
"GG",//"Guernsey"
"GH",//"Ghana"
"GI",//"Gibraltar"
"GL",//"Greenland"
"GM",//"Gambia"
"GN",//"Guinea"
"GP",//"Guadeloupe"
"GQ",//"Equatorial Guinea"
"GS",//"South Georgia and the South Sandwich Islands"
"GT",//"Guatemala"
"GU",//"Guam"
"GW",//"Guinea-Bissau"
"GY",//"Guyana"
"HK",//"Hong Kong"
"HM",//"Heard Island and McDonald Islands"
"HN",//"Honduras"
"HR",//"Croatia"
"HT",//"Haiti"
"ID",//"Indonesia"
"IL",//"Israel"
"IM",//"Isle of Man"
"IN",//"India"
"IO",//"British Indian Ocean Territory"
"IQ",//"Iraq"
"IR",//"Iran, Islamic Republic of"
"IS",//"Iceland"
"JE",//"Jersey"
"JM",//"Jamaica"
"JO",//"Jordan"
"JP",//"Japan"
"KE",//"Kenya"
"KG",//"Kyrgyzstan"
"KH",//"Cambodia"
"KI",//"Kiribati"
"KM",//"Comoros"
"KN",//"Saint Kitts and Nevis"
"KP",//"Korea, Democratic People's Republic of"
"KR",//"Korea, Republic of"
"KW",//"Kuwait"
"KY",//"Cayman Islands"
"KZ",//"Kazakhstan"
"LA",//"Lao People's Democratic Republic"
"LB",//"Lebanon"
"LC",//"Saint Lucia"
"LI",//"Liechtenstein"
"LK",//"Sri Lanka"
"LR",//"Liberia"
"LS",//"Lesotho"
"LY",//"Libyan Arab Jamahiriya"
"MA",//"Morocco"
"MC",//"Monaco"
"MD",//"Moldova, Republic of"
"ME",//"Montenegro"
"MF",//"Saint Martin"
"MG",//"Madagascar"
"MH",//"Marshall Islands"
"MK",//"Macedonia"
"ML",//"Mali"
"MM",//"Myanmar"
"MN",//"Mongolia"
"MO",//"Macao"
"MP",//"Northern Mariana Islands"
"MQ",//"Martinique"
"MR",//"Mauritania"
"MS",//"Montserrat"
"MU",//"Mauritius"
"MV",//"Maldives"
"MW",//"Malawi"
"MX",//"Mexico"
"MY",//"Malaysia"
"MZ",//"Mozambique"
"NA",//"Namibia"
"NC",//"New Caledonia"
"NE",//"Niger"
"NF",//"Norfolk Island"
"NG",//"Nigeria"
"NI",//"Nicaragua"
"NO",//"Norway"
"NP",//"Nepal"
"NR",//"Nauru"
"NU",//"Niue"
"NZ",//"New Zealand"
"OM",//"Oman"
"PA",//"Panama"
"PE",//"Peru"
"PF",//"French Polynesia"
"PG",//"Papua New Guinea"
"PH",//"Philippines"
"PK",//"Pakistan"
"PM",//"Saint Pierre and Miquelon"
"PN",//"Pitcairn"
"PR",//"Puerto Rico"
"PS",//"Palestinian Territory"
"PW",//"Palau"
"PY",//"Paraguay"
"QA",//"Qatar"
"RE",//"Reunion"
"RS",//"Serbia"
"RU",//"Russian Federation"
"RW",//"Rwanda"
"SA",//"Saudi Arabia"
"SB",//"Solomon Islands"
"SC",//"Seychelles"
"SD",//"Sudan"
"SG",//"Singapore"
"SH",//"Saint Helena"
"SJ",//"Svalbard and Jan Mayen"
"SL",//"Sierra Leone"
"SM",//"San Marino"
"SN",//"Senegal"
"SO",//"Somalia"
"SR",//"Suriname"
"SS",//"South Sudan"
"ST",//"Sao Tome and Principe"
"SV",//"El Salvador"
"SX",//"Sint Maarten"
"SY",//"Syrian Arab Republic"
"SZ",//"Swaziland"
"TC",//"Turks and Caicos Islands"
"TD",//"Chad"
"TF",//"French Southern Territories"
"TG",//"Togo"
"TH",//"Thailand"
"TJ",//"Tajikistan"
"TK",//"Tokelau"
"TL",//"Timor-Leste"
"TM",//"Turkmenistan"
"TN",//"Tunisia"
"TO",//"Tonga"
"TR",//"Turkey"
"TT",//"Trinidad and Tobago"
"TV",//"Tuvalu"
"TW",//"Taiwan"
"TZ",//"Tanzania, United Republic of"
"UA",//"Ukraine"
"UG",//"Uganda"
"UM",//"United States Minor Outlying Islands"
"US",//"United States"
"UY",//"Uruguay"
"UZ",//"Uzbekistan"
"VA",//"Città del Vaticano"
"VC",//"Saint Vincent e Grenadine"
"VE",//"Venezuela"
"VI",//"Isole Vergini Americane"
"VG",//"Isole Vergini Britanniche"
"VN",//"Vietnam"
"VU",//"Vanuatu"
"WF",//"Wallis e Futuna"
"WS",//"Samoa"
"YE",//"Yemen"
"YT",//"Mayotte"
"ZA",//"Sud Africa"
"ZM",//"Zambia"
"ZW"//"Zimbabwe"
],
settings: {
style: "dark",
bannerPosition: "top",
tagPosition: 'bottom-right',
hideprivacysettingstab: 1,
hidepopupprivatesettings: 1,
onlyshowwithineu: 1,
httpserviceapilocation:'http://api.wipmania.com/jsonp?',
consenttype: 'explicit',
confirmClick:1,
confirmScroll:1,
idPageInformation:47,
cookieExpire:365
},
strings: {
jqueryWarning: "Developer: Caution! You need to use jQuery 1.4.4 or higher.",
invalidKeyWarning: "Developer: Warning! You must provide a valid API.",
socialDefaultTitle: "Social media",
analyticsDefaultTitle: "Analytics",
socialDefaultDescription: "Facebook, Twitter and other social websites need to know who you are to work properly.",
analyticsDefaultDescription: "We anonymously measure your use of this website to improve your experience.",
notificationTitle: "Durch die weitere Nutzung der Seite stimmen Sie der Verwendung von Cookies zu.",
seeDetails: "see details",
seeDetailsImplicit: "change your settings",
hideDetails: "hide details",
savePreference: 'Save preference',
allowCookies: 'Akzeptieren',
allowCookiesImplicit: 'Close',
privacySettings: "Privacy settings",
privacySettingsDialogTitleA: "Privacy settings",
privacySettingsDialogSubtitle: "Some features of this website need your consent to remember who you are.",
closeWindow: "Close window",
preferenceConsent: "I consent",
preferenceDecline: "I decline",
notificationTitleImplicit: "We use cookies to ensure you get the best experience on our website",
informationCookies:"Weitere Informationen",
textOff: "Bitte akzeptieren Sie Cookies um alle Funktionen nutzen zu können."
},
geturlparameter: function (name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if (results == null)
return false;
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
},
isfunction: function (functionToCheck) {
var getType = {};
return functionToCheck && getType.toString.call(functionToCheck) == '[object Function]';
},
setup: function () {
jQuery.each(cc.bindfunctions, function (key, value) {
for (i = 0; i < value.length; i++) {
jQuery(document).bind("cc_" + key, value[i]);
}
});
verstr = jQuery().jquery;
parts = verstr.split('.');
versionRequired = cc.jqueryversionrequired.split('.');
jqueryOk = true;
for (i = 0; i < parts.length && i < versionRequired.length; i++) {
currentpart = parseInt(parts[i]);
requiredpart = parseInt(versionRequired[i]);
if (currentpart < requiredpart) {
/* Unsatisfied - this part of the version string is less than the version we require */
jqueryok = false;
break;
}
if (currentpart > requiredpart) {
/* Satisfied - this part of the version string is greater than the version we require */
break;
}
/* This version is the same as the one we require. Check the next part of the version number. */
}
if (!jqueryOk) {
alert(cc.strings.jqueryWarning);
}
jQuery.each(cc.defaultCookies, function (key, value) {
if (key == "social") {
cc.defaultCookies[key].title = cc.strings.socialDefaultTitle;
cc.defaultCookies[key].description = cc.strings.socialDefaultDescription;
}
else if (key == "analytics") {
cc.defaultCookies[key].title = cc.strings.analyticsDefaultTitle;
cc.defaultCookies[key].description = cc.strings.analyticsDefaultDescription;
}
});
jQuery.each(cc.initobj.cookies, function (key, value) {
if (!value.title) {
if (key == "social") {
cc.initobj.cookies[key].title = cc.strings.socialDefaultTitle;
}
else if (key == "analytics") {
cc.initobj.cookies[key].title = cc.strings.analyticsDefaultTitle;
}
else {
cc.initobj.cookies[key].title = cc.strings.defaultTitle;
}
}
if (!value.description) {
if (key == "social") {
cc.initobj.cookies[key].description = cc.strings.socialDefaultDescription;
}
else if (key == "analytics") {
cc.initobj.cookies[key].description = cc.strings.analyticsDefaultDescription;
}
else {
cc.initobj.cookies[key].description = cc.strings.defaultDescription;
}
}
if (!value.defaultstate) {
cc.initobj.cookies[key].defaultstate = "on";
}
cc.initobj.cookies[key].asked = false;
cc.initobj.cookies[key].approved = false;
cc.initobj.cookies[key].executed = false;
cc.executeoff(key);
});
testmode = cc.geturlparameter('cctestmode');
if (testmode == 'accept' || testmode == 'decline') {
cc.settings.testmode = testmode;
}
/* if (cc.settings.disableallsites) {
cc.hideallsitesbutton = true;
}*/
for (var attrname in cc.initobj.cookies) {
cc.cookies[attrname] = cc.initobj.cookies[attrname];
if (cc.settings.testmode == "accept") {
cc.approved[attrname] = "yes";
}
if (cc.settings.testmode == "decline") {
cc.approved[attrname] = "no";
}
}
},
initialise: function (obj) {
/* controlla che l'oggetto abbia il suo vettore di lingua valorizzato
altrimenti utilizza quello di default
*/
var stringLanguage = cc.messageLanguage();
if (stringLanguage != '' && stringLanguage != 'error')
obj.strings = stringLanguage;
cc.initobj = obj;
if (obj.settings !== undefined) {
for (var attrname in obj.settings) {
this.settings[attrname] = obj.settings[attrname];
}
}
if (obj.strings !== undefined) {
for (var attrname in obj.strings) {
this.strings[attrname] = obj.strings[attrname];
}
}
cc.settings.style = "cc-" + cc.settings.style;
cc.settings.bannerPosition = "cc-" + cc.settings.bannerPosition;
if (window.jQuery) {
cc.setupcomplete = true;
cc.setup();
}
},
insertscript: function (script) {
var newfile = document.createElement('script');
newfile.setAttribute("type", "text/javascript");
newfile.setAttribute("src", script);
document.getElementsByTagName("head")[0].appendChild(newfile);
},
insertscripttag: function (content) {
var newfile = document.createElement('script');
newfile.setAttribute("type", "text/javascript");
newfile.innerHTML = content;
document.getElementsByTagName("head")[0].appendChild(newfile);
},
checklocal: function () {
this.checkedlocal = true;
jQuery.each(cc.cookies, function (key, value) {
cookieval = cc.getcookie('cc_' + key);
if (cookieval) {
cc.approved[key] = cookieval;
}
});
this.checkapproval();
},
deletecookie: function (key) {
date = new Date();
date.setDate(date.getDate() - 1);
document.cookie = escape("cc_" + key) + '=; path=/; expires=' + date;
},
removecookieAnalytics: function (key, sPath, sDomain) {
for (var i = 0; i < cc.cookieAnalytics.length; i++){
if (key == cc.cookieAnalytics[i]){
document.cookie = key + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
}
}
},
reloadifnecessary: function () {
if (cc.refreshOnConsent || cc.ismobile || cc.forcereload) {
setTimeout("location.reload(true);", 0);
}
},
onkeyup: function (e) {
if (e.keyCode == 27) {
cc.closemodals();
}
},
closemodals: function () {
if (!cc.closingmodal) {
if (cc.noclosewin) {
cc.noclosewin = false;
} else {
if (jQuery('#cc-modal').is(":visible")) {
jQuery('#cc-modal .cc-modal-closebutton a').click();
}
if (jQuery('#cc-settingsmodal').is(":visible")) {
jQuery('#cc-settingsmodal #cc-settingsmodal-closebutton a').click();
}
}
}
},
showbanner: function () {
jQuery('#cc-tag').fadeOut(null, function () {
jQuery(this).remove();
});
jQuery('#cc-notification').remove();
if (cc.ismobile) {
cc.setupformobile();
jQuery('head').append('');
}
data = '