
function resizeIframe_nofocus() {
	if (document.all){
		iHeight = this.document.body.scrollHeight
	} else if (document.documentElement && document.documentElement.scrollHeight ) {
		iHeight = this.document.documentElement.scrollHeight
	} else {
		iHeight = this.document.body.scrollHeight
	}
    if(iHeight < 1000)
		{ iHeight = 1000; }
	parent.document.getElementById('divcenterpart').style.height = (iHeight+5) + 'px';
	parent.document.getElementById('mainFrame').style.height = (iHeight+5) + 'px';
}

function resizeIframe() {
  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;
}

