/*
添加到收藏
*/

function addfavorite(cateid,infoid,strname,strurl){
	addschedule(0);
	var url="/addfavorite.ashx";
	var pars="cateid="+cateid+"&cid="+infoid+"&title="+escape(strname)+"&strurl="+escape(strurl);
	var myajax=new Ajax.Request(
					url,{
					method:"post",
					parameters:pars,
					onComplete:function(res){addschedule(1);},
					onSuccess:function(res){					
					var r=parseInt(res.responseText);
						if(r==1){
							alert('恭喜您!\n收藏此信息成功!');
						}else if(r==-2){
							alert('对不起!\n收藏此信息失败!\n请稍候再试!');
						}else if(r==-1){
							if(confirm('您不是本站会员,或者还没有登录!\n是否现在登录?')){
								window.location.href="/user/login.aspx?refurl="+escape(window.location.href);
							}
						}
					},
					onFailure:function(res){
						
						alert('添加收藏失败!请稍后再试!');
					}			
					});
	
}
function contrastbizinfo(form,cateid){	
	var s=GetCheckBoxValue(form,'checkid');
	if(s=='' || s.indexOf(',')<=0){
		alert('请选择至少2条信息进行对比!');
	}else{
		switch(cateid){
			case 1:
				window.location.href='/sell/compare.aspx?checkid='+s;
		}
	}
}
function contrastbizinfochklength(form,obj){
	var s=GetCheckBoxValue(form,'checkid');
	var ary=s.split(",");
	if(ary.length>10){
		alert('您已经选择了10条信息,候选的信息不能超过10条!');
		obj.checked=false;
	}else{
		if(obj.checked){
			obj.parentNode.parentNode.parentNode.style.backgroundColor='#FEEEE0';
		}else{
			obj.parentNode.parentNode.parentNode.style.backgroundColor='#FEFFEE';
		}
	}
}

