try{onespot.module_data={};onespot.doc_head=document.getElementsByTagName("head")[0];if(!onespot.demo)onespot.sizzle_loaded=false;onespot.clicky_loading=false;onespot.pageview_logged=false;onespot.render=function(a,b){var c,d;c=document.createElement("iframe");c.style.display="block";c.style.width=onespot.module_data[a].width;c.height=0;c.frameBorder=0;c.border=0;c.scrolling="no";c.id="test";document.getElementById(onespot.module_data[a].placeholder).appendChild(c);d=c.contentWindow||c.contentDocument;if(d.document)d=d.document;onespot.module_data[a].iframe=c;onespot.module_data[a].doc=d;d.open();d.write(b);d.close()};onespot.display_publication=function(a,b,c){onespot.module_data[a].doc.getElementById(b).innerHTML=c;onespot.resize_iframe(a)};onespot.build_module_data=function(){var a,b={},c,d;if(typeof onespot.page_url==="undefined")onespot.page_url=window.top.location.href;if(onespot.query_parameters)if(typeof onespot.query_parameters==="string")onespot.query_parameters=[onespot.query_parameters];else{if(!(onespot.query_parameters instanceof Array))onespot.query_parameters=[]}else onespot.query_parameters=[];onespot.polling_interval=typeof onespot.polling_interval==="number"&&onespot.polling_interval>=1E3?Math.round(onespot.polling_interval):3E3;d=typeof onespot.polling_attempts==="number"&&onespot.polling_attempts>=1&&onespot.polling_attempts<=15?Math.round(onespot.polling_attempts):15;if(onespot.modules)for(c=0;c<onespot.modules.length;c++){b={};b.name=onespot.modules[c].name;b.placeholder=onespot.modules[c].placeholder;if(onespot.modules[c].selectors)if(typeof onespot.modules[c].selectors==="string")b.selectors=[onespot.modules[c].selectors];else{if(onespot.modules[c].selectors instanceof Array)b.selectors=onespot.modules[c].selectors}else if(onespot.selectors)if(typeof onespot.selectors==="string")b.selectors=[onespot.selectors];else if(onespot.selectors instanceof Array)b.selectors=onespot.selectors;if(!b.selectors)b.selectors=["body"];b.width=typeof onespot.modules[c].width==="string"?onespot.modules[c].width:typeof onespot.module_width==="string"?onespot.module_width:"100%";onespot.module_data[onespot.modules[c].name]=b}else{b.name=onespot.module_name;b.placeholder=typeof onespot.placeholder==="string"?onespot.placeholder:"onespot_nextclick";b.selectors=typeof onespot.selectors==="string"?[onespot.selectors]:onespot.selectors&&onespot.selectors instanceof Array?onespot.selectors:["body"];b.width=typeof onespot.module_width==="string"?onespot.module_width:"100%";b.content_posted=false;b.polling_attempts=d;onespot.module_data[onespot.module_name]=b}for(a in onespot.module_data)if(onespot.module_data.hasOwnProperty(a)){onespot.module_data[a].content_posted=false;onespot.module_data[a].polling_attempts=d}};onespot.strip_url_params=function(){var a,b,c,d,f;c=onespot.page_url;b=[];d=[];var g=[];a=c.indexOf("#");if(a!==-1)c=c.slice(0,a);b=c.indexOf("?");if(b!==-1)if(a=b+1===c.length?true:false)return c.slice(0,c.length-1);else{a=c.slice(0,b);c=c.slice(b+1)}else return c;b=c.split("&");for(c=0;c<b.length;c++){d=b[c].split("=");f=d[0];for(d=0;d<onespot.query_parameters.length;d++)f===onespot.query_parameters[d]&&g.push(b[c])}return g.length>0?a+"?"+g.join("&"):a};onespot.build_urls=function(){var a,b;onespot.article_url=onespot.strip_url_params();for(b in onespot.module_data)if(onespot.module_data.hasOwnProperty(b)){a=onespot.entry_id?"entry_id="+onespot.entry_id:onespot.polling_mode&&onespot.polling_mode==="standard"?"selector="+encodeURIComponent(onespot.module_data[b].selectors[0]):"have_content=true";onespot.module_data[b].request_url="http://"+onespot.account+"/ism/"+onespot.module_data[b].name+"/index.js?url="+encodeURIComponent(onespot.article_url)+"&"+a+"&callback=onespot.dispatch"}};onespot.make_request=function(a){var b;b=document.createElement("script");b.src=onespot.module_data[a].request_url+"&_="+(new Date).getTime();onespot.doc_head.appendChild(b)};onespot.poll=function(a){if(onespot.module_data[a].polling_attempts>0){setTimeout(function(){onespot.make_request(a)},onespot.polling_interval);onespot.module_data[a].polling_attempts--}};onespot.post_content=function(a){var b,c,d,f;b=document.createElement("iframe");b.style.display="block";b.frameBorder=0;b.width=0;b.height=0;document.body.appendChild(b);setTimeout(function(){c=b.contentWindow||b.contentDocument;if(c.document)c=c.document;d=c.createElement("form");d.action=onespot.module_data[a].request_url;d.method="post";f=c.createElement("input");f.type="hidden";f.name="content";f.value=onespot.module_data[a].text_content;c.body.appendChild(d);d.appendChild(f);d.submit();onespot.module_data[a].content_posted=true;onespot.poll(a)},100)};onespot.get_text_node_content=function(a){var b=[],c,d,f;c=0;for(d=a.childNodes.length;c<d;c++){f=a.childNodes[c];if(f.nodeType===1&&f.tagName.toLowerCase()!=="script")b.push(onespot.get_text_node_content(f));else f.nodeType===3&&b.push(f.data)}return b.join("")};onespot.gather_content=function(a){var b,c,d=[],f="",g=onespot.module_data[a].selectors,h;h=setInterval(function(){if(onespot.sizzle_loaded){clearInterval(h);for(b=0;b<g.length;b++){d=onespot.sizzle(g[b],document);for(c=0;c<d.length;c++)f+=onespot.get_text_node_content(d[c])+" "}onespot.module_data[a].text_content=f.replace(/\s+/g," ");onespot.post_content(a)}},250)};onespot.load_sizzle=function(a){var b;b=document.createElement("script");b.src="http://embed.onespot.com/javascripts/ism/wsj/v2/min/sizzle.js";b.onload=function(){onespot.sizzle_loaded=true;onespot.gather_content(a)};b.onreadystatechange=function(){if((b.readyState==="loaded"||b.readyState==="complete")&&!onespot.sizzle_loaded){onespot.sizzle_loaded=true;onespot.gather_content(a)}};onespot.doc_head.appendChild(b)};onespot.dispatch=function(a){switch(a.status){case "need content":if(onespot.module_data[a.module_name].content_posted)onespot.poll(a.module_name);else if(onespot.sizzle_loaded||onespot.sizzle_loading)onespot.gather_content(a.module_name);else{onespot.sizzle_loading=true;onespot.load_sizzle(a.module_name)}break;case "pending":onespot.poll(a.module_name);break;case "ready":onespot.render(a.module_name,a.results);break}};onespot.get_iframe_height=function(a){return onespot.module_data[a].doc.documentElement.scrollHeight||onespot.module_data[a].doc.body.scrollHeight};onespot.resize_iframe=function(a){var b=onespot.get_iframe_height(a),c,d;onespot.module_data[a].iframe.setAttribute("height",b);d=setInterval(function(){c=onespot.get_iframe_height(a);if(c!==b){onespot.module_data[a].iframe.setAttribute("height",c);clearInterval(d)}},100)};onespot.link_target=function(a,b){var c,d;if(typeof b==="undefined")b="_top";c=onespot.module_data[a].doc.getElementsByTagName("a");for(d=0;d<c.length;d++)c[d].getAttribute("target")||c[d].setAttribute("target",b)};onespot.log_viewport_view=function(a){var b;if(typeof clicky_custom!=="undefined"&&typeof clicky_custom.timer!=="undefined"){b=clicky_custom.timer;clicky_custom.timer=0}clicky.log(onespot.article_url,a+" ^ "+document.title,"download");if(typeof b!=="undefined")clicky_custom.timer=b};onespot.attach_clicky=function(a){var b,c,d,f,g=onespot.module_data[a].doc;if(!onespot.pageview_logged){onespot.pageview_logged=true;clicky.log(onespot.article_url,document.title,"pageview")}onespot.module_data[a].log_ism_view&&onespot.log_viewport_view(a);b=[["from_mysa","From mySA.com"],["from_web","From Around the Web"],["more_searches","More Searches"]];for(c=0;c<b.length;c++){f=g.getElementById(b[c][0]).getElementsByTagName("a");for(d=0;d<f.length;d++)f[d].onclick=function(h,i){return function(){clicky.log(i,a+" ^ "+h+" ^ "+onespot.article_url,"outbound")}}(b[c][1],f[d].href)}};onespot.init_clicky=function(a){clicky.init(onespot.clicky_id);onespot.attach_clicky(a)};onespot.load_analytics=function(a){if(onespot.clicky_id){var b;if(typeof clicky==="undefined"&&typeof clicky_custom==="undefined"&&!onespot.clicky_loading){onespot.clicky_loading=true;window.clicky_custom=onespot.clicky_custom;var c,d=document.location.protocol==="https:"?"https:":"http:";c=document.createElement("script");c.src=d+"//static.getclicky.com/js";c.onloadDone=false;c.onload=function(){c.onloadDone=true;onespot.init_clicky(a)};c.onreadystatechange=function(){if((c.readyState==="loaded"||c.readyState==="complete")&&!onespot.clicky_loaded){c.onloadDone=true;onespot.init_clicky(a)}};onespot.doc_head.appendChild(c)}else if(onespot.clicky_loading)b=setInterval(function(){if(typeof clicky!=="undefined"){clearInterval(b);onespot.attach_clicky(a)}},250)}};onespot.top_offset=function(a){for(var b=0;a;){b+=a.offsetTop;a=a.offsetParent}return b};onespot.ism_in_viewport=function(a){var b=window.pageYOffset;a=onespot.module_data[a].trigger_point;return b+window.innerHeight>a&&b<a?true:false};onespot.check_ism_position=function(a){onespot.ism_in_viewport(a)&&setTimeout(function(){if(!onespot.module_data[a].viewport_logged&&onespot.ism_in_viewport(a)){onespot.module_data[a].viewport_logged=true;window.removeEventListener("scroll",function(){onespot.check_ism_position(a)},false);if(clicky.init)onespot.log_viewport_view(a);else onespot.module_data[a].log_ism_view=true}},2E3)};onespot.viewport_tracking=function(a){if(onespot.clicky_id)if(navigator.userAgent.indexOf("Firefox/3.6")!==-1){onespot.module_data[a].viewport_logged=false;onespot.module_data[a].log_ism_view=false;onespot.module_data[a].ism_top=onespot.top_offset(onespot.module_data[a].iframe);onespot.module_data[a].trigger_point=onespot.module_data[a].ism_top+onespot.module_data[a].iframe.height/2;window.addEventListener("scroll",function(){onespot.check_ism_position(a)},false)}};onespot.build_module_data();onespot.build_urls();(function(){var a;for(a in onespot.module_data)onespot.module_data.hasOwnProperty(a)&&onespot.make_request(a)})()}catch(e){};