(function ($) {
    $.fn.iframeAutoHeight = function (options) {

        var options = $.extend({
            heightOffset: 0
        }, options);

        $(this).each(function () {

            if ($.browser.safari || $.browser.opera) {

                $(this).load(function () {
                    var iframe = this;
                    var delayedResize = function () {
                        resizeHeight(iframe);
                    };
                    setTimeout(delayedResize, 0);
                });


                var source = $(this).attr('src');
                $(this).attr('src', '');
                $(this).attr('src', source);
            }
            else {

                $(this).load(function () {
                    resizeHeight(this);
                });
            }


            function resizeHeight(iframe) {
                var newHeight = iframe.contentWindow.document.body.offsetHeight + options.heightOffset;
                iframe.style.height = newHeight + 30 + 'px';
								boxMove();
            }

        });
    }
})(jQuery);
