//any_type 说明 4 会员通知,1 中标结果,3 准备资料
function role_check(role_flag,id,ann_type,url,day_count,link_url)
{
	
	if( role_flag == "普通会员" || role_flag == "金卡会员" || role_flag == "银卡会员" || role_flag == "普通商务会员" )
	{
		alert("您还不是星级会员,无权查看此信息!");		
		return false;
		
	}
	if( role_flag == "过客")
	{
		alert("您还没有登录,请先登录!");		
		document.location.href ="user_login.aspx?page_url="+url;
		
	}
	else
	{	
		
		if (day_count < 0)
		{
			alert("您的会员效期已经到期!");		
			return false;

		}
		switch (ann_type)
		{
			case "4":			
				//document.location.href = "ann_detail.aspx?record_id="+id+"&ann_type="+ann_type;
				//document.location.href = link_url; 
				window.open(link_url);
				break;
			case "1":
				if(role_flag != "2星级会员")
				{
					//document.location.href = "ann_detail.aspx?record_id="+id+"&ann_type="+ann_type;
					//document.location.href = link_url; 
					window.open(link_url);
				}
				else
				{
					alert("您还没有足够的权限!");
					document.location.href ="user_xjhy.aspx";
					
				}
				break;
			case "3":
				if( role_flag == "2星级会员" )
				{
					alert("您还没有足够的权限!");
					document.location.href ="user_xjhy.aspx";				
				}
				else if( role_flag == "3星级会员" )
				{
					alert("您还没有足够的权限!");
					document.location.href ="user_xjhy.aspx";
				}
				else
				{
					//document.location.href = "ann_detail.aspx?record_id="+id+"&ann_type="+ann_type;
					//document.location.href = link_url; 
					window.open(link_url);
				}
				break;
		
		}
	}
	
}
function role_check_bs(flag,invite_id,org_id,url,day_count)
{
	
	if( flag == "普通会员" || flag == "金卡会员" || flag == "银卡会员" || flag == "普通商务会员")
	{
		alert("您还不是星级会员,无权查看此信息!");		
		return false;
		
	}
	if( flag == "过客")
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+url;
	}
	
	else
	{		
		if (day_count < 0)
		{
				alert("您的会员效期已经到期!");		
				return false;

		}
		else
		{		
			window.open('bsxz.aspx?invite_id='+invite_id+'&org_id='+org_id ,'','toolbar=0,location=0,directories=0,menubar=0,resizable=1,scrollbars=1,copyhistory=1,width=370,height=300');
		}
	}	
}
//留言与咨询判断
function check_login(user_flag,record_id,from_url,to_url)
{
	
	if (user_flag != "")
	{
		document.location.href = to_url+"?record_id="+record_id+"&message_type=1";
		//+"&product_id="+product_id+"&org_id="+org_id
	}
	else
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+from_url;
		//alert("user_login.aspx?page_url="+from_url);
	}
}

//产品博览
function check_login_bl(user_flag,record_id,from_url,to_url,product_id,org_id)
{
	
	if (user_flag != "")
	{
		document.location.href = to_url+"?record_id="+record_id+"&message_type=1"+"&product_id="+product_id+"&org_id="+org_id;
		//+"&product_id="+product_id+"&org_id="+org_id
	}
	else
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+from_url;
		//alert("user_login.aspx?page_url="+from_url);
	}
}


//招商看板留言判断
function check_login_zs(user_flag,record_id,from_url,to_url,org_id)
{
	
	if (user_flag != "")
	{
		document.location.href = to_url+"?record_id="+record_id+"&message_type=2"+"&org_id="+org_id;
	}
	else
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+from_url;
	}
}

//求购看板留言判断
function check_login_qg(user_flag,record_id,from_url,to_url,org_id)
{
	
	if (user_flag != "")
	{
		document.location.href = to_url+"?record_id="+record_id+"&message_type=3"+"&org_id="+org_id;
	}
	else
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+from_url;
	}
}


//招商信息留言判断
function check_login_zsxx(user_flag,record_id,from_url,to_url,org_id)
{
	if (user_flag != "")
	{
		document.location.href = to_url+"?record_id="+record_id+"&message_type=4&org_id="+org_id;
	}
	else
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+from_url;
	}
}

//求购信息留言判断
function check_login_qgxx(user_flag,record_id,from_url,to_url,org_id)
{
	if (user_flag != "")
	{
		document.location.href = to_url+"?record_id="+record_id+"&message_type=5&org_id="+org_id;
	}
	else
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+from_url;
	}
}



//求购信息留言判断
function ckly_zzkb(user_flag,record_id,from_url,to_url,org_id)
{
	if (user_flag != "")
	{
		document.location.href = to_url+"?record_id="+record_id+"&message_type=5&org_id="+org_id;
	}
	else
	{
		alert("您还没有登录,请先登录!");
		document.location.href ="user_login.aspx?page_url="+from_url;
	}
}