if(kfShareUrl=="")
{
	kfShareUrl=window.location.href;
}
if(kfShareTitle=="")
{
	kfShareTitle=document.title;
}
if(/Android|webOS|iPhone|iPod|BlackBerry|Windows CE|Windows Phone/i.test(navigator.userAgent))
{
	if (navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == "micromessenger")
	{
		var protocolStr = document.location.protocol;
		if(protocolStr == "https:")
		{
   		document.write('<div class="weixinsharecom" onClick="$(this).hide()" id="weixinsharecom"><p><img src="/wap/images/sharepoint.png"/>点击右上角<span>...</span>图标<br />将它转发给指定朋友或微信群<div class="close">点击关闭提示</div></p></div>');
		document.write('<div class="shareBoxMini">');
		document.write('<ul>');
		document.write('<li class="titl">分享到</li>');
		document.write('<li onclick="shareshow();">');
		document.write('<i><img src="/images/share01.png" alt="分享到微信" /></i>');
		document.write('<div class="nam">微信分享</div></li>');
		document.write('</ul></div>');
		}
		else
		{
   		document.write('<div class="weixinsharecom" onClick="$(this).hide()" id="weixinsharecom"><p><img src="/wap/images/sharepoint.png"/>点击右上角<span>...</span>图标<br />将它发送给指定朋友<br />或分享到朋友圈<div class="close">点击关闭提示</div></p></div>');
		document.write('<div class="shareBox">');
		document.write('<ul>');
		document.write('<li class="titl">分享到</li>');
		document.write('<li onclick="shareshow()">');
		document.write('<i><img src="/images/share01.png" alt="分享到微信" /></i>');
		document.write('<div class="nam">微信</div></li>');
		document.write('<li onclick="shareAc(\'qq\');">');
		document.write('<i><img src="/images/share02.png" alt="分享到QQ空间" /></i>');
		document.write('<div class="nam">QQ空间</div></li>');
		document.write('<li onclick="shareAc(\'weibo\');">');
		document.write('<i><img src="/images/share03.png" alt="分享到微博" /></i>');
		document.write('<div class="nam">微博</div></li>');
		document.write('</ul></div>');
		}
    } 
	else 
	{
		document.write('<script language="javascript" src="/js/clipboard.min.js"></script>');
		document.write('<div class="shareBox">');
		document.write('<ul>');
		document.write('<li class="titl">分享到</li>');
		document.write('<li><button class="weixincopy">');
		document.write('<i><img src="/images/share01.png" alt="分享到微信" /></i>');
		document.write('<div class="nam">微信</div></button></li>');
		document.write('<li onclick="shareAc(\'qq\');">');
		document.write('<i><img src="/images/share02.png" alt="分享到QQ空间" /></i>');
		document.write('<div class="nam">QQ空间</div></li>');
		document.write('<li onclick="shareAc(\'weibo\');">');
		document.write('<i><img src="/images/share03.png" alt="分享到微博" /></i>');
		document.write('<div class="nam">微博</div></li>');
		document.write('</ul></div>');
		$(document).ready(function(){ 
		var clipboard = new Clipboard('.weixincopy', {
    	text: function() {
		alert("分享内容已复制，打开微信粘贴发送给朋友或朋友圈。");
        return kfShareTitle+'\r\n'+kfShareUrl;
    	}
		});
		});
	}
 }
 else
 {
	document.write('<div class="shareBox">');
	document.write('<ul>');
	document.write('<li class="titl">分享到</li>');
	document.write('<li onclick="shareAc(\'weixin\');">');
	document.write('<i><img src="/images/share01.png" alt="分享到微信" /></i>');
	document.write('<div class="nam">微信</div></li>');
	document.write('<li onclick="shareAc(\'qq\');">');
	document.write('<i><img src="/images/share02.png" alt="分享到QQ空间" /></i>');
	document.write('<div class="nam">QQ空间</div></li>');
	document.write('<li onclick="shareAc(\'weibo\');">');
	document.write('<i><img src="/images/share03.png" alt="分享到微博" /></i>');
	document.write('<div class="nam">微博</div></li>');
	document.write('</ul></div>');
 }
function shareAc(sv)
{
	if(sv=="qq")
	{
		window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+escape(kfShareUrl)+"&title="+encodeURI(kfShareTitle));
	}
	if(sv=="weibo")
	{
		window.open("http://v.t.sina.com.cn/share/share.php?url="+escape(kfShareUrl)+"&title="+encodeURI(kfShareTitle)+"&searchPic=ture");
	}
	if(sv=="weixin")
	{
		window.open("/s/weixin.aspx?url="+escape(kfShareUrl));
	}
}
function shareshow()
{
	if(kfShareState=="1")
	{
		 window.location.href = kfShareUrl;
	}
	else
	{
		$("#weixinsharecom").show();
	}
}