Viewing File: /people/testlab/www/testlab.com.pl/inc/cookies.js
/*
* Skrypt wyswietlajacy okienko z informacja o wykorzystaniu ciasteczek (cookies)
*/
function WHCreateCookie(name, value, days) {
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
var expires = "; expires=" + date.toGMTString();
document.cookie = name+"="+value+expires+"; path=/";
}
function WHReadCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
window.onload = WHCheckCookies;
function WHCheckCookies() {
if(WHReadCookie('cookies_accepted') != 'T') {
var message_container = document.createElement('div');
message_container.id = 'cookies-message-container';
var html_code = '<div id="cookies-message" style="padding: 10px 0px; font-size: 14px; line-height: 22px; border-bottom: 1px solid #a4a9ab, 208); text-align: center; position: fixed; bottom: 0px; background: rgb(239, 239, 239); background: rgba(239, 239, 239, 0.95); width: 100%; z-index: 999; color: #333333;">Ta strona używa ciasteczek (cookies), dzięki którym nasz serwis może działać lepiej. <a style="display: inline; background: none; color: #333333;" href="http://wszystkoociasteczkach.pl/">Dowiedz się więcej</a>.<a href="javascript:WHCloseCookiesWindow();" id="accept-cookies-checkbox" name="accept-cookies" style="background-color: #6d9fd1; padding: 5px 10px; color: #ffffff; border-radius: 4px; -moz-border-radius: 4px; -webkit-border-radius: 4px; display: inline-block; margin-left: 10px; text-decoration: none; cursor: pointer;">Rozumiem</a></div>';
message_container.innerHTML = html_code;
document.body.appendChild(message_container);
}
}
function WHCloseCookiesWindow() {
WHCreateCookie('cookies_accepted', 'T', 365);
document.getElementById('cookies-message-container').removeChild(document.getElementById('cookies-message'));
}
Back to Directory
File Manager