function iframeResize(o){
  if (o.src != "") {
    if (frames[o.id] && typeof frames[o.id].document.parentWindow != 'undefined') {
		//IE
		var h=1, d=frames[o.id].document;
		if (d.body) {
		    var h; var w;
		    if(navigator.appVersion.match('MSIE 7.0') && d.location.protocol.match('https:')){
		        o.scrolling = 'yes';    // Hack for IE7 with SSL.
		    }
             if(document.firstChild.text){
		        if(document.firstChild.text.match('DOCTYPE')){
		            h = d.documentElement.scrollHeight 
		            w = d.documentElement.scrollWidth
		            if(!o.src.match("Blank.htm") && o.frameBorder != '0'){
		                if(o.rdIFrameAdditionalScrollWidthAdded != null){
		                    if(o.rdIFrameAdditionalScrollWidthAdded != 'True'){
		                        h = h + 4;
		                        w = w + 4;
		                        o.rdIFrameAdditionalScrollWidthAdded = "True"
		                    }
		                }  
		            }     
		        }
		    }
		    else{
		        h = d.body.scrollHeight 
		        w = d.body.scrollWidth
		        if(!o.src.match("Blank.htm") && o.frameBorder != '0'){
		            if(o.rdIFrameAdditionalScrollWidthAdded != null){
	                    if(o.rdIFrameAdditionalScrollWidthAdded != 'True'){
	                        h = h + 4;
	                        w = w + 4;
	                        o.rdIFrameAdditionalScrollWidthAdded = "True"
	                    }
	                }
	            }
		    }
		    if(!o.rdIFrameFixedHeight){
                o.height= (o.height > h ? o.height : h) ;
            }
            if(!o.rdIFrameFixedWidth){	
                o.width = (o.width > w ? o.width : w);
                //o.width = w;
            }
		}
	} 
	else {
		// Non-IE.
		    var h; var w;
		    h = o.contentDocument.body.scrollHeight;
		    w = o.contentDocument.body.scrollWidth;
		    if(!o.parentNode.innerHTML.match('rdiframefixedheight="True"')){
			    o.height = h;
		    }
		    if(!o.parentNode.innerHTML.match('rdiframefixedwidth="True"')){	
	            if(o.scrolling == "yes")
	                if(!navigator.vendor.match('Google'))
		                o.width=w + 15;    // Added 15px to compensate the scroll bars.
		            else
		                o.width = w;
	            else
                     o.width = w;
	        }  
		}
	}
	
	//Does this frame have a parent that needs to be resized?
    if (frameElement) {
	    if (parent.iframeResize) {
	        if(navigator.appName.indexOf("Microsoft Internet") != -1){
//	            if(!d) d = d=frames[o.id].document;
//                if(!d.referrer.match('rdSort') || !d.referrer.match('rdNewPageNr'))
                    if(frameElement.rdIFrameAdditionalScrollWidthAdded != null){
                        frameElement.rdIFrameAdditionalScrollWidthAdded = "False";
                    }
//                else
//                    frameElement.scrolling = 'no';
	        }
		    parent.iframeResize(frameElement)
	    }
    }
	
}
