﻿


//不带框架的新窗口,显示本页内容

function Show_thisHtmlDiv(Title,h,w)
{
 document.body.style.overflow='hidden';
 reval = "	<h1 id=\"Evaluate_H1\" onmousedown=\"new dialog().moveStart(event, 'ShowEvaluateLocal');\"><span id=\"closeF\"><a href=\"javascript:;\" onclick=\"ShowEvaluateLocalClose();\" style=\"color: #4786b3;\">×</a></span> <h2 id=\"DivTitle\" style=\"color: #FFFFFF;\"> </h2> </h1>";
 $("#ShowEvaluateLocal").prepend(reval);
 reval= "<div id=\"Localback\"style=\"position:absolute;left:0;top:0;width:"+document.body.clientWidth+";height:"+document.body.scrollHeight+";visibility:hidden;\"> </div>";
 $(reval).appendTo("body");

Localback.style.background='#333333';
Localback.style.filter='alpha(opacity=40)';
Localback.style.visibility='';

 var T=(document.body.clientHeight-h)/2;
 var L=(document.body.clientWidth-w)/2;
//document.documentElement.scrollTop
      DivTop		= document.body.scrollTop+T;
	  DivLeft		= document.body.scrollLeft+L;
 
	document.getElementById("ShowEvaluateLocal").style.display = "block";
	document.getElementById("DivTitle").innerText = Title;
	document.getElementById("ShowEvaluateLocal")['style']['height'] =h ;//"400px"
	document.getElementById("ShowEvaluateLocal")['style']['width'] =w ;//"300px";
	document.getElementById("ShowEvaluateLocal")['style']['top'] = DivTop;
	document.getElementById("ShowEvaluateLocal")['style']['left'] = DivLeft;

}
function ShowEvaluateLocalClose()
{

	$("#Evaluate_H1").remove();
	$("#Localback").remove();
	$("#ShowEvaluateLocal").hide();
	document.body.style.overflow='';
}

//=================================================================
// 调用等待窗口 load....　　js是函数   开始   2008-11-30
//  
function Show_WinLoading(Title)
{
  Show_NewDiv(0,Title,'/Include/Loading.html',100,350);
  return false;
}


//调用等待窗口 load....　　　js是函数   结束
//=================================================================

//带框架的新窗口
 function CreateWindowsDiv_()
{$("<div id=CreateWindowsDiv_Evaluate><DIV Id=Set_Html_Iframe></DIV><div id=Set_Html_BgDiv></div></div>").appendTo("body");}

function Show_NewDiv(Id,Title,URL,h,w)
{
 document.body.style.overflow='hidden'; 
 var T=(document.body.clientHeight-h)/2;
 var L=(document.body.clientWidth-w)/2;
 
 	  DivTop		= document.body.scrollTop+T;
	  DivLeft		= document.body.scrollLeft+L+24;

CreateWindowsDiv_();
reval  = "";
reval += "<div id=\"ShowEvaluate\" class=\"ShowEvaluate\">";
reval += "	<h1 onmousedown=\"new dialog().moveStart(event, 'ShowEvaluate');\"><span id=\"closeF\"><a href=\"javascript:;\" onclick=\"ShowEvaluateClose("+Id+");\" style=\"color: #4786b3;\">×</a></span> <h2 id=\"DivTitle\" style=\"color: #FFFFFF;\"> </h2> </h1>";
reval += "	<iframe src=\"\" name=\"ShowEvaluateFrame\" frameborder=\"0\" id=\"ShowEvaluateFrame\" scrolling=\"no\" style=\"width: 100%; height: 100%;\"></iframe>";
reval += "</div>";
Set_Html_Iframe.innerHTML=reval;
reval= "<div id=\"back\"style=\"position:absolute;left:0;top:0;width:"+document.body.clientWidth+";height:"+document.body.scrollHeight+";visibility:hidden;\"> </div>";
Set_Html_BgDiv.innerHTML=reval;
back.style.background='#333333';
back.style.filter='alpha(opacity=40)';
back.style.visibility='';
//document.documentElement.scrollTop
 
	document.getElementById("ShowEvaluate").style.display = "block";
	document.getElementById("DivTitle").innerText = Title;
 	document.getElementById("ShowEvaluateFrame").src = URL;  
	document.getElementById("ShowEvaluate")['style']['height'] =h ;//"400px"
	document.getElementById("ShowEvaluate")['style']['width'] =w ;//"300px";
	document.getElementById("ShowEvaluate")['style']['top'] = DivTop;
	document.getElementById("ShowEvaluate")['style']['left'] = DivLeft;
 }
  
function ShowEvaluateClose(Id)
{
	$("#CreateWindowsDiv_Evaluate").remove();
	document.body.style.overflow='';
}


//移动对话框
function dialog()
{
	this.moveStart = function (event, _sId)
	{
		var oObj = document.getElementById(_sId);
		oObj.onmousemove = mousemove;
		oObj.onmouseup = mouseup;
		oObj.setCapture ? oObj.setCapture() : function(){};
		oEvent = window.event ? window.event : event;
		var dragData = {x : oEvent.clientX, y : oEvent.clientY};
		var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};
		function mousemove()
		{
			var oEvent = window.event ? window.event : event;
			var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);
			var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);
			oObj.style.left = iLeft + "px";
			oObj.style.top = iTop + "px";
			dragData = {x: oEvent.clientX, y: oEvent.clientY};
		}
		function mouseup()
		{
			var oEvent = window.event ? window.event : event;
			oObj.onmousemove = null;
			oObj.onmouseup = null;
			if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > window.top.document.body.clientWidth || oEvent.clientY > window.top.document.body.clientHeight)
			{
				oObj.style.left = backData.y + "px";
				oObj.style.top = backData.x + "px";
			}
			oObj.releaseCapture ? oObj.releaseCapture() : function(){};
		}
	}
}


