function ct(o,p,t,ty){
    var nocache = new Date().getTime(); 
    var i = new Image;
    if(t == null) t = o.innerHTML;
    i.src = "/requestlog?url="+encodeURIComponent(o.href)+"&pos="+p+"&title="+t+"&testType="+ty+"&timestamp=" + nocache;
    return true;
}

function ctlog(p,t,ty){
    var nocache = new Date().getTime(); 
    var i = new Image;
    i.src = "/requestlog?pos="+p+"&title="+t+"&testType="+ty+"&timestamp=" + nocache;
    return true;
}
function openYdWeather(){
    var cityName = ele("city").innerHTML;
    if(cityName){
        cityName = cityName.split("<",1);
    }
    var url = "http://www.youdao.com/search?q=" + encodeURIComponent(cityName) + "%E5%A4%A9%E6%B0%94&ue=utf8&keyfrom=hao163.weather";
    window.open(url, "_blank");
    ctlog('searchWeather',cityName,'hao163');
}
function ele(elementId){
    return document.getElementById(elementId);
} 
function openLeftSites(url, cname){
    var a = {href:url};
    ct(a,'leftSites',cname);
    if(url.indexOf("category") != -1){
        window.open(url + "&cname=" + encodeURIComponent(cname), "_blank");
    } else{
        window.open(url);
    }
}