﻿<!--
//=================================
//div模拟模态窗口
//div_content窗口内容
//div_width窗口宽度
//div_height窗口高度
//div_opacity遮蔽层的透明高
//连接不同的iframe链接
//=================================
function ModalDialog_DIV(div_content,div_width,div_height,div_opacity,url_value){
   //----------------检测试屏幕宽和高--------------------------------------
	var Scroll_Width,Scroll_Height;
	if (window.innerHeight && window.scrollMaxY) {
		//alert(document.body.scrollWidth);
	   //Scroll_Width = window.screen.width-16;
	   if(document.body.scrollWidth>window.screen.width){
		   Scroll_Width = document.body.scrollWidth;
	   }else{
		   Scroll_Width = window.screen.width-16;
	   }
		Scroll_Height = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){
		// all but Explorer Mac 
		//Scroll_Width = window.screen.width-16;
		//alert(document.body.scrollWidth);
	   if(document.body.scrollWidth>window.screen.width){
		   Scroll_Width = document.body.scrollWidth;
	   }else{
		   Scroll_Width = window.screen.width-16;
	   }
		Scroll_Height = document.body.scrollHeight;
	} else { 
	// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		//alert(document.body.scrollWidth);
		Scroll_Width = window.screen.width-20;
		Scroll_Height = document.body.offsetHeight;
	}
	//------------------------------------------------------------------
	var ShieldBody_DIV = document.createElement("DIV");
	ShieldBody_DIV.id = "ShieldBody_DIV";
	ShieldBody_DIV.style.position = "absolute";
	ShieldBody_DIV.style.left = "0px";
	ShieldBody_DIV.style.top = "0px";
	ShieldBody_DIV.style.width = Scroll_Width+"px";
	ShieldBody_DIV.style.height = Scroll_Height+"px";
	//alert(document.documentElement.scrollLeft+"px");
	
	
	ShieldBody_DIV.style.background = "#666";
	ShieldBody_DIV.style.textAlign = "center";
	ShieldBody_DIV.style.zIndex = "1000";
	ShieldBody_DIV.style.filter = "alpha(opacity="+div_opacity+")";//ie上的透明设置代码
	ShieldBody_DIV.style.opacity = div_opacity/100;//Mozilla上的透明设置代码
	var ModalDialogFram_DIV = document.createElement("DIV");
	ModalDialogFram_DIV.id="ModalDialogFram_DIV";
	ModalDialogFram_DIV.style.position = "absolute";
	ModalDialogFram_DIV.style.left = "50%";
	ModalDialogFram_DIV.style.top = "50%";
	ModalDialogFram_DIV.style.marginLeft =-(div_width/2)+document.documentElement.scrollLeft+"px" ;
	ModalDialogFram_DIV.style.marginTop = -(div_height/2)+document.documentElement.scrollTop-50+"px";

	ModalDialogFram_DIV.style.width = div_width+"px";
	ModalDialogFram_DIV.style.height = div_height+"px";
	ModalDialogFram_DIV.style.background = "#ccc";
	ModalDialogFram_DIV.style.textAlign = "center";
	ModalDialogFram_DIV.style.lineHeight = "150px";
	ModalDialogFram_DIV.style.zIndex = "1001";
	
	ModalDialogFram_DIV.innerHTML = div_content;
	document.body.appendChild(ModalDialogFram_DIV);
	document.body.appendChild(ShieldBody_DIV);
	//==========设置iframe的src地址=======
	if(document.getElementById('edit_iframe')){
		document.getElementById('edit_iframe').src=url_value;
	}
	//==================================
	this.close_div = function(){
		//ModalDialogFram_DIV.style.display = "none";
		//ShieldBody_DIV.style.display = "none";
		document.body.removeChild(ModalDialogFram_DIV);
		document.body.removeChild(ShieldBody_DIV);
		//document.body.onselectstart = function(){return true;}
		document.body.oncontextmenu = function(){return true;}
	}
	//document.getElementById("closewin_div").focus();
	//document.body.onselectstart = function(){return false;}
	document.body.oncontextmenu = function(){return false;}
}

function homehelp(){
   alert("什么是1510房客？\n\n1510房客是我们已经确认了真实身份，并且有所了解的用户。1510房客还包括了网站的专栏作家，管理员以及编辑人员。");
}
function reporthelp(){
   alert("什么是我要报料？\n\n如果在你的身边发生了你觉得需要大众关注的事情，请提供具体的时间，地点，以及详情。\n我们鼓励你成为一个公民记者，报道技巧，专业训练不是首要的，最重要的是你能够行动起来，把你看到的事件写下来。\n最重要的是要尊重事实，作者要在道德和法律上为自己的言论负责。资讯要有透明度，特别是要清除交待自己在所报道事件中的角色或者位置。引用别的信息来源，请注明出处。");
}

function vouchhelp(){
   alert("什么是我要推荐？\n\n所有注册的用户，如果在其他的网站，博客和论坛看到自己喜欢的文章，欢迎提供链接。我们希望透过互联网，让大家分享更多的信息。");
}

//-->
