var SERVER = "http://ht.www.sogou.com/websearch/features/yun4.jsp?pid=sogou-brse-596dedf4498e258e&";
window.comSogouWwwStop = true;
setTimeout(function(){
if (!document.location || document.location.toString().indexOf(SERVER) != 0){
return;
}
function bind(elem, evt, func){
if (elem){
return elem.addEventListener?elem.addEventListener(evt,func,false):elem.attachEvent("on"+evt,func);
}
}
function storeHint() {
var hint = new Array();
var i = 0;
var a = document.getElementById("hint_" + i);
var b = document.getElementById("hint_text_" + i);
var storeClick = function(){sogouExplorer.extension.sendRequest({cmd: "click"});}
while(a && b) {
bind(a, "click", storeClick);
hint.push({"text":b.innerHTML, "url":a.href});
i++;
a = document.getElementById("hint_" + i);
b = document.getElementById("hint_text_" + i);
}
return hint;
}
if (document.getElementById("windowcloseit")){
var flag_is_new = "flag-is-new";
if (document.getElementById("windowcloseit").className.indexOf(flag_is_new) === -1) {
document.getElementById("windowcloseit"). cdth= function(){
sogouExplorer.extension.sendRequest({cmd: "closeit"});
}
}
// with "flag-is-new", should apply the new logic to process;
// send "ext_hide_it" to extension;
else {
document.getElementById("windowcloseit"). cdth= function(){
sogouExplorer.extension.sendRequest({cmd: "ext_hide_it"});
}
}
var flag = false;
document.getElementById("bbconfig"). cdth= function(){
flag = true;
var style = document.getElementById("pan_style").className;
if(style && style === "old"){
sogouExplorer.extension.sendRequest({cmd: "config",type:"old"});
}else if(style && style === "1"){
sogouExplorer.extension.sendRequest({cmd: "config",type:"1"});
}else if(style && style === "6"){
sogouExplorer.extension.sendRequest({cmd: "config",type:"6"});
}else if(style && style === "7"){
sogouExplorer.extension.sendRequest({cmd: "config",type:"7"});
}else if(style && style === "8"){
sogouExplorer.extension.sendRequest({cmd: "config",type:"8"});
}
return false;
}
document.body. cdth= function(){
if (flag) {
flag = false;
} else {
sogouExplorer.extension.sendRequest({cmd: "closeconfig"});
}
};
// document.getElementById("bbhidden"). cdth= function(){
// sogouExplorer.extension.sendRequest({cmd: "hide"});
// return false;
// }
var sogoutip = document.getElementById("sogoutip");
var tip = {};
tip.word = sogoutip.innerHTML;
tip.c cdth= sogoutip.title.split(",");
var hint = storeHint();
sogouExplorer.extension.sendRequest({cmd: "show", data: {hint:hint,tip:tip}});
}else{
if (document.getElementById("windowcloseitnow")){
sogouExplorer.extension.sendRequest({cmd: "closeit", data: true});
}
}
}, 1);