
function OpenDivDialog(sUrl,sArgs,sDialogWidth,sDialogHeight,sResizable,sCNTitle,sENTitle)
{
	var divWinObj = createDivWin(sDialogWidth,sDialogHeight);
	divWinObj.location.href = sUrl;
	moveDiv_init();
}

function OpenDivDialogApply(sUrl,sArgs,sDialogWidth,sDialogHeight,sResizable,sCNTitle,sENTitle)
{
	var divWinObj = createDivWin1(sDialogWidth,sDialogHeight);
	divWinObj.location.href = sUrl;
	moveDiv_init();
}
function buttonClose(){
	//alert("OK");
	//document.all.PopupFormDiv.style.display = 'none';
	 parent.PopupFormDiv.style.display = 'none';
	 //PopupFormFrame.location.href = 'opener.location.href';
	// window.location.href = location.href;
	   //window.location.href = window.opener.location.href;
	   PopupFormFrame.location.href = 'about:blank';
}

function buttonCloseB(){
	//alert("OK");
	//document.all.PopupFormDiv.style.display = 'none';
	 parent.PopupFormDiv.style.display = 'none';
	 PopupFormFrame.location.href = 'about:blank';
}

function CloseDivDialog(isUpdate){
	var s = CurrentOpenned;
	
	parent.PopupFormDiv.style.display = 'none';
	parent.PopupFormFrame.location.href = 'about:blank';
	if (isUpdate){
		switch (s){
			case 2:
			case 3:
				MyBaseInfo();
				break;
			case 4:
				get_pagesize();
				break;
			case 14:
			case 15:
			case 16:
			case 18:
				if (LANGUAGE=='CN')
					Get_CNResumeStatus();
				else
					Get_ENResumeStatus();
				break;	
			case 25:
				Get_JobChance();
				break;
			case 41:
			case 44:
			case 45:
			case 46:
			case 47:
				Trrequest();
				break;
			case 70:
			case 80:
			case 91:
				Get_TestAttach();
				break;			
		}				
	}
	return isUpdate;			
}

//移动层窗口
function moveDiv_setZIndex(obj, zOrder) {
	obj.zIndex = zOrder
}
function moveDiv_shiftTo(obj, x, y) {
		if ((x>=0)&&(x<window.screen.width-50)){
		obj.pixelLeft = x;

		}
		if ((y>=0)&&(y<window.screen.height-100)){
		obj.pixelTop = y;		
		}		
	
}
var selectedObj
var offsetX, offsetY

function moveDiv_setSelectedElem(evt) {
	
		var imgObj = window.event.srcElement;
		if (imgObj.id=='dragDiv') {
			
			selectedObj = document.all.PopupFormDiv.style;
			moveDiv_setZIndex(selectedObj,100);
			return;
		}
		selectedObj = null;
		return;
}

function moveDiv_dragIt(evt) {
	if (window.event.srcElement.id=='dragDiv'){
		window.event.srcElement.style.cursor = "move";
	}
	if (selectedObj) {
			moveDiv_shiftTo(selectedObj, (window.event.clientX - offsetX), (window.event.clientY - offsetY));
			return false;
	}
}

function moveDiv_engage(evt) {
	moveDiv_setSelectedElem(evt);
	if (selectedObj) {
			offsetX = window.event.offsetX;
			offsetY = window.event.offsetY;
	}
	return false;
}

function moveDiv_release(evt) {
	if (selectedObj) {
		moveDiv_setZIndex(selectedObj, 0);
		selectedObj = null;
	}
}

function moveDiv_init() {
	document.all.dragDivTd.onmousedown = moveDiv_engage;
	document.all.dragDivTd.onmousemove = moveDiv_dragIt;
	document.all.dragDivTd.onmouseup = moveDiv_release;
}

function createDivWin(sDivWidth,sDivHeight){
	if (typeof(document.all.PopupFormDiv)=='object'){
		document.getElementsByTagName("body").item(0).removeChild(document.all.PopupFormDiv);
	}
	var bodyObj = document.getElementsByTagName("body").item(0);
	var divObj =  document.createElement("div");
	var strHTML;
	bodyObj.appendChild(divObj);
	
	divObj.id						= "PopupFormDiv";
	divObj.name						= "PopupFormDiv";	
	divObj.style.position			= 'absolute';
	divObj.style.border				= '1px outset';
	divObj.style.borderTop			= '1px outset #D5E4F0';
	divObj.style.borderLeft			= '2px outset #D5E4F0';
	divObj.style.borderRight		= '2px outset #D5E4F0';
	divObj.style.borderBottom		= '2px outset #D5E4F0';
	divObj.style.backgroundColor	= '#EEF0F2';
	divObj.style.width				= sDivWidth;
	divObj.style.height				= sDivHeight;
	divObj.style.left				= (bodyObj.clientWidth-parseInt(sDivWidth))/2+80;
	divObj.style.top				= (bodyObj.clientHeight-parseInt(sDivHeight))/2-120;	
	
	strHTML = '<table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr>';
	strHTML = strHTML + '<td id="dragDivTd"><img id="dragDiv" src="/imgs/head.gif" width="';
	strHTML = strHTML +	(parseInt(sDivWidth)-20)+'" height="20"></td>';
	strHTML = strHTML + '<td width="20"><img src="/imgs/closeIMG1.gif" onmousedown="this.src=\'/imgs/closeIMG2.gif\'" onmouseout="this.src=\'/imgs/closeIMG1.gif\'" onclick="buttonClose();" WIDTH="20" HEIGHT="20"  style="cursor:hand;"></td></tr></table>';
	strHTML = strHTML + '<iframe id="PopupFormFrame" width="'+sDivWidth+'" FRAMEBORDER="0" height="'+sDivHeight+'"></iframe>';
	
	divObj.innerHTML = strHTML;
	return window.PopupFormFrame;
}
function createDivWin1(sDivWidth,sDivHeight){
	if (typeof(document.all.PopupFormDiv)=='object'){
		document.getElementsByTagName("body").item(0).removeChild(document.all.PopupFormDiv);
	}
	var bodyObj = document.getElementsByTagName("body").item(0);
	var divObj =  document.createElement("div");
	var strHTML;
	bodyObj.appendChild(divObj);
	
	divObj.id						= "PopupFormDiv";
	divObj.name						= "PopupFormDiv";	
	divObj.style.position			= 'absolute';
	divObj.style.border				= '1px outset';
	divObj.style.borderTop			= '1px outset #D5E4F0';
	divObj.style.borderLeft			= '2px outset #D5E4F0';
	divObj.style.borderRight		= '2px outset #D5E4F0';
	divObj.style.borderBottom		= '2px outset #D5E4F0';
	divObj.style.backgroundColor	= '#EEF0F2';
	divObj.style.width				= sDivWidth;
	divObj.style.height				= sDivHeight;
	divObj.style.left				= (bodyObj.clientWidth-parseInt(sDivWidth))/2+80;
	divObj.style.top				= (bodyObj.clientHeight-parseInt(sDivHeight))/2+260;	
	
	strHTML = '<table width="100%"  border="0" cellspacing="0" cellpadding="0"><tr>';
	strHTML = strHTML + '<td id="dragDivTd"><img id="dragDiv" src="/imgs/head.gif" width="';
	strHTML = strHTML +	(parseInt(sDivWidth)-20)+'" height="20"></td>';
	strHTML = strHTML + '<td width="20"><img src="/imgs/closeIMG1.gif" onmousedown="this.src=\'/imgs/closeIMG2.gif\'" onmouseout="this.src=\'/imgs/closeIMG1.gif\'" onclick="buttonClose();" WIDTH="20" HEIGHT="20"  style="cursor:hand;"></td></tr></table>';
	strHTML = strHTML + '<iframe id="PopupFormFrame" width="'+sDivWidth+'" FRAMEBORDER="0" height="'+sDivHeight+'"></iframe>';
	
	divObj.innerHTML = strHTML;
	return window.PopupFormFrame;
}