/** * @author 6057 */ String.prototype.beginsWith = function(a){ return this.length>=a.length && this.substring(0,a.length)==a }; String.prototype.strip = function(){ try { return this.replace(/^\s+|\s+$/g, ""); } catch(e) { return s; } }; function getCookie(x){ var ck = top.document.cookie; if (ck.indexOf(x + '=') == -1) { return ''; } var cookies = ck.split(';'); for (var y = 0; y < cookies.length; y++) { cookies[y] = cookies[y].strip(); if (cookies[y].beginsWith(x + '=')) { return cookies[y].split(x + '=')[1]; } } return ''; }