var _clientwidth= 0;
var _pageheight =0;

document.body.style.overflow="hidden";
document.body.scroll="no";

function createDIV( ){
 
  var popMain = document.createElement("div");
  popMain.id = "pop-main2";
  popMain.style.position = "absolute";
  popMain.style.zIndex = "999";
  popMain.style.left=parseInt(( window.screen.width-460)/2) + "px";
  popMain.style.top= "250px";


  var popBox = document.createElement("div");
  popBox.id = "pop-box";

  popMain.appendChild(popBox); 
    var source = null;
    //var regurl = "http://www.marry5.com/public/subjects/sreg/index.html";
	var regurl = "http://www.363333.com/";
    if(source != null && source != ""){
        regurl += "?source="+source;
    }

  var notice = document.createElement("div");
  notice.className ="notice";
  notice.innerHTML="<table width='100%' border='0' cellspacing='0' cellpadding='0'>" +
	               "<tr>"+
                     "<td width='60' rowspan='2' align='center' valign='top'><span class='pop-leftcon'><img src='http://img.12925.net/pics/login/popup_icon.gif' width='42' height='43' /></span></td>"+
				     "<td height='45' class='Red14'><a href='"+regurl+"'>加盟红豆网，共享甜蜜产业百万商机！</a></td><td align=right><a href='#' onclick='upLockDiv()'><img src='http://img.12925.net/pics/login/close.gif' border=0 /></a></td>"+
				   "</tr>"+
				   "<tr>"+
				     "<td height='60'><table width='100%' border='0' cellspacing='0' cellpadding='0'>"+
				       "<tr>"+
				         "<td width='250'>全国统一免费加盟热线：400-00-12925。 中国红娘群：16864150</td>"+
	                     "<td align='center'><a target=\"_blank\" href=\"http:\/\/wpa.qq.com\/msgrd?v=3&uin=26004698&site=qq&menu=yes\"><img border=\"0\" src=\"http:\/\/wpa.qq.com\/pa?p=2:26004698:41 &r=0.31424189273771735\" alt=\"苏文\" title=\"苏文\"><\/a>  <a target=\"_blank\" href=\"http:\/\/wpa.qq.com\/msgrd?v=3&uin=979086549&site=qq&menu=yes\"><img border=\"0\" src=\"http:\/\/wpa.qq.com\/pa?p=2:979086549:41\" alt=\"红豆客服\" title=\"红豆客服\"><\/a></td>"+
	                   "</tr>"+
	                 "</table></td>"+
	               "</tr>"+
	               "</table>";

  popBox.appendChild(notice);

  
  
  var login = document.createElement("div");
  login.className ="login";
  login.innerHTML="<table width='100%' border='0' cellspacing='0' cellpadding='2'>" +
	               "<tr>"+
                     "<td height='25' colspan='5' valign='top' class='Grey'><span id=message>红豆网www.363333.com免费加盟，红豆婚介管理软件免费试用。</span></td>"+
				   "</tr>"+
				   "<tr>"+
				     "<td width='55' align='right'><span class='mBlack14'><strong>1、</strong></span></td>"+
				     "<td><a href='http://www.36336.net/winsoft/hunjie/hongduo_Access.rar' >红豆婚介管理软件</a></td>"+
				     "<td width='55' align='right'><strong>2、</strong></td>"+
	                 "<td></td>"+
	                 "<td><a href='china.html' target='_blank'>红豆网地方站加盟</a></td>"+
	               "</tr>"+
	               "</table>";

  popBox.appendChild(login);
 
  return  popMain;
}



function noLogin(){
   lockDiv();
   var popMain = createDIV();
   document.body.appendChild(popMain);
}


function browserWidth() {
  if (self.innerWidth) {
    return self.innerWidth;
  } else{
    return document.body.clientWidth;
  }
   return window.screen.width;
}

function lockDiv(){
  // 锁屏图层
  var newMask = document.createElement("div");
  newMask.id = "lock";
  newMask.style.position = "absolute";
  newMask.style.zIndex = "899";
  newMask.style.width = window.screen.width-20 + "px";
  newMask.style.height = document.body.scrollHeight + "px";
  newMask.style.top =  "0px";
  newMask.style.left = "0px";
  newMask.style.background = "#777";
  newMask.style.filter ="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
  newMask.style.opacity = "0.40";
  //newMask.style.display = "none";
  document.body.appendChild(newMask);
}


function upLockDiv(){
  // 关闭锁屏
   //document.body.removeChild(docEle("pop-main2"));
   //document.body.removeChild(docEle("lock"));
   document.body.removeChild(document.getElementById("pop-main2"));
   document.body.removeChild(document.getElementById("lock"));
}

var docEle = function() {
  return document.getElementById(arguments[0]) || false;
}

var loginSub=false;
function submitLogin(){
   if(loginSub) return ;
   loginSub=true;
   var id = document.getElementById("user_id").value;
   var password = document.getElementById("user_pass").value;
   document.getElementById("message").innerHTML="<font color='red'>正在登陆，请稍候...</font>";
   document.getElementById("loginButton").disabled = true;
   $.ajax({                                                
     type: "POST",                                    
     url: "signin.aspx",  
     data: "loginId="+id+"&password="+password,                               
     timeout: 5000,  
     success: function(msg){   
	    if(msg!="1" && msg!="0" && msg.length>2){
		  document.getElementById("loginButton").disabled = false;
		  document.getElementById("message").innerHTML="<font color='red'>登陆成功，正在刷新页面</font>";
		  location.reload() ;
		}else{
		   loginSub=false;
		  document.getElementById("loginButton").disabled = false;
		  document.getElementById("message").innerHTML="<font color='red'>帐号或密码错误,请重试...</font>";
		}
     }
   });
}

