﻿// JScript 文件

function init_floatbox(formname)
{
	bdMvEvt= document.body.onmousemove;
	bdUpEvt= document.body.onmouseup;
	
	form = document.getElementsByName(formname)[0];
	buildDiv("popupLogin");
	buildGlobalDiv();
}


function sltLogin(show,value){
 	cancel();hiddenLayer("popupLogin");
}

function initLogin(){
	var htmlDiv = '';
	
	htmlDiv +='<table width="421" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">';
	htmlDiv +='<tr>';
	htmlDiv +='<td>';
	htmlDiv +='<table width="421" border="0" cellpadding="0" cellspacing="0">';
	htmlDiv +='<tr>';
	htmlDiv +='<td>';
	htmlDiv +='<div class="draghead">';
	htmlDiv +='<span>用户登录</span>';
	htmlDiv +='<cite><a href="javascript:;" onclick="javascript:cancel();hiddenLayer(\'popupLogin\')"><img src="images/close.gif" alt="关闭窗口" /></a></cite>';
	htmlDiv +='</div>';
	htmlDiv +='</td>';
	htmlDiv +='</tr>';
	htmlDiv +='</table>';
	htmlDiv +='</td>';
	htmlDiv +='</tr>';
	htmlDiv +='<tr>';
	htmlDiv +='<td width="421">';
	htmlDiv +='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
	htmlDiv+='<tr>';
	htmlDiv+='<td>';
	htmlDiv +='<div class="loginbox">';
	htmlDiv +='<h1><img src="images/userlogin_title.gif" alt="用户登录" /></h1>';
	htmlDiv +='<p>';
	htmlDiv +='<span>用户名：</span>';
	htmlDiv +='<input type="text" ID="UN"/>';
	htmlDiv +='</p>';
	htmlDiv +='<p>';
	htmlDiv +='<span>密　码：</span>';
	htmlDiv +='<input type="password" ID="PW" />';
	htmlDiv +='</p>';
	htmlDiv +='<p class="reg">';
	htmlDiv +='<span><a href="#" target="_blank">忘记密码</a></span>';
	htmlDiv +='<span><a href="http://user.e-jjj.com/UserReg/index.aspx" target="_blank">用户注册</a></span>';
	htmlDiv +='</p>';
	htmlDiv +='<h2>';
	htmlDiv +='<input type="button" value="" onclick="MemberLogin3();" />';
	htmlDiv +='</h2>';
	htmlDiv +='</div>';
	htmlDiv+='</td>';
	htmlDiv+='</tr>';
	htmlDiv+='</table>';
	htmlDiv+='</td></tr>';
	htmlDiv +='</table>';
	
	return htmlDiv;
}


function MemberLogin3()
{      
    var returnHtml = "";
    var UN = document.all('UN').value;
    var PW = (hex_md5(document.all('PW').value)).toUpperCase();  
    var result = HuaRunList.Login(UN,PW).value;
    if (result=='1')
    {
       //
       cancel();
       hiddenLayer('popupLogin');
       alert('登录成功!');
       window.location = 'Upload.aspx';
    }  
    else
    {
       alert(result);
    }       
}


function GoUpload()
{
   if ((HuaRunList.IsLogin()).value != "1")
   {
      alert('您还没有登录，请先登录！');
      if (form == '')
     {
    	init_floatbox('form1');
	  }
      
      hide();
      displayLayer('popupLogin');
      return false;
   }
   else
   {
     window.location = 'Upload.aspx';
     return true;
   }
   
   //转向  
}


function PostDiaoCha(typeId,requtionnum)
{

    jQuery.ajax({
            data:"tid="+typeId+"&rid="+requtionnum,
            type:"POST",
            url:"chinahandler/PostDiaoCha.ashx",
            success:function(data){
                if(data == "1")
                {
                    alert("谢谢您的投票");
                    jQuery("div [@rel="+typeId+"]").remove();
                    GetDiaoCha(typeId);
                }
            }
        })
}

