
/*
function setMinSize(width, height)
{
	frmMinWidth = width;
	frmMinHeight = height
	applyMinSize = true;
}
function setMaxSize(width, height)
{
	frmMaxWidth = width;
	frmMaxHeight = height
	applyMaxSize = true;
}*/

var minWidth;
var minHeight;
var maxWidth;
var maxHeight;

var applyMaxSize = false;
var applyMinSize = false;
function resizeIframe(name,flag) 
{
	if (name == null || name == "")	{
		name = "content";
	}
  var oBody = "";      
  try {
    if (document.all){
    	oBody   = document.frames(name).document.body;
    }else{
      oBody = document.getElementById(name).contentDocument.body;
    }
  	var oIFrame    = document.all(name);
    var frmWidth   = oBody.scrollWidth + (oIFrame.offsetWidth - oIFrame.clientWidth);
    var frmHeight  = oBody.scrollHeight + (oIFrame.offsetHeight - oIFrame.clientHeight);
/*
        if (applyMinSize)
        {
            frmWidth  = Math.max(frmWidth, minWidth);
            frmHeight = Math.max(frmHeight, minHeight);
        }
        if (applyMaxSize)
        {
            frmWidth  = Math.min(frmWidth, maxWidth);
            frmHeight = Math.min(frmHeight, maxHeight);
        }
*/        
			if( flag == "board"){
	      if (oIFrame.src.indexOf("ComAllComment.jsp")>0&&frmWidth>780)
	      {
	          frmWidth = 780;
	      }
	  	}else if( flag == "album"){
	  		if (oIFrame.src.indexOf("ComAlbumComment.jsp")>0&&frmWidth>780)
	      {
	          frmWidth = 780;
	      }
	    }else if( flag == "poll"){
	  		if (oIFrame.src.indexOf("/service/ComClubPoll.jsp")>0&&frmWidth>180)
	      {
	          frmWidth = 180;
	      }
	  	}else if( flag == "calendar"){
	  		if (oIFrame.src.indexOf("/service/ComClubCalendar.jsp")>0&&frmWidth>180)
	      {
	          frmWidth = 180;
	      }
	  	}
	    oIFrame.style.height = frmHeight;
	    oIFrame.style.width  = frmWidth;
    }catch (e) {}
}

function parentResizeIframe(name,flag)
{	
    if (parent && parent != this && parent.resizeIframe != null)
    {
        parent.resizeIframe(name,flag);
    }
}

function resizeIframeBody( Iframe , frmWidth , frmHeight )
{
    var allHeight = 0;
    var allWidth  = 0;
    
    allWidth  = Iframe.contentWindow.document.body.scrollWidth;
    if(allWidth < frmWidth) allWidth = frmWidth;

    allHeight = Iframe.contentWindow.document.body.scrollHeight;
    
    if( frmHeight == "" )  frmHeight = allHeight;
    if(allHeight < frmHeight) allHeight = frmHeight;
    
    Iframe.style.width  = allWidth;
    Iframe.style.height = allHeight;
}
