<%@ Control Language="C#"%>
<%@ Register TagPrefix="UI" Namespace="ASPNET.WebControls" Assembly="ASPNET.WebControls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Controls" Assembly="Hishop.Web.Controls" %>
<%@ Register TagPrefix="Hishop" Namespace="Hishop.Web.Components" Assembly="Hishop.Web.Components" %>
<%@ Import Namespace="Hishop.SystemServices" %>
<div id="HiddenFieldProduct">
<asp:HiddenField ID="ProductTitle" runat="server" />
<asp:HiddenField ID="ProductImg" runat="server" />
<asp:HiddenField ID="ProductName" runat="server" />
<asp:HiddenField ID="ProductWebUrl" runat="server" />
<div class="partake">
						<span><a title="查看推荐有礼规则" target="_blank">分享到</a>：</span>
						<div>
						<a title="分享到新浪微博" id="site-sina" onclick="ShareTo('tsina')" href="javascript:void(0)">sina</a>
						<a title="分享到腾讯微博" id="site-qzone" onclick="ShareTo('qqblog')" href="javascript:void(0)">腾讯QQ</a>
						<a title="分享到人人" id="site-renren" onclick="ShareTo('renren')" href="javascript:void(0)">renren</a>
                        <a title="分享到开心网" id="site-kaixing" onclick="ShareTo('kaixin001')" href="javascript:void(0)">kaixing</a>
						<a title="分享到豆瓣" id="site-douban" onclick="ShareTo('douban')" href="javascript:void(0)">douban</a>											
						<a title="分享到MSN" id="site-msn" onclick="ShareTo('msn')" href="javascript:void(0)">msn</a>
						<a title="QQ书签" id="site-qq" href="javascript:void(0)" onclick="ShareTo('qq')">qq</a>						
						<a target="_blank" title="点击更多推荐" id="MoreShareProduct" class="MoreShareProduct">更多推荐</a>
						</div>
</div>

<div id="ShareProduct" style="position:absolute;width:245px;z-index:999;display:none;"> 
<div class="shareto_div_01"> 		
<div class="recTitle">分享到...<a title="关闭" onclick="closeShareTo()"></a></div> 		
<div class="shareto_div_02"> 
<a class="stitle" onclick="ShareTo('tsina');return false;" href="javascript:void(0);"><span class="stico stico_tsina">新浪微博</span></a>
<a class="stitle" onclick="AddBookmark();return false;" href="javascript:void(0);"><span class="stico stico_fav">收藏夹</span></a>	
<a class="stitle" onclick="ShareTo('kaixin001');return false;" href="javascript:void(0);"><span class="stico stico_kaixin001">开心网</span></a>
<a class="stitle" onclick="ShareTo('gmail');return false;" href="javascript:void(0);"><span class="stico stico_gmail">Gmail</span></a>	
<a class="stitle" onclick="ShareTo('renren');return false;" href="javascript:void(0);"><span class="stico stico_renren">人人网</span></a>
<a class="stitle" onclick="ShareTo('qqblog');return false;" href="javascript:void(0);"><span class="stico stico_qqblog">腾讯微博</span></a>
<a class="stitle" onclick="ShareTo('qq');return false;" href="javascript:void(0);"><span class="stico stico_qq">QQ书签</span></a>
<a class="stitle" onclick="ShareTo('qzone');return false;" href="javascript:void(0);"><span class="stico stico_qzone">Qzone</span></a>	
<a class="stitle" onclick="ShareTo('baidu');return false;" href="javascript:void(0);"><span class="stico stico_baidu">百度收藏</span></a>
<a class="stitle" onclick="ShareTo('douban');return false;" href="javascript:void(0);"><span class="stico stico_douban">豆瓣</span></a>	
<a class="stitle" onclick="ShareTo('google');return false;" href="javascript:void(0);"><span class="stico stico_google">谷歌收藏</span></a>
<a class="stitle" onclick="ShareTo('taojianghu');return false;" href="javascript:void(0);"><span class="stico stico_taojianghu">淘江湖</span></a>
<a class="stitle" onclick="ShareTo('vivi');return false;" href="javascript:void(0);"><span class="stico stico_sina">新浪收藏</span></a>
<a class="stitle" onclick="ShareTo('51');return false;" href="javascript:void(0);"><span class="stico stico_51">51社区</span></a>
<a class="stitle" onclick="ShareTo('yahoo');return false;" href="javascript:void(0);"><span class="stico stico_yahoo">Yahoo!收藏</span></a>
<a class="stitle" onclick="ShareTo('bai');return false;" href="javascript:void(0);"><span class="stico stico_bai">白社会</span></a>
<div style="clear: both;"></div></div></div>	
</div>
<script> 
$(function(){
             $("#MoreShareProduct").click(function(event){
                    event.stopPropagation();
                    var leftValue=$(this).offset().left-100; 
                    var topValue=$(this).offset().top+24;
                    $("#ShareProduct").css({top:topValue,left:leftValue}).show(500);//添加动画效果                 
                 });
 });
 
 function closeShareTo()
 {
    $("#ShareProduct").hide(500);
 }
      
 function AddBookmark()
 {
   var inputArray=document.getElementById("HiddenFieldProduct").getElementsByTagName("input");
   var title =inputArray[0].value;//商品标题
   var content =inputArray[2].value;//推广内容	
   var productUrl =inputArray[3].value;//网站访问地址
   	
   if (document.all){
         window.external.AddFavorite(productUrl, title);
    } else if (window.sidebar){
        window.sidebar.addPanel(title, productUrl, "")
    }else if(window.opera && window.print ) {
        var addbm = document.getElementById('addBookmark');
        addbm.setAttribute('rel','sidebar');
        addbm.setAttribute('href',productUrl);
        addbm.setAttribute('title',title);
        addbm.click();
    }else{
        alert("加入收藏失败，请按CTRL+D来手工添加!");
    }
 } 
 
  

function ShareTo(webName)
{
  var url="";
  var inputArray=document.getElementById("HiddenFieldProduct").getElementsByTagName("input");
  var title =inputArray[0].value;//商品标题					       
  var img =inputArray[1].value;//商品图片地址		
   var content =inputArray[2].value;//推广内容		       
   var productUrl =inputArray[3].value;//网站访问地址
  switch(webName){
    case "tsina":
	  url="http://v.t.sina.com.cn/share/share.php?url="+productUrl+"&title="+content; 
	  break;
	 case "kaixin001":
	  url ="http://www.kaixin001.com/repaste/share.php?" + "rtitle=" +content+ "&rcontent=" +  title+productUrl + "&rurl=" + productUrl;	 
	  break;
	 case "gmail":
	  url="https://mail.google.com/mail/?view=cm&fs=1&tf=1&ui=2&shva=1&to&su="+ title + "&body=" + productUrl;
	  break;
	 case "renren":
	  url="http://share.renren.com/share/buttonshare.do?link="+productUrl+"&title="+title;  
	  break;
	 case "qq":
      url="http://shuqian.qq.com/post?from=3&title="+encodeURIComponent(title)+"&uri="+productUrl+"&jumpback=2&noui=1"
	  break;
	  case "qqblog":
	  url="http://v.t.qq.com/share/share.php?site="+productUrl+"&title="+encodeURIComponent(title)+"&pic="+img+"&url="+productUrl  
	  break;	 
	 case "qzone":
	  var url="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+encodeURIComponent(productUrl)
	  break;
	 case "baidu":
	  url="http://cang.baidu.com/do/add?it="+encodeURIComponent(title)+"&iu="+encodeURIComponent(productUrl)+"&fr=ien#nw=1";  
	  break;
	 case "douban":
	   //url="http://www.douban.com/recommend/?title="+title+"&comment="+content+"&url="+productUrl;
	  url='http://www.douban.com/recommend/?url='+productUrl+'&title='+encodeURIComponent(title); 
	  break;
	 case "google":
	  //url="http://www.google.com/reader/link?url='"+productUrl+"'&title='"+title+"'&srcURL="+img+"'";
	  url="http://www.google.com/bookmarks/mark?op=edit&hl=zh-CN&output=popup&bkmk="+productUrl+"&title="+title;  
	  break;
	 case "taojianghu":
	  url="http://share.jianghu.taobao.com/share/addShare.htm?url="+productUrl+"&title="+title;  
	  break;
	 case "vivi":
	  url="http://vivi.sina.com.cn/collect/icollect.php?title="+escape(title)+"&url="+escape(productUrl)+"&desc="+escape(content);  
	  break;
	 case "51":
	  url="http://share.51.com/share/share.php?type=8&title="+encodeURIComponent(title)+"&vaddr="+encodeURIComponent(productUrl);  
	  break;
	 case "yahoo":
	  url="http://myweb.cn.yahoo.com/popadd.html?url="+encodeURIComponent(productUrl)+"&title="+encodeURIComponent(title);  
	  break;
	case "bai":
	  url="http://bai.sohu.com/appLogin.jsp?bru=/app/share/blank/add.do?link="+productUrl+"&title="+title;
	  break;
	case "msn":
	  url ="http://profile.live.com/badge/?url=" + encodeURIComponent(productUrl) + "&title=" + encodeURIComponent(title) + "&description=" + encodeURIComponent(content) + "&screenshot=" + img; 
	  break;
	default:
	  break;
   }
 window.open(url,"_blank");
}
</script>
</div>

             