function func_share(s_type,s_url,s_title,Cmd,CmdNum) {
	s_url=encodeURI(s_url);
	//s_title=encodeURI(s_title);
	
	$.ajax({
   		type: "POST",
	    url: "sharer.asp",
	    data: "idanc=kdoand&Cmd="+Cmd+"&CmdNum="+CmdNum+"&title="+s_title+"&stype="+s_type,
	    success: function(msg){
		//alert(msg);
		//document.getElementById("word").value=msg
	   }
	 });
	
	switch(s_type)
	   {
	   case 'f':
			func_share_facebook(s_url,s_title);
		 break
	   case 'p':
			func_share_plurk(s_url, s_title);
		 break
	   case 's':
			func_share_send(s_url);
	   break 
	   default:
			func_share_fw(s_url, s_title,Cmd);
	   }
	   

};
function func_share_facebook(s_url, s_title) {
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(s_url)+'&t='+encodeURIComponent(s_title));
	return false;
};

function func_share_plurk(s_url, s_title) {
	window.open('http://www.plurk.com/?qualifier=shares&status='+encodeURIComponent(s_url)+' ('+encodeURIComponent(s_title)+')');
	return false;
};

function func_share_send(s_url) {
	window.open(s_url);
	return false;
};

function func_shareicon(s_url,s_title,Cmd,CmdNum,mode) {
	if (eval(mode)==3){
		document.write('<table width="600" border="0" cellspacing="0" cellpadding="0">'+
		 '<tr>'+
		  '<td valign="top" width="50"><img src="http://i.fgi.tw/images/share/blogpf_01.gif" width="50" height="32" /></td>'+
		  '<td valign="top" width="24"><a href="javascript:void(0);" onClick="javascript:func_share(\'p\',\''+s_url+'\',\''+s_title+'\',\''+Cmd+'\',\''+CmdNum+'\')"><img src="http://i.fgi.tw/images/share/plurk_'+mode+'.gif" width="24" height="32" alt="推薦到你的噗浪" border="0" align="absmiddle" /></a></td>'+
		  '<td valign="top" width="46"><a href="javascript:void(0);" onClick="javascript:func_share(\'f\',\''+s_url+'\',\''+s_title+'\',\''+Cmd+'\',\''+CmdNum+'\')"><img src="http://i.fgi.tw/images/share/facebook_'+mode+'.gif" width="31" height="32" alt="推薦到你的臉書" border="0" align="absmiddle" /></a></td>'+
		  '<td>&nbsp;</td>'+
		  '<td valign="top"><g:plusone></g:plusone></td>'+
		  '<td>'+
		'<iframe src="http://www.facebook.com/plugins/like.php?href='+s_url+'&amp;layout=standard&amp;show_faces=true&amp;width=480&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:480px; height:80px;" allowTransparency="true"></iframe>'+
		'</td></tr></table>');
	}else{
		document.write('<table width="98" border="0" class="t1">'+
		 '<tr>'+
		  '<td width="22"><a href="javascript:void(0);" onClick="javascript:func_share(\'p\',\''+s_url+'\',\''+s_title+'\',\''+Cmd+'\',\''+CmdNum+'\')"><img src="http://i.fgi.tw/images/plurkicon.gif" alt="推薦到你的噗浪" border="0" align="absmiddle" /></a></td>'+
		  '<td width="22"><a href="javascript:void(0);" onClick="javascript:func_share(\'f\',\''+s_url+'\',\''+s_title+'\',\''+Cmd+'\',\''+CmdNum+'\')"><img src="http://i.fgi.tw/images/facebookicon.gif" alt="推薦到你的臉書" border="0" align="absmiddle" /></a></td>'+
		  '<td width="22"><a href="javascript:void(0);" onClick="javascript:func_share(\'s\',\'http://www.fashionguide.com.tw/DM08/SendToFriendF.asp?DM08Num=\''+CmdNum+'\'&SendM=D\',\''+s_title+'\',\''+Cmd+'\',\''+CmdNum+'\')"><img src="http://i.fgi.tw/images/emailicon.gif" alt="寄給好友" border="0" align="absmiddle" /></a></td>'+
		 '</tr>'+
		'</table>');
	}
}


