/* 
 * 分享到微博的js函数
 */

/**
 * t： 标题，z：分享文章来源地址，id:来源分类p：分享附带的图片 type 0为图文分享(默认) 1为视频分享
 */
function shareToTweet(t,z,id,p,type,key,s,d,e){
    if(undefined == s) {
        s = screen;
    }
    if(undefined == d) {
        d=document;
    }
    if(undefined == e) {
        e=encodeURIComponent;
    }
	var f='http://t.ifeng.com/interface.php?_c=share&_a=share&',
	u=z||d.location,
	pa=['sourceUrl=',e(u),'&title=',e(t||d.title),'&pic=',e(p||''),'&source=',e(id||''),'&type=',e(type||0),'&key=',e(key||0)].join('');

	function a(){
		if(!window.open([f,pa].join(''),'',['toolbar=0,status=0,resizable=1,width=640,height=481,left=',(s.width-640)/2,',top=',(s.height-480)/2].join('')))
            u.href=[f,pa].join('');
    };
    if(/Firefox/.test(navigator.userAgent))
        setTimeout(a,0);
    else a();
}
