﻿function drop_mouseover(pos){
	try{window.clearTimeout(timer);}catch(e){}
}
function drop_mouseout(pos){
	var posSel=document.getElementById(pos+"Sel").style.display;
	if(posSel=="block"){
		timer = setTimeout("drop_hide('"+pos+"')", 1000);
	}
}
function drop_hide(pos){
	document.getElementById(pos+"Sel").style.display="none";
}
function search_show(pos,searchType,href){
    document.getElementById(pos+"SearchType").value=searchType;
    document.getElementById(pos+"Sel").style.display="none";
    document.getElementById(pos+"Slected").innerHTML=href.innerHTML;
    document.getElementById(pos+'q').focus();
    var sE = document.getElementById("searchExtend");
    if(sE != undefined && searchType == "bar"){
    	sE.style.display="block";
    }else if(sE != undefined){
    	sE.style.display="none";
    }
	try{window.clearTimeout(timer);}catch(e){}
	return false;
}


$(document).ready(function () {
    //分类
    $('.sidelist').mousemove(function () {
        $(this).find('.i-list').show();
        $(this).find('p').addClass('hover');
    });
    $('.sidelist').mouseleave(function () {
        $(this).find('.i-list').hide();
        $(this).find('p').removeClass('hover');
    });
});



function postToWb() {
    var _t = encodeURI(document.title);
    var _url = encodeURIComponent(document.location);
    var _appkey = encodeURI("appkey"); //你从腾讯获得的appkey
    var _pic = encodeURI(''); //（例如：var _pic='图片url1|图片url2|图片url3....）
    var _site = ''; //你的网站地址
    var _u = 'http://v.t.qq.com/share/share.php?url=' + _url + '&appkey=' + _appkey + '&site=' + _site + '&pic=' + _pic + '&title=' + _t;
    window.open(_u, '', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
}

function delHtmlTag(str) { return str.replace(/<[^>]+>/g, ""); }
function cli(obj) {
    var con = obj.id;
    var a = delHtmlTag(document.getElementById("newstitle").innerHTML);
    var b = "";
    if (con == "btn_sf") {
        var u = 'http://t.sohu.com/third/post.jsp?&url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(a) + '&c=' + encodeURIComponent(b) + '&content=gb2312'; window.open(u, "sohu");
    }
    else if (con == "btn_kx") {
        var u = 'http://www.kaixin001.com/repaste/share.php?rtitle=' + encodeURIComponent(a) + '&rurl=' + encodeURIComponent(location.href) + '&rcontent=' + encodeURIComponent(b); window.open(u, "kaixin");
    }
    else if (con == "btn_xn") {
        var u = 'http://share.renren.com/share/buttonshare.do?link=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(a); window.open(u, "xiaonei");
    }
    else if (con == "btn_db") {
        var u = 'http://www.douban.com/recommend/?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(a); window.open(u, "douban");
    }
    else if (con == "btn_fb") {
        var u = 'http://www.facebook.com/share.php?u=' + encodeURIComponent(location.href) + '&t=' + encodeURIComponent(a) + '&rurl=' + encodeURIComponent(location.href) + '&rcontent=' + encodeURIComponent(b); window.open(u, "btn_fb");
    }
    else if (con == "btn_tt") {
        var u = 'http://twitter.com/home?status=' + encodeURIComponent(a) + encodeURIComponent(location.href) + '&content' + encodeURIComponent(location.href); window.open(u, "btn_tt");
    }
    else if (con == "btn_ff") {
        var u = 'http://fanfou.com/share.new?u=' + encodeURIComponent(location.href) + '&t=' + encodeURIComponent(a) + '&d=' + encodeURIComponent(b); window.location.href = u;
    }
    else if (con == "btn_sina") {
        var u = 'http://v.t.sina.com.cn/share/share.php?url=' + encodeURIComponent(b) + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(a) + '&source=浙江在线网&sourceUrl=http://www.zjol.com.cn/&content=gb2312&pic='; window.open(u, "btn_sina");
    }
    else if (con == "btn_t6") {
        var u = 'http://t.zjol.com.cn/api/share.php?url=' + encodeURIComponent(location.href) + '&title=' + escape(a); window.open(u, "t6");
    }
    else if (con == "btn_phone") {
        var u = 'http://go.10086.cn/ishare.do?m=t&u=' + encodeURIComponent(location.href) + 'sid=6295c13d16170cd3930687d8156ed4a0'; window.open(u, "btn_phone");
    } else { return false }
}
