﻿// JScript 文件
function show_NewsList(str){
    for(i=1;i<5;i++){
	   if(str==i){	 
	     document.getElementById("econtent"+str).style.display="block";
		 document.getElementById("da"+str).style.backgroundImage="url(/Images/index_45.gif)";	
	   }else{
	        document.getElementById("econtent"+i).style.display="none";
     		document.getElementById("da"+i).style.backgroundImage="url(/Images/index_47.gif)";
	   }
	}
}
function CheckAll(oCheckbox,gvsrc) 
{ 
    var GridView2 = document.getElementById(gvsrc); 
    for(i = 1;i < GridView2.rows.length; i++) 
    { 
        GridView2.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked = oCheckbox.checked;
    } 
}
function isOneCheck(gvsrc)
{
    var flag=0;
    var GridView2 = document.getElementById(gvsrc); 
    for(i = 1;i < GridView2.rows.length; i++) 
    { 
        if(GridView2.rows[i].cells[0].getElementsByTagName("INPUT")[0].checked)
        {
            flag=1;return true;
        }
    } 
    if(flag == 0)
    {
        alert('请至少选择一项!');
        return false;
    }
}
 function JudgeUserName(username)
        {
        
            $.ajax({
            type:"GET",
            url:"/Ajax/AjaxUserInfoModify.aspx",
            dataType:"html",
            data:"userName="+username,
           
            beforeSend:function(XMLHttpRequest)
                {
                    $("#showResult").text("正在查询");
                    //Pause(this,100000);
                },
            success:function(msg)
                {   
                    $("#showResult").html(msg);
                    $("#showResult").css("color","red");
                },
           complete:function(XMLHttpRequest,textStatus)
                {
                    //隐藏正在查询图片
                },
          error:function()
               {
                    //错误处理
                    $("#showResult").html("查寻出错...");
                    $("#showResult").css("color","red");
               }
            });
        }	
        
         function JudgeUserNameIsEx(username)
        {
        
            $.ajax({
            type:"GET",
            url:"/Ajax/AjaxUserInfoModifyIsEx.aspx",
            dataType:"html",
            data:"userName="+username,
           
            beforeSend:function(XMLHttpRequest)
                {
                    $("#showResult").text("正在查询");
                    //Pause(this,100000);
                },
            success:function(msg)
                {   
                    $("#showResult").html(msg);
                    $("#showResult").css("color","red");
                },
           complete:function(XMLHttpRequest,textStatus)
                {
                    //隐藏正在查询图片
                },
          error:function()
               {
                    //错误处理
                    $("#showResult").html("查寻出错...");
                    $("#showResult").css("color","red");
               }
            });
        }
        
        function CheckIDFunction(id,type)
        {
        
            $.ajax({
            type:"GET",
            url:"/Ajax/CheckID.aspx?id="+id+"&type="+type,
            dataType:"html",
            data:null,
           
            beforeSend:function(XMLHttpRequest)
                {
                    $("#showResult").text("正在查询");
                    //Pause(this,100000);
                },
            success:function(msg)
                {   
                    $("#showResult").html(msg);
                    $("#showResult").css("color","red");
                },
           complete:function(XMLHttpRequest,textStatus)
                {
                    //隐藏正在查询图片
                },
          error:function()
               {
                    //错误处理
                    $("#showResult").html("查寻出错...");
                    $("#showResult").css("color","red");
               }
            });
        }		

