var Browser = new Object();
Browser.isMozilla = (typeof document.implementation!='undefined')&&(typeof document.implementation.createDocument!='undefined')&&(typeof HTMLDocument!='undefined');
Browser.isIE = window.ActiveXObject?true:false;
Browser.isGecko=navigator.userAgent.indexOf("Gecko")!=-1;
Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
function getclientHeight(){
    if(window.innerHeight<document.body.clientHeight){
       return window.innerHeight
    }
    return document.body.clientHeight
}
function getscrollHeight(){
    if(document.body.scrollHeight>document.documentElement.clientHeight){
       return document.body.scrollHeight
    }else{
       return document.documentElement.clientHeight
    }
}

function $$(id){
  return document.getElementById(id);
}
var $ = function(ID){ return document.getElementById(ID); };

function getposOffset(what, offsettype){
  var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
  var parentEl=what.offsetParent;
  while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
  }
  return totaloffset;
}

var onloading="<img src='/images/loading001.gif' align='absmiddle' />请稍等，正在装载数据中";
var MessBoxDiv=null;
function ShowMessBox(Msg, objOffX, objOffY){
    if(MessBoxDiv==null || !MessBoxDiv){
       MessBoxDiv = document.createElement("div");
       if(Browser.isMozilla){
          MessBoxDiv.style.cssText="border:1px solid #CAE2F8;position:absolute;height:auto;width:auto;color:#FF0000;background-color:#FFFFFF;opacity:.3;text-align:left;padding:3px";
       }else{
          MessBoxDiv.style.cssText="border:1px solid #CAE2F8;position:absolute;height:auto;width:auto;color:#FF0000;background-color:#FFFFFF;padding:5px 0px 0px 0px;filter:alpha(opacity=90);text-align:left;padding:3px";
       }
       MessBoxDiv.style.left = objOffX != -1 ? objOffX : ( document.body.clientWidth - 100 ) / 2 ;
       MessBoxDiv.style.top = objOffY != -1 ? document.documentElement.scrollTop + objOffY : document.documentElement.scrollTop ;
       
       MessBoxDiv.innerHTML = Msg;
       MessBoxDiv.id = "MessBox";
       MessBoxDiv.style.display="inline";
       document.body.appendChild(MessBoxDiv);
     }else{
       MessBoxDiv.innerHTML=Msg;
     }
}

function CloseMessBox(){
    if(MessBoxDiv == null) return;
    document.body.removeChild(MessBoxDiv);
    MessBoxDiv=null;
}

var MaskLayer=null;

function ShowMaskLayer(){
      if(MaskLayer==null || !MaskLayer){
              MaskLayer=document.createElement("DIV");
                    if(Browser.isMozilla){
                           MaskLayer.style.cssText="position:absolute;top:20px;left:0px;background-color:#cccccc;opacity:.8;";
                    }else{
                           MaskLayer.style.cssText="position:absolute;top:0px;left:0px;background-color:#cccccc;filter:alpha(opacity=80);";
                    }
             MaskLayer.style.height=getscrollHeight();
             MaskLayer.style.width=document.body.clientWidth;
             document.body.appendChild(MaskLayer);
       }
 }
 
function CloseMaskLayer(){
    if(MaskLayer == null) return;
    document.body.removeChild(MaskLayer);
    MaskLayer=null;
} 

var MessageBoxDiv=null;

/**
 * 显示信息框
 * 使用方法： showMessageBox(onloading,getposOffset(LoginDiv,"left") + 10, getposOffset(LoginDiv,"top") + 50);
 * @param Msg      - 要显示的信息内容
 * @param objOffX  - 信息框绝对位置左端距离
 * @param objOffY  - 信息框绝对位置上端距离
 */
function showMessageBox(Msg, objOffX, objOffY){
    if(MessageBoxDiv==null||!MessageBoxDiv){
       MessageBoxDiv = document.createElement("div");
       if(Browser.isMozilla){
          MessageBoxDiv.style.cssText="position:absolute;height:18px;width:100px;color:#FFFFFF;background-color:#FF0000;opacity:.3;";
       }else{
          MessageBoxDiv.style.cssText="position:absolute;height:18px;width:auto;color:#FFFFFF;background-color:#FF0000;padding:5px 0px 0px 0px;filter:alpha(opacity=90);";
       }
       MessageBoxDiv.style.left = objOffX != -1 ? objOffX : ( document.body.clientWidth - 100 ) / 2 ;
       MessageBoxDiv.style.top = objOffY != -1 ? objOffY : document.documentElement.scrollTop ;
       
       MessageBoxDiv.innerHTML = Msg;
       MessageBoxDiv.id = "MessageBox";
             //OnLoadingDiv.focus();
             //eval("document.getElementById('OnLoading').focus();");
       MessageBoxDiv.style.display="inline";
       document.body.appendChild(MessageBoxDiv);
     }
}

function closeMessageBox(){
    if(MessageBoxDiv == null) return;
    document.body.removeChild(MessageBoxDiv);
    MessageBoxDiv=null;
}


var maskDiv=null;

function showmask(){
      if(maskDiv==null||!maskDiv){
              maskDiv=document.createElement("DIV");
                    if(Browser.isMozilla){
                           maskDiv.style.cssText="position:absolute;top:22px;left:0px;background-color:#fff;opacity:.9;";
                    }else{
                           maskDiv.style.cssText="position:absolute;top:22px;left:0px;background-color:#fff;filter:alpha(opacity=95);";
                    }
             maskDiv.style.height=getscrollHeight()+60;
             maskDiv.style.width=document.body.clientWidth;
             document.body.appendChild(maskDiv);
       }
 }

var pDiv=null;
function PopupWindows(){
	showmask();
	pDiv=document.createElement("div");
    pDiv.style.left = ( document.body.clientWidth - 500 ) / 2;
    pDiv.style.top = 150;
	pDiv.style.width = 500;
	pDiv.style.height = 300;
	pDiv.style.position = "absolute";
	//pDiv.style.background = "#fff";
    pDiv.style.border = "2px";
	//pDiv.style.cssText="position:absolute;background-color:#fff;width:700;height:400;border-bottom:2px solid #C3C3C3;";
	pDiv.innerHTML='<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="80%" height="24" align="left" background="/images/windows_title_head.gif">该内容显示被管理员做了遮罩</td><td width="20%" align="right" background="/images/windows_title_head.gif"><img src="/images/close_move.gif " style="cursor:hand" onmousedown="closePopupWindows()" /></td></tr><tr><td colspan="2"><div id="content" style="border:3px double #666666;background: #FFF;line-height:160%">1.没有权限访问<br>2.需要会员登录<br>3.非诚信通会员禁止查看最新三天商业机会信息<br><br><br><div></td></tr></table>';
	pDiv.style.display="";
	document.body.appendChild(pDiv);
} 

