function share(where){
    var href = encodeURIComponent(document.location.href),
		title = encodeURIComponent(document.title),
	    text=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text),
		url;
	switch(where){
	    case 'qq':
			url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+href;
		    window.open(url);
		    break;
		case 'kaixin':
			url = 'http://www.kaixin001.com/repaste/share.php?rurl='+href+'&rtitle='+title+'&rcontent='+title;
		    window.open(url,'kaixin');
		    break;
		case 'xiaonei':
			url = 'http://share.xiaonei.com/share/buttonshare.do?link='+href+'&title='+title;
		    window.open(url,'xnshare','toolbar=0,status=0,resizable=1,width=626,height=436,left='+(window.screen.width-626)/2+',top='+(window.screen.height-436)/2);
			break;
		case 'baidu':
		    url = "http://cang.baidu.com/do/add?it="+ encodeURIComponent(document.title.substr(0,76))+"&iu="+href+"&dc="+text.substr(0,180)+"&fr=ien#nw=1";
		    window.open(url,'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes');
			break;
		case 'sinavivi':
			url = 'http://vivi.sina.com.cn/collect/icollect.php?pid=28&title='+escape(document.title)+'&url='+href+'&desc='+text;
		    window.open(url,'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes');
			break;
		case 'google':
			url = 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk='+href+'&title='+title;
		    window.open(url,'bkmk_popup','left='+((window.screenX||window.screenLeft)+10)+',top='+((window.screenY||window.screenTop)+10)+',height=420px,width=550px,resizable=1,alwaysRaised=1');
			break;
		case 'yahoo':
			url = 'http://myweb.cn.yahoo.com/popadd.html?url='+href+'&title='+title;
		    window.open(url,'Yahoo','scrollbars=yes,width=440,height=440,left=80,top=80,status=yes,resizable=yes');
			break;
		case 'xianguo':
			url = 'http://www.xianguo.com/service/submitfav/?link='+href+'&title='+title;
		    window.open(url,'_blank');
			break;
		case 'douban':
			url = 'http://www.douban.com/recommend/?url='+href+'&title='+title;
		    window.open(url,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330');
			break;
		case 'sina':
			url = 'http://v.t.sina.com.cn/share/share.php?title='+title+'&url='+href+'&source=bookmark';
		    window.open(url,'_blank','width=450,height=400');
			break;
		case 'sohu':
			url = 'http://t.sohu.com/third/post.jsp?url='+href+'&title='+title+'&content=utf-8&pic=';
		    window.open(url,'mb','toolbar=0,status=0,resizable=1,width=660,height=470,left='+(window.screen.width-660)/2+',top='+(window.screen.height-470)/2)
			break;
		case '163'://163微博接口有问题
			url = 'http://t.163.com/article/user/checkLogin.do?link=http://www.yoka.com/&amp;source='+ encodeURIComponent('网易新闻')+'&amp;info='+title+ ' '+href+'&amp;'+new Date().getTime();
		    window.open(url,'newwindow','height=330,width=550,top='+(window.screen.height-280)/2+',left='+(window.screen.width-550)/2+', toolbar=no, menubar=no, scrollbars=no,resizable=yes,location=no, status=no')
			break;
		case 'myspace':
			url = 'http://www.myspace.cn/Modules/PostTo/Pages/Default.aspx?u='+href+"&t="+title;
		    window.open(url);
		case 'qqblog':
			var _appkey = encodeURI("1276cd82e5394ddea71084869cd13a16 ");//你从腾讯获得的appkey
			var _pic = encodeURI('');//（例如：var _pic='图片url1|图片url2|图片url3....）
			var _site = '';//你的网站地址
			url = 'http://v.t.qq.com/share/share.php?url='+href+'&appkey='+_appkey+'&site='+_site+'&pic='+_pic+'&title='+title;
			window.open( url,'', 'width=700, height=680, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no' );
	}
}

