	/*使用说明
    在页面头部调用脚本：
    <script src="http://10.1.11.34/v/handong/ucenter/include/fast.js"></script>
 
    定义回调函数,例如：
    function fastcallback(typestr,userinfo)
    返回参数：typestr   类型：字符串为"login"或者"logout",分别对应登录或者退出
    		 userinfo 类型：数组 例：用户信息,userinfo['uid']和userinfo['username']
 
    注册回调函数：
    RegisterLoginCallback(fastcallback);
    
	调用：
    fastlogin(_HtmlStr,is_center,is_background,callback)
    _HtmlStr:类型字符串,参数为2种，'register':注册窗口 'login':快速登录
    is_center：类型字符,是否居中，false在鼠标位置显示
    is_background：类型字符,是否背景变灰
	callback:只执行本次的回调函数

	完整例子：
    <script src="http://10.1.11.34/v/handong/ucenter/include/fast.js"></script>
	<script>
	 RegisterLoginCallback(fastcallback);
	 function fastcallback(typestr,userinfo){
		alert(typestr+'-'+userinfo['uid']);	 
	 }
	</script>
	<a href="#" onclick="fastlogin('register','false','')">快速注册</a><br>
    <a href="#" onclick="fastlogin('login','false','')">快速登录</a><br>
	<a href="#" onclick="fastlogin('backPSW','false','')">找回密码</a><br>
*/
	
	try{
		hostUrl
	}catch(err){
		hostUrl="http://member.openv.com/";
	}
	var imageUrl="http://img.openv.tv/member/reg_new/";
	var tempcallback=null;
	DynamicLoadCSS(imageUrl+"style/fastzc.css");
	DynamicLoadJS("http://img.openv.tv/vsns/phprpc/js/compressed/phprpc_client.js");
	var mouseX;
	var mouseY;
	var scrollY;
	function $$(id){
		return document.getElementById(id)
	}
	function trim(str) {
		return (str + '').replace(/(\s+)$/g, '').replace(/^\s+/g, '');
	}
	
	var onLogincallbackList = new Array();
	//注册回调函数
	function RegisterLoginCallback(_func)
	{
		onLogincallbackList[onLogincallbackList.length] = _func;
	}

	//注册/登录回调
	function registerState(result){
		if(result['state']=='false'){
			onwrong(result['lable'],result['showmessage']);
		}else{
			if (tempcallback)
			{
				tempcallback('login',result);
				tempcallback = null;
			}
			for (var i=0;i<onLogincallbackList.length;i++)
			{
				onLogincallbackList[i]('login',result);
			}
			closeBox();
		}
	}
	
	//验证回调
	function r(result){
		if(result['state']=='true'){
			onright(result['lable'],'');
		}else{
			onwrong(result['lable'],result['showmessage']);
		}
	}
	
	//取回密码回调
	function backPSWr(result){
		//if(result['state']=='true'){
			$$(result['lable']).innerHTML=eval(result['showmessage']);
		//}
	}
	
	//使用RPC
	function Get_RPC_Data(Function_str,phpvar){
			var rpc = new PHPRPC_Client(hostUrl+'fastlogin.php', [Function_str]);
			if(Function_str=='checkemail') rpc.checkemail(phpvar,r);	
			if(Function_str=='checkusername') rpc.checkusername(phpvar,r);
			if(Function_str=='checkcode') rpc.checkcode(phpvar,r);
			if(Function_str=='register') rpc.register(phpvar,registerState);
			if(Function_str=='login') rpc.login(phpvar,registerState);
			if(Function_str=='backPSW') rpc.backPSW(phpvar,backPSWr);
	}
	
	//在层中显示html		
	function fastlogin(_HtmlStr,is_center,is_background,callback){
		//注册页面
		register_Html="<table id=\"register\" width=\"418\"  height=\"353\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"border_fast\">  <tr>    <td height=\"32\" background=\""+imageUrl+"image\/top_1.jpg\" bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">      <tr>        <td width=\"3%\">&nbsp;<\/td>        <td width=\"87%\" class=\"f14_fast c_white_fast\"><strong>快速注册<\/strong><\/td>        <td width=\"10%\" class=\"c_white_fast\"><strong><a href=\"javascript:closeBox();\" class=\"c_white_fast\">关闭<\/a><\/strong><\/td>      <\/tr>    <\/table><\/td>  <\/tr>  <tr>    <td bgcolor=\"#FFFFFF\"><div align=\"center\"><form id=\"form1\" name=\"form1\" method=\"post\" action=\"\" onsubmit=\"return false;\" target=\"BackData\">     <table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">          <tr>            <td width=\"19%\" height=\"25\">&nbsp;<\/td>            <td width=\"45%\">&nbsp;<\/td>            <td width=\"36%\"><div align=\"right\"><a href=\"javascript:fastlogin(\'login\',\'"+is_center+"\',\'"+is_background+"\',\'"+callback+"\');\" class=\"c_orange_fast\">已经注册过天线了<\/a><\/div><\/td>          <\/tr>          <tr>            <td height=\"8\" colspan=\"3\"><\/td>            <\/tr>          <tr>            <td height=\"40\" class=\"f14_fast\"><div align=\"right\" class=\"f14_fast\">Email：<\/div><\/td>            <td><label>              <div align=\"left\">                <input name=\fastemail\" id=\"fastemail\" type=\"text\" class=\"input1_fast\" onblur=\"checkmail()\" \/>                <\/div>            <\/label>            <\/td>            <td>  <table id=\"emailcheck\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>  <td width=\"9%\">&nbsp;<\/td>  <td width=\"91%\" align=\"left\" class=\"c_grey_fast\">请输入您的真实邮箱，用于登录。<\/td><\/tr>  <\/table><\/td>          <\/tr>          <tr>            <td height=\"40\" class=\"f14_fast\"><div align=\"right\">昵称：<\/div><\/td>            <td><div align=\"left\">              <input name=\"fastusername\" id=\"fastusername\" type=\"text\" class=\"input1_fast\" onblur=\"checkusername()\" \/>            <\/div><\/td>            <td class=\"c_grey2_fast\">  <table id=\"usernamecheck\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>  <td width=\"9%\">&nbsp;<\/td>  <td width=\"91%\" align=\"left\" class=\"c_grey_fast\">昵称是少 4个字符，最多可以30个字符<\/td><\/tr>  <\/table><\/td>          <\/tr>          <tr>            <td height=\"40\" class=\"f14_fast\"><div align=\"right\">密码：<\/div><\/td>            <td><div align=\"left\">              <input name=\"fastpassword\" id=\"fastpassword\" type=\"password\" class=\"input1_fast\" onblur=\"checkpassword()\"\/>            <\/div><\/td>            <td class=\"c_grey2_fast\"><table id=\"passwordcheck\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">  <tr><td width=\"9%\">&nbsp;<\/td><td width=\"91%\" align=\"left\" class=\"c_grey_fast\">6到16位的数字或字母。<\/td>  <\/tr><\/table><\/td>          <\/tr>          <tr>            <td height=\"40\" class=\"f14_fast\"><div align=\"right\">确认密码：<\/div><\/td>            <td><div align=\"left\">              <input name=\"fastlastpassword\" id=\"fastlastpassword\" type=\"password\" class=\"input1_fast\" onblur=\"checklastpassword()\"\/>            <\/div><\/td>            <td><table id=\"lastpasswordcheck\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>  <td width=\"9%\">&nbsp;<\/td>  <td width=\"91%\" align=\"left\" class=\"c_grey_fast\">请重复输入您的密码<\/td><\/tr>  <\/table><\/td>          <\/tr>          <tr>            <td height=\"40\" class=\"f14_fast\"><div align=\"right\">验证码：<\/div><\/td>            <td><div align=\"left\">              <input name=\"inputcheckcode\" type=\"text\" class=\"input1_fast\" id=\"inputcheckcode\" onblur=\"checkinputcheckcode()\" maxlength=\"4\" \/>  <input type=\"hidden\" name=\"poststart\" value=\"ok\" \/>            <\/div><\/td>            <td><table id=\"inputcheckcodecheck\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>  <td width=\"9%\">&nbsp;<\/td>  <td width=\"91%\" align=\"left\" class=\"c_grey_fast\">请输入下面图片中的字母和数字<\/td><\/tr>  <\/table><\/td>          <\/tr>          <tr>            <td height=\"35\" class=\"f14_fast\"><div align=\"right\"><\/div><\/td>            <td colspan=\"2\"><div align=\"left\"><img id=\"fast_checkcode\" src=\""+hostUrl+"checkcode.php\" width=\"56\" height=\"25\" align=\"absmiddle\" \/>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c_grey2_fast\">如果看不清，点<a href=\"javascript:insteadcheckcode();\" class=\"c_orange_fast\">这里<\/a>换一张。<\/span><\/div>              <div align=\"left\"><\/div><\/td>            <\/tr>          <tr>            <td height=\"35\" class=\"f14_fast\"><div align=\"right\"><\/div><\/td>            <td valign=\"bottom\"><div align=\"center\"><input id=\"submitbutton\" type=\"image\" src=\""+imageUrl+"image\/anniu_zc.jpg\" onclick=\"return checksubmit();\" \/><\/div><\/td>            <td>&nbsp;<\/td>          <\/tr>          <\/table><\/form>    <\/div><\/td>  <\/tr>    <tr>    <td height=\"8\" bgcolor=\"#FFFFFF\"><\/td>  <\/tr><\/table>";
	
		//登录页面
		login_Html="<table id=\"login\" width=\"358\" height=\"205\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"border_fast\">  <tr>    <td height=\"32\" background=\""+imageUrl+"image\/top_1.jpg\" bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">      <tr>        <td width=\"3%\">&nbsp;<\/td>        <td width=\"87%\" class=\"f14_fast c_white_fast\"><strong>快速登录<\/strong><\/td>        <td width=\"10%\" class=\"c_white_fast\"><strong><a href=\"javascript:closeBox();\" class=\"c_white_fast\">关闭<\/a><\/strong><\/td>      <\/tr>    <\/table><\/td>  <\/tr>  <tr>    <td bgcolor=\"#FFFFFF\"><div align=\"center\">      <form id=\"form1\" name=\"form1\" method=\"post\" action=\"\" onsubmit=\"return false;\">        <table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">          <tr>            <td height=\"10\" colspan=\"3\"><\/td>            <\/tr>          <tr>            <td height=\"8\" colspan=\"3\"><table id=\"loginerror\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>  <td width=\"9%\">&nbsp;<\/td>  <td width=\"91%\" align=\"left\" class=\"c_grey_fast\">&nbsp;<\/td><\/tr>  <\/table><\/td>          <\/tr>          <tr>            <td width=\"18%\" height=\"35\" class=\"f14_fast\"><div align=\"right\" class=\"f14_fast\">用户名：<\/div><\/td>            <td width=\"55%\"><label>                  <div align=\"left\">                    <input name=\"fastemail\" id=\"fastemail\" type=\"text\" class=\"input1_fast\" \/>                  <\/div>              <\/label>            <\/td>            <td width=\"27%\"><div align=\"left\" class=\"c_grey2_fast\">              <div align=\"left\">输入邮箱或昵称登录<\/div>            <\/div><\/td>          <\/tr>          <tr>            <td height=\"35\" class=\"f14_fast\"><div align=\"right\">密码：<\/div><\/td>            <td><div align=\"left\">              <input name=\"fastpassword\" id=\"fastpassword\" type=\"password\" class=\"input1_fast\" \/><input type=\"hidden\" name=\"loginsubmit\" value=\"yes\" />            <\/div><\/td>            <td class=\"c_grey2_fast\"><div align=\"left\">输入密码。<\/div><\/td>          <\/tr>          <tr>            <td height=\"35\" class=\"f14_fast\"><div align=\"right\"><\/div><\/td>            <td><div align=\"center\">轻松<a href=\"javascript:fastlogin(\'register\',\'"+is_center+"\',\'"+is_background+"\',\'"+callback+"\');\" class=\"c_orange_fast\">注册<\/a>  10秒搞定<\/div>              <div align=\"left\"><\/div><\/td>            <td>&nbsp;<\/td>          <\/tr>          <tr>            <td height=\"35\" class=\"f14_fast\"><div align=\"right\"><\/div><\/td>            <td valign=\"bottom\"><div align=\"center\"><input type=\"image\" src=\""+imageUrl+"image\/anniu_dl.jpg\" onclick=\"return login();\" \/><\/div><\/td>            <td>&nbsp;<\/td>          <\/tr>        <\/table>      <\/form>    <\/div><\/td>  <\/tr><\/table>";

		//找回密码
		backPSW_Html="<table width=\"418\" height=\"196\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"border_fast\">  <tr>    <td height=\"32\" background=\""+imageUrl+"image\/top_1.jpg\" bgcolor=\"#FFFFFF\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">      <tr>        <td width=\"3%\">&nbsp;<\/td>        <td width=\"87%\" class=\"f14_fast c_white_fast\"><strong>找回密码<\/strong><\/td>        <td width=\"10%\" class=\"c_white_fast\"><strong><a href=\"javascript:closeBox();\" class=\"c_white_fast\">关闭<\/a><\/strong><\/td>      <\/tr>    <\/table><\/td>  <\/tr>  <tr>    <td bgcolor=\"#FFFFFF\" valign=\"top\"><div id=\"backpsw\" align=\"center\">      <table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">          <tr>            <td height=\"10\" colspan=\"3\"><\/td>          <\/tr>          <tr>            <td height=\"8\" colspan=\"3\"><\/td>          <\/tr>          <tr>            <td width=\"54%\" height=\"35\" class=\"f14_fast\">输入您注册时登记的Email地址：<\/td>            <td width=\"46%\"><label>                  <div align=\"left\">                    <input name=\"fastbackPSW\" id=\"fastbackPSW\" type=\"text\" class=\"input1_fast\" \/>                  <\/div>              <\/label>            <\/td>          <\/tr>          <tr>            <td height=\"40\" class=\"f14_fast\">&nbsp;<\/td>            <td><table id=\"fastPSWcheck\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>  <td width=\"9%\">&nbsp;<\/td>  <td width=\"91%\" align=\"left\" class=\"c_grey_fast\">&nbsp;<\/td><\/tr>  <\/table><\/td>          <\/tr>          <tr>            <td height=\"35\" colspan=\"2\" class=\"f14_fast\"><div align=\"center\"><input type=\"image\" src=\""+imageUrl+"image\/anniu_send.jpg\" onclick=\"return checkbackPSW();\" \/><\/div><\/td>            <\/tr>        <\/table>      <\/div><\/td>  <\/tr><\/table>";
		//找回密码成功
		backPSWok_Html="<table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">          <tr>            <td height=\"10\"><\/td>          <\/tr>          <tr>            <td height=\"8\"><\/td>          <\/tr>          <tr>            <td height=\"44\" bgcolor=\"#FFFFEB\" class=\"border3\"><div align=\"left\"><span class=\"c_grey2_fast f14_fast\" style=\"padding-left:20px;\">密码邮件发送成功，请登录您的邮箱查看。<\/span><\/div><\/td>            <\/tr>          <tr>            <td height=\"20\" class=\"f14_fast\"><\/td>            <\/tr>          <tr>            <td height=\"35\" class=\"f14_fast\" align=\"center\"><a href=\"javascript:fastlogin(\'login\',\'"+is_center+"\',\'"+is_background+"\',\'"+callback+"\');\">重新登录<\/a>　　<a href=\"http://www.openv.com\">返回首页<\/a><\/td>            <\/tr><\/table>";
		
		tempcallback = eval(callback);
		var isIE = document.all ? true : false;
		if (_HtmlStr=='register')
			HtmlStr= register_Html;
		if (_HtmlStr=='login')
			HtmlStr= login_Html;
		if (_HtmlStr=='backPSW')
			HtmlStr= backPSW_Html;
		
		if (isIE && scrollY!=undefined)
			mouseY=mouseY+scrollY;
		
		div=createmaskdiv('divBox',mouseX,mouseY,0,0,HtmlStr);		
		div.style.zIndex=10;
		if (isIE){
			bWidth=document.body.offsetWidth;
			bHeight=document.body.offsetHeight;
			tableWidth=$$(_HtmlStr).offsetWidth;
			tableHeight=$$(_HtmlStr).offsetHeight;
		}else{
			bWidth=document.body.clientWidth;
			bHeight=document.body.clientHeight;
			tableWidth=$$(_HtmlStr).clientWidth;
			tableHeight=$$(_HtmlStr).clientHeight;
		}
		if(is_center=='' || is_center=='true'){
			if(is_background=='' || is_background=='true'){
				bgdiv=createmaskdiv('bgdiv',0,0,bWidth,bHeight,'');
				bgdiv.style.filter = "alpha(opacity="+(0.5*100)+")";
				bgdiv.style.backgroundColor="#000";
				bgdiv.style.opacity=0.5;
				bgdiv.style.MozOpacity = 0.5;
			}
			
			if(div.style.display==''){
				centerWidth=(bWidth-tableWidth)/2;
				centerHeight=mouseY-tableHeight/2;
				div.style.left=centerWidth+'px';
				div.style.top=centerHeight+'px';
			}
		}else{
			if(bWidth<(mouseX+tableWidth) && div.style.display=='')
				div.style.left=bWidth-tableWidth+'px';
		}
		try{
			insteadcheckcode();
		}catch(err){
		}
	}
	
	//创建div层
	function createmaskdiv(_id,_left,_top,_width,_height,_message)
	{
		div=$$(_id);
		if(div==null){
			var div = window.document.createElement("div");
			div.style.display='';
			div.style.left = _left+'px';	 
			div.style.top = _top+'px';
		}else if(div.style.display=='none'){
			div.style.display='';
			div.style.left = _left+'px';	 
			div.style.top = _top+'px';
		}else if(div.style.display==''){
			div.style.display='block';
		}
		div.setAttribute("id",_id);
		div.style.width = _width+'px';	 
		div.style.height = _height+'px';	 
		div.style.position='absolute';
		div.innerHTML=_message;
		document.body.appendChild(div);
		return div;
	}

	//关闭层
	function closeBox(){
		tempcallback = null;
		div=$$('divBox');
		div.style.display='none';
		try{
			bgdiv=$$('bgdiv');
			bgdiv.style.display='none';
		}catch(err){
		}
	}

	//错误信息
	function onwrong(lable,message){
		var obj=document.getElementById(lable);
		obj.rows[0].cells[1].innerHTML=message;
		obj.rows[0].cells[1].className ="c_red";
		obj.rows[0].cells[0].innerHTML='<img src="'+imageUrl+'image/ico_4.jpg" width="16" height="16" />';
		try{
			document.getElementById("submitbutton").disabled=true;
		}catch(err){
		}
	}
	
	//正确信息
	function onright(lable,message){
		var obj=document.getElementById(lable);
		obj.rows[0].cells[1].innerHTML=message;
		obj.rows[0].cells[1].className ="c_grey_fast";
		obj.rows[0].cells[0].innerHTML='<img src="'+imageUrl+'image/ico_3.jpg" width="16" height="16" />';
		try{
			document.getElementById("submitbutton").disabled=false;
		}catch(err){
		}
	}
	
	//验证email
	function checkmail(){
		var email = trim($$('fastemail').value);
		unlen=email.length;
		if(email==''){
			onwrong('emailcheck','请输入Email地址');
			return;
		}
		if(unlen>30){
			onwrong('emailcheck','您输入的Email地址过长');
			return;
		}
		illegalemail = !(/^[\-\.\w]+@[\.\-\w]+(\.\w+)+$/.test(email));
		if(illegalemail){
			onwrong('emailcheck','请输入正确的Email格式');
			return;
		}
		Get_RPC_Data('checkemail',email);
		return email;
	}
	
	//找回密码的验证email
	function checkbackPSW(){
		var backPSW = trim($$('fastbackPSW').value);
		unlen=backPSW.length;
		if(backPSW==''){
			onwrong('fastPSWcheck','请输入Email地址');
			return false;
		}
		if(backPSW>30){
			onwrong('fastPSWcheck','您输入的Email地址过长');
			return false;
		}
		illegalemail = !(/^[\-\.\w]+@[\.\-\w]+(\.\w+)+$/.test(backPSW));
		if(illegalemail){
			onwrong('fastPSWcheck','请输入正确的Email格式');
			return false;
		}
		onright('fastPSWcheck','正在发送请稍候...');
		Get_RPC_Data('backPSW',backPSW);
		return false;
	}
	
	//验证用户名
	function checkusername(){
		var username = trim($$('fastusername').value);
		var unlen = username.replace(/[^\x00-\xff]/g, "**").length;
		re = new RegExp("[^a-zA-Z0-9\u4e00-\u9fa5_]","i");
	  	if(username.match(re)){
			onwrong('usernamecheck','请使用中文英文数字下划线');
			return;
		}
		
		if(username==''){
			onwrong('usernamecheck','请输入昵称');
			return;
		}
		if(unlen < 4) {
			onwrong('usernamecheck','您输入的昵称过短，昵称应为4到20个字符');
			return;
		}
		if(unlen > 20) {
			onwrong('usernamecheck','您输入的昵称过长，昵称应为4到20个字符');
			return;
		}
		Get_RPC_Data('checkusername',username);
		return username;
	}
	
	//验证密码
	function checkpassword(){
		var password = trim($$('fastpassword').value);
		var unlen = password.replace(/[^\x00-\xff]/g, "**").length;
		
		if(password==''){
			onwrong('passwordcheck','请输入6到16位的密码');
			return;
		}
		if(unlen < 6) {
			onwrong('passwordcheck','您输入的密码过短，密码应为6到16位的密码');
			return;
		}
		if(unlen > 16) {
			onwrong('passwordcheck','您输入的密码过长，密码应为6到16位的密码');
			return;
		}
		onright('passwordcheck','')
		return password;
	}
	
	function checklastpassword(){
		var password = trim($$('fastpassword').value);
		var lastpassword = trim($$('fastlastpassword').value);
		if(password!=lastpassword) {
			onwrong('lastpasswordcheck','两次输入的密码不一致');
			return;
		}else{
			onright('lastpasswordcheck','')
		}
	}
	
	//校验验证码
	function checkinputcheckcode(){
		var checkcode = trim($$('inputcheckcode').value);
		if(checkcode==''){
			onwrong('inputcheckcodecheck','请输入验证码');
			return;
		}
		Get_RPC_Data('checkcode',checkcode);
	}
	
	//提交注册信息
	function checksubmit(){
		email=checkmail();
		username=checkusername();
		password=checkpassword();
		checklastpassword();
		checkinputcheckcode();

		if(intercept('emailcheck')!='ico_3.jpg'){
			return false;
		}
		if(intercept('usernamecheck')!='ico_3.jpg'){
			return false;
		}
		if(intercept('passwordcheck')!='ico_3.jpg'){
			return false;
		}
		if(intercept('lastpasswordcheck')!='ico_3.jpg'){
			return false;
		}
		if(intercept('inputcheckcodecheck')!='ico_3.jpg'){
			return false;
		}
		var member=new Array(email,username,password);
		Get_RPC_Data('register',member);
		return false;
	}
	
	function login(){
		email=$$('fastemail').value;
		password=$$('fastpassword').value;
		
		var member=new Array(email,password);
		Get_RPC_Data('login',member);
		return false;
	}
	
	//更换验证码
	function insteadcheckcode(){
		var checkcodeobj = $$('fast_checkcode');
		checkcodeobj.src=hostUrl+'checkcode.php?rand='+Math.random();
	}
	
	//截取图片ICON
	function intercept(lable){
		if(lable){
			str=document.getElementById(lable).rows[0].cells[0].firstChild.src.split('/');
			return str[str.length-1];
		}
	}
	
	//加载JS
	function DynamicLoadJS(_src)
	{
	  var scripts = document.getElementsByTagName("script"); 
      for (var i=0;i<scripts.length;i++) 
            if (scripts[i].src && scripts[i].src.toLowerCase() == _src.toLowerCase() ) return; 

	 var oHead = document.getElementsByTagName('HEAD').item(0); 
     var oScript= document.createElement("script"); 
   	 oScript.type = "text/javascript"; 
   	 oScript.src=_src; 
   	 oHead.appendChild(oScript); 
    }
    
	//加载CSS
    function DynamicLoadCSS(_src)
    {
		var head = document.getElementsByTagName('HEAD').item(0); 
		var style = document.createElement('link'); 
		style.href = _src; 
		style.rel = 'stylesheet'
		style.type = 'text/css'; 
		head.appendChild(style); 
    }

  	//获取鼠标坐标----Start-------
  	function mouseMove(ev){
		ev = ev || window.event;
		try{
			var mousePos = mouseCoords(ev);
			mouseX=mousePos.x;
			mouseY=mousePos.y;
		}catch(err){}
	}
	
	function mouseCoords(ev){
		if(ev.pageX || ev.pageY){
			return {x:ev.pageX, y:ev.pageY};
		}
		return {
			x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
			y:ev.clientY + document.body.scrollTop - document.body.clientTop
		};
	}
	
	document.onmousemove = mouseMove;
	//获取鼠标坐标----End-------

	function scrollMove(){
		scrollY=document.documentElement.scrollTop;
	}
	window.onscroll=scrollMove;
	
	
	//获取滚动条的高度
	function getPageScroll()
	{
		var yScroll;
		if (self.pageYOffset) {
			yScroll = self.pageYOffset;
		} else if (document.documentElement && document.documentElement.scrollTop){
			yScroll = document.documentElement.scrollTop;
		} else if (document.body) {
			yScroll = document.body.scrollTop;
		}
		
		arrayPageScroll = new Array('',yScroll)
		return arrayPageScroll;
	}
	//获取页面实际大小
	function getPageSize()
	{
		var xScroll,yScroll;
		if (window.innerHeight && window.scrollMaxY){
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){
			sScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else {
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth,windowHeight;
		var pageHeight,pWidth; 
		if (self.innerHeight) {
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) {
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}
		
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else {
			pageHeight = yScroll;
		}
		
		if(xScroll < windowWidth) {
			pWidth = windowWidth;
		} else {
			pWidth = xScroll;
		}
		arrayPageSize = new Array(pWidth,pageHeight,windowWidth,windowHeight)
	//	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
		return arrayPageSize;
	}

	function getCenterPos()
	{
			var arrayPageSize   = getPageSize();
			var arrayPageScroll = getPageScroll();
			var arr = new Array();
		arr['y']  = (arrayPageScroll[1] + ((arrayPageSize[3]-200) / 2));
		
		arr['x'] = (((arrayPageSize[0] - 400) / 2));
		return arr;
	}
	
	function showmessage(message,title,boxType,callFun){
		if(boxType=='confirm'){
			$button="<a href=\"javascript:"+callFun+";\"><img border=\"0\" src=\""+imageUrl+"image\/anniu_yes.jpg\" \/><\/a>&nbsp;&nbsp;<a href=\"javascript:closeBox();\"><img border=\"0\" src=\""+imageUrl+"image\/anniu_no.jpg\" \/><\/a>"
		}else{
			$button="<a href=\"javascript:closeBox();\"><img border=\"0\" src=\""+imageUrl+"image\/anniu_close.jpg\" \/><\/a>";
		}
		
		var HtmlStr="<table width=\"420\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" bgcolor=\"#005EAC\">  <tr>    <td width=\"6\" height=\"30\">&nbsp;<\/td>    <td width=\"365\" style=\"font-size:14px; color:#FFFFFF\" align=\"left\"><strong>"+title+"<\/strong><\/td>    <td width=\"37\" align=\"center\"><a href=\"javascript:closeBox();\"><img src=\""+imageUrl+"image\/close1.jpg\"  border=\"0\" width=\"16\" height=\"16\" \/><\/a><\/td>  <\/tr>  <tr>    <td colspan=\"3\" align=\"center\" bgcolor=\"#FFFFFF\">      <table width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">        <tr>          <td>&nbsp;<\/td>        <\/tr>        <tr>          <td align=\"center\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#FCE199\">            <tr align=\"left\">              <td bgcolor=\"#FFFFEB\" style=\"font-size:12px\" height=\"60\"><font style=\"margin:5px\">"+message+"<\/font><\/td>            <\/tr>          <\/table>            <br \/>"+$button+"<\/td>        <\/tr>        <tr>          <td>&nbsp;<\/td>        <\/tr>      <\/table>    <\/td>  <\/tr><\/table>";
	
		var bHeight = window.document.body.clientHeight;
		if(bHeight<document.body.clientHeight) bHeight=document.body.clientHeight;
		bWidth=document.body.clientWidth;
		
		bgdiv=createmaskdiv('bgdiv',0,0,bWidth,bHeight,'');
		bgdiv.style.filter = "alpha(opacity="+(0.5*100)+")";
		bgdiv.style.backgroundColor="#000";
		bgdiv.style.opacity=0.5;
		bgdiv.style.MozOpacity = 0.5;
		
		
		//var left = (document.body.offsetWidth-420)/2;
		//var top = (mouseY-170)/2;
		//var top = document.body.scrollTop+220;	
		var topleft = getCenterPos();
		var left = topleft['x'];
		var top = topleft['y'];	
		div=createmaskdiv('divBox',left,top,0,0,HtmlStr);
	}