/*
function resizeIframe_nofocus() {
	infoHeight = parent.document.getElementById('divinfo_inner').scrollHeight;

	frame = parent.document.getElementById('mainFrame');
	innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
	newheight = innerDoc.documentElement.clientHeight;
	mainHeight = innerDoc.body.scrollHeight;

	iHeight = mainHeight;
    if(newheight>0 && newheight<iHeight)
		{ iHeight = newheight; }

    if(iHeight < infoHeight)
		{ iHeight = infoHeight; }
    if(iHeight < 1000)
		{ iHeight = 1000; }

	iHeight = iHeight + 20;
	parent.document.getElementById('divcenterpart').style.height = iHeight + 'px';
	parent.document.getElementById('divinfo').style.height = iHeight + 'px';
	parent.document.getElementById('divmain').style.height = iHeight + 'px';
//	parent.document.getElementById('mainFrame').style.height = iHeight + 'px';
	parent.document.getElementById('mainFrame').height = iHeight;
}
*/


function resizeIframe_nofocus() {
  if (parent)
  {
	infoHeight = parent.document.getElementById('divinfo_inner').scrollHeight;

	frame = parent.document.getElementById('mainFrame');
	innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
	iHeight = innerDoc.body.scrollHeight+2;

	height2 = innerDoc.height;
    if (height2>0)
	{	if (height2<iHeight)
		{ iHeight = height2+30; }
	}
	else 
	{
		height1 = innerDoc.documentElement.clientHeight;
		if (height1>0 && height1<iHeight)
			{ iHeight = height1+30; }
	}

    if(iHeight < infoHeight)
		{ iHeight = infoHeight; }
    if(iHeight < 1000)
		{ iHeight = 1000; }


	parent.document.getElementById('divcenterpart').style.height = (iHeight+0) + 'px';
	parent.document.getElementById('divinfo').style.height = (iHeight+0) + 'px';
	parent.document.getElementById('divmain').style.height = (iHeight+0) + 'px';
	parent.document.getElementById('mainFrame').height = (iHeight+0) + 'px';
  }
}


function resizeIframe() {
  if (parent)
  {
  resizeIframe_nofocus();
  parent.window.scrollTo(0,0);
  }
}

function resizeIframe_scrollname() {
  resizeIframe();
  var anchor = window.location.hash.substr(1); 
//  window.alert( 'anchor = ' + anchor );
  if (anchor != "")
  {
    var allLinks = document.getElementsByTagName('a'); 
    for (var i=0;i<allLinks.length;i++) { 
      var lnk = allLinks[i]; 
//    window.alert( 'lnk/i = ' + lnk.name + '/' + i);
      if (lnk.name && (lnk.name == anchor)) { 
        var CT = findPos(lnk);
//      window.alert( 'CT = ' + CT);
        parent.window.scrollTo(0,CT);
        break; 
      }
    }
 }
}

function findPos(obj) {
	if (obj.offsetParent) {
//      window.alert( 'fp = ' + obj.offsetTop );
			return  obj.offsetTop + findPos(obj.offsetParent);
  }
	return 0;
}


function resizeMe(obj) { 
	var docHeight = mainContent.document.body.scrollHeight
	obj.style.height = docHeight + 'px'
}

function autoResize(id){
    var newheight;
    if (!window.opera && !document.mimeType && document.all && document.getElementById){
        newheight=document.getElementById(id).contentWindow.document.body.offsetHeight;
    }else if(document.getElementById){
        newheight=document.getElementById(id).contentWindow.document.body.scrollHeight;
    }
    if(newheight < 900)
		{ newheight = 900 }
    document.getElementById(id).height= (newheight + 16) + "px";
}


function setIframeHeight() {
	  var iframeName = "mainFrame";
	  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
	  if (iframeEl) {
		  iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
		  var h = alertSize();
		  var new_h = (h-148);
		  iframeEl.style.height = new_h + "px";
	  }
}

function alertSize() {
	  var myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myHeight = document.body.clientHeight;
	  }
	  //window.alert( 'Height = ' + myHeight );
	  return myHeight;
}


