
function resizeIframe(x){
	/*alert('gd');
	alert(x);
	alert(x.contentWindow);
	alert(x.contentDocument);
	var docHt = getDocHeight(x.contentDocument);
 	alert(docHt);

	alert(getDocHeight(x.contentDocument));

	//alert(x.contentDocument.body);

	//alert(x.contentDocument.body.offsetHeight);

	alert(x.contentWindow.document);
	alert(x.contentWindow.document.body);
	alert(x.contentWindow.document.body.offsetHeight);
	try{
		x.scrolling='no',
		x.style.height=x.contentWindow.document.body.offsetHeight+60+'px'
	}
	catch(x){

	}*/
}

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;
}

function setIframeHeight(iframeName) {
	  alert('ramka');
	  var iframeWin = window.frames[iframeName];
	  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
	  alert(iframeWin.document);
  	  var docHt = getDocHeight(iframeWin.document);
  	  alert(docHt);
      alert('ramka');
	  if ( iframeEl && iframeWin ) {
	  //iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous


	  // need to add to height to be sure it will all show
	  iframeEl.style.height = 100 + "%";
	  alert(document.height);
	  }
}

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;
}