var g_notifytype=null,g_notifydata=null,g_matchingsites=null;function oninitnotify(){}
function onshownotify(){var a=getBG();if(a){g_notifytype=a.g_notification_type;g_notifydata=a.g_notification_data;$("#body").css("background","#ffffe1");if(g_notifytype=="error"){if(typeof g_notifydata.yellow=="undefined"||!g_notifydata.yellow)$("#body").css("background","#f00");document.getElementById("notifymsg").innerHTML=g_notifydata.msg;document.getElementById("notifyfeedbackbtn").style.display=g_notifydata.showFeedback?"":"none";document.getElementById("notifytryagainbtn").style.display=g_notifydata.showLogin?
"":"none";document.getElementById("notifycreateaccountbtn").style.display=g_notifydata.showCreateAccount&&!a.LPISLOC?"":"none";document.getElementById("notifydisablebtn").style.display=g_notifydata.multifactor_disable_url?"":"none";document.getElementById("notifydisablesinglebtn").style.display="none"}else if(g_notifytype=="save"){$("#body").css("background","#87d087");document.getElementById("notifymsg").innerHTML=gs("Should LastPass remember this password?")+" ("+g_notifydata.tld+")"}else if(g_notifytype==
"change"){g_matchingsites=a.getsites(g_notifydata.tld,true);var b;if(array_length(g_matchingsites)==1)for(var c in g_matchingsites){b=gs("LastPass detected a password change for user:")+" "+a.getusernamefromacct(a.g_sites[c]);break}else b=gs("LastPass detected a password change for domain:")+" "+g_notifydata.tld;document.getElementById("notifymsg").innerHTML=b}else if(g_notifytype=="upgrade")if(g_notifydata.upgrade){document.getElementById("notifymsg").innerHTML=gs("An Update is Available. Would you like to install?");
document.getElementById("notifyyesbtn").style.display="";document.getElementById("notifynobtn").style.display=""}else{if(g_notifydata.checking)document.getElementById("notifymsg").innerHTML=gs("Checking For Updates...");else document.getElementById("notifymsg").innerHTML=gs("No Updates Are Available");document.getElementById("notifyyesbtn").style.display="none";document.getElementById("notifynobtn").style.display="none"}a=document.getElementsByTagName("div");for(c=0;c<a.length;c++)if(a[c].id.indexOf("notify")==
0&&a[c].id.substring(a[c].id.length-5)!="popup")a[c].style.display="none";document.getElementById("notify"+g_notifytype).style.display=""}}function savethesite(){var a=getBG();g_notifydata.addsite=1;a.g_site_data=g_notifydata;chrome.tabs.create({url:getchromeurl("site.html")});closemole()}
function clicknever(a){var b={neversite:{title:gs("Never For This Site"),cmd:"neversite"},neverdomain:{title:gs("Never For This Domain"),cmd:"neverdomain"}},c="",d,e;for(d in b)if(b[d]==null)c+='<div id="'+d+'" class="notifyspacer"><div></div></div>';else{e=typeof b[d].cmd=="undefined"?"":" onclick=\"notifyaction('"+b[d].cmd+"')\"";c+='<div id="'+d+'" class="notifybutton"'+e+'"><div>'+b[d].title+"</div></div>"}b=document.getElementById("notifyneverpopup");b.style.left=a.x;b.style.top=0;b.innerHTML=
c}function notifyaction(a){var b=g_notifydata.url,c=getBG();if(a=="neversite")b=c.lpcanonizeUrl(b);else if(a=="neverdomain")b=c.lp_gettld_url(b);c.addNever(b);closemole()}
function changeconfirm(){if(array_length(g_matchingsites)==1)for(var a in g_matchingsites){getBG().changePassword(g_notifydata.newpw,Array(a));break}else if(g_browseraction){receiveBG({cmd:"changepw",newpw:g_notifydata.newpw,tld:g_notifydata.tld});return}else getBG().openchangepw(g_notifydata.newpw,g_notifydata.tld);closemole()};
