/**
 * @author loppp
 */
function ns_iframe()
{
	
}

//------------------------PUBLIC SECTION---------------------------//

/**
 * 设置iframe的高度为其包含的页面高度
 * 
 * 注意：1.如果不指定iframe的id，则其将会寻找调用函数的parentIframe子对象
 * 		并将其作为iframe的节点，故如果要采用无参数调用，则需要在调用节点上
 * 　　　将parentIframe赋值
 * 		2.如果定iframe的id，则必须在父窗口调用
 * 
 * @param {iframe的id} strIframeId
 */
ns_iframe.resizeIframe = function(strIframeId, objParam)
{
    var Iframe;
	var	nExtraWidth;
	if(null != objParam)
	{
		if(null != objParam.ExtraWidth)
		{
			nExtraWidth = objParam.ExtraWidth;

		}
		if(null != objParam.ExtraHeight)
		{
			nExtraHeight = objParam.ExtraHeight;
		}
		else
		{
			nExtraHeight = 60;
		}
	}
	else
	{
		nExtraHeight = 60;
	}

	
	// 得到iframe
	if ('string' == typeof(strIframeId)) 
	{
		Iframe = document.getElementById(strIframeId);
	}
	else
	{
		Iframe = this.parentIframe;
	}
	
    if (Iframe) 
    {
		//alert(Iframe.parentNode.scrollWidth);
		//Iframe.style.height = Get
	try{
		var bHeight = Iframe.contentWindow.document.body.scrollHeight;
		var dHeight = Iframe.contentWindow.document.documentElement.scrollHeight;
		var height = Math.max(bHeight, dHeight);
		Iframe.height =  height + nExtraHeight;
		}catch (ex){}
		
		if(null != nExtraWidth)
		{
			Iframe.style.width = Iframe.parentNode.scrollWidth + nExtraWidth + 'px';
		}
    }



}



