﻿//var SignOutStr="&nbsp;&nbsp;<a href =\'javascript:signout();\' >注销</a>"  







function helps(id)
{
	var d = new Date();
    PostRequest("action=helps&id=" +id+ "&guid="  + d.getTime() ,null,'callbackhelp');
}


function callbackhelp(msg){  
	    document.getElementById("loading").innerHTML=msg;  
}
function homelogin(userName,password)
{   
 var submitOK = true;
	canSubmit = true;
	
	var reg = "[^a-zA-Z_0-9]";//判断用户名只能为字母，数字，下划线的正则表达式	var reg1 = "\\D";//判断用户名必须以字母开头的正则表达式	if(userName == "" || password == "")
	{
		alert("用户名和密码不能为空!");
		return ;
	}
	else if(userName.length < 3||userName.length > 20)//判断用户名长度//modified by Nemo 将5~18 改成了 3~20
	{
		alert("用户名长度必须为3～20位!");
		return ;
	}
	else 
	{
		if(!userName.substring(0,1).match(reg1))//用户名不是以字母开头		{
			alert("用户名必须已字母开头!");
			return ;
		}
		else if(userName.match(reg))//用户名中出现其他特殊字符
		{
			alert("用户名只能是字母、数字、下划线!");
			return ;
		}
	}
	
	if (password.length < 6 || password.length > 20)//密码长度是否符合规则//modified by Nemo 将6~18 改成了 6~20
	{
		alert("密码长度不正确。");
		return;
	}

	//提交登陆请求的url变量
	var d = new Date();
	Request.sendPOST("web/disk/UIController.ashx", "action=homelogin&name=" + userName +"&pass="+password+ "&guid="  + d.getTime() , null, true, callback2,'callbacklogin') ;

}
//==============================================

//用户登陆
function login(name,pass)
{
    var submitOK = true;
	canSubmit = true;
	loginusername();
	submitOK = submitOK & canSubmit;
	j_password();
	submitOK = submitOK & canSubmit;
	
	if(canSubmit==false||submitOK==0)//验证没有通过，返回
	{	
	return;
	}

	//提交登陆请求的url变量
	var d = new Date();
    PostRequest("action=login&name=" + name +"&pass="+pass+ "&guid="  + d.getTime() ,null,'callbacklogin');
}


function callbacklogin(rtncontent){
    var inx=2;
    var flag=rtncontent.substring(0,inx);
    var msg=rtncontent.substring(inx+1);
    if(flag=="-1") //服务器返回-1，代表账号密码验证失败
    {	
	    alert(msg);
	 }
	 else if(flag=="-3") //代表账号不能登陆
	 {		  
	    alert(msg);
	 }
	  else if(flag=="-2") //重定向到用户注册的服务器
	 {		  
	    //alert(msg);
	    parent.location=msg;
	 }
	 else if(flag=="00")
     { //登录成功，显示登录成功页面
	    $("loading").innerHTML=msg;  
	   //重新装入上传控件   
	   // parent.ifrupload.location="BigUpLoad.aspx?createUrl=true";//modify by nemo
	 }
}

//用户注销退出
function signout()
{
	//logout();
	//parent.ifrupload.location="BigUpLoad.aspx";//modify by nemo
	//window.setTimeout("loadcontrol(\'loadlogin\')", 100);
	 var d = new Date();
    GetRequest("action=logout&guid="  + d.getTime() ,callback,'callsignout');
}

function callsignout(rtncontent){
     $("loading").innerHTML=rtncontent;
}


//function logout()
//{
//    var d = new Date();
//    GetRequest("action=logout&guid="  + d.getTime() ,callback,null);
//}

//登陆验证用户
function loginusername()
{
	document.getElementById("NameError").innerHTML = "";//清空错误信息
	var userName = document.getElementById("Txt_UserName").value;
	var reg = "[^a-zA-Z_0-9]";//判断用户名只能为字母，数字，下划线的正则表达式

	var reg1 = "\\D";//判断用户名必须以字母开头的正则表达式


	if(userName == "")//用户名为空，不可以	{
		document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名不能为空!<font><br>";
		canSubmit = false;
	}
	else if(userName.length < 3||userName.length > 20)//判断用户名长度//modified by Nemo 将5~18 改成了 3~20

	{
		document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名长度必须为3～20位！<font><br>";
		canSubmit = false;
	}
	else 
	{
		if(!userName.substring(0,1).match(reg1))//用户名不是以字母开头


		{
			document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名必须已字母开头!<font><br>";
			canSubmit = false;
		}
		else if(userName.match(reg))//用户名中出现其他特殊字符
		{
			document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名只能是字母、数字、下划线!<font><br>";
			canSubmit = false;
		}else
		{
			canSubmit = true;
		}
	}
}



//注册
var arr_UserName = new Array();//保存已经查询过的 用户名




var arr_BackInfo = new Array();//保存查询过的用户名 是否可以注册的信息




var canSubmit = false;//用户点击注册按钮，是否可以提交到服务器




//------------------- 判断用户名是否重复----------------------------//
//注册时判断用户名是否符合规范，是否已经被注册
function j_username()
{
	document.getElementById("NameError").innerHTML = "";//清空错误信息
	var userName = document.getElementById("Txt_UserName").value;
	var reg = "[^a-zA-Z_0-9]";//判断用户名只能为字母，数字，下划线的正则表达式	var reg1 = "\\D";//判断用户名必须以字母开头的正则表达式	if(userName == "")//用户名为空，不可以	{
		document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名不能为空!<font><br>";
		canSubmit = false;
	}
	else if(userName.length < 3||userName.length > 20)//判断用户名长度//modified by Nemo 将5~18 改成了 3~20

	{
		document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名长度必须为3～20位！<font><br>";
		canSubmit = false;
	}
	else 
	{
		if(!userName.substring(0,1).match(reg1))//用户名不是以字母开头


		{
			document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名必须已字母开头!<font><br>";
			canSubmit = false;
		}
		else if(userName.match(reg))//用户名中出现其他特殊字符
		{
			document.getElementById("NameError").innerHTML = "<font color=\"red\">用户名只能是字母、数字、下划线!<font><br>";
			canSubmit = false;
		}
		else
		{
				var isChecked = false;//是否检测过的bool变量
				//遍历检测过的用户数组，看是否已经查询过这个用户是否存在，如果已经查询过就不用再次到服务器进行查询了
				for(var i=0;i<arr_UserName.length;i++)
				{
				//这个账户名已经检测过。




					if(document.getElementById("Txt_UserName").value == arr_UserName[i])
					{
						switch (arr_BackInfo[i])//根据检测过的账户信息数组，显示相应提示。


						{
							case "0":
								document.getElementById("NameError").innerHTML = "<font color=\"red\">该用户名不符合注册规则,您可以尝试注册!<font><br>";
								canSubmit = false;
								break;
							case "1":
								document.getElementById("NameError").innerHTML = "<font color=\"red\">对不起,您注册的用户名已经存在!<font><br>";
								canSubmit = false;
								break;
							case "2":
								document.getElementById("NameError").innerHTML = "<font color=\"red\">恭喜您,该用户名无人使用!<font><br>";
								canSubmit = true;
								break;
						}
						isChecked = true;
						break;
					}
				}
				//账户没有相关信息，只能到服务器进行查询


				if(!isChecked)
				{
					checkname(document.getElementById("Txt_UserName").value);
				}
		}
	}
}

//向服务器发送请求，检测用户名是否已经被注册


function checkname(name)
{
	var d = new Date();
    GetRequest("action=checkuser&name=" + name +"&guid="  + d.getTime() ,null ,'callbackcheckuser');
	$("NameError").innerHTML = "<font color=\"red\">正在检测用户名是否重复...您可以尝试注册!<font><br>";
}

//点击注册按钮后 回调的函数，用于显示服务器返回的结果
function callbackcheckuser(str)
{
		arr_UserName[arr_UserName.length] = document.getElementById("Txt_UserName").value;//用户输入的账户名
		arr_BackInfo[arr_BackInfo.length] = str;//把刚查询的用户名的返回结果存储起来，再次使用就不用向服务器请求了
		switch (str)
		{
			case "0"://用户名不符合规则
				$("NameError").innerHTML = "<font color=\"red\">该用户名不符合注册规则,您不可以尝试注册!<font><br>";
				canSubmit = false;
				break;
			case "1"://用户名已经注册


				$("NameError").innerHTML = "<font color=\"red\">对不起,您注册的用户名已经存在!<font><br>";
				canSubmit = false;
				break;
			case "2"://可以注册
				$("NameError").innerHTML = "<font color=\"red\">恭喜您,该用户名无人使用!<font><br>";
				canSubmit = true;
				break;
		}      
}

//------------输入数据的检验------------------//


//验证密码是否符合规则
function j_password()
{
	var password = document.getElementById("Txt_Password").value;
	if (password.length < 6 || password.length > 20)//密码长度是否符合规则//modified by Nemo 将6~18 改成了 6~20
	{
		document.getElementById("PwdError").innerHTML = "<font color=\"red\">密码长度不正确。<font>";
		canSubmit = false;
		return;
	}
	if (document.getElementById("Txt_UserName").value == password)//用户名和密码不能相同
	{
		document.getElementById("PwdError").innerHTML = "<font color=\"red\">为了您的安全，用户名与密码不能一致，请使用新的密码<font>";
		canSubmit = false;
		return;
	}
	var reg = "\\W";
	if(password.match(reg))//密码是否出现英文或数字之外的字符
	{
		document.getElementById("PwdError").innerHTML = "<font color=\"red\">密码只能是英文或者数字!<font>";
		canSubmit = false;
		return;
	}
	document.getElementById("PwdError").innerHTML = "";
	canSubmit = true;//都符合条件，验证通过
}

//Add by nemo
//效验密码合法性


function pwdValid(pwd_id,username_id,outputError_id)
{
    var password = document.getElementById(pwd_id).value;
    var pwd = document.getElementById(pwd_id);
    var username = document.getElementById(username_id).value;
    var pwderror = document.getElementById(outputError_id);
    
    if (password.length < 6 || password.length > 20)//密码长度是否符合规则
    {
	    pwderror.innerHTML = "<font color=\"red\">密码长度不正确。<font>";
	    canSubmit = false;
    	return false;
    }
    if (username == password)//用户名和密码不能相同
    {
	    pwderror.innerHTML = "<font color=\"red\">为了您的安全，用户名与密码不能一致，请使用新的密码<font>";
	    canSubmit = false;
    	return false;
    }
    var reg = "\\W";
    if(password.match(reg))//密码是否出现英文或数字之外的字符
    {
	    pwderror.innerHTML = "<font color=\"red\">密码只能是英文或者数字!<font>";
	    canSubmit = false;
	    return false;
    }
    pwderror.innerHTML = "";
    canSubmit = true;
    return true;//都符合条件，验证通过
}
//Add by nemo
function validationpwd()//后台管理员和代理修改密码



{
     var submitOK = true;
    canSubmit = true;
    j_password();
    submitOK = submitOK & canSubmit;
    j_password1();
    submitOK = submitOK & canSubmit;
    pwdValid('Txt_oldPassword','Txt_UserName','oldPwdError');
    submitOK = submitOK & canSubmit;
	
    if(canSubmit==false||submitOK==0)//验证没有通过，返回


    {	
      return false;
    }
    else
    {
      return true;
    }
}

//判断两次输入的密码是否一致


function j_password1()
{
	var password = document.getElementById("Txt_Password_AG").value;
	if(password != document.getElementById("Txt_Password").value)//两次输入的密码不相同，出现错误提示


	{
		document.getElementById("PwdError2").innerHTML = "<font color=\"red\">两次输入的密码不一致,请重新输入!<font>";
		document.getElementById("Txt_Password_AG").value = "";
		canSubmit = false;
		return;
	}
	//两次输入的密码相同，校验通过。




	document.getElementById("PwdError2").innerHTML = "";
	canSubmit = true;
}
//检验邮件格式是否正确




function j_email()
{
	var email = document.getElementById("Txt_Email").value;//得到输入的邮箱


	var reg = /^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$/;//定义验证邮件的正则表达式
	if(!email.match(reg))//验证失败，显示错误信息，返回
	{
		document.getElementById("EmailError").innerHTML = "<font color=\"red\">邮件地址无效!<font>";
		canSubmit = false;
		return;
	}
	document.getElementById("EmailError").innerHTML = "";
	canSubmit = true;//验证通过
}

 var REG_EMAIL="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$";   //邮箱
var REG_QQ="^[0-9]{5,10}$";      //QQ：


var REG_HTTPURL="^http://.*$";   //网址
var REG_HTTPNAME="^[\\w\\u4e00-\\u9fa5]{0,200}$";   //网站名


var REG_CONTACT1="^[\\w\\u4e00-\\u9fa5]{0,30}$";   //其它联系

function j_QQ()
{
    var reg = REG_QQ;
    var error_msg="限5-10位QQ号码";
    var contrl=document.getElementById('Txt_QQ');
    var er=document.getElementById('spQQError');
    
  if(!contrl.value.match(reg) && contrl.value != "")//进行值的判断，如果 值为空不判断
    {
      er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
      canSubmit = false;
    }
    else//验证通过
    {
      er.innerHTML="";
      canSubmit = true;
    }
}
function j_HttpUrl()
{
    var reg = REG_HTTPURL;
    var error_msg="不合法的店铺地址!";
    var contrl=document.getElementById('Txt_Url');
    var er=document.getElementById('spUrlError');
    
   if(!contrl.value.match(reg) && contrl.value != "")//进行值的判断，如果 值为空不判断
    {
      er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
      canSubmit = false;
    }
    else//验证通过
    {
      er.innerHTML="";
      canSubmit = true;
    }
}
function j_HttpUrlName()
{
    var reg = REG_HTTPNAME;
    var error_msg="不合法的店铺名!";
    var contrl=document.getElementById('Txt_UrlName');
    var er=document.getElementById('spUrlNameError');
    
   if(!contrl.value.match(reg) && contrl.value != "")//进行值的判断，如果 值为空不判断
    {
      er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
      canSubmit = false;
    }
    else//验证通过
    {
      er.innerHTML="";
      canSubmit = true;
    }
}
var REG_QUESTIONNAME="^[\\w\\u4e00-\\u9fa5]{2,200}$";   //网站名
function j_Question()
{
    var reg = REG_QUESTIONNAME;
    var error_msg="不合法的密码问题!";
    var contrl=document.getElementById('txtQuestion').value;
    var er=document.getElementById('spQuesionError');
    if(contrl == "")//为空，不可以
	{
		er.innerHTML = "<font color=\"red\">密码问题不能为空!<font><br>";
		canSubmit = false;
	}
    else{ 
        if(!contrl.match(reg))//进行值的判断
        {
        er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
        canSubmit = false;
        }
        else//验证通过
        {
        er.innerHTML="";
        canSubmit = true;
        }
    }
}
function j_Answer()
{
    var reg = REG_QUESTIONNAME;
    var error_msg="不合法的密码答案!";
    var contrl=document.getElementById('txtAnswer').value;
    var er=document.getElementById('spAnswerError');
    
    if(contrl == "")//为空，不可以
	{
		er.innerHTML = "<font color=\"red\">密码答案不能为空!<font><br>";
		canSubmit = false;
	}
    else{ 
        if(!contrl.match(reg))//进行值的判断
        {
      er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
      canSubmit = false;
        }
        else//验证通过
        {
      er.innerHTML="";
      canSubmit = true;
        }
    }
}



function j_Contact1()
{
    var reg = REG_CONTACT1;
    var error_msg="不合法的淘宝会员号!";
    var contrl=document.getElementById('Txt_elsecontact');
    var er=document.getElementById('spElseError');
    
   if(!contrl.value.match(reg) && contrl.value != "")//进行值的判断，如果值为空不判断
    {
      er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
      canSubmit = false;
    }
    else//验证通过
    {
      er.innerHTML="";
      canSubmit = true;
    }
}

//提交用户注册请求
function j_submit()
{
	//再调一次js判断,避免用户不输入密码和邮件提交不触发时间导致无效的注册请求
	var submitOK = true;
	canSubmit = true;
	j_username();
	submitOK = submitOK & canSubmit;
	j_password();
	submitOK = submitOK & canSubmit;
	j_password1();
	submitOK = submitOK & canSubmit;
	j_email();
	submitOK = submitOK & canSubmit;
	//add by nemo
    j_QQ();
    submitOK = submitOK & canSubmit;
    j_HttpUrl();
    submitOK = submitOK & canSubmit;
    j_HttpUrlName();
    submitOK = submitOK & canSubmit;
    
    j_Question();
    submitOK = submitOK & canSubmit;
     j_Answer();
    submitOK = submitOK & canSubmit;
    
    j_Contact1();
    submitOK = submitOK & canSubmit;
    
	if(canSubmit==false||submitOK==0)
	{
	alert("输入错误，请检查您的输入！");
	return false;
	}
//////////////add by nemo	
var btn = document.getElementById("Button1");
var rebtn = document.getElementById("Reset1");
if(btn != null)
{
  btn.disabled=true;
}
if(rebtn != null)
{
  rebtn.disabled=true;
}
var d = new Date();
///////////////

	//提交注册请求的url变量
var strURL = "action=register&name="+document.getElementById("txt_username").value+"&guid=" + d.getTime();	
	strURL+="&pass="+document.getElementById("txt_password").value+"&mail="+document.getElementById("txt_email").value;
	strURL+="&check="+document.getElementById("txt_check").value;
	strURL+="&cname="+escape(document.getElementById("hdfcname").value);//add by nemo	
	strURL+="&qq="+escape(document.getElementById("Txt_QQ").value);//add by nemo	
	strURL+="&url="+escape(document.getElementById("Txt_Url").value);//add by nemo	
	strURL+="&urlname="+escape(document.getElementById("Txt_UrlName").value);//add by nemo	
	strURL+="&elsecontact="+escape(document.getElementById("Txt_elsecontact").value);//add by nemo	
	
	strURL+="&question="+escape(document.getElementById("txtQuestion").value);//add by nemo	
	strURL+="&answer="+escape(document.getElementById("txtAnswer").value);//add by nemo	
    PostRequest( strURL, null,'callbackregister') 
}

function callbackregister(rtncontent){

//////////////add by nemo
var btn = document.getElementById("Button1");
var rebtn = document.getElementById("Reset1");
if(btn != null)
{
  btn.disabled=false;
}
if(rebtn != null)
{
  rebtn.disabled=false;
}
/////////////

	if(rtncontent=="0")
	{
	    alert("验证码输入错误！");
	}
	else if(rtncontent=="-1")
	{
	    alert("注册用户失败！");
	}
	else if(rtncontent=="-2")
	{
	    alert("服务器没有注册！");
	}
	else if(rtncontent=="-3")
	{
	    alert("文件服务器停止注册！");
	}
	else if(rtncontent=="-4")
	{
	    alert("用户服务器停止注册！");
	}
	else if(rtncontent=="-5")
	{
	    alert("资料服务器注册人数超过上限！");
	}
	else if(rtncontent=="-6")
	{
	    alert("资料服务器空间不够！");
	}
	else{
	//注册成功
	    $("loading").innerHTML="注册成功，您已经登录，您的账号是"+rtncontent+"。请点击“相册空间-文件管理”开始使用，祝愉快。"; 

	}
   
}

function j_modifyinfosubmit()//资料修改提交
{
  if(document.getElementById('Txt_Email').value=="")
  {
    document.getElementById('EmailError').innerText == "邮箱地址不能为空";
    return false;
  }

	//再调一次js判断,避免用户不输入密码和邮件提交不触发时间导致无效的注册请求
	var submitOK = true;
	canSubmit = true;
	
	 j_Question();
    submitOK = submitOK & canSubmit;
     j_Answer();
    submitOK = submitOK & canSubmit;
    
    
	j_email();
	submitOK = submitOK & canSubmit;
	//add by nemo
    j_QQ();
    submitOK = submitOK & canSubmit;
    j_HttpUrl();
    submitOK = submitOK & canSubmit;
    j_HttpUrlName();
    submitOK = submitOK & canSubmit;
    j_Contact1();
    submitOK = submitOK & canSubmit;
    
    if(canSubmit==false||submitOK==0 )
	{
	  //alert("输入错误，请检查您的输入！");
	  return false;
	}
	else
	{
      return true;
	}
}


//提交用户资料修改
function j_userprofile()
{
    var valid = registerValid();//add by nemo
    
	//再调一次js判断,避免用户不输入密码和邮件提交不触发时间导致无效的注册请求
	var submitOK = true;
	canSubmit = true;

	j_email();

	submitOK = submitOK & canSubmit;
	//if(canSubmit==false||submitOK==0)//验证没有通过，返回



if(canSubmit==false||submitOK==0 || valid==false)//Add by nemo
	{
	alert("输入错误，请检查您的输入！");
	return;
	}
	var d = new Date();
	//提交注册请求的url变量
	var strURL = "action=userprofile&name="+document.getElementById("txt_username").value+"&guid=" + d.getTime();
	strURL+="&mail="+document.getElementById("txt_email").value;
	strURL+="&qq="+escape(document.getElementById("Txt_QQ").value);//add by nemo	
	strURL+="&url="+escape(document.getElementById("Txt_Url").value);//add by nemo	
	strURL+="&urlname="+escape(document.getElementById("Txt_UrlName").value);//add by nemo	
	strURL+="&elsecontact="+escape(document.getElementById("Txt_elsecontact").value);//add by nemo	
	//strURL+="&id="+document.getElementById("hfId").value;	
    GetRequest(strURL ,callback3,null);

}

//提交用户密码修改
function j_modifypass()
{
	var submitOK = true;
	canSubmit = true;
	j_password();
	submitOK = submitOK & canSubmit;
	j_password1();
	submitOK = submitOK & canSubmit;

	if(canSubmit==false||submitOK==0)
	{
	alert("输入错误，请检查您的输入！");
	return;
	}
	var d = new Date();

	var strURL = "action=modifypass&name="+document.getElementById("txt_username").value+"&guid=" + d.getTime();
	strURL+="&pass="+document.getElementById("txt_password").value+"&oldpass="+document.getElementById("Txt_oldPassword").value;//modified by nemo	
    GetRequest(strURL ,null,'modifypassback');
}
//Add by nemo
//判断修改密码操作是否成功
function modifypassback(str)
{
  if(str !="")
  {
    if(parseInt(str) > 0)
    {
      document.getElementById('loading').innerHTML = "<font color=\"red\">密码修改成功！<font><br>";
    }
    else
    {
      document.getElementById('loading').innerHTML = "<font color=\"red\">密码修改失败！<font><br>";
    }
  }
  else
  {
    document.getElementById('loading').innerHTML = "<font color=\"red\">密码修改失败！<font><br>";
  }
}

//判断用户是否登陆
function isauth()
{
	var d = new Date();
	var strURL = "action=isauth&guid=" + d.getTime();
    GetRequest(strURL ,null,'callbackisauth');
}

function callbackisauth(rtncontent)
{
	return rtncontent;
}


//lqj
//移动鼠标显示缩略图




var oPopup = window.createPopup();
function rdl_doClick(obj){
var lbt=document.all("lbt");
with (oPopup.document.body) {
style.backgroundColor="lightyellow";
style.border="solid black 1px";
style.backgroud
innerHTML="<div><img src='"+obj+" ' width=120 height=90></div>";
}
oPopup.show(event.clientX+50, event.clientY+50, 120, 90);
}

    
//checkbox全选函数


  function SelectAll(tempControl)
        {
           
            //将除头模板中的其它所有的CheckBox取反 

             var theBox=tempControl;
              xState=theBox.checked;    

             elem=theBox.form.elements;
             for(i=0;i<elem.length;i++)
             if(elem[i].type=="checkbox" && elem[i].id!=theBox.id)
              {
                   if(elem[i].checked!=xState)
                         elem[i].click();
             }         
   }  


function   checknum()   
  {   
  var   pattern4   =   /^\d{1,6}$/;   
  if   (!(pattern4.test(document.Default1.pagcount.value)))   
  {alert("显示数量必须是数字！");   
  document.Default1.pagcount.focus();   
    return   false;   
   }   
  return   true;
  }   
  
  
  
  function displayDiv()
{
   panel1.style.display="none";
  
}

//显示移动状态

function displaymove()
{
  showinfo.style.display="block"; 
}


function closediv()
{
  showinfo.style.display="none";
  document.getElementById('lbtnmove').click();//执行了弹出层
  document.getElementById('btnmove').click();//执行了，绑定移动目录树




}
//批量上传，选择新路径




function popclick()
{
 document.getElementById('lb').click();
  

}
//无组件上传，选择新路径


function noclick()
{
 document.getElementById('LinkButton1').click();
}
//复制地址到本地粘贴版上


function setTxt(s) 
{       
   window.clipboardData.setData('Text',s);    
   alert('内容复制完毕！请按 Ctrl + V ,或者鼠标右键粘贴，即可使用地址！！！！！\r\r（注：\'批量地址\'表示所有选中文件的URL连接，例<img src=\'http://www.51nst.com/a/b/c.jpg\' />；\r\'地址\'表示当前文件的URL连接,例http://www.51nst.com/a/b/c.jpg；请根据需要使用功能）');


} 

function openwin(s) 
{ 
window.open(s,"fileview","left=0,top=0,width=1010,height=620,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,toolbar=no");
//alert(s);
} 

//隐藏上传组件
 function closetable()
{
  zhtable.style.display="none";
}
//显示上传组件
function opentable()
{
  zhtable.style.display="block";

//document.getElementById('btn').click();//modify lqj 12.5


}
//验证搜索文件的名字




function   checkfilename()   
  {   
    var filename = document.getElementById("search").value;//得到输入的文件名
	var reg = /^[\.\w\u4e00-\u9fa5]{1,20}$/;//定义验证文件名的正则表达式




	if(!filename.match(reg))//验证失败，显示错误信息，返回
	{
	    alert("文件名只能是数字(0-9)，大小写字母(a/A-z/Z)，或下划线_或中文");
		return false;
	}
 document.getElementById('okreach').click();
	return true;
  } 
    
  //验证创建文件夹的名字
  function   checkCreateFile()   
  {   
    var filename = document.getElementById("tb_createdir").value;
     var reg = /^[\w\u4e00-\u9fa5]+[\w\u4e00-\u9fa5]{1,20}$/;



	if(!filename.match(reg))
	{
	   alert("文件名只能是数字(0-9)，大小写字母(a/A-z/Z)，或下划线_或中文");
		return false;
	}
	  document.getElementById('createdir').click();
	return true;
  } 
 
  
    function   checktb()   
  {   
    var filename = document.getElementById("search").value;
	var reg = /^[\w\u4e00-\u9fa5]+[\.\w\u4e00-\u9fa5]{1,20}$/;




	if(!filename.match(reg))
	{
	   document.getElementById("search").value=""
		return false;
	}
	return true;
  } 
  
//邮件系统判断如果没有文件被选中，不执行删除事件add lqj 12.12
      function mailcheckdel(obj)
      {
      if(checkCheckbox(obj)==true)
      {
       if(confirm('确认删除？'))
        {
        document.getElementById('btdel').click();
        return true;
        }
      }
      else
      {
       alert("请选择待删除文件");
       return false;
      }
      }
      //邮件系统判断是否文件被选择，否则不执行删除到已删除油箱操作
          function mailcheckjunkdel(obj)
      {
      if(checkCheckbox(obj)==true)
      {
       if(confirm('确认删除？'))
        {
        document.getElementById('btjunk').click();
        return true;
        }
      }
      else
      {
       alert("请选择待删除文件");
       return false;
      }
      }
      
      function js_newmailcount()
      {
      var username=document.getElementById("tb_username").value;
      var password=document.getElementById("tb_password").value;
    
	var d = new Date();

	var strURL = "action=newmailcount&name="+username+"&guid=" + d.getTime();
	strURL+="&pass="+password; 
    GetRequest(strURL ,null,'newmailcountback');
      }

function newmailcountback(str)
{
      
    if(str == "0")
    {
      document.getElementById('lblcount').innerHTML = "";
    }
    else
    {
      document.getElementById('lblcount').innerHTML = str;
    }
    
}

//邮件系统鼠标移动图片上显示高亮
function mouseovermap(obj)
{
document.getElementById(obj).className="image_bg";
}
function mouseoutmap(obj)
{
document.getElementById(obj).className="padding3";
}
 /////////////////////////////
 //                         //
 //      无组件上传相关     //
 //                         //
//////////////////////////////Hereinafter Add By Nemo//////////////////////////

///////////////////显示隐藏File
//使用DropDownlist或RadioButton时用
function showFile(n)
{
  for(div=1; div<=5; div++)//隐藏
  {
    var name1=eval("fileDiv"+div);
    document.getElementById(name1.id).style.display="none";
    document.getElementById("Radio"+div).checked="";		
  }
  document.getElementById("Radio"+n).checked="checked";		
  for(nI = 1; nI<=n; nI++)//显示
  {
    var name2=eval("fileDiv"+nI);
    document.getElementById(name2.id).style.display="";		    
  }
}

/////////////////////文件上传控制
//是否选择了文件


function IsPickFile()
{
    var isEmpt =0;
    for(i=1;i<=5;i++)
    {
        var iptfname="Bigupload1_inputFile"+i;
        var value = document.getElementById(iptfname).value;
        if(value =="")isEmpt++; 
    }
    if(isEmpt == 5)
        return false;
    else
        return true;
}
//上传时,显示进度条隐藏FilePick
function inputFileSubmit()
{
    clearOutPut();
    if(!IsPickFile())
    {
        document.getElementById('Bigupload1_bodyPre').innerText = "请选择您要上传的文件！";
    }
    else
    {
       if(IsVarlidator())
       {            
            document.getElementById('FilePick').style.display = 'none';

            document.getElementById('CancelButton').style.display = "";
            document.getElementById('Bigupload1_inlineProgressBarDiv').style.display = "";
            
            document.getElementById('Bigupload1_submitButton').click();            
        }
    }
}
function hideVarlidator()//隐藏验证控件
{
    document.getElementById('Bigupload1_Rglar1').style.visibility = "hidden";
    document.getElementById('Bigupload1_Rglar2').style.visibility = "hidden";
    document.getElementById('Bigupload1_Rglar3').style.visibility = "hidden";
    document.getElementById('Bigupload1_Rglar4').style.visibility = "hidden";
    document.getElementById('Bigupload1_Rglar5').style.visibility = "hidden";
}

function IsVarlidator()//是否验证通过
{
    if(document.getElementById('Bigupload1_Rglar1').style.visibility == "visible"
     || document.getElementById('Bigupload1_Rglar2').style.visibility == "visible"
      ||document.getElementById('Bigupload1_Rglar3').style.visibility == "visible"
       ||document.getElementById('Bigupload1_Rglar4').style.visibility == "visible"
        ||document.getElementById('Bigupload1_Rglar5').style.visibility == "visible")
        return false;
       else
        return true;
}
//上传完成
function uploadFinish()
{
    document.getElementById('FilePick').style.display = "none";
    document.getElementById('CancelButton').style.display = "none";
    document.getElementById('btnGoOn').style.display = "";
    hideVarlidator();
    ifrautofit();
}

//清空progressbar属性


function ClearProgressBar()
{
    if(document.frames['Bigupload1_inlineProgressBar'] != null)
    {
    document.frames['Bigupload1_inlineProgressBar'].location.href = '../../NeatUpload/Progress.aspx';
    }
}
//继续上传
function GoOnUpload()
{
    document.getElementById('btnGoOn').style.display = "none";
    document.getElementById('FilePick').style.display = "";

    clearOutPut();
    ClearProgressBar();
    ShowOverWrite();
    hideVarlidator();
    resetiframe();
}

//清空上传过程中的提示信息
function clearOutPut()
{
    document.getElementById('Bigupload1_bodyPre').innerText = "";
    document.getElementById('Bigupload1_OutPutUrl').innerHTML ="";
}

//单击上传
function NeedVerdict()
{
    clearOutPut();
    var d = new Date();
    var strURL = "action=isauth&guid=" + d.getTime();
    GetRequest(strURL ,null,'callbackisauth');
}

//判断登陆
function callbackisauth(rtncontent)
{
    if("0" == rtncontent)
    {
        alert('请先注册登陆，然后再上传文件！');
    }
    else if("1" == rtncontent)
    {
        inputFileSubmit();
    }
}

//是否overwrite
function ShowOverWrite()
{
  var show = document.getElementById("BigUpLoad1_hdfOverWrite").value;
  if("TRUE" == show.toUpperCase())
  {
    document.getElementById("overwrite").style.display ="";
    document.getElementById("Bigupload1_DivFileType").style.display ="";
  }
  else
  {
    document.getElementById("overwrite").style.display ="none";
    document.getElementById("Bigupload1_DivFileType").style.display ="none";
  }
}


//添加路径拾取器


function addInputFile()
{
    if(document.getElementById("fileDiv2").style.display =="none")document.getElementById("fileDiv2").style.display="";
    else if(document.getElementById("fileDiv3").style.display =="none")document.getElementById("fileDiv3").style.display="";
    else if(document.getElementById("fileDiv4").style.display =="none")document.getElementById("fileDiv4").style.display="";
    else if(document.getElementById("fileDiv5").style.display =="none")document.getElementById("fileDiv5").style.display="";
    else if(document.getElementById("fileDiv6").style.display =="none")document.getElementById("fileDiv6").style.display="";
    else if(document.getElementById("fileDiv7").style.display =="none")document.getElementById("fileDiv7").style.display="";
    else if(document.getElementById("fileDiv8").style.display =="none")document.getElementById("fileDiv8").style.display="";
    else if(document.getElementById("fileDiv9").style.display =="none")document.getElementById("fileDiv9").style.display="";
    else if(document.getElementById("fileDiv10").style.display =="none")document.getElementById("fileDiv10").style.display="";
    else alert("只能同时上传10个文件！");
    ifrautofit();
}

//iframe
function resetiframe()
{
 if(parent.document.getElementById('ifrupload') != null)
 {
    parent.document.getElementById('ifrupload').style.height="380px";
 }
  if(parent.document.getElementById('ifrtable') != null)
 {
    parent.document.getElementById('ifrtable').style.height="380px";
 }
}



//删除一个上传文件

function replaceInput(yourId,n)
{
if(document.getElementById('Bigupload1_Rglar'+n).style.visibility == "visible")
{
  return;
}
    document.getElementById('fileDiv'+n).style.display = 'none';
    var inputFile = document.getElementById(yourId);

    if (inputFile.type == 'file' && inputFile.value && inputFile.value.length > 0)
    {
        try 
        {
            var newInputFile = CloneInputFile(inputFile);
            inputFile.parentNode.replaceChild(newInputFile, inputFile);
        }
        catch (ex)
        {
            ;
        }
    }
}
function CloneInputFile(inputFile)
{
   var newInputFile = document.createElement('input');
    for (var a=0; a < inputFile.attributes.length; a++)
    {
        var attr = inputFile.attributes.item(a);
         var attrName = attr.name.toLowerCase();

        if (attrName != 'name' && ! attr.specified) 
            continue;
        var attrName = attr.name.toLowerCase();
        if (attrName != 'type' && attrName != 'value')
        {
            if (attrName == 'style' && newInputFile.style && inputFile.style && inputFile.style.cssText)
                newInputFile.style.cssText = inputFile.style.cssText;
            else if (attrName == 'class')
                newInputFile.className = attr.value; 
            else if (attrName == 'for') 
                newInputFile.htmlFor = attr.value;
            else
                newInputFile.setAttribute(attr.name, attr.value);
        }
    }
    newInputFile.onchange = inputFile.onchange;
    newInputFile.setAttribute('type', 'file');
    return newInputFile;
}

function adduploadfile(inputFile)
{
   var newInputFile = document.createElement('input');
    for (var a=0; a < inputFile.attributes.length; a++)
    {
        var attr = inputFile.attributes.item(a);
         var attrName = attr.name.toLowerCase();

        if (attrName != 'name' && ! attr.specified) 
            continue;
        var attrName = attr.name.toLowerCase();
        if (attrName != 'type' && attrName != 'value')
        {
            if (attrName == 'style' && newInputFile.style && inputFile.style && inputFile.style.cssText)
                newInputFile.style.cssText = inputFile.style.cssText;
            else if (attrName == 'class')
                newInputFile.className = attr.value; 
            else if (attrName == 'for') 
                newInputFile.htmlFor = attr.value;
            else if (attrName == 'name') 
                alert("name----"+attr.value);
            else if (attrName == 'id') 
                alert("ID----"+attr.value);
            else
                newInputFile.setAttribute(attr.name, attr.value);
        }
    }
    newInputFile.onchange = inputFile.onchange;
    newInputFile.setAttribute('type', 'file');
    var newup = document.createElement("Upload");
    newup=newInputFile;
    document.getElementById("fileDiv1").appendChild(newup);
    
    var delbtn = document.createElement("input");
    delbtn.type="button";
    delbtn.value='删除';
    delbtn.className="button_width";
    delbtn.onclick ="replaceInput('"+newup.id+"')";    
    document.getElementById("fileDiv1").appendChild(delbtn);
    
    var br = document.createElement("br");
    document.getElementById("fileDiv1").appendChild(br);
    return newInputFile;
}


//////////////////////////////////////忘记密码
function getquestion(name)
{

document.getElementById("OutPut").innerText ="";

document.getElementById('spQuestion').innerText="";	
	 var submitOK = true;
	canSubmit = true;
	loginusername();
	submitOK = submitOK & canSubmit;		
	
	if(canSubmit==false||submitOK==0)//验证没有通过，返回	{	
	    return;
	}
	
    
    var d = new Date();
    PostRequest("action=getquestion&name=" + escape(name) + "&guid="+ d.getTime(),null ,'callbackgetquestion');
}

//点击注册按钮后 回调的函数，用于显示服务器返回的结果
function callbackgetquestion(str)
{		
    
		switch (str)
		{
			case "-1"://用户名不符合规则
				
				document.getElementById("NameError").innerText ="系统找不到您输入的用户名!";
				canSubmit = false;
				break;
			default:
			document.getElementById("NameError").innerText ="";
				document.getElementById('spQuestion').innerText=str;			
				document.getElementById("spQuesionError").innerText="";
				canSubmit = true;
				break;
		}      
}





function SendPwd(name,email,question,answer)
{  
    var submitOK = true;
	canSubmit = true;
	loginusername();
	submitOK = submitOK & canSubmit;
	
	 if(document.getElementById('spQuestion').value == "")//为空，不可以
	{
		document.getElementById('spQuesionError').innerText = "密码问题不能为空!";
		canSubmit = false;
	}
	submitOK = submitOK & canSubmit;	
	j_Answer();
	submitOK = submitOK & canSubmit;
	j_email();
	submitOK = submitOK & canSubmit;
	
	if(canSubmit==false||submitOK==0)//验证没有通过，返回	{	
	    return;
	}
	
    document.getElementById('OutPut').innerText='正在验证答案……';
    document.getElementById('AjaxSend').disabled=true;
    var d = new Date();
    PostRequest("action=CheckEmailAndName&name=" + escape(name) +"&email=" + escape(email)+"&question=" + escape(question)+"&answer=" + escape(answer)+ "&guid="+ d.getTime(),null ,'CallBackCheckNameEmail');

}

//back
function CallBackCheckNameEmail(str)
{
   document.getElementById('AjaxSend').disabled=false;
   	switch (str)
	{
        case "-1":   
            document.getElementById("OutPut").innerText = "用户名的答案与注册的时候不一致!";
            break;	 
        case  "-2":
            document.getElementById("OutPut").innerText = "用户名不存在!";
            break;
        default:
            document.getElementById("OutPut").innerText = str;
            break;   
   }
}

///////////////////////////////////////add by nemo///////公共方法
//复制文本框里内容
function copyToParse(txtID)
{
   var tempStr=document.getElementById(txtID);
   window.clipboardData.setData('Text',tempStr.value); 
   tempStr.focus();
   tempStr.select();   
   alert('内容复制完毕！您可以进行粘贴了。');
}

//框架高宽自适应
function ifrautofit()
{
    try
    {
        if(window!=parent)
        {
            var a = parent.document.getElementsByTagName("IFRAME");
            for(var i=0; i<a.length; i++) 
            {
                if(a[i].contentWindow==window)
                {
                    var h1=0, h2=0, wid1=0, wid2=0;
                    a[i].parentNode.style.height = a[i].offsetHeight +"px";
                    a[i].style.height = "10px";
                    a[i].style.width = "10px";
                    if(document.documentElement && document.documentElement.scrollHeight)
                    {
                        h1=document.documentElement.scrollHeight;
                        wid1=document.documentElement.scrollWidth;
                    }
                    
                    if(document.body)
                    {
                      h2=document.body.scrollHeight;
                      wid2=document.body.scrollWidth;
                    }

                    var h=Math.max(h1, h2);
                    var wd=Math.max(wid1, wid2);
                    if(document.all) {h += 4;wd += 4;}
                    if(window.opera) {h += 1;wd += 1;}
                    a[i].style.height = a[i].parentNode.style.height = h +"px";
                    a[i].style.width = a[i].parentNode.style.width = wd +"px";
                }
            }
        }
    }
    catch (ex){}
}

//框架高自适应
function ifrautoheight()
{
    try
    {
        if(window!=parent)
        {
            var a = parent.document.getElementsByTagName("IFRAME");
            for(var i=0; i<a.length; i++) 
            {
                if(a[i].contentWindow==window)
                {
                    var h1=0, h2=0;
                    a[i].parentNode.style.height = a[i].offsetHeight +"px";
                    a[i].style.height = "10px";
                    if(document.documentElement && document.documentElement.scrollHeight)
                    {
                        h1=document.documentElement.scrollHeight;
                    }
                    if(document.body) h2=document.body.scrollHeight;

                    var h=Math.max(h1, h2);
                    if(document.all) {h += 4;}
                    if(window.opera) {h += 1;}

                    a[i].style.height = a[i].parentNode.style.height = h +"px";
                }
            }
        }
    }
    catch (ex){}
}

//去空格


function ltrim ( s ) { 	
return s.replace( /^\s*/, "" ) 
} 
function rtrim ( s ) { 	
return s.replace( /\s*$/, "" ); 
}  
function trim ( s ) { 	
return rtrim(ltrim(s)); 
}
//判断输入框是否为空


function NoNullInput(controlID)
{
    var msgstr=document.getElementById(controlID).value;
    var str = trim(msgstr);
    if(str == "")
    {        
        return true;
    }
    else
    {
        return false;
    }
}


//在输入框中回车=单击按钮
function entersubmit(btn_id)
{
    if(event.keyCode == 13)document.getElementById(btn_id).click();
}

//radio选中项的值


function getRodioCheckedValue(name)
{
  var rad = document.getElementsByName(name);
  for(i=0;i<rad.length;i++)
  {
    if(rad[i].checked)
    {
      return rad[i].value;
    }
  }
  return -1;
}

//下拉列表选中项的值


function getSelected(sel_id,text)
{
 if(text == 1)
 {
   return document.getElementById(sel_id).options[document.getElementById(sel_id).selectedIndex].text;
 }
 else
 {
   return document.getElementById(sel_id).options[document.getElementById(sel_id).selectedIndex].value;
 }
}

//checkbox是否勾选了
function getCheckBox(check_id)
{
  if(document.getElementById(check_id).checked ==true)
  {
    return 1;
  }
  else
  {
    return 0;
  }
}

function KeyIsNumber()
{
    var KeyCode=event.keyCode
    //如果输入的字符是在0-9之间

    if((KeyCode>=48) && (KeyCode<=59))
    {
       return true;
    }
    else
    {
       return false;
    }
}

//只能输入正整数


function KeyIsfloat(input_ID,digit)
{
   var KeyCode=event.keyCode
    //如果输入的字符是在0-9之间，或者是backspace、DEL键


    if(((KeyCode>47)&&(KeyCode<58))||(KeyCode==8)||(KeyCode==46))
    {
       var n=String.fromCharCode(event.keyCode);
       var Inputval = document.getElementById(input_ID).value;
       for(i=0;i<Inputval.lenght;i++)
       {alert(Inputval.lenght);
         if(Inputval[i] =="." && KeyCode== 46)return false;
         if(Inputval[i-1] ==".")return false;
       }       
       return true;
    }
    else
    {
          return false;
    }
}

//Add by nemo
//判断两个控件值是否一致

//参数说明：

//mubiao_id：用于比较的控件ID
//validate_id：要验证的控件ID
//Error_id：显示结果的控件ID（如果相同则不显示）
function myCompareValidator(mubiao_id,validate_id,Error_id)
{
   var control1 = document.getElementById(mubiao_id);
   var control2 = document.getElementById(validate_id);
   var errormsg = document.getElementById(Error_id);
   
   if(control1 == null || control2 == null)
   {
       if(control1 == null)//控件1不存在


       {
         errormsg.innerHTML = "<font color=\"red\">控件："+control1+"不存在无法验证。<font>";
       }
       if(control2 == null)//控件2不存在


       {
         errormsg.innerHTML = "<font color=\"red\">控件："+control2+"不存在无法验证。<font>";
       }
       canSubmit = false;
   }
   else if(control1.value != control2.value)//判断值是否相等


   {
		errormsg.innerHTML = "<font color=\"red\">两次输入的值不一致。<font>";
		control2.value="";
		canSubmit = false;
   }
   else
   {
	 //两次输入相同，校验通过。

	 errormsg.innerHTML = "";
	 canSubmit = true;
	}
}

//功能：正则表达式验证输入
//参数说明：


//regular：正则表达式
//str_id：要验证的控件ID
//error_id：提示信息ID
//error_msg：提示信息内容


function myRegularValidator(regular,str_id,error_id,error_msg)
{
    var reg = regular;
    var contrl=document.getElementById(str_id);
    var er=document.getElementById(error_id);
    
    if(contrl == null)//判断要验证的控件是否存在
    {
      er.innerHTML="<font color=\"red\">控件："+str_id+"不存在，无法验证。<font><br>";
      canSubmit = false;
    }
    else if(!contrl.value.match(reg) && contrl.value != "")//进行值的判断，如果 值为空不判断
    {
      er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
      canSubmit = false;
    }
    else//验证通过
    {
      er.innerHTML="";
      canSubmit = true;
    }
}

function myRegularValidatorNotNull(regular,str_id,error_id,error_msg)
{
    var reg = regular;
    var contrl=document.getElementById(str_id);
    var er=document.getElementById(error_id);
    
    if(contrl == null)//判断要验证的控件是否存在
    {
      er.innerHTML="<font color=\"red\">控件："+str_id+"不存在，无法验证。<font><br>";
      canSubmit = false;
    }
    else if(contrl.value == "")
    {
        er.innerHTML="<font color=\"red\">不能为空<font><br>";
      canSubmit = false;
    
    }
    else if(!contrl.value.match(reg))//进行值的判断
    {
      er.innerHTML="<font color=\"red\">"+error_msg+"<font><br>";
      canSubmit = false;
    }
    else//验证通过
    {
      er.innerHTML="";
      canSubmit = true;
    }
}



 function myQueryString(item)
 {
  var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i"));
  return svalue ? svalue[1] : svalue;
 }
///////
/////////////////////////////////////////////////////////////////////////

//add by nemo 2008.1.3 15:17
//用于index.asx用户登陆
function indexlogin(name,pass)
{
    var submitOK = true;
	canSubmit = true;
	loginusername();
	submitOK = submitOK & canSubmit;
	j_password();
	submitOK = submitOK & canSubmit;
	
	if(canSubmit==false||submitOK==0)//验证没有通过，返回
	{	
	return;
	}

	//提交登陆请求的url变量
	var d = new Date();
    PostRequest("action=indexlogin&name=" + name +"&pass="+pass+ "&guid="  + d.getTime() ,null,'callbackindexlogin');
}
//add by nemo 2008.1.8 12:17
//用于index.asx用户登陆回调函数
function callbackindexlogin(rtncontent){
    var inx=2;
    var flag=rtncontent.substring(0,inx);
    var msg=rtncontent.substring(inx+1);
    if(flag=="-1") //服务器返回-1，代表账号密码验证失败

    {	
	    alert(msg);
	 }
	 else if(flag=="-3") //代表账号不能登陆
	 {		  
	    alert(msg);
	 }
	  else if(flag=="-2") //重定向到用户注册的服务器
	 {		  
	    //alert(msg);
	    parent.location=msg;
	 }
	 else if(flag=="00")
     {//登录成功，显示登录成功页面
	    $("loading").innerHTML=msg;  
	 //重新装入上传控件   
	    parent.ifrupload.location="BigUpLoad.aspx?createUrl=true";
	 }
}
//add by nemo 2008.1.3 14:26
//用于index.aspx用户退出
function indexsignout()
{
	var d = new Date();
    GetRequest("action=inxlogout&guid="  + d.getTime() ,callback,"callinxsignout");
	parent.ifrupload.location="BigUpLoad.aspx";
	//window.setTimeout("loadcontrol(\'loadindexlogin\')", 100);
}

function callinxsignout(rtncontent){
     $("loading").innerHTML=rtncontent;
     //parent.ifrupload.location="BigUpLoad.aspx";
}

//add by nemo 2008.1.31 12:00
//支付前判断
//function ispayed()
//{
//  var pay = document.getElementById("hfFlag").value;
//  if(pay == "1")
//  {
//    alert("该页面已经被支付过一次,如果要继续支付,请重新进入该页面!");
//    return false;
//  }
//  else
//  {
//    return true;
//  }
//}
