function fnStartInit() {
	var obj = document.getElementById('loading');
	obj.style.visibility = 'hidden';
}

function load_link(E,URL)
{
		//var obj = xGetElementById(E);
		//var html = getHTML(URL);
		//obj.innerHTML = html;
	var div_parent=document.getElementById(E); 
	if(!xGetElementById('child_frame'))
	{
		var div_child=document.createElement("iframe"); 
		div_child.id = "child_frame";
		div_child.name = "child_frame";
		div_child.style.width = div_parent.offsetWidth;
		div_child.style.height = xClientHeight();
		div_child.style.display = 'block';
		div_parent.innerHTML = "";
		div_child.frameBorder='0'; 
	 // div_child.attachEvent("onload",adjustIFrameSize);
	  div_child.attachEvent("onload",adjustIFrameSize);
		div_parent.appendChild(div_child); 
	}
	else
	{	
		var div_child = xGetElementById('child_frame');
		div_child.style.width = div_parent.offsetWidth;
	}
	 
	div_child.src = URL; 
	//div_child.onload = "javascript:child_frame.style.height = child_frame.scrollHeight;";
	
  //xHeight(div_child,xClientHeight());
   //adjustIFrameSize(div_child);
  //xHeight(div_parent,parent_height);
  //xResizeTo(div_child, xClientWidth(), xClientHeight());
  //xWidth(div_child, getBodyWidth());// size the IFRAME according to user's prefs or initial textarea 
	//test_frame.position="absolute"; 
	//test_frame.style.zIndex==1; 
	//test_frame.style.top=0+"px"; 
	//test_frame.style.left=0+"px"; 
	//test_frame.style.height=height+"px"; 
	//test_frame.style.width=width+"px"; 
}

xAddEventListener(window,'load',fnStartInit);

function getHTML(URL) {
   var html = ""+
        "<iframe src="+URL+" id='mypage' name='mypage' frameborder='0' scrolling='auto' "+
        " onload='resize_window(this); function resize_window(obj) "+
        "{ var h = obj.contentWindow.document.body.scrollHeight; "+
        " mypage.resizeBy(400,h); }'"+
        "></iframe>";
        return html;    
}
function adjustIFrameSize () { 
	var iframeElement = xGetElementById('child_frame');
		if(iframeElement==null) return;
				if (iframeElement.contentDocument && iframeElement.contentDocument.body.offsetHeight) //ns6 syntax
				{
				iframeElement.style.height = 	iframeElement.Document.body.offsetHeight+50; 
				}
				else if (iframeElement.Document && iframeElement.Document.body.scrollHeight) //ie5+ syntax
				{
				iframeElement.style.height = 	iframeElement.Document.body.scrollHeight+50; 
				}

} 
