(function(){BLOOMBERG.util.Cookie.removeCookies(["opttm","optwnd"],"/","bloomberg.com");BLOOMBERG.util.Cookie.removeCookies(["nonstopnews","nonstopnewsdt"],"/","bloomberg.com");BLOOMBERG.util.Cookie.removeCookies(["hptest201103","hptest2011time"],"/","bloomberg.com");BLOOMBERG.util.Cookie.removeCookies(["snapshottest","snapshottest_tm"],"/","bloomberg.com");BLOOMBERG.util.Cookie.removeCookies(["bviewopn","bviewopn_tm"],"/","bloomberg.com");BLOOMBERG.util.Cookie.removeCookies(["hprec201108","hprec201108_tm"],"/","bloomberg.com")})();(function(){var h=BLOOMBERG.namespace("bucket_test");var c=BLOOMBERG.namespace("bucket_collection_list");var g=BLOOMBERG.util.Cookie;var a="bloomberg.com";var b=Date.nextYear().toGMTString();function f(i){var j=g.get(i);if(j){return new Date(j*1000)}return -1}function e(j,k,i){if(i){console.log("["+j+"] "+k)}}function d(i){var j=g.get(i);if(j!==""){g.set(i,j,b,"/",a)}}h.run_test=function(j){var l={test_name:"test_name",roll_time_key:"roll_time_key",value_key:"value_key",percentage:0,bucket_values:["0","1"],debug:false,after_set_cookie_fn:null};$.extend(l,j);if(l.debug){console.log("****"+l.test_name+"****");console.log(l)}var k=f(l.roll_time_key);if(k<0){g.set(l.roll_time_key,Math.floor((new Date()).getTime()/1000),b,"/",a);var i=Math.random()*100;e(l.test_name,"side: "+i,l.debug);if(i<l.percentage){var m=l.bucket_values[Math.floor(Math.random()*l.bucket_values.length)];e(l.test_name,"cookie_value: "+m,l.debug);g.set(l.value_key,m,b,"/",a);if(l.after_set_cookie_fn){l.after_set_cookie_fn(m)}}else{e(l.test_name,"not_in_bucket",l.debug)}}d(l.value_key);d(l.roll_time_key)}})();(function(){var c="/markets";var o="/markets/home_v2";function f(){var u=BLOOMBERG.util.Cookie.get(k.value_key);if(!u||u=="0"){return false}return true}function h(){var u=window.location.href;return(u.indexOf("/apps/quote?ticker")!=-1)||(u.indexOf("/quote/")!=-1)}function r(){var u=window.location.href;return(u.indexOf("/apps/quote?ticker")!=-1)}function j(){var u=window.location.href;return(u.search(/(:cur)/i)!=-1)}function l(){var u=window.location.pathname;return(u==c)||(u==c+"/")}function g(){var u=window.location.pathname;return(u==o)||(u==o+"/")}var p=BLOOMBERG.bucket_test;var k={test_name:"companypage_test",roll_time_key:"companypage_tm1",value_key:"companypage",percentage:parseInt(BLOOMBERG.global_var.quote_ab_bucket_size),bucket_values:["0","1"],debug:false,after_set_cookie_fn:null};p.run_test(k);var m=f();var h=h();var n=r();if(BLOOMBERG.global_var.quote_enable_ab_testing=="true"){if((m&&n&&h)||(!m&&j())){var t=window.location.href.split("=")[1];t=t.replace("%2F","+");t=t.replace("/","+");t=t.replace(".","!");var s=window.location.host;window.location=window.location.protocol+"//"+s+"/quote/"+t}else{if(!m&&!n&&h){if(!j()){var t=window.location.href.split("/")[4];t=t.replace("+","/");t=t.replace("!",".");var s=window.location.host;window.location=window.location.protocol+"//"+s+"/apps/quote?ticker="+t}}else{if(m&&l()){window.location.pathname=o}else{if(!m&&g()){window.location.pathname=c}}}}}else{if(n){var t=window.location.href.split("=")[1];t=t.replace("%2F","+");t=t.replace("/","+");t=t.replace(".","!");var s=window.location.host;window.location=window.location.protocol+"//"+s+"/quote/"+t}if(l()){window.location.pathname=o}}var d={"/markets/currencies":"/markets/currencies_v2","/markets/currencies/americas":"/markets/currencies_v2/americas","/markets/currencies/europe-africa-middle-east":"/markets/currencies_v2/europe-africa-middle-east","/markets/currencies/asia-pacific":"/markets/currencies_v2/asia-pacific","/markets/currencies/cross-rates":"/markets/currencies_v2/cross-rates"};var q={};for(var b in d){q[d[b]]=b}function a(){return window.location.pathname.replace(/\/$/,"")}var i=a();if(!m){var e=q[i]}else{var e=d[i]}if(typeof(e)!="undefined"){window.location.pathname=e+"/"}if(!m){if(i=="/markets/currencies_v2/etfs"){window.location.pathname="/markets/etfs/currency/"}if(i=="/markets/currencies_v2/currency-converter"){window.location.pathname="/personal-finance/calculators/currency-converter/"}}})();(function(){var b=BLOOMBERG.bucket_test;var a={test_name:"top_rails_stories_test",roll_time_key:"morestories201112_tm",value_key:"morestories201112",percentage:100,bucket_values:["a1","a2","a3","a4","a5","rsch6","qn7","qn8","qn9","qn10","qn11","qn12","dm13","dm14","dm15","dm16","dm17","int18","int19","int20","int21","int22","rsch23","rsch24","rsch25","rsch26","rsch27","rsch28","rsch29","rsch30","rsch31","rsch32","dm33","dm34","dm35","dm36","dm37","dm38","dm39","dm40","dm41","qn42","qn43","qn44","qn45","qn46","qn47","qn48","qn49","qn50"],debug:false,after_set_cookie_fn:null};b.run_test(a)})();(function(){var b=BLOOMBERG.bucket_test;var a={test_name:"homepage_recommendations",roll_time_key:"hprec201202_tm",value_key:"hprec201202",percentage:100,bucket_values:["rd1","rd2","rd3","rd4","rd5","rd6","rd7","idx8","dm9","qn10"],debug:false,after_set_cookie_fn:null};b.run_test(a)})();(function(){var a=BLOOMBERG.namespace("ab_test");a.set_bucket=function(c,d){var b=Date.nextYear().toGMTString();BLOOMBERG.util.Cookie.set(c,d,b,"/","bloomberg.com");window.location.reload()}})();
