
<!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>blog</title>
<link rel="stylesheet" type="text/css" href="skin/default/jooyea/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/default/jooyea/css/iframe.css">
<SCRIPT language=JavaScript src="servtools/ajax_client/ajax.js"></SCRIPT>

<script type="text/javascript">

function xmlchange(){
	if(xmlhttp.readyState==4&&xmlhttp.status==200){
			var return_str=xmlhttp.responseText;
			var	return_text=return_str.replace(/[\s\n\r]/g,"");	 	
	}
}

function save_sort(sort_id,text_id){
	var sort_value=document.getElementById(text_id).value;
	xmlhttp=InitAjax();
	xmlhttp.open("POST","do.php?act=blog_sort_change&id="+sort_id,true);
	xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	xmlhttp.onreadystatechange=xmlchange;
	document.getElementById('info_'+sort_id).style.display="";
	document.getElementById('info_'+sort_id+'_edit').style.display="none";
	document.getElementById('show_info_'+sort_id).innerHTML=sort_value;
	xmlhttp.send("name="+sort_value);
}

function exit_sort(info_id,show_id,text_id){
	document.getElementById(info_id).style.display="";
	document.getElementById(info_id+"_edit").style.display="none";
}

function edit_sort(info_id){
	document.getElementById(info_id).style.display="none";
	document.getElementById(info_id+"_edit").style.display="";
}
</script>
</head>
<body>
    <div class="main_right_title">
       <span class="main_title_dot"></span>
       <span class="main_title_txt">{echo:lp{b_blog};/}</span>
  </div> 
	<div id="tabsB">
		<ul>
			<li><a href="#" class="nowbutl"><span class="nowbutr">{echo:lp{b_manage_sort};/}</span></a></li>
		</ul>
		<div class="div_but_2" onclick="window.history.go(-1);">{echo:lp{b_re_last};/}</div>
	</div>
	<table width="90%" class="blog_ms_table rs_list bnone" cellspacing="0">
		<tr>
			<td colspan='2'>{echo:lp{b_def_sort};/}</td>
		</tr>
		{sta:foreach($blog_sort_rs as $rs)[loop]}		
			<tr id="info_{echo:$rs['id'];/}" >
				<td class="td_a">
						<div id="show_info_{echo:$rs['id'];/}" class="log_sort_bg">
							{echo:$rs['name'];/}
						</div>
				</td>
				<td class="td_b">
						<a class="log_edit_link" href=javascript:edit_sort("info_{echo:$rs['id'];/}");>{echo:lp{b_edit};/}</a>&nbsp &nbsp
						<a class="log_del_link" href='do.php?act=blog_sort_del&id={echo:$rs["id"];/}' onclick='return confirm("{echo:lp{b_a_del};/}")'>{echo:lp{b_del};/}</a>
				</td>
			</tr>
			
			<tr id="info_{echo:$rs['id'];/}_edit" style="display:none;">
				<td class="td_a">
						<input type='text' id="change_sort_{echo:$rs['id'];/}" value="{echo:$rs['name'];/}" maxlength="20">
				</td>
				<td class="td_b">
					<input type='button' class='top_button' value='{echo:lp{b_button_save};/}' onclick=save_sort("{echo:$rs['id'];/}","change_sort_{echo:$rs['id'];/}"); />&nbsp &nbsp
					<input type='button' class='top_button' value='{echo:lp{b_button_cancel};/}' onclick=exit_sort("info_{echo:$rs['id'];/}","show_info_{echo:$rs['id'];/}","change_sort_{echo:$rs['id'];/}");  />
				</td>
			</tr>
							
{end:foreach/}

	</table>							
</body>
</html>