function adjustIFrameSize(iframeWindow) {
	if(iframeWindow == null){return}
	var iframeToSize = document.getElementById(iframeWindow.name);
	if (typeof jQuery != 'undefined') {
     _doResize(iframeToSize);	 
	}else{
		 _doImport(iframeToSize);  
	}	
}

function _doResize(theIframe){ 
  theIframe.style.height = jQuery(theIframe).contents().height() + "px";
}

function _doImport(theIframe){
	var head= document.getElementsByTagName('head')[0];
	var script= document.createElement('script');
	script.type= 'text/javascript';	
	if(script.readyState){  //IE
		 script.onreadystatechange = function(){
			 if(script.readyState == "loaded" ||
					script.readyState == "complete"){
					script.onreadystatechange = null;
					_doResize(theIframe)
			 }
		 };
	}else {  //Others
			script.onload = function(){
				_doResize(theIframe)
			};
  }	
	script.src= '/scripts/jquery/jquery.js';
	head.appendChild(script);
}
