/***********  设置确认按钮事件  ***********/
function SetBtnClick()
{
	var StrUrl = window._RetUrl;
	if(StrUrl != "")
	{
		if(StrUrl != '')
		{
			SetSafetyCookie();
			close();
			window.location.href = StrUrl;
		}
		else
		{
			SetSafetyCookie();
			close();
			window.location.href = window.location.href;			
		}
	}
	else
	{
		SetSafetyCookie();
		close();
		window.location.href = window.location.href;
	}
}
function GetCookie(name)
{
	m=document.cookie;
	re1=new RegExp("(?!\w)"+name+"=[^;]+","");
	re2=new RegExp("^"+name+"=","");
	try
	{
		var a=unescape(m.match(re1)[0]);
	}
	catch(e)
	{
		return null
	}
	return a;
} 

function SetSafetyCookie() 
{
	var ChboxID = document.getElementById("checkbox1");
	if(ChboxID.checked)
	{
		var name = 'login_SafetyCookie';
		//获取cookie中的内容
		var SafetyCookie = GetCookie(name);
		var SafetyCookies='';
		if (SafetyCookie!=null)
		{
			SafetyCookie = SafetyCookie.substring(SafetyCookie.lastIndexOf('=')+1,SafetyCookie.length);
			SafetyCookies =SafetyCookie.split(',');
		}
		//如果小于5个，直接加
		if (SafetyCookie==null)
		{
			value=window._loginID+',';
		}
		else if (SafetyCookies.length<6)
		{
			if (SafetyCookie.indexOf(window._loginID+',')<0)
			{
				value=SafetyCookie+window._loginID+',';
			}
		}
		else
		{
			var temp1= SafetyCookie.length;
			var temp2= SafetyCookie.indexOf(',')+1;
			value=SafetyCookie.substring(temp2,temp1)+window._loginID+',';
		}
		
		var expdate = new Date();
		var path = '/';
		var domain = '5173.com';
		expdate.setTime(expdate.getTime() + 1000*60*60*24*365);
		document.cookie = name + "=" + escape(value) + "; expires="+ expdate.toGMTString()
		+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain));	//escape(value)
	}
	

}
/********** 关闭弹出层**********/
function close()
{
	call_back_win_js_alert_close();
}
/********* 执行关闭回调事件 *********/
function call_back_win_js_alert_close()
{
	window.location.href = window.location.href;	
}
function GoCheckKf()
{  
	window.open('http://www.5173.com/CheckKefu.aspx');		
}
function GoRestPwd()
{   
	window.open('http://user.5173.com/findpassword.aspx');
}
