|
<script type="text/javascript"> |
|
function setCookie(name, value, expires, path, domain, secure) { |
|
var today = new Date(); |
|
today.setTime( today.getTime() ); |
|
|
|
if ( expires ) { |
|
expires = expires * 1000 * 60 * 60 * 24; |
|
} |
|
var expires_date = new Date( today.getTime() + (expires) ); |
|
|
|
document.cookie = name + '=' + escape( value ) + |
|
( ( expires ) ? ';expires=' + expires_date.toGMTString() : '' ) + |
|
( ( path ) ? ';path=' + path : '' ) + |
|
( ( domain ) ? ';domain=' + domain : '' ) + |
|
( ( secure ) ? ';secure' : '' ); |
|
} |
|
|
|
function getCookie(name) { |
|
var start = document.cookie.indexOf( name + "=" ); |
|
var len = start + name.length + 1; |
|
|
|
if ( (!start) && (name != document.cookie.substring(0, name.length)) ) { |
|
return null; |
|
} |
|
if ( start == -1 ) return null; |
|
|
|
var end = document.cookie.indexOf( ';', len ); |
|
if ( end == -1 ) end = document.cookie.length; |
|
|
|
return JSON.parse(unescape(document.cookie.substring(len, end))); |
|
} |
|
|
|
(function() { // Load whole script at end of body otherwise will not work |
|
function hideStuff(id) { |
|
document.getElementById(id).style.display = 'none'; |
|
} |
|
|
|
if ( getCookie('isVisited') == null ) { |
|
|
|
var cookieWrapper = '<div id="cookie-wrapper" style="display: block; position: fixed; width: 100%; bottom: 0; color: #FFF; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.6; background: #222222; z-index: 9999;">\ |
|
<div style="padding: 20px 80px;">\ |
|
<img id="cookie-close" onclick="hideStuff(id)" src="cookie-close.gif" width="28" height="28" style="display: block; position: absolute; right: 0; top: 0; cursor: pointer; z-index: 9999;" />\ |
|
\ |
|
<div style="margin-bottom: 10px; font-size: 18px; text-transform: uppercase;">\ |
|
Cookie Preferences\ |
|
</div>\ |
|
<p style="margin-bottom: 10px;">\ |
|
We uses cookies to deliver the best possible web experience. By continuing and using this site, you agree that we may store and access cookies on your device in accordance with our <a href="#" target="_blank" style="color: #FFFFFF;">cookie policy</a>.\ |
|
</p>\ |
|
<img id="cookie-continue" src="cookie-button.gif" width="91" height="27" style="cursor: pointer;" />\ |
|
</div>\ |
|
</div>'; |
|
|
|
document.body.innerHTML += cookieWrapper; |
|
|
|
document.getElementById('cookie-close').addEventListener('click', function() { |
|
hideStuff('cookie-wrapper'); |
|
}); |
|
document.getElementById('cookie-continue').addEventListener('click', function() { |
|
hideStuff('cookie-wrapper'); |
|
}); |
|
|
|
setCookie('isVisited', true); |
|
}; |
|
})(); |
|
</script> |