var title;
var rsFavorite,context,co;
function addFavorite(id){
/*
版权：北京无忧电脑技术开发有限公司南京分公司
CopyRight:2001-2004 wyks8.com All rights reserved
创建：黄文海
Created by:hengzhe
创建时间：2004-11-08
Created on:
功能：往收藏夹中添加项目。
Function:
输入参数：
Parameters:
返回值：id--商品编号
Return Value:
调用实例：
Call sample:
*/	
	try{
		  title=event.srcElement.title;
	      if(rsFavorite==null){
			rsFavorite = RSGetASPObject("/netstore/member/Favorite.logic.asp");
		  }
		}
	catch(e){
		status="发生错误：\n"+e.description;
		alert("您的浏览器的Applet功能已被禁用，为了能够使用收藏夹，请开启Applet。");
		return(false);
	}
	context= "收藏夹--添加项目";
	co=rsFavorite.add(id,showResults,showErrors,context);
	//}
	//catch(e){
		//alert(context+"发生错误：\n"+e.description);
	//}
}
function removeFavorite(id){
/*
版权：北京无忧电脑技术开发有限公司南京分公司
CopyRight:2001-2004 wyks8.com All rights reserved
创建：黄文海
Created by:hengzhe
创建时间：2004-11-08
Created on:
功能：从收藏夹中移除项目。
Function:
输入参数：
Parameters:
返回值：id--商品编号
Return Value:
调用实例：
Call sample:
*/		
	try{
		if(rsFavorite==null){
			rsFavorite = RSGetASPObject("/netstore/member/Favorite.logic.asp");
		}
      context = "收藏夹--删除项目";
      co=rsFavorite.remove(id,showResults,showErrors,context);
	//document.all['item'+id].style.display='none';
	}
	catch(e){
		alert("从收藏夹中删除项目时出错!\nid:"+id+e.description);
	}
	
}

function showResults(co){
//功能：执行相关的RS方法后，成功时调用该函数。	
var info;
	try{
	if(co.context!="收藏夹--删除项目"){
		info=co.return_value;
		var re=/先/i;
		if(info.search(re)==-1) info="【"+title+"】"+info+"\n是否查看收藏夹？";
		if(confirm(info)) window.open("/netstore/member/favorites.asp");
		}
	}
	catch(e){
		alert("showResults"+e.description);
	}
}
function showErrors(co){
//功能：执行相关的RS方法后，失败时调用该函数。		
    // Dump raw data
    msg = "The raw data returned by the remote method call is "
    msg = msg + co.data
   // alert(msg);
    // Display friendlier information
    msg = "The following error occurred during the " 
    msg = msg + co.context
    msg = msg + " remote scripting call:\n"
    msg = msg + co.message
    alert(msg);
}
