﻿/* * 
 * 弹出窗口
 */
function open_new(openpage){
	var str, str1, url;
	url = ""+openpage+"";
	//层居中改  top:50%;
	str1 = "<div id='cont' style='left: 50%; top:0; background:#2f2020; position:absolute; z-index:20; border:1px solid #44312f; width:856px;'><div style='text-align:right;width:100%;height:19px;';;><a href='javascript:close_new()' title='close' style='cursor:hand'><img src=images/close.gif border=0></a>&nbsp;&nbsp;</div><div id=goods-main /></div>";
	
	//document.getElementById('cont') ? document.getElementById('cont').style.display = 'block' : document.body.innerHTML += str1 
	createDiv('cont', str1);
	document.getElementById('goods-main').innerHTML="<iframe height=400 width=100% frameborder=0 scrolling=auto src='"+url+"'></iframe>";
	//层居中改  -400+document.  (-200对应 以上 iframe height=400 值 height的一半的负值) 
	document.getElementById('cont').style.marginTop = 98+document.documentElement.scrollTop+"px";
	document.getElementById('cont').style.marginLeft = "-428px";

}
function close_new(){
	document.getElementById('over').style.display = 'none';
	document.getElementById('cont').style.display = 'none';
}
/* *
 * 在页面弹出层 2008-05-24 21:59:28 victor
 */
function createDiv(divId, string)
{
	var obj = document.getElementById(divId);
	var obj1 = document.getElementById('over');
		
	str = "<div id='over' onclick='javascript:close_new()' style='position:absolute;z-index: 10; top: 0px ;left: 0px; filter: Alpha(Opacity=90); opacity:0.9; background:#44312f; display:block; width:100%; ' />";
	obj1 ? obj1.style.display = 'block' : document.body.innerHTML += str ;
	document.getElementById('over').style.height=((document.documentElement.clientHeight>document.body.scrollHeight)?document.documentElement.clientHeight:document.body.scrollHeight)+"px";
	//document.getElementById('over').style.height=document.body.scrollHeight+"px";
	obj ? obj.style.display = 'block' : document.body.innerHTML += string ;
}