function pmwin(action, param) {
	//var objs = document.getElementsByTagName("OBJECT");
	if(action == 'open') {
		/*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 clientHeight = "667px";
		var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
		var pmwidth = 800;
		var pmheight = clientHeight * 0.8;
		
		if(!document.getElementById('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=80,finishOpacity=100,style=0)';
			div.style.opacity = 0.8;
			div.style.zIndex = '998';
			document.getElementById('append_parent').appendChild(div);
			document.getElementById('pmlayer_bg').innerHTML = '<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;filter:alpha(opacity=0);"></iframe>'
			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';
			document.getElementById('append_parent').appendChild(div);
			document.getElementById('pmlayer').innerHTML = '<div style="width: 800px; background: #666666; margin: 5px auto; text-align: left;">' +
				'<div style="width: 800px; height: ' + pmheight + 'px; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px;">' +
				'<a href="javascript:void(0);" onclick="pmwin(\'close\')"><img style="position: absolute;right: 20px;top: 15px" border="0" src="/images/close.gif" title="关闭" /></a>' +
				'<iframe id="pmframe" name="pmframe" style="width:' + pmwidth + 'px;height:100%" allowTransparency="true" frameborder="0"></iframe></div></div>';
		}
		if(document.getElementById('xiangdao')){
			document.getElementById('xiangdao').style.display = 'none';
			document.getElementById('xdpmlayer').style.display = 'none';
		}
		document.getElementById('pmlayer_bg').style.display = 'block';
		document.getElementById('pmlayer').style.display = 'block';
		//document.getElementById('pmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop) + 'px';
		if(window.screen.height<=800){
			document.getElementById('pmlayer').style.top = '5px';
		}else if (window.screen.height>800 && window.screen.height<1024){
			document.getElementById('pmlayer').style.top = '50px';
		}else{
			document.getElementById('pmlayer').style.top = '100px';
		}
		if(!param) {
			pmframe.location = '/member/my/message';
		} else {
			pmframe.location = '/member/my/message/' + param;
		}
		document.body.style.overflow = "hidden";
		document.body.scroll = "no";
	} else if(action == 'close') {
		/*for(i = 0;i < objs.length; i ++) {
			if(objs[i].attributes['oldvisibility']) {
				objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue;
				objs[i].removeAttribute('oldvisibility');
			}
		}*/
		document.getElementById('pmlayer').style.display = 'none';
		document.getElementById('pmlayer_bg').style.display = 'none';
		document.body.style.overflow = "auto";
		document.body.scroll = "auto";
		window.location.reload();
		document.getElementById('xiangdao').style.display = 'none';
	}
}

/*向导*/

function xd(action, param) {
	//var objs = document.getElementsByTagName("OBJECT");
	if(action == 'open') {
		/*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 pmwidth = 760;
		var pmheight = clientHeight * 0.9;
		window.scrollTo(0,0);
		if(!document.getElementById('xiangdao')) {
			div = document.createElement('div');div.id = 'xiangdao';  
			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.height = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) + "px"
			//window.attachEvent("onresize",div.style.height ); 
			
			//div.style.height = document.body.scrollHeight + clientHeight + "px";
			
			div.style.backgroundColor = '#000';
			div.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=80,finishOpacity=100,style=0)';
			div.style.opacity = 0.8;
			div.style.zIndex = '998';
			document.getElementById('xdappend_parent').appendChild(div);
			document.getElementById('xiangdao').innerHTML = '<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;filter:alpha(opacity=0);"></iframe>'
			div = document.createElement('div');div.id = 'xdpmlayer';
			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';
			document.getElementById('xdappend_parent').appendChild(div);
			document.getElementById('xdpmlayer').innerHTML = '<div style="width: 760px; background: #666666; margin: 5px auto; text-align: left;">' +
				'<div style="width: 760px; height: 580px; padding: 1px; background: #FFFFFF; border: 1px solid #7597B8; position: relative; left: -6px; top: -3px;">' +
				'<a href="javascript:void(0);" onclick="xd(\'close\')"><img style="position: absolute;right: 20px;top: 15px" border="0" src="/images/close.gif" title="关闭" /></a>' +
				'<iframe id="xdpmframe" name="xdpmframe" style="width:' + pmwidth + 'px;height:580px" allowTransparency="true" frameborder="0"></iframe></div></div>';
		}
		if(document.getElementById('pmlayer_bg')){
			document.getElementById('pmlayer_bg').style.display = 'none';
			document.getElementById('pmlayer').style.display = 'none';
		}
		document.getElementById('xiangdao').style.display = 'block';
		document.getElementById('xdpmlayer').style.display = 'block';
		//document.getElementById('xdpmlayer').style.top = ((clientHeight - pmheight) / 2 + scrollTop +50) + 'px';
		if(window.screen.height<=800){
			document.getElementById('xdpmlayer').style.top = '5px';
		}else if (window.screen.height>800 && window.screen.height<1024){
			document.getElementById('xdpmlayer').style.top = '50px';
		}else{
			document.getElementById('xdpmlayer').style.top = '100px';
		}
		
		if(!param) {
			xdpmframe.location = '/member/my/guide';
		} else {
			xdpmframe.location = '/member/my/guide/' + param;
		}
		document.body.style.overflow = "hidden";
		document.body.scroll = "no";
	} else if(action == 'close') {
		/*for(i = 0;i < objs.length; i ++) {
			if(objs[i].attributes['oldvisibility']) {
				objs[i].style.visibility = objs[i].attributes['oldvisibility'].nodeValue;
				objs[i].removeAttribute('oldvisibility');
			}
		}*/
		document.getElementById('xdpmlayer').style.display = 'none';
		document.getElementById('xiangdao').style.display = 'none';
		document.body.style.overflow = "auto";
		document.body.scroll = "auto";
		//window.location.reload();
		document.getElementById('pmlayer_bg').style.display = 'none';
	}
}
