//This function is to get the height of IFrame slide
function getDocHeight(doc) 
{ 
	var docHt = 0, sh, oh; 
	if (doc.height) docHt = doc.height; 
	else if (doc.body) 
	{ 
		if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight; 
		if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight; 
		if (sh && oh) docHt = Math.max(sh, oh); 
	} 
return docHt; 

} 

//This function is to get the width of IFrame slide
function getDocWidth(doc) 
{ 
	var docWt = 0, sh, oh; 
	if (doc.width) docWt = doc.width; 
	else if (doc.body) 
	{ 
		if (doc.body.scrollWidth) docWt = sh = doc.body.scrollWidth; 
		if (doc.body.offsetWidth) docWt = oh = doc.body.offsetWidth; 
		if (sh && oh) docWt = Math.max(sh, oh); 
	} 

return docWt; 
} 

//This function is to set the height of IFrame 
function setiframeheight(iframeName) { 
	var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null; 
	var iframeWin = window.frames[iframeName];
	
	for(i=0;i<window.top.frames.length;i++)
   	{
	try
	{
		if(iframeWin == null)
		{
			iframeName=window.parent.frames[i+1].frameElement.id;
			iframeWin = window.frames[iframeName];
		}
	}catch(ex){}
	
	if ( iframeEl && iframeWin ) 
	{ 
		iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous 

		var docHt = getDocHeight(iframeWin.document); 
		var docWt = getDocWidth(iframeWin.document); 
		// need to add to height to be sure it will all show 
		
			docHt = docHt + "px"
			
			docWt = docWt + "px"

		// Remove below comments for Global Portal
			//if (docHt) iframeEl.style.height = docHt;

		// Remove below comment for TiVo
			if (docHt) 
			{
				iframeEl.style.height = docHt; 
			}
			if (docWt) 
			{
				iframeEl.style.width = docWt;
			}
			if(window.top.frames[i].name!= "")
			{
				window.top.document.getElementsByName(window.top.frames[i].name)[0].style.height = iframeEl.style.height ;
				window.top.document.getElementsByName(window.top.frames[i].name)[0].style.width = iframeEl.style.width;
			}
		} 
	} 	
}
