|
<?php echo $this->Html->scriptBlock(' |
|
attach(window, "load", init); |
|
function attach(elm, event, callback) { // @see http://stackoverflow.com/questions/9434/how-do-i-add-an-additional-window-onload-event-in-javascript |
|
if (elm.addEventListener) { // W3C standard |
|
window.addEventListener(event, callback, false); |
|
} else if (elm.attachEvent) { // Microsoft |
|
elm.attachEvent("on" + event, callback); |
|
} |
|
} |
|
|
|
function init(){ |
|
EU.CookieManager.init({ |
|
expires: 20, |
|
cookie_prefix: "EU_", |
|
optin_cookie_name: "OPTIN", |
|
test:false, |
|
idle:0, |
|
link: "/vec-o-piskotkih", |
|
defaultValue:4, |
|
assosiatedCookies: { |
|
"strict" : ["a"], |
|
"functional": ["b", "c"], |
|
"targeting": ["d", "e", "f"] |
|
} |
|
}); |
|
$("#EU_OPIN_SETTINGS_PAGE").click(function(){ |
|
EU.CookiePreferenceUI.toggleOptions(); |
|
$("#strict").trigger("click"); |
|
$("#cokkie-options input:eq(0)").attr("checked", "checked"); |
|
}); |
|
}' |
|
); |
|
?> |
|
|
|
<?php if(Configure::read('thisServer') == 'live') { ?> |
|
<script type="text/javascript"> |
|
var selectedLevel = EU.Cookie.getLevel(); |
|
if ( selectedLevel === '3' || selectedLevel === '4') { |
|
var _gaq = _gaq || []; |
|
_gaq.push(['_setAccount', 'TRACKING_CODE']); |
|
_gaq.push(['_trackPageview']); |
|
|
|
(function() { |
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
|
})(); |
|
} |
|
</script> |
|
<?php } ?> |