/** * HEX COOKIES 1.1 * by Oriol Tendero - oriol[at]kasualstudios[dot]com - kasualstudios[dot]com * July 2014 * * Insert the script befor tag: * **/ /*CONFIGURATION*/ var hexcookieBase = "/HexCookies"; // "/HexCookies"; //Default root directory domain, or use full addres directory http://apps.hexderp.com/HexCookies var hexcookieLang = "en"; /*Default lang*/ var hexcookieLink = "#None"; /*Default policy link*/ var hexcookieMode = "confirm"; /*Default behaivour*/ var hexcookieLife = "year"; /*Default life span 1 year*/ var hexcookieMsg = ""; var hexcookieLinkTarget = ""; function HexInit() { /** * Test if a element is empty */ jQuery.extend( { empty: function(o) { if( !jQuery.isFunction(o) && ( o == null || o == undefined || o == "" || o.length == 0) ) { return true; } return false } }); /*Get ARGS*/ if(jQuery("script#hexcookie").length > 0){ if( !jQuery.empty(jQuery("script#hexcookie").attr("data-life")) ){ hexcookieLife = jQuery("script#hexcookie").attr("data-life"); } if( !jQuery.empty(jQuery("script#hexcookie").attr("data-mode")) ){ hexcookieMode = jQuery("script#hexcookie").attr("data-mode"); } if( !jQuery.empty(jQuery("script#hexcookie").attr("data-lang")) ){ hexcookieLang = jQuery("script#hexcookie").attr("data-lang"); } if( !jQuery.empty(jQuery("script#hexcookie").attr("data-link")) ){ hexcookieLink = jQuery("script#hexcookie").attr("data-link"); hexcookieLinkTarget = 'target="_blank"'; } if( !jQuery.empty(jQuery("script#hexcookie").attr("data-msg-selector")) ){ hexcookieMsg = jQuery("script#hexcookie").attr("data-msg-selector"); } } /*HEXCOOKIE cookie*/ if(jQuery.cookie("HexCookieSeed") != "1"){ /*Button text*/ var hexcookieButton = ""; if(hexcookieMode=="auto"){ if(hexcookieLang=="es"){ hexcookieButton = "Continuar navegando"; } else if(hexcookieLang=="ca"){ hexcookieButton = "Continuar navegant"; } else if(hexcookieLang=="en"){ hexcookieButton = "Continue browsing"; } else if(hexcookieLang=="pt"){ hexcookieButton = "Continuar a navegação"; } else if(hexcookieLang=="fr"){ hexcookieButton = "Continuer"; } else{ hexcookieButton = "Continue browsing"; } }else{ if(hexcookieLang=="es"){ hexcookieButton = "Aceptar cookies"; } else if(hexcookieLang=="ca"){ hexcookieButton = "Acceptar cookies"; } else if(hexcookieLang=="en"){ hexcookieButton = "Accept cookies"; } else if(hexcookieLang=="pt"){ hexcookieButton = "Aceita nossa cookies"; } else if(hexcookieLang=="fr"){ hexcookieButton = "Accepter cookies"; } else{ hexcookieButton = "Accept cookies"; } } if(hexcookieLang=="es"){ if(hexcookieMsg!=""){ jQuery.hcDisclaimer = ''; hexcookieLink = ""; /*Disable self information*/ }else{ jQuery.hcDisclaimer = ''; } jQuery.hcLegalNote = '

Cookies propias

El sitio web utiliza cookies (archivos de información que se guardan en el ordenador de quien accede a la página) en la medida imprescindible para el correcto funcionamiento y visualización del sitio web por parte del usuario. Las cookies utilizadas tienen una vigencia temporal limitada y en ningún caso se usan para recoger información de carácter personal.

Cookies de terceros

Google Analytics (_utma, _utmb, _utmc, _utmz)
Estas cookies se usan para recopilar información acerca del uso. Utilizamos esta información para mejorar el sitio web. Las cookies recopilan información en un formulario anónimo, incluyendo el numero de visitantes del sitio, desde donde vienen entre otros.

'; }else if(hexcookieLang=="ca"){ if(hexcookieMsg!=""){ jQuery.hcDisclaimer = ''; hexcookieLink = ""; /*Disable self information*/ }else{ jQuery.hcDisclaimer = ''; } jQuery.hcLegalNote = '

Cookies pròpies

El lloc web utilitza cookies (arxius d\'informació que es guarden a l\'ordinador de qui accedeix a la página) en la mesura imprescindible per al correcte funcionament i visualització del lloc web per part de l\'usuari. Les cookies utilitzades tenen una vigència temporal limitada i en cap cas es fan servir per recollir informació de carácter personal.

Cookies de tercers

Google Analytics (_utma, _utmb, _utmc, _utmz)
Aquestes cookies es fan servir per recopilar informació sobre de l\'ús. Utilitzem aquesta informació per millorar el lloc web. Les cookies recopilen informació en un formulari anònim, incloent el nombre de visitants del lloc, des d\'on vénen entre altres.

'; }else if(hexcookieLang=="en"){ if(hexcookieMsg!=""){ jQuery.hcDisclaimer = ''; hexcookieLink = ""; /*Disable self information*/ }else{ jQuery.hcDisclaimer = ''; } jQuery.hcLegalNote = '

Own Cookies

The site uses cookies (files of information stored in the computer of the person accessing the page) to the extent necessary for the correct operation and representation of the website by the user. These cookies have a limited temporal validity and in no case are used to collect personal information.

Third party cookies

Google Analytics ( _utma, _utmb, _utmc, _utmz)
These cookies are used to gather information about use. We use this information to improve the website. The cookies collect information in an anonymous form, including the number of visitors to the site, where they come from others.

'; }else if(hexcookieLang=="pt"){ if(hexcookieMsg!=""){ jQuery.hcDisclaimer = ''; hexcookieLink = ""; /*Disable self information*/ }else{ jQuery.hcDisclaimer = ''; } jQuery.hcLegalNote = '

Own Cookies

The site uses cookies (files of information stored in the computer of the person accessing the page) to the extent necessary for the correct operation and representation of the website by the user. These cookies have a limited temporal validity and in no case are used to collect personal information.

Third party cookies

Google Analytics ( _utma, _utmb, _utmc, _utmz)
These cookies are used to gather information about use. We use this information to improve the website. The cookies collect information in an anonymous form, including the number of visitors to the site, where they come from others.

'; }else if(hexcookieLang=="fr"){ if(hexcookieMsg!=""){ jQuery.hcDisclaimer = ''; hexcookieLink = ""; /*Disable self information*/ }else{ jQuery.hcDisclaimer = ''; } jQuery.hcLegalNote = '

Cookies propres

Le site utilise des cookies (fichiers d\'informations stockées dans l\'ordinateur de la personne Accès à la page) dans la mesure nécessaire pour le bon fonctionnement et la représentation du site par l\'utilisateur. Ces cookies ont une validité temporelle limitée et en aucun cas sont utilisés pour collecter le personnel de l\'information.

Autres cookies

Google Analytics ( _utma, _utmb, _utmc, _utmz)
Ces cookies sont utilisés pour recueillir des informations sur l\'utilisation. Nous utilisons ces informations pour améliorer le site. Les cookies recueillent des informations sous une forme anonyme, y compris le nombre de visiteurs sur le site, d\'où ils viennent d\'autres.

'; }else{ if(hexcookieMsg!=""){ jQuery.hcDisclaimer = ''; hexcookieLink = ""; /*Disable self information*/ }else{ jQuery.hcDisclaimer = ''; } jQuery.hcLegalNote = '

Own Cookies

The site uses cookies (files of information stored in the computer of the person accessing the page) to the extent necessary for the correct operation and representation of the website by the user. These cookies have a limited temporal validity and in no case are used to collect personal information.

Third party cookies

Google Analytics ( _utma, _utmb, _utmc, _utmz)
These cookies are used to gather information about use. We use this information to improve the website. The cookies collect information in an anonymous form, including the number of visitors to the site, where they come from others.

'; } /*Load styles*/ jQuery("body").append(''); /*Load html disclaimer*/ jQuery("body").append(jQuery.hcDisclaimer); /*Wait for CSS loaded*/ var hcCssListener = setInterval(function(){ if(jQuery("body #hexcookies").css("position")==="fixed"){ clearInterval(hcCssListener); /*FX IN*/ jQuery("body #hexcookies").attr("style",""); jQuery("body #hexcookies").css({ "margin-bottom":"-50px" }); jQuery("body #hexcookies").animate({ "margin-bottom":"0px" }, { duration: 250, queue: false }); /*Close button*/ jQuery("#hexcookies .hcOK").click(function(){ /*Accept cookies*/ if(hexcookieLife=="year"){ jQuery.cookie("HexCookieSeed","1",{ expires: 365, path: '/' }); }else{ var date = new Date(); var minutes = parseInt(hexcookieLife); date.setTime(date.getTime() + (minutes * 60 * 1000)); jQuery.cookie("HexCookieSeed","1",{ expires: date, path: '/' }); } /*Hide disclaimer*/ jQuery("body #hexcookies").animate({ "margin-bottom":"-1000px" }, { duration: 250, queue: false, complete:function(){ jQuery("body #hexcookies").remove(); } }); }); /*Show legal note*/ jQuery("#hexcookies .hcLegal").click(function(){ if(hexcookieLink.indexOf("#None") >= 0){ if(jQuery("#hexcookies .hcInfo").length == 0){ jQuery("#hexcookies .hcContent").append('
'+jQuery.hcLegalNote+'
'); } } }); /*Auto confirmation by following the navigation*/ if(hexcookieMode=="auto"){ /*Accept cookies after 5 seconds*/ setTimeout(function(){ jQuery.cookie("HexCookieSeed","1",{ expires: 365, path: '/' }); }, 5000); /*Auto fade out after 10 seconds*/ //setTimeout(function(){ jQuery("body #hexcookies").fadeOut(500); }, 10000); } } },50); } } /*jQuery loaded on DOM check*/ if(typeof jQuery=='undefined') { var TAG = document.getElementsByTagName("body")[0]; var jqTag = document.createElement('script'); jqTag.type = 'text/javascript'; jqTag.src = hexcookieBase+'/libs.hexcookies.js'; TAG.appendChild(jqTag); if(navigator.appName.indexOf("Internet Explorer")!=-1){ /*If IE*/ setTimeout(function(){ HexInit(); }, 1000); }else{ jqTag.onload = HexInit; } } else { var TAG = document.getElementsByTagName("body")[0]; var jqTag = document.createElement('script'); jqTag.type = 'text/javascript'; jqTag.src = hexcookieBase+'/libs.cookie.js'; TAG.appendChild(jqTag); jqTag.onload = HexInit; if(navigator.appName.indexOf("Internet Explorer")!=-1){ /*If IE*/ setTimeout(function(){ HexInit(); }, 1000); }else{ jqTag.onload = HexInit; } }