function setcookie(cookieName,cookieValue,nDays) { var today = new Date(); var expire = new Date(); if (nDays==null || nDays==0) nDays=1; expire.setTime(today.getTime() + 3600000*24*nDays); document.cookie = cookieName+"="+escape(cookieValue) + ";path=/;domain=.adcash.com;expires="+expire.toGMTString(); } var PersistentStorage = (function() { var storage = null; var storagecode = null; var storage_flash = null; var storagecode_flash = null; var backends = { localstorage: { name: "localstorage", init: function() { try { return window.localStorage ? this : null; } catch (e) { return null; } }, get: function(key) { return localStorage.getItem(key); }, set: function(key, value) { try { localStorage.setItem(key, value); } catch (e) { return false; } return true; }, unset: function(key) { try { return !!localStorage.removeItem(key); } catch (e) { } return false; }, is_ready: function() { return true; } }, globalstorage: { name: "globalstorage", init: function() { try { return (typeof(window.globalStorage) !== "undefined" && (storage = globalStorage[document.domain])) ? this : null; } catch (e) { return null; } }, get: function(key) { var value_ = storage.getItem(key); return value_ ? value_.value : null; }, set: function(key, value) { try { storage.setItem(key, value); } catch (e) { return false; } return true; }, unset: function(key) { try { return !!storage.removeItem(key); } catch (e) { } return false; }, is_ready: function() { return true; } }, activex: { name: "activex", init: function() { if (!window.ActiveXObject) { return null; } with (storage = document.createElement("div")) { id = "__pss__"; style.display = "none"; addBehavior("#default#userData"); } document.body.appendChild(storage); return this; }, get: function(key) { try { storage.load("ps"); } catch (e) { return null; } return storage.getAttribute(key); }, set: function(key, value) { try { storage.setAttribute(key, value); storage.save("ps"); } catch (e) { return false; } return true; }, unset: function(key) { return this.set(key, undefined); }, is_ready: function() { return true; } }, flash: { name: "flash", swfuri: "storage.swf", init: function() { if (navigator.mimeTypes.length > 0) { if (typeof(navigator.mimeTypes ["application/x-shockwave-flash"]) === "undefined" || !navigator.mimeTypes["application/x-shockwave-flash"]. enabledPlugin) { return null; } } else if (window.ActiveXObject) { try { new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch (e) { return null; } } else { return null; } if (navigator.appName.indexOf("Microsoft") != -1) { storage_flash = window['storage_flash']; } else { storage_flash = document.getElementById('storage_flash_embed'); } return this; }, get: function(key) { if (storage_flash && storage_flash.get) return storage_flash.get(key) || null; return ''; }, set: function(key, value) { if (storage_flash && storage_flash.set) return storage_flash.set(key, value); return ''; }, unset: function(key) { return storage_flash.unset(key); }, is_ready: function() { return storage.get !== null; // return !!storage_flash.unset; } } }; function init() { if ((storagecode = (backends.localstorage.init() || backends.globalstorage.init() || backends.activex.init()))) { storagecode.wait_until_ready = this.wait_until_ready; } if ((storagecode_flash = (backends.flash.init()))) { storagecode_flash.wait_until_ready_flash = this.wait_until_ready_flash; } var res = Array(storagecode, storagecode_flash); return res; } function wait_until_ready(cb) { if (storagecode.is_ready() !== true) { var __method = wait_until_ready; window.setTimeout(function() { return __method.apply(__method, [ cb ]); }, 100); return false; } return cb.call(); } function wait_until_ready_flash(cb) { if (storagecode_flash.is_ready() !== true || storage_flash == null) { var __method = wait_until_ready_flash; window.setTimeout(function() { return __method.apply(__method, [ cb ]); }, 100); return false; } return cb.call(); } return { init: init, wait_until_ready: wait_until_ready, wait_until_ready_flash: wait_until_ready_flash }; })();