var formtype = false;

document.domain = "51lunwen.net";

function $(id) {

	return document.getElementById(id);

}

function divshow (action) {

	var objs = document.getElementsByTagName("OBJECT");

	for(i = 0;i < objs.length; i ++) {

		if(objs[i].style.visibility != 'hidden') {

			objs[i].setAttribute("oldvisibility", objs[i].style.visibility);

			objs[i].style.visibility = 'hidden';

		}

	}

	var clientWidth = document.body.clientWidth;

	var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;

	var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;

	var pmheight = clientHeight * 0.9;

	if (action=='open') {

	var pmwidth = 800;

	}

	else {

	pmheight = 300;

	var pmwidth = 400;

	}

	if(!$('pmlayer_bg')) {

		div = document.createElement('div');div.id = 'pmlayer_bg';

		div.style.position = 'absolute';

		div.style.left = div.style.top = '0px';

		div.style.width = '100%';

		div.style.height = (clientHeight > document.body.scrollHeight ? clientHeight : document.body.scrollHeight) + 'px';

		div.style.backgroundColor = '#000';

		div.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=20,finishOpacity=100,style=0)';

		div.style.opacity = 0.8;

		div.style.zIndex = '998';

		$('append_parent').appendChild(div);

		div = document.createElement('div');div.id = 'pmlayer';

		div.style.width = pmwidth + 'px';

		div.style.height = pmheight + 'px';

		div.style.left = ((clientWidth - pmwidth) / 2) + 'px';

		div.style.position = 'absolute';

		div.style.zIndex = '999';

		$('append_parent').appendChild(div);

		$('pmlayer').innerHTML = '<div style="width: ' + pmwidth + 'px; background: #ffffff; margin: 5px auto; text-align: center;">' +

			'<div style="width: ' + pmwidth + 'px; height: ' + pmheight + 'px; padding: 1px; background: #FFFFFF; border: 1px solid #FFFFFF; position: relative; left: -6px; top: -3px;">' +

			'<a href="###" onclick="pmwin(\'close\')"><img style="position: absolute;right: 20px;top: 15px" border="0" src="http://www.51lunwen.net/close.gif" title="关闭" /></a>' +

			'<iframe id="pmframe" name="pmframe" style="width:' + pmwidth + 'px;height:100%" allowTransparency="true" frameborder="0"></iframe></div></div>';

	}

	$('pmlayer_bg').style.display = '';

	$('pmlayer').style.display = '';

	$('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px';

	document.body.style.overflow = "hidden";

	document.body.scroll = "no";

}


