1var exp_id = ""; 2function set_cookie(cookie_name, cVal) { 3 var expDate = new Date(); 4 expDate.setMinutes(expDate.getMinutes() + 5); 5 var cookie = cookie_name + "=" + cVal + ";"; 6 document.cookie = cookie; 7} 8 9function getCookie(sKey) { 10 if (!sKey) { 11 return null; 12 } 13 return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null; 14} 15 16 17function build_ab_test(exp_val) { 18 var cookie_name = "ab_experiment"; 19 if (exp_val != null){ 20 ab_val = exp_val; 21 set_cookie(cookie_name,ab_val); 22 return 23 } 24 var cookie_val = getCookie(cookie_name); 25 if (cookie_val == null) { 26 cookie_val = Math.floor((Math.random() * 100) + 1); 27 28 set_cookie(cookie_name, cookie_val); 29 } 30} 31 32function get_query_params() { 33 var args = document.location.search.substring(1).split('&'); 34 var argsParsed = {}; 35 if (args[0] != ''){ 36 for (var i=0; i < args.length; i++) { 37 var arg = decodeURIComponent(args[i]); 38 var kvp = arg.split('='); 39 argsParsed[kvp[0].trim()] = kvp[1].trim(); 40 } 41 } 42 return argsParsed; 43 } 44 45 var QP = get_query_params(); 46 47 if ("exp_val" in QP){ 48 build_ab_test(QP['exp_val']); 49 } 50 else{ 51 build_ab_test(null); 52 }
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.