<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Description" content="{echo:$metaDesc;/}" />
<meta name="Keywords" content="{echo:$metaKeys;/}" />
<title>{echo:$siteName;/}</title>
<link rel="stylesheet" type="text/css" href="skin/default/jooyea/css/jooyea.css">
<SCRIPT language=JavaScript src="servtools/md5.js"></SCRIPT>
<script src="skin/default/js/yui-utilities.js" type=text/javascript></script>
<script src="skin/default/js/tbra.js" type=text/javascript></script>
<script src="skin/default/js/area_config_act.js" type="text/javascript"></script>
<script src="skin/default/js/jooyea.js" type="text/javascript"></script>
<SCRIPT language=JavaScript src="skin/default/js/login.js"></SCRIPT>
<SCRIPT language=JavaScript src="servtools/ajax_client/ajax.js"></SCRIPT>
<SCRIPT language=JavaScript src="skin/default/js/Dialog.js"></SCRIPT>
<SCRIPT language=JavaScript src="servtools/Common.js"></SCRIPT>
<script language=JavaScript>
function goLogin(){
	Dialog.confirm("{echo:lp{pu_login};/}",function(){top.location="index.php";});
}	
    
function getVerCode()
{
  document.getElementById("verCodePic").src="servtools/veriCodes.php?vc="+Math.random();
}

function getEnt(){
	document.onkeydown = function (e){
		var theEvent = window.event || e;
		var code = theEvent.keyCode || theEvent.which;
		if(code == 13){
			  login();
		}
	}
}

function inputTxt(obj,act)
{
  var str="{echo:lp{re_empty_val};/}";
  if(obj.value==''&&act=='set')
  {  
     obj.value=str;
     obj.style.color='gray';
  }
  
  if(obj.value==str&&act=='clean')
  {  
     obj.value='';
     obj.style.color='gray';
  }
}
     
//ajax
function xmlchange()
{
      var argb_div=document.getElementById("operate");
    if(xmlhttp.readyState==4&&xmlhttp.status==200)
 		{
 			var check=/\.php/;
 			var	return_text=trim(xmlhttp.responseText);
 		    if(check.test(return_text)){
 		         if(document.getElementById("tmpiId").checked){
 		            saveTmpEmail(1);
 		         }else{
 		         	  saveTmpEmail(0);
 		         }
 		         window.location.href=return_text;
 		    }else{
            argb_div.style.display="block";
	 		argb_div.innerHTML='<img src="skin/default/jooyea/images/icon_err.gif" align="top" style="margin-right:2px">'+return_text;
	    }
 		}else{
 	    argb_div.innerHTML="<span style='color:#838383'><img src='skin/default/jooyea/images/login_loading.gif' align='top' style='margin-right:2px'>{echo:lp{l_loading};/}</span>";
 	}
}

function saveTmpEmail(para){
   var Then=new Date();
   var uemailStr=document.getElementById("login_email").value;
   Then.setTime(Then.getTime() +3600*1000*24*300 );
   if(para==1){
     document.cookie='UserIId='+uemailStr+';expires='+ Then.toGMTString();
   }else{
     document.cookie="IsReged=Y;expires="+ Then.toGMTString();
   }
}

function login()
{
	 u_email=document.getElementById('login_email').value;
	 u_pws=document.getElementById('login_pws').value;
	 if(u_pws!=''){
	 	u_pws=MD5(u_pws);
	}
	 u_hidden=0;
	 if(document.getElementById('hidden').checked){
	    u_hidden=1;
	 }
	 xmlhttp=InitAjax();
	 xmlhttp.open("POST","do.php?act=login",true);
	 xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	 xmlhttp.onreadystatechange=xmlchange;
	 xmlhttp.send("u_email="+u_email+"&u_pws="+u_pws+"&hidden="+u_hidden);
 }
     
function check_form(){
	var email=/^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;	
	var veriCode=trim(document.getElementById("veriCode").value);
	var u_pws=trim(document.getElementById("u_pws").value);
	var reu_pws=trim(document.getElementById("reu_pws").value);
	document.getElementById('u_pws').value=u_pws;
	document.getElementById('reu_pws').value=reu_pws;
	var u_name=trim(document.getElementById("u_name").value);
	var u_email=trim(document.getElementById("u_email").value);
  var regerr_div=document.getElementById("regerrmsg");
        
  if(u_name==""){
   errshow(regerr_div,"{echo:lp{re_right_name};/}");
   return false;
	}
	
	if(u_email==""){
   errshow(regerr_div,"{echo:lp{l_empty_mail};/}");
   return false;
	}
	
	if(!email.test(u_email)){
		errshow(regerr_div,"{echo:lp{re_right_email};/}");
		return false;
	}
    
  if(u_pws==""){
	  errshow(regerr_div,"{echo:lp{l_empty_pass};/}");
		return false;
	}
	
	if(reu_pws==""){
	  errshow(regerr_div,"{echo:lp{l_empty_repa};/}");
		return false;
	}
	
	if(u_pws.length<6){
	  errshow(regerr_div,"{echo:lp{re_pass_limit};/}");
		return false;
	}
    
  if(u_pws!=reu_pws){
		errshow(regerr_div,"{echo:lp{re_dif_pass};/}");
		return false;
	}
    
	if(veriCode==("{echo:lp{re_empty_val};/}"||"")){
    errshow(regerr_div,"{echo:lp{re_empty_val};/}");
    return false;
	}else{
		document.getElementById("u_pws").value=MD5(u_pws);
		document.getElementById("reu_pws").value=MD5(reu_pws);
	}
}

function errshow(obj,err_text){
	obj.style.display="block";
	obj.innerHTML='<img src="skin/default/jooyea/images/icon_err.gif" align="top" style="margin-right:2px">'+err_text;
}

function ser_item(){
	document.getElementById("screen_div").style.display='';
	document.getElementById("screen_div").style.top=0;
	document.getElementById("screen_div").style.left=0;
	document.getElementById("screen_div").style.width=window.document.body.clientWidth+"px";
	document.getElementById("screen_div").style.height=window.document.body.clientHeight+"px";
	document.getElementById("ser_window").style.display='';
	document.getElementById("ser_window").style.top=window.document.body.clientHeight/2-200+"px";
	document.getElementById("ser_window").style.left=window.document.body.clientWidth/2-250+"px";
	var xmlhttp=InitAjax();
	xmlhttp.open("get","do.php?act=get_ser_item");
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4&&xmlhttp.status==200){
			var return_str=xmlhttp.responseText;
			var	return_text=return_str.replace(/&lt;/g,"<");
			var	return_text=return_text.replace(/&gt;/g,">");
			document.getElementById("ser_content").innerHTML=return_text;
			}
		}
		xmlhttp.send(null);
	}

function close_ser_item(){
	document.getElementById("screen_div").style.display='none';
	document.getElementById("ser_window").style.display='none';
}
</script>
</head>
<body onLoad="{echo:$onload_run_script;/}" >
<div id='ser_window' style='display:none;width:500px;height:350px;' class='ajax_window'>
	<div id='ser_content' style='height:330px'></div>
	<div><input type='button' class='top_button' onclick='close_ser_item()' value='{echo:lp{l_close};/}' /></div>
</div>
<div id='screen_div' style='background-color:gray;filter:alpha(opacity=70);opacity: 0.7;display:none;position:absolute;z-index:1;'></div>	
<div class="wrapper">
{inc:include("uiparts/guestheader.php");/}
  <div class="main top10">
    <div class="main_l left">
    <!--login star-->
      <div class="login" >
        <div class="c_t">
          <div class="c_t_l left"></div>
          <div class="c_t_r right"></div>
        </div>
        <div class="c_m" id="loginform" >
         <form name="login_form" method="post" onsubmit='return false'>
          <h2>{echo:lp{l_momber_login};/}</h2>
          <div id='operate' style='display:none;color:red'></div>
          <p>
            <label>{echo:lp{l_email};/}：</label></p>
            <p><input type="text" class="txt" name="login_email" id='login_email' maxlength="39" value="">
          </p>
          <p>
            <label>{echo:lp{l_pass};/}：</label>
          </p>
          <p>
            <input type="password"  class="txt" name="login_email" id="login_pws"  maxlength="18"  value="" onkeydown='if(this.value.length>3){getEnt();}'>
          </p>
          <div class="top10"></div>
          <p>
            <input type="button" onClick="login();" class='btn'  name=loginsubm id=loginsubm value=" {echo:lp{l_login};/} ">
          </p>
          <div class="item">
            <div class="chkbox">
            <input name="hidden" class="chk" id="hidden" type="checkbox" value="1" onKeyDown="getEnt();"></div>
            <div class="cookie" style="margin-right:8px;">{echo:lp{l_hid};/}</div>
            <div class="chkbox">
              <input name="tmpiId" class="chk" id="tmpiId" type="checkbox" value="save" checked onKeyDown="getEnt();">
            </div>
            <div class="cookie">{echo:lp{l_save_aco};/}</div>
            
          </div></form>
        </div>
        <div class="c_m" id="regform" style="display:none" >
          <form name="reg_form" method="post" action="do.php?act=reg" onsubmit='return check_form()'>
          <h2 class="regh2">{echo:lp{l_momber_register};/}</h2>
          <div id='regerrmsg' style='display:none;color:red'></div>
          <p><label>{echo:lp{re_name};/}：</label></p>
          <p><input type="text" class="txt" name="u_name" id="u_name" value="" maxlength="20" autocomplete='off'></p>
          <p><label>{echo:lp{l_email};/}：</label></p>
          <p><input type="text" class="txt" name="u_email" maxlength="50" id="u_email" value=""></p>
          <p><label>{echo:lp{l_pass};/}：</label></p>
          <p><input type="password" class="txt" maxlength="18" name="u_pws" id="u_pws" value=""></p>
          <p><label>{echo:lp{l_repass};/}：</label></p>
          <p><input type="password" class="txt" maxlength="18" name="reu_pws" id="reu_pws" value=""></p>
          <div class="item"><input name="u_sex" type="radio" value="0" checked>
				              <label>{echo:lp{pu_woman};/}</label>&nbsp;
			
				            <input name="u_sex" type="radio" value="1">    
				              <label>{echo:lp{pu_man};/}</label></div>
          <div class="item"><img border="0" src="servtools/veriCodes.php" height=20 id="verCodePic"><img border="0" src="skin/default/jooyea/images/veri_reload.gif" width="20" height="20" title="{echo:lp{re_cha_photo};/}" class="hand" style="margin-left:3"  onclick='getVerCode();'></div><p><input type="text" class="txt" style="width:100px; color:#777;" name="veriCode" id="veriCode" maxlength="5" value="{echo:lp{re_empty_val};/}" onFocus="inputTxt(this,'clean');" onBlur="inputTxt(this,'set');"></p>
          <div class="item"><div class="chkbox"><input name="agreed" class="chk" type="checkbox" value="ON" onClick="if(this.checked==true){document.getElementById('regsubmit').disabled=null;}else{document.getElementById('regsubmit').disabled=true;}" checked></div><div class="cookie">{echo:lp{re_agree};/}<a href="javascript:ser_item();" class="user_menu_a">{echo:lp{re_ser_item};/}</a>
						   <onClick="if(document.getElementById('regsubmit').disabled==true){alert('{echo:lp{re_must_agree};/}');}" ></div></div>
               <p><input type="submit" class='btn' id="regsubmit" value=" {echo:lp{re_reg};/} ">
						        
						        <input type="button" class='btn' value=" {echo:lp{re_re_login};/} " onClick="showLogin();"></p>
          </form>
          <div class="clear top10"></div>
        </div>
        <div class="c_bt">
          <div class="c_bt_l left"></div>
          <div class="c_bt_r right"></div>
        </div>
      </div>
      <!-- login end -->
      <div class="register top10">
        <div class="c_t">
          <div class="c_t_l left"></div>
          <div class="c_t_r right"></div>
        </div>
        <div class="c_m">
          <h3><a href="javascript:showReg();">{echo:lp{l_30s_register};/}</a></h3>
          <p>{echo:$siteName;/}{echo:lp{l_wel_insert};/}</p>
        <!-- plugins !-->  
        <div id="plugin_menu">
        	{echo:show_plugins($plugin_menu);/}
        </div>
        <!-- plugins !-->           
        </div>
        <div class="c_bt">
          <div class="c_bt_l left"></div>
          <div class="c_bt_r right"></div>
        </div>
      </div>
      <!-- register end -->
    </div>
 <!-- main_l end -->
{sta:if($tg=='search_pals')[exc]}
<div class="main_r left10" >
  <div id="maincontent">
    <div class="c_t">
      <div class="c_t_l left"></div>
      <div class="c_t_r right"></div>
    </div>
    <div class="c_m">
		<div id="search_star">
			<div class="top">
				<h2>{echo:lp{l_search_result};/}</h2>
			</div>
			
{end:if/}
   {inc:include($index_ref);/}
{sta:if($tg=='search_pals')[exc]}
			</div>
		</div>
    
<div class="c_bt">
  <div class="c_bt_l left"></div>
  <div class="c_bt_r right"></div>
</div>
</div>
</div>
{end:if/}
        <!-- main end -->
      
<div class="clear"></div>
        <!-- plugins !-->  
        <div id="plugin_floor">
        	{echo:show_plugins($plugin_floor);/}
        </div>
        <!-- plugins !-->
{inc:include("uiparts/footor.php");/}
</div>
</body>
</html>