<!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" />
<title><?php echo $_LANG['step2_title'];?></title>
<link rel="stylesheet" media="screen"  href="css/style.css"/>
</head>
<script>
function trim(text)
{
	return (text || "").replace( /^\s+|\s+$/g, "").replace(/^　+|　+$/g, "");
}

function f_submit()
{
	var i, sign = true;
	for(i = 0; i < document.theForm.elements.length; i++) {
		if (document.theForm.elements[i].type == 'text' || document.theForm.elements[i].type == 'textarea') {
			if (trim(document.theForm.elements[i].value) == '') {
				document.getElementById(document.theForm.elements[i].name+'_msg').innerHTML = '<?php echo $_LANG['js_check_input_empty'];?>';
				sign = false;
			} else {
				document.getElementById(document.theForm.elements[i].name+'_msg').innerHTML = '';
			}
			
			if(window.addEventListener){  //FF  
				document.getElementById(document.theForm.elements[i].name).addEventListener("blur", function(evt){var evt = window.event?window.event:evt,target=evt.srcElement||evt.target;if (trim(target.value) != ''){document.getElementById(target.name+'_msg').innerHTML = '';}}, false);    
			}else{  //IE chrome  
				document.getElementById(document.theForm.elements[i].name).attachEvent("onblur", function(evt){var evt = window.event?window.event:evt,target=evt.srcElement||evt.target;if (trim(target.value) != ''){document.getElementById(target.name+'_msg').innerHTML = '';}});    
			}  		
		}
	}
	
	if (sign == true) {
		document.theForm.submit();
	}
	return;
}

</script>
<body id="step2">
   <div id="wrap">
     <div id="main" >
     
        <?php include_once 'templates/header.php';?>
        
        <div id="content">
          <div class="content-inner">
            <?php include_once 'templates/nav.php';?>
            <div class="middle">
              <div class="pad1">
                <form name="theForm" method="post" action="index.php?step=3&method=check_app" class="step">
                <h3 class="normal-a"><?php echo $_LANG['site_name'];?></h3>
                
                  <fieldset>
                    <div class="clear"><label><span>*</span><?php echo $_LANG['site_name'];?>:</label><input name="site_name" id="site_name" value="<?php echo htmlspecialchars($site_name);?>" type="text" class="w318" /><span class="r" id="site_name_msg"></span></div>
                    <div class="clear"><label><span>*</span><?php echo $_LANG['site_info'];?>:</label><textarea name="site_info" id="site_info" cols="" rows=""><?php echo htmlspecialchars($site_info);?></textarea><span class="r" id="site_info_msg"></span></div>
                    <div class="clear"><label style="margin-bottom:2em;"><span>*</span>APP KEY:</label><input name="app_key" id="app_key" value="<?php echo htmlspecialchars($app_key);?>" type="text" class="w159" />&nbsp;&nbsp;<span class="gray"><?php echo $_LANG['not_apply'];?>?<a href="http://open.t.sina.com.cn/apps/new" target="_blank"> <?php echo $_LANG['click_to_apply'];?></a><?php echo $_LANG['you_app_key'];?></span>
                      <p><?php echo $_LANG['app_key_notice'];?>。<span class="r" id="app_key_msg"></span></p>
                    </div>
                    <div class="clear"><label style="margin-bottom:2em;"><span>*</span>APP SECRET:</label><input name="app_secret" id="app_secret" value="<?php echo htmlspecialchars($app_secret);?>" type="text" class="w318" /><span class="r" id="app_secret_msg"></span>
                      <p><?php echo $_LANG['app_secret_notice'];?></p>
                    </div>
                  </fieldset>
              </form>
                
              </div>
              
              <p class="tips" style="padding-top:50px">
			  <a href="index.php?step=1"><img src="img/btn5.gif" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:f_submit();" ><img src="img/btn4.gif" /></a>
			  </p>
                
            </div>
            
            <div class="bottom"></div>
            
          </div>
          
          
          
        </div>
     </div>
   </div>
</body>
</html>

