var v_div='<div class="spot"><div style="display:none;" class="vs-temp"><div class="vs-item"><div class="vs-img-w"><a class="vs-link" target="_blank" rel="nofollow"><img class="vs-img vs-delay"></img></a></div><div class="vs-detail-w"><div class="vs-detail"><div class="vs-title-w"><a class="vs-link vs-title" target="_blank" rel="nofollow"></a></div><div><div class="vs-meta"></div></div><div class="vs-desc"></div></div></div><div class="vs-bb"></div></div></div><div style="display:none;" class="vs-temp2"><div class="vs-item"><div class="vs-img-w"><a class="vs-link" target="_blank" rel="nofollow"><img class="vs-img vs-delay"></img></a></div><div class="vs-detail-w"><div class="vs-detail"><div class="vs-title-w"><a class="vs-link vs-title" target="_blank" rel="nofollow"></a></div><div><div class="vs-meta"></div></div><div class="vs-desc"></div></div></div><div class="vs-bb"></div></div></div><div class="vs-tab ui-tabs ui-widget ui-widget-content"><div class="vs-ul-w"><ul class="vs-ul" style="padding:0px;margin:0px;"><li class="ui-state-default vs-tabl" style="padding:0px;margin:0px;"><a href="#news_panel" class="vs-open" type="news">News</a></li><li class="ui-state-default vs-tabl" style="padding:0px;margin:0px;"><a href="#video_panel" class="vs-open" type="video">Video</a></li><li class="ui-state-default vs-tabl" style="padding:0px;margin:0px;"><a href="#image_panel" class="vs-open" type="image">Image</a></li><li class="ui-state-default vs-tabl" style="padding:0px;margin:0px;"><a href="#blog_panel" class="vs-open" type="blog">Blog</a></li></ul><div style="clear:both;"></div></div><div class="image-panel vs-panel ui-tabs-panel ui-widget-content" style="display:none;" view="ImageView" rate="ImageRate"><div class="vs-list-w"><div class="vs-list"></div></div><div><div class="vs-page-w" style="display:none;"><a href="#" class="vs-more" target="_blank" style="display:none;">more</a></div></div></div><div class="video-panel vs-panel ui-tabs-panel ui-widget-content" style="display:none;" view="VideoView" rate="VideoRate"><div class="vs-list-w"><div class="vs-list"></div></div><div><div class="vs-page-w" style="display:none;"><a href="#" class="vs-more" target="_blank" style="display:none;">more</a></div></div></div><div class="news-panel vs-panel ui-tabs-panel ui-widget-content" style="display:none;" view="NewsView" rate="NewsRate"><div class="vs-list-w"><div class="vs-list"></div></div><div><div class="vs-page-w" style="display:none;"><a href="#" class="vs-more" target="_blank" style="display:none;">more</a></div></div></div><div class="blog-panel vs-panel ui-tabs-panel ui-widget-content" style="display:none;" view="BlogView" rate="BlogRate"><div class="vs-list-w"><div class="vs-list"></div></div><div><div class="vs-page-w" style="display:none;"><a href="#" class="vs-more" target="_blank" style="display:none;">more</a></div></div></div></div><div style="clear:both;"></div></div>',
v_css=".vs-content {text-align:left;min-width:120px;} .vs-img-w { height:90px;float:left;overflow:hidden;} .vs-img { width:120px;border:none !important;padding:0px !important;margin:0px !important;height:90px;} .vs-content div { border:none;padding:0px;margin:0px;} .vs-content a { border:none;padding:0px;margin:0px;} .vs-item { height:90px;position:relative;} .vs-detail-w {height:90px;overflow:hidden;} .vs-compact .vs-item { height:35px;position:relative;} .vs-compact .vs-detail-w {height:35px;overflow:hidden;} .vs-compact .vs-title-w {margin-top:0px !important;} .vs-compact .vs-desc { display:none;} .vs-compact .vs-bb {display:none;} div.vs-detail { margin-left:5px;} .vs-title {text-decoration:none;} .vs-title:hover {text-decoration:underline;} div.vs-title-w { font-weight:bold;overflow:hidden;} div.vs-meta { color:grey;overflow:hidden;font-size:12px;height:15px;line-height:15px;} div.vs-desc { margin-right:5px;overflow:hidden;clear:both;} .vs-12 .vs-title-w { font-size:13px;margin-top:3px;line-height:16px;height:16px;} .vs-12 .vs-desc { font-size:12px;margin-top:2px;height:48px;line-height:16px;} .vs-13 .vs-title-w { font-size:14px;margin-top:3px;line-height:17px;height:17px;} .vs-13 .vs-desc { font-size:13px;margin-top:2px;height:48px;line-height:16px;} .vs-14 .vs-title-w { font-size:15px;margin-top:3px;line-height:18px;height:18px;} .vs-14 .vs-desc { font-size:14px;margin-top:2px;height:48px;line-height:16px;} .vs-15 .vs-title-w { font-size:16px;margin-top:3px;line-height:19px;height:19px;} .vs-15 .vs-desc { font-size:15px;margin-top:1px;height:49px;line-height:16px;} .vs-16 .vs-title-w { font-size:17px;margin-top:3px;line-height:20px;height:20px;} .vs-16 .vs-desc { font-size:16px;height:51px;line-height:17px;} .vs-17 .vs-title-w { font-size:18px;margin-top:3px;line-height:21px;height:21px;} .vs-17 .vs-desc { font-size:17px;height:48px;line-height:16px;} .vs-18 .vs-title-w { font-size:19px;margin-top:5px;line-height:22px;height:22px;} .vs-18 .vs-desc { font-size:18px;height:40px;line-height:20px;} .vs-open { padding:0px !important;text-decoration:none;line-height:19px;font-size:14px;width:auto !important;} .vs-panel { padding:0px !important;position:absolute;top:0px;left:0px;width:100%;} .vs-tab { padding:0px !important;border:none !important;font-size:16px;position:relative;} .vs-ul {list-style-type:none;list-style-image:none;border:none !important;line-height:1.3;background-image:none;} .vs-ul-w {margin-bottom:1px;position:absolute;top:0px;left:0px;width:100%;} li.vs-tabl { position:absolute; top:0px; text-align:center;border:none !important; cursor:pointer;height:19px;line-height:19px !important; overflow:hidden; list-style-type: none !important; } .vs-simple .ui-tabs-selected{ font-weight:bold; margin:0; padding:0; background-color:rgba(0,0,0, 0.05); } li:before { content: none !important; } .vs-list { position:absolute;top:0px;left:0px;width:100%; } .vs-list-w {position:relative;overflow:hidden;} .spot {word-wrap:break-word;line-height:normal;} .vs-bb {position:absolute;bottom:0px;height:1px;background-color:black;width:100%;opacity:0.1;overflow:hidden;filter:alpha(opacity=10);} a.vs-more {float:right;margin-right:1px;} .vs-page-w {font-size:12px;text-align:center;} a.vs-page {margin-left:5px;} div.vs-stars{width:50px;margin-right:5px;margin-top:2px;height:12px;overflow:hidden;float:left;} .vs-stars .vs-star{ background:url(http://cdn.vikispot.com/z/images/widget/star-s.gif) no-repeat top left; /* background:url(/z/images/widget/star-s.gif) no-repeat top left; */ width:10px !important; height:10px !important; display:block !important; overflow:hidden !important; cursor:pointer; border: none !important; float:left !important; } .vs-star-on{background-position:0 -10px !important;} .vs-star-set{background-position:0 -20px !important;}",
vs_pt,vs_ga="UA-12595826-3",vs_load,vs_data={},vs_init_content,v_sq=[],vs_history,vs_inited;function vs_callback(d){if("1"==d.status){var j=d.query;vs_data[j]=d.spot;d=jQuery(".vs-content[query='"+j+"']");for(j=0;j<d.length;j++)vs_load(jQuery(d[j]),j==0)}}function v_check(){if(vs_inited)return false;vs_inited=true;if(document.getElementsByClassName)return document.getElementsByClassName("vs-content").length>0;return true}function v_queue(){for(var d,j=0;j<v_sq.length;j++){d=v_sq[j];d()}}
function vs_load_search(){google.load("search","1",{callback:v_queue,nocss:true})}function insert_css(d){var j=document.createElement("style");j.type="text/css";j.innerText=d;document.getElementsByTagName("head")[0].appendChild(j)}function insert_css2(d){d='<style type="text/css">'+d+"</style>";document.write(d)}function vs_refresh(){typeof vs_init_content!="undefined"&&jQuery(".vs-content").each(function(d,j){vs_init_content(jQuery(j))})}
function v_google(){if(typeof google=="undefined"||typeof google.search=="undefined"){var d=document.createElement("script");d.src="http://www.google.com/jsapi?callback=vs_load_search";d.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(d)}}
function vs_ls(d,j){var p=document.getElementsByTagName("head")[0],m=document.createElement("script");m.src=d;var s=false;m.onload=m.onreadystatechange=function(){var q=this.readyState;if(!s&&(!q||q=="loaded"||q=="complete")){s=true;j!=null&&j();m.onload=m.onreadystatechange=null;p.removeChild(m)}};p.appendChild(m)}function load_jquery(d){typeof jQuery=="undefined"?vs_ls("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js",d):d()}
function p_init(){Date.prototype.toRelativeTime=function(d){var j=new Date-this;d=parseInt(d,10);if(isNaN(d))d=0;if(j<=d)return"Just now";d=null;var p={millisecond:1,second:1E3,minute:60,hour:60,day:24,month:30,year:12};for(var m in p)if(j<p[m])break;else{d=m;j/=p[m]}j=Math.floor(j);if(j!==1)d+="s";return[j,d,"ago"].join(" ")};Date.fromString=function(d){return new Date(Date.parse(d))}}if(v_check()){v_google();insert_css2(v_css);load_jquery(ws_init)}
function ws_init(){if(jQuery(".vs-content").length!=0){p_init();vp_init();vs_refresh()}}function v_pre(){v_google();insert_css2(v_css);p_init();vp_init()}
function vp_init(){(function(d){function j(a,b){var c=jQuery.ajaxSettings.cache;jQuery.ajaxSettings.cache=true;d.getScript(a,b);jQuery.ajaxSettings.cache=c}function p(a,b,c,e){e=parseInt(e);vs_pt._trackEvent(a,b+"",c+"",e)}function m(a,b){if(vs_pt!=null){var c=s(b);c.indexOf("fbc_channel")>0||p("WidgetView",a,c,3E4)}else t[t.length]=function(){m(a,b)}}function s(a){var b=a.attr("link");b||(b=a.closest(".vs-topic").attr("link"));b||(b=q());return b}function q(){var a=document.location+"";a=B(a,"widget.location");
return a=B(a,"caller")}function B(a,b){var c=C(a,b);if(c!=null)a=c;return a}function C(a,b){var c=RegExp("[\\?&]"+b+"=([^&#]*)").exec(a);if(c==null)return null;return unescape(c[1])+""}function P(a){a.find(".vs-delay").each(function(){var b=d(this).attr("longdesc");b&&b.length>0&&d(this).attr("src",b).removeClass("delay")})}function D(a){var b=n(a,"url",false);b||(b=n(a,"href",""));return b}function E(a){var b=a.closest(".spot").parent(),c=a.closest(".vs-panel");a=parseInt(n(a,"page",1));var e=a-
1;b=n(b,"line",1);e*=b;var f=c.find(".vs-item").length;e=e;b=f-b+1;if(b<=0)e=0;else{if(e<0)e=0;else if(e>=b)e=b-1;e=e}b=F("height",d(".vs-item",c));b=b*e*-1;c.find(".vs-list").animate({top:b+"px"});c.find(".vs-page").attr("href","#");c.find(".vs-page[page='"+a+"']").removeAttr("href")}function G(a,b){var c=d("."+b+"-panel",a),e=c.find(".vs-item").length;P(c);if(!(c.attr("inited")&&c.css("display")=="block"&&e>0)){c.attr("inited","true");d(".vs-panel",a).hide();c.show();d(".vs-open",a).parent().removeClass("ui-state-active ui-tabs-selected");
d("a[type='"+b+"']",a).parent().addClass("ui-state-active ui-tabs-selected");e<1&&Q(function(){R(a,b)})}}function R(a,b){if(typeof google!="undefined"){var c=d("."+b+"-panel",a);if(!(c.find(".vs-item").length>0)){var e=a.attr("name");e||(e=a.attr("query"));if(b=="image")e+=" imagesize:1024x768";var f=S(b);f.setResultSetSize(GSearch.LARGE_RESULTSET);f.setNoHtmlGeneration();f.setSearchCompleteCallback(this,function(){var g=a.find("."+b+"-panel").find(".vs-item").length;if(!(g>0))if(f.results&&f.results.length>
0){var h=f.results,i=H[b];g=parseInt(n(a,"count",1));for(var l=0;l<h.length&&l<g;l++)i(a,h[l],l,false)}E(c,0)},null);f.execute(e)}}}function S(a){if(a=="news")return new google.search.NewsSearch;if(a=="image")return new google.search.ImageSearch;if(a=="video")return new google.search.VideoSearch;if(a=="blog")return new google.search.BlogSearch}function u(a,b,c){if(b){var e=parseInt(n(a,"count",1));b.length>0&&d("."+c+"-panel",a).find(".vs-list").html("");c=H[c];for(var f=0;f<b.length&&f<e;f++)c(a,
b[f],f,true)}}function T(a){if(a.indexOf("og:")==0)return d("meta[property='"+a+"']").attr("content");if(a.indexOf("m:")==0){a=a.replace("m:","");return d("meta[name='"+a+"']").attr("content")}return d(a).html()}function y(a,b){var c=a.closest(".vs-stars"),e=c.find(".vs-star"),f=a.attr("value"),g=c.attr("rating");c=n(c,"voted",false);if(!(b==2&&c)){if(b==0&&g){b=c?2:1;f=g}for(g=0;g<e.length;g++){c=d(e[g]);var h=b,i=f;c.removeClass("vs-star-on vs-star-set");var l=c.attr("value");i=parseFloat(i);i+=
0.5;if(h==1)l<=i&&c.addClass("vs-star-set");else h==2&&l<=i&&c.addClass("vs-star-on")}}}function U(a,b){a.parent().find(".vs-name").each(function(){d(this).html()||d(this).html(b)})}function Q(a){if(typeof google!="undefined")google.load("search","1",{callback:a,nocss:true});else v_sq[v_sq.length]=a}function I(a,b){var c=a.attr("query");c=vs_data[c];a.find(".spot").attr("spotid",c.id);vs_id=c.id;if(vs_id!=0){u(a,c.news,"news");u(a,c.videos,"video");u(a,c.images,"image");u(a,c.blogs,"blog");v(a,".image-panel",
c.imageUrl);v(a,".video-panel",c.videoUrl);v(a,".news-panel",c.newsUrl);v(a,".blog-panel",c.blogUrl)}J(a);b&&m(c.id,a)}function v(a,b,c){c&&d(b,a).find(".vs-more").attr("href",c).show()}function J(a){var b=a.attr("selected");if(b==null)b="news";G(a,b)}function n(a,b,c){a=a.attr(b);if(!a||a=="")return c;return a}function z(a,b,c){a=n(a,b,c);return a=="1"||a=="true"}function F(a,b){var c=b.css(a);if(!c)return"14";return c=c.replace("px","")}function w(a,b){var c=a.attr(b),e=d("a[type='"+b+"']",a).parent();
if(c=="true"||c=="1"){e.attr("active","true").show();c=a.attr("selected");if(!c||a.attr(c)!="true")a.attr("selected",b);return b}else{e.remove();a.find("."+b+"-panel").remove();return null}}var V=v_div,K,t=[],H={news:function(a,b){var c=d(".vs-temp",a).find(".vs-item").clone(true);c.find(".vs-img-w").hide();var e=b.unescapedUrl,f=b.title,g=b.content,h=b.publisher,i=b.publishedDate;i=new Date(i);i=i.toRelativeTime();c.find(".vs-title").html(f);c.find(".vs-link").attr("href",e);c.find(".vs-desc").html(g);
e=h+" - "+i;c.find(".vs-meta").html(e);d(".news-panel",a).find(".vs-list").append(c)},image:function(a,b,c,e){c=d(".vs-temp2",a).find(".vs-item").clone(true);var f=c.find("img"),g="src";if(e)g="longdesc";f.attr(g,b.tbUrl);c.find(".vs-link").attr("url",b.url);(e=b.titleNoFormatting)||(e=a.attr("name"));c.find(".vs-title").html(e);(e=b.visibleUrl)||(e="");c.find(".vs-meta").html(e);(b=b.contentNoFormatting)||(b="There is no description.");c.find(".vs-desc").html(b);d(".image-panel",a).find(".vs-list").append(c)},
video:function(a,b,c,e){c=d(".vs-temp2",a).find(".vs-item").clone(true);var f=c.find("img"),g=b.url,h=C(g,"q");if(h!=null)g=h;h="src";if(e)h="longdesc";f.attr(h,b.tbUrl).parent();c.find(".vs-link").attr("href",g).attr("play",b.playUrl);c.find(".vs-title").html(b.titleNoFormatting);c.find(".vs-desc").html(b.content);e=parseInt(b.duration);f=Math.floor(e/60);e=e%60;if(e<10)e="0"+e;e=f+":"+e;b=b.published;b=new Date(b);b=b.toRelativeTime();b=e+" - "+b;c.find(".vs-meta").html(b);d(".video-panel",a).find(".vs-list").append(c)},
blog:function(a,b,c){var e=d(".vs-temp",a).find(".vs-item").clone(true);e.find(".vs-img-w").hide();var f=b.postUrl,g=b.title,h=b.titleNoFormatting,i=b.content,l=f;l=l.replace("http://","");c=l.indexOf("/");if(c>0)l=l.substring(0,c);b=b.publishedDate;b=new Date(b);b=b.toRelativeTime();e.find(".vs-title").html(g).attr("title",h);e.find(".vs-link").attr("href",f);e.find(".vs-desc").html(i);f=l+" - "+b;e.find(".vs-meta").html(f);d(".blog-panel",a).find(".vs-list").append(e)}},L=[".vs-topic",".post>h2>a",
"og:title","title"];(function(){d(".vs-tabl").live("mouseover",function(){d(this).addClass("ui-state-hover")});d(".vs-tabl").live("click",function(a){a.preventDefault();a=d(this).find(".vs-open").attr("type");var b=d(this).closest(".spot").parent();G(b,a);b.attr("inited","true")});d(".vs-tabl").live("mouseout",function(){d(this).removeClass("ui-state-hover")});d(".vs-page").live("click",function(a){a.preventDefault();E(d(this))});d(".vs-link").live("click",function(){var a=d(this),b=D(a),c=a.closest(".spot").attr("spotid");
a=a.closest(".vs-panel").attr("view");p(a,c,b,3E4)})})();(function(){var a=d(".vs-star");a.live("click",function(){var b=d(this),c=b.closest(".vs-panel").attr("rate"),e=b.closest(".vs-stars");if(!n(e,"voted",false)){e.attr("voted","true");e=b.attr("value");var f=b.closest(".vs-item").find(".vs-link");f=D(f);var g="u="+f+"&r="+e,h=b.closest(".spot").attr("spotid");p(c,h,g,e);b.closest(".vs-stars").attr("rating",e);c=b=0;if(f){for(b=0;b<f.length;b++){g=f.charCodeAt(b);c+=g*(b+1)}f=Math.abs(c)%4294967295+
""}else f="";if(vs_history==null){b=d.cookie("r");b=b=unescape(b);vs_history=b=eval("("+b+")");if(vs_history==null)vs_history={}}vs_history[f]=e+"";var i;e=vs_history;f=[];b=0;for(i in e){f[b]='"'+i+'":'+e[i];b++}i="{"+f.join(",")+"}";i=escape(i);d.cookie("r",i)}y(d(this),0)});a.live("mouseover",function(){y(d(this),2)});a.live("mouseout",function(){y(d(this),0)})})();(function(){vs_pt==null&&j("http://www.google-analytics.com/ga.js",function(){try{vs_pt=_gat._createTracker(vs_ga);vs_pt._setDomainName("none");
vs_pt._setDetectFlash(false);vs_pt._setAllowLinker(true);vs_pt._setAllowHash(false);vs_pt._link();vs_pt._linkByPost();vs_pt._trackPageview("/widget?url="+q());for(var a,b=0;b<t.length;b++){a=t[b];a()}}catch(c){}})})();vs_load=I;vs_init_content=function(a){var b=a.attr("name");if(b!="_unknown"){var c=a.attr("spotid");a.html(V);d(".vs-open",a).parent().hide();w(a,"image");w(a,"video");w(a,"news");w(a,"blog");var e=d("li",a).length;e<=1&&d(".vs-ul-w",a).hide();a.attr("tabs",e);var f=a.attr("tabs"),g=
parseInt(n(a,"width",0)),h=parseInt(n(a,"font",14));if(h<12)h=12;if(h>18)h=18;var i=z(a,"compact","false"),l=parseInt(n(a,"line",1));e=parseInt(n(a,"count",1));if(l>e)l=e;var r=g;if(r>0){d(".spot",a).css("width",r+"px");a.css("width",r+"px")}r=100/f;if(f==3)r=33;for(var M=d(".vs-tabl[active='true']",a),N=0,x=0;x<M.length;x++){var A=r;if(f==3&&x==0)A=34;var O=d(M[x]);O.css("width",A+"%");O.css("position","absolute").css("left",N+"%");N+=A}if(g==0)g=F("width",a);h=h;g=g;d(".vs-tab",a).addClass("vs-"+
h);var o;if(g>0){if(g<=120)o=9;else if(g<=150)o=11;else if(g<=170)o=12;else if(g<250)o=14;g<250&&d(".vs-temp2",a).find(".vs-meta").hide()}o&&d(".vs-open",a).css("font-size",o+"px");if(i){d(".vs-temp2",a).find(".vs-detail-w, .vs-bb").hide();d(".vs-temp2",a).find(".vs-img-w").css("text-align","center").css("float","none");f==1&&!z(a,"image")&&!z(a,"video")&&d(".vs-panel",a).addClass("vs-compact")}o=l;g=a.attr("selected");h=90;if(f==1&&i&&(g=="news"||g=="blog"))h=35;g=h*o;d(".vs-list-w",a).css("height",
g+"px");f>1&&d(".vs-panel",a).css("top","20px");i&&e==1||d(".vs-page-w",a).show();h=0;if(f>1)h+=20;i&&o==1||(h+=15);f=g+h;d(".vs-tab",a).css("height",f+"px");l=l;e=e/l;for(f=0;f<e&&e>1;f++){i='href="#"';if(f==0)i="";o=f+1;d(".vs-page-w",a).append("<a "+i+' class="vs-page" page="'+o+'">'+o+"</a>")}l==1&&d(".vs-bb",a).hide();a:{c=c;b=b;var k;if(c)e=c;else{c="0";if(!b){b=a.closest(".vs-topic");if(b.length==0)b=d(".vs-topic");(e=b.attr("topic"))||(e=b.html());if(e&&e.length>50)e=null;b=e}if(b)e=b;else{b=
"0";b:{for(k=0;k<L.length;k++)if((e=T(L[k]))&&d.trim(e).length>2){k=k=e.split(",")[0];break b}k=""}if(!k)break a;e=k}U(a,e)}c="/wsj/"+c;if(b)c+="/"+b;if(k)c+="/"+k;escape(c);k=q();k.indexOf(".vikispot.com")>0||k.indexOf("peterliu2.se");k=e;a.attr("query",k);b=vs_data[k];if(b!=null)b!=""&&I(a,false);else vs_data[k]="";n(a,"inited","")!="true"&&J(a)}k=a.attr("css");if(k==null||k==""||k=="simple"){a.find(".vs-tabl").css("background-image","none");k=="simple"&&a.find(".vs-ul").addClass("vs-simple")}else{if(k.indexOf("http://")==
-1&&k.indexOf("/")!=0)k="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/"+k+"/jquery-ui.css";if(k!=K){a=k;b=document.createElement("link");b.href=a;b.rel="stylesheet";b.type="text/css";document.getElementsByTagName("head")[0].appendChild(b);K=k}}}}})(jQuery)};
