// JavaScript Document

//后台登陆检测
function check_login(){
	if(document.g_login_form.username.value=="")
	{
		alert("用户名不能为空！");
		document.g_login_form.username.focus;
		return false;
		}
	if(document.g_login_form.password.value=="")
	{
		alert("密码不能为空！");
		document.g_login_form.password.focus;
		return false;
		}
	
	}

//关于搜索提示
var search_text="搜索其实很简单 (^.^)";
function searchFocus(e){
	if(e.value==search_text)
		{
			e.value='';
			}
	}
function searchBlur(e){
	if(e.value=='')
		{
			e.value=search_text;
			}
	}
function searchCheck_face()
{
	if(document.face_search.searchword.value==search_text)
	{
		alert('请输入搜索关键字！');
		return false;
		}		
	}
function searchCheck_admin()
{
	if(document.admin_search.searchword.value==search_text)
	{
		alert('请输入搜索关键字！');
		return false;
		}		
	}
	
//后台表格经过变色
    $(document).ready(function(){ 							 
     $("tr").mouseover(function(){  
      $(this).addClass("over");  
     });  
     $("tr").mouseout(function(){  
      $(this).removeClass("over"); 
     });   
     $("tr").hover( 
  	function(){ 
    	$(this).addClass("hover");  
  	}, 
  	function(){ 
   	 $(this).removeClass("hover");  
  	} 
	); 
     //$("tr:even").addClass("double");  

    });
	
//检测更新后台管理员
function check_manager(){
	if(document.manager.username.value=='')
	{
		alert("用户名不能为空");
		document.manager.username.focus;
		return false;
		}
	if(document.manager.password.value=='')
	{
		alert("密码不能为空");
		document.manager.password.focus;
		return false;
		}
	if(document.manager.password_again.value=='')
	{
		alert("确认密码不能为空");
		document.manager.password_again.focus;
		return false;
		}
	if(document.manager.password.value!=document.manager.password_again.value)
	{
		alert("密码不一致，请重新填写");
		document.manager.password.focus;
		return false;
		}
	
	}
//首页调用
var h = null; 
var j = null;
	function sapLoadMsg(t){
	 j = t + h;
     document.getElementById("pw").innerHTML = j;
	 h = j;
	 }