(function(g){if(typeof console=="undefined"||typeof window.console.firebug=="undefined"){var f=["log","debug","info","warn","error"];window.console={};for(var c in f){window.console[f[c]]=function(){}}}var e={disableWidthResizing:false,disableHeightResizing:false,resizeHints:new Array(),debug:false};g.fn.resizeIFrames=function(h){e=g.extend(e,h);return this.each(function(){var i=g(this);if(e.debug){console.debug("[%s]",i.attr("id"))}var j=d(i,e);if(!e.disableWidthResizing&&!i.data("resizingDisabled")){a(i,j)}if(!e.disableHeightResizing&&!i.data("resizingDisabled")){b(i,j)}if(e.debug){console.debug(" ")}})};function a(k,l){var h=k.width();var i;try{if(l){contentWidth=l.width}else{if(document.all){contentWidth=k.contents().find("body").attr("scrollWidth")}else{contentWidth=k.contents().find("html").attr("scrollWidth")}}if(e.debug){console.debug("iframe width: %i",h);console.debug("content width: %i",contentWidth)}if(h!=contentWidth){k.width(contentWidth)}}catch(j){if(e.debug){console.error("error updating width; skipping resizing");console.error("exception: %o",j)}k.data("resizingDisabled",true)}}function b(j,l){var i=j.height();var k;try{if(l){k=l.height}else{if(document.all){k=j.contents().find("body").attr("scrollHeight")}else{k=j.contents().find("body").attr("scrollHeight")}}if(e.debug){console.debug("iframe height: %i",i);console.debug("content height: %i",k)}if(i!=k){j.height(k)}}catch(h){if(e.debug){console.error("error updating height; skipping resizing");console.error("exception: %o",h)}j.data("resizingDisabled",true)}}function d(m,h){var o;var l=h.resizeHints;var n=m.attr("id");var i=l[n];if(i){try{if(i!=null){var k=m.contents().find(i);if(k.length<1){if(h.debug){console.warn("resize hint %s for iframe %s did not return a dom element",i,n)}}else{if(k.length>1){if(h.debug){console.warn("resize hint %s for iframe %s returned %s elements",i,n,k.length)}}else{o={width:k.width(),height:k.height()};if(h.debug){console.debug("resize hint %s for iframe %s returned %o",i,n,o)}}}}}catch(j){if(h.debug){console.error("error locating iframe %s resize hint, skipping resizing",n);console.error("exception %o",j)}m.data("resizingDisabled",true)}}else{if(h.debug){console.info("no resize hint found for iframe %s",n)}}return o}})(jQuery);
