document.addEventListener("DOMContentLoaded",function(){CheckRTL();InitPageInfo(sessionStorage.title);CheckDataReady()});function CheckDataReady(){void 0==sessionStorage.status_pageinfo_ok||0==sessionStorage.status_pageinfo_ok?setTimeout(CheckDataReady,1E3):ShowData()}function CheckRTL(){IsRTL()&&(document.body.style.direction="rtl")}
function InitPageInfo(){var a=""==sessionStorage.url?"":'<img src="image/loading.gif" class="icon_16">',b=sessionStorage.url;$("#content").html('<table id="tbl_pageinfo"><thead><tr class="tr_head"><td>'+MYLANG("Tag")+"</td><td>"+MYLANG("Content")+'</td><td id="lbl_length">'+MYLANG("Length")+'</td></tr></thead><tbody><tr class="tr_item tr_bg1"><td class="td_subject" id="lbl_url">'+MYLANG("URL")+':</td><td class="td_info" id="td_url">'+b+'</td><td class="td_num" id="td_url_num"></td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_lnk_canonical">'+
MYLANG("HtmlTag_CanonicalURL")+':</td><td class="td_info" id="td_lnk_canonical">'+a+'</td><td class="td_num" id="td_lnk_canonical_num">&nbsp;</td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_title">'+MYLANG("HtmlTag_Title")+':</td><td class="td_info" id="td_title">'+a+'</td><td class="td_num" id="td_title_num"></td></tr><tr class="tr_item tr_bg1"><td class="td_subject" id="lbl_key">'+MYLANG("HtmlTag_MetaKey")+':</td><td class="td_info" id="td_key">'+a+'</td><td class="td_num" id="td_key_num"></td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_desc">'+
MYLANG("HtmlTag_MetaDesc")+':</td><td class="td_info" id="td_desc">'+a+'</td><td class="td_num" id="td_desc_num"></td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_desc">'+MYLANG("HtmlTag_MetaRobots")+':</td><td class="td_info" id="td_robots">'+a+'</td><td class="td_num" id="td_robots_num"></td></tr><tr class="tr_item tr_bg1"><td class="td_subject" id="lbl_lnk_out">'+MYLANG("LinkExternal")+':</td><td class="td_info" id="td_lnk_external">'+a+'</td><td class="td_num">&nbsp;</td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_lnk_in">'+
MYLANG("LinkInternal")+':</td><td class="td_info" id="td_lnk_internal">'+a+'</td><td class="td_num">&nbsp;</td></tr><tr class="tr_item tr_bg1"><td class="td_subject" id="lbl_h1">'+MYLANG("HtmlTag_H1")+':</td><td class="td_info" id="td_h1">'+a+'</td><td class="td_num" id="td_h1_num">&nbsp;</td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_h2">'+MYLANG("HtmlTag_H2")+':</td><td class="td_info" id="td_h2">'+a+'</td><td class="td_num" id="td_h2_num">&nbsp;</td></tr><tr class="tr_item tr_bg1"><td class="td_subject" id="lbl_b">'+
MYLANG("HtmlTag_Bold")+':</td><td class="td_info" id="td_b">'+a+'</td><td class="td_num" id="td_b_num">&nbsp;</td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_i">'+MYLANG("HtmlTag_Italic")+':</td><td class="td_info" id="td_i">'+a+'</td><td class="td_num" id="td_i_num">&nbsp;</td></tr><tr class="tr_item tr_bg1"><td class="td_subject" id="lbl_alt">'+MYLANG("HtmlTag_Alt")+':</td><td class="td_info" id="td_alt">'+a+'</td><td class="td_num" id="td_alt_num">&nbsp;</td></tr><tr class="tr_item tr_bg2"><td class="td_subject" id="lbl_body">'+
MYLANG("HtmlTag_Body")+':</td><td class="td_info" id="td_body">'+a+'</td><td class="td_num" id="td_body_num">&nbsp;</td></tr></tbody></table>')}function ShowPageInfoItem(a,b,d,c){$("#"+a).html(""==b?MYLANG("NotFound2"):b);d&&$("#"+a+"_num").html(""==b?"-":FormatNum(-1==c?b.length:c))}
function ShowData(){ShowPageInfoItem("td_url",sessionStorage.PI_url,1,-1);ShowPageInfoItem("td_title",sessionStorage.PI_title,1,-1);ShowPageInfoItem("td_key",sessionStorage.PI_keywords,1,-1);ShowPageInfoItem("td_desc",sessionStorage.PI_description,1,-1);ShowPageInfoItem("td_robots",sessionStorage.PI_robots,1,-1);ShowPageInfoItem("td_h1",sessionStorage.PI_h1,1,sessionStorage.PI_h1_len);ShowPageInfoItem("td_h2",sessionStorage.PI_h2,1,sessionStorage.PI_h2_len);ShowPageInfoItem("td_b",sessionStorage.PI_b,
1,sessionStorage.PI_b_len);ShowPageInfoItem("td_i",sessionStorage.PI_i,1,sessionStorage.PI_i_len);ShowPageInfoItem("td_alt",sessionStorage.PI_alt,1,sessionStorage.PI_alt_len);ShowPageInfoItem("td_body",sessionStorage.PI_body,1,sessionStorage.PI_body_len);ShowPageInfoItem("td_lnk_canonical",sessionStorage.PI_link_canonical,1,-1);var a=FormatNum(sessionStorage.PI_link_internal)+" ("+MYLANG("LinkNofollow").replace("%NUM%",FormatNum(sessionStorage.PI_link_internal_nofollow))+")",b=FormatNum(sessionStorage.PI_link_external)+
" ("+MYLANG("LinkNofollow").replace("%NUM%",FormatNum(sessionStorage.PI_link_external_nofollow))+")";chrome&&(chrome.extension&&chrome.extension.sendMessage)&&(0<sessionStorage.PI_link_internal&&(a='<a href="#" id="lnk_internal" title="'+a+'">'+a+"</a>"),0<sessionStorage.PI_link_external&&(b='<a href="#" id="lnk_external" title="'+b+'">'+b+"</a>"));ShowPageInfoItem("td_lnk_internal",a,0,-1);ShowPageInfoItem("td_lnk_external",b,0,-1);chrome&&(chrome.extension&&chrome.extension.sendMessage)&&(0<sessionStorage.PI_link_internal&&
$("#lnk_internal").click(function(){chrome.extension.sendMessage({action:"openPage",page:"links"});return!1}),0<sessionStorage.PI_link_external&&$("#lnk_external").click(function(){chrome.extension.sendMessage({action:"openPage",page:"links"});return!1}))};
