﻿



//////////////////////////////////////////////////////////////////////////
// 腾讯微博开放平台信息转播分享
//////////////////////////////////////////////////////////////////////////
function postToWb(jobtitle,joburl,appkey,pic,sitename){
			        var _t = encodeURI(jobtitle);
			        var _url = encodeURIComponent(joburl);
			        var _appkey = encodeURI(appkey);
			        var _pic = encodeURI(pic);//（例如：var _pic='图片url1|图片url2|图片url3....）
			        var _site = sitename;
			        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=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
}    

//////////////////////////////////////////////////////////////////////////
// 新浪微博开放平台信息转播分享
//////////////////////////////////////////////////////////////////////////
function postToSinaWb(joburl,jobtitle)
{
        appkeys = '196491329';/**您申请的应用appkey,显示分享来源(可选)|（由万行招聘微博账号申请账号790212655@qq.com add by wby 2011-08-10）*/
        //url = 'http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + ' width='+ _w + ' height=' + _h ;
        //window.open(url,'', 'width=700, height=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
        //document.write('<iframe allowTransparency="true" frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?' + temp.join('&') + '" width="'+ _w+'" height="'+_h+'"></iframe>');
        var url2 = 'http://service.weibo.com/share/share.php?url=' + encodeURIComponent(joburl) + '&appkey=' + encodeURIComponent(appkeys) + '&title=' + encodeURIComponent(jobtitle) + '&pic=&ralateUid=';
        var obj = new Object();
        obj.name="shareWb";
        window.showModalDialog(url2,obj,"dialogWidth=600px;dialogHeight=612px;dialogLeft=10px;dialogTop=10px;resizable=yes;scroll=no");
}


//////////////////////////////////////////////////////////////////////////
// 各种微博分享信息
//////////////////////////////////////////////////////////////////////////
function delHtmlTag(str){ return str.replace(/<[^>]+>/g,""); }
function shareToWb(obj,content,url) {
    var con = obj.id;
    var a = delHtmlTag(content);  // 转发内容
    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"){  //Facebook
    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(url)+'&title='+ encodeURIComponent(content) +'&source=万行教师人才网&sourceUrl=http://www.job910.com/&content=gb2312&pic=';window.open(u,"btn_sina",'width=700, height=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no');
    }
    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{
     return false;
    }
} 
