﻿function E_CardShow(StrUrl) {
	document.write("<div id=\"E_CardShowDiv\" style=\"width:486px; height:450px; left:50%; margin:-180px 0 0 -255px; position:absolute; top:50%; Z-INDEX: 100;");
	document.write("filter:progid:DXImageTransform.Microsoft.Shadow(direction=135,color=#aaaaaa,strength=8);");
	document.write("border: 1px solid #000000;background-color: #FFFFFF;");
	document.write("\">");

	document.write("<div id=\"E_CardShowTwo\" style=\"border: 1px dotted #000000;text-align: center;width: 10px;height:10px;visibility: visible;overflow:hidden;position: absolute;cursor: hand;top: 3px;left: 470px; Z-INDEX: 102;background-color: #d1e6f7;\" title=\"关闭\" onclick=\"E_CardShowClose();\">");
	document.write("<div id=\"E_CardShowThree\" style=\"font-family: Verdana;font-size: 10px;color: #000000;font-weight: bolder;cursor: hand;position: absolute;top: -3px;left: 2px; Z-INDEX: 103\"><a href=\"#\">x</a></div>");
	document.write("</div><br>");
	document.write("<iframe id=\"E_CardIframeShow\" frameborder=0 src=\"E-card/" + StrUrl + "\" scrolling=\"no\" style=\"width:100%; height:100%; VISIBILITY: inherit; Z-INDEX: -1\"></iframe>");
	document.write("</div>");
}

function E_CardShowClose() {
	document.getElementById("E_CardIframeShow").src = "about:blank";
	document.getElementById("E_CardShowDiv").style.visibility = "hidden";
	document.getElementById("E_CardShowTwo").style.visibility = "hidden";
	document.getElementById("E_CardShowThree").style.visibility = "hidden";
}


//用逗号把每个iframe的ID分隔. 例如: ["myframe1", "myframe2"]，可以只有一个窗体，则不用逗号。
//定义iframe的ID
var iframeids = ["E_CardIframeShow"]

//如果用户的浏览器不支持iframe是否将iframe隐藏 yes 表示隐藏，no表示不隐藏
var iframehide = "yes"
function dyniframesize() {
	var dyniframe = new Array()
	for (i = 0; i < iframeids.length; i++) {
		if (document.getElementById) {
			//自动调整iframe高度
			dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
			if (dyniframe[i] && !window.opera) {
				dyniframe[i].style.display = "block"
				if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //如果用户的浏览器是NetScape
				{
					dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight;
					document.getElementById("E_CardShowDiv").style.height = (dyniframe[i].contentDocument.body.offsetHeight + 15) + "px";
				}
				else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //如果用户的浏览器是IE
				{
					dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
					document.getElementById("E_CardShowDiv").style.height = dyniframe[i].Document.body.scrollHeight + "px";
				}
			}
		}
		//根据设定的参数来处理不支持iframe的浏览器的显示问题
		if ((document.all || document.getElementById) && iframehide == "no") {
			var tempobj = document.all ? document.all[iframeids[i]] : document.getElementById(iframeids[i])
			tempobj.style.display = "block"
		}
	}
}

if (window.addEventListener) {
	window.addEventListener("load", dyniframesize, false)
}
else if (window.attachEvent) {
	window.attachEvent("onload", dyniframesize)
}
else {
	window.onload = dyniframesize
}
