//显示div层
function displayLayer(obj,layerID)
{
	//ClickAreaOK('selectArea');//关闭层显示
	//ClickJobTypeOK('selectJobType');//关闭层显示
	
	var dv = document.getElementById(layerID);
	GetCenterXY_ForLayer(dv);//将div层定位于页面中心
	SetTheDivVisible(dv);////设置div层为显示
}

//将层定位于页面中心
function GetCenterXY_ForLayer(TheDivObj)
{
	x = document.body.scrollLeft;
	y = document.body.scrollTop;
	availWidth = parseInt(window.screen.availWidth);
	availHeight = parseInt(window.screen.availHeight);
	tblWidth = parseInt(TheDivObj.width);
	y = y + availHeight/4;
	x = (availWidth - tblWidth)/2;
	
	//新的
	var clientHeight=TheDivObj.firstChild.clientHeight;
	x = parseInt(document.documentElement.scrollLeft+(document.documentElement.clientWidth - 670)/2)+'px';
	var relTop=(document.documentElement.clientHeight-clientHeight)/2 > 0 ? (document.documentElement.clientHeight-clientHeight)/2:0;
	y = parseInt(document.documentElement.scrollTop+relTop)+'px';
	//新的
	
	TheDivObj.style.top = y;
	TheDivObj.style.left = x;
}

function SetTheDivVisible(TheDivObj)
{
	hideElementAll();
	TheDivObj.style.visibility = "visible";
}

function HideElement(strElementTagName){
	try{
		for(i=0;i<window.document.getElementsByTagName(strElementTagName).length; i++){
			var objTemp = window.document.getElementsByTagName(strElementTagName)[i];
			objTemp.style.visibility = "hidden";
		}
	}catch(e){
		alert(e.message);
	}
}

function ShowElement(strElementTagName){
	try{
		for(i=0;i<window.document.getElementsByTagName(strElementTagName).length; i++){
			var objTemp = window.document.getElementsByTagName(strElementTagName)[i];
			objTemp.style.visibility = "visible";
		}
	}catch(e){
		alert(e.message);
	}
}

function hideElementAll(){
	HideElement("SELECT");
	HideElement("OBJECT");
	HideElement("IFRAME");
}

function showElementAll(){
	ShowElement("SELECT");
	ShowElement("OBJECT");
	ShowElement("IFRAME");
}

//***************************拖动函数 start **********************************//
var currentMoveObj = null;    //当前拖动对象
var relLeft;    //鼠标按下位置相对对象位置
var relTop;
var tHeight,lWidth;

function f_mdown(obj,e)
{
    currentMoveObj = obj;        //当对象被按下时，记录该对象
    currentMoveObj.style.position = "absolute"; 
    var e = e ? e : event; 
    relLeft = e.clientX - currentMoveObj.offsetLeft;
    relTop = e.clientY -  currentMoveObj.offsetTop; 
}
window.document.onmouseup = function()
{
      currentMoveObj = null;    //当鼠标释放时同时释放拖动对象
}
function f_move(obj,e)
{
    if(currentMoveObj != null)
    {
        var e = e ? e : event; 
        currentMoveObj.style.left=parseInt(e.clientX)-relLeft+"px";
        currentMoveObj.style.top=parseInt(e.clientY)-relTop+"px"; 
    }   
}
    
//***************************拖动函数 end **********************************//


function GetBrowser()
{
    var oType = "";
    if(navigator.userAgent.indexOf("MSIE")!=-1){
        oType="IE";
    }else if(navigator.userAgent.indexOf("Firefox")!=-1){
        oType="FIREFOX";
    }
    return oType;
} 

function show(ele)
{ 
    var objcurrentBack = document.getElementById(ele);
    objcurrentBack.style.display = '';
    var BGheight = document.body.scrollHeight ;
    var BGwidht = document.body.scrollWidth;
 
   objcurrentBack.style.height = BGheight+'px';
   objcurrentBack.style.width = BGwidht+'px';
}

function hidden(ele)
{
     var objcurrentBack = document.getElementById(ele);
     objcurrentBack.style.display = 'none';
}