document.addEventListener("DOMContentLoaded",function(){CheckRTL();LoadElements();LoadConfig();SetEvent()});function CheckRTL(){IsRTL()&&(document.body.style.direction="rtl")}function GetCheckedValue(a){a=document.getElementsByName(a);if(!a)return"";var c=a.length;if(void 0==c)return a.checked?a.value:"";for(var b=0;b<c;b++)if(a[b].checked)return a[b].value;return""}function LoadConfig(){var a="#f_firstopen"+GetConfig("config_firstopen","seostats");$(a).attr("checked",!0)}
function SetEvent(){$("#btn_save").click(function(){OnSave()});$("#lnk_save").click(function(){OnSave()});$("#btn_cancel").click(function(){window.close()});$("#lnk_cancel").click(function(){window.close()});$("#email").focus(function(){OnEmailfocus()});$("#email").blur(function(){OnEmailBlur()})}function OnEmailfocus(){var a=GetCtrl("#email");a.value==a.defaultValue&&(a.value="")}function OnEmailBlur(){var a=GetCtrl("email");""==a.value&&(a.value=a.defaultValue)}
function OnSave(){var a=GetCheckedValue("f_firstopen");SetConfig("config_firstopen",a);a=$("#f_cache_duration").val();SetConfig("config_cache_hours",a);0==a&&window.indexedDB&&window.indexedDB.deleteDatabase("PRS-DB");window.close()}
function LoadElements(){var a;a=MYLANG("Rate5Stars").replace(/%LINK%/i,"https://chrome.google.com/webstore/detail/pagerank-status/hbdkkfheckcdppiaiabobmennhijkknn/reviews");$("#do_you_like").html('<img src="image/rate.png" class="icon_16" ALT=""> '+a);$("#lbl_option").html(MYLANG("Options"));$("#lnk_save").html(MYLANG("SaveClose"));$("#lnk_cancel").html(MYLANG("Cancel"));$("#lbl_title").html(document.title=MYLANG("PageRank")+" - "+MYLANG("Options"));$("#lbl_title_desc").html(MYLANG("description"));
$("#lbl_cache").html(MYLANG("CacheDuration"));a=GetConfig("config_cache_hours",24);$("#ctrl_cache").html('<select id="f_cache_duration" name="f_cache_duration">      <option value="0"'+(0==a?" selected":"")+">"+MYLANG("CacheDisable")+'</option>      <option value="1"'+(1==a?" selected":"")+">"+MYLANG("1Hour")+'</option>      <option value="12"'+(12==a?" selected":"")+">"+MYLANG("12Hours")+'</option>      <option value="24"'+(24==a?" selected":"")+">"+MYLANG("1Day")+'</option>      <option value="72"'+
(72==a?" selected":"")+">"+MYLANG("3Days")+'</option>      <option value="168"'+(168==a?" selected":"")+">"+MYLANG("7Days")+"</option>    </select>");$("#lbl_first_open").html(MYLANG("FirstDisplay"));$("#lbl_firstopenseostats").html(MYLANG("SEOStats"));$("#lbl_firstopentraffic").html(MYLANG("TrafficStats"));$("#lbl_firstopensiteinfo").html(MYLANG("PageSite"));$("#lbl_firstopenpageinfo").html(MYLANG("PageInfo"));$("#lbl_firstopenlinks").html(MYLANG("LinksStats"));$("#lbl_firstopenpagespeed").html(MYLANG("PageSpeed"));
$("#lbl_firstopenwebtools").html(MYLANG("Tools"));$("#btn_save").html(MYLANG("SaveClose"));$("#btn_cancel").html(MYLANG("Cancel"));$("#btn_sub").attr("value",MYLANG("Subscribe"));$("#lbl_subscribe").html(MYLANG("SubscribeTo"));$("#email").attr("defaultValue",MYLANG("Enter_email"));$("#lbl_submail").html($("lnk_submail").title=MYLANG("Sub_email"));$("#lbl_why").html($("lnk_why").title=MYLANG("Why_sub"));$("#lbl_follow").html(MYLANG("Follow_me")+":");$("#lbl_privacy").html(MYLANG("PrivacyNote"));$("#lbl_about").html(MYLANG("AboutPageRank"));
$("#lbl_feedback").html(MYLANG("Feedback")+": ");$("#lnk_home").html($("lnk_home").title=MYLANG("Support"));$("#lnk_rateit").html($("lnk_rateit").title=MYLANG("RateIt"));a=GetPaypalLink("paypal@chromefans.org","EXT-PR","Donate for PageRank Status");$("#lbl_donate").html('<a href="'+a+'" title="'+MYLANG("DonateIt")+'" target=_blank id="lnk_donate">'+MYLANG("DonateIt")+"</a>")};
