/*
 * @author			Daniyal Hamid
 * 
 * @license			This JavaScript file is a commercial file, available for purchase at 
 *					http://codecanyon.net/user/daniyal/portfolio. Any illegal copying, 
 *					distribution, packaging or re-production of this script for commercial or 
 *					personal use is strictly prohibited and will be considered theft.
 *
 * @copyright		The author is the first owner of copyright and reserves all rights to
 *					all written work contained in this file. Distribution, re-production
 *					or commercial use of the written work in this file, without the author's 
 * 					signed permission, prior consent or a valid license, is strictly prohibited.
 *					The author is protected by the "Copyright, Designs and Patents Act 1988" of 
 *					the United Kingdom. Any infringement of the copyright, in or outside of the
 *					United Kingdom, may result in a lawsuit.
 */


(function(c){var d={minimized:false,minimizedHeight:15,maximizedHeight:45};var a={adjustFrameHeight:function(){var f=c(this),g=f.data("options");var e=c(f).outerHeight();c(g.iframe).height(c(window).height()-e);c(g.iframe).css("bottom",e)}};var b={init:function(e){return this.each(function(){var f=c(this),g=f.data("options");if(null==e){e={}}if(null==c(e.iframe)||null==c(e.iframe).attr("name")||c(e.iframe).attr("name")==""){throw new Error('You must specify an iframe element with a "name" attribute!')}e=c.extend({},d,e);if(!g){f.data("options",e)}c(window).resize(function(){a.adjustFrameHeight.apply(f)}).load(function(){a.adjustFrameHeight.apply(f);b.minimize.apply(f,[e.minimized])})})},minimize:function(e){return this.each(function(){var f=c(this),g=f.data("options");c(f).height((e)?g.minimizedHeight:g.maximizedHeight);a.adjustFrameHeight.apply(f);g.minimized=e;c(f).trigger("toggle.dashboard",[g.minimized])})},toggle:function(){return this.each(function(){var e=c(this),f=e.data("options");if(f.minimized){b.minimize.apply(e,[false])}else{b.minimize.apply(e,[true])}})}};c.fn.dashboard=function(e){if(b[e]){return b[e].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof e==="object"||!e){return b.init.apply(this,arguments)}else{throw new Error("Method "+e+" does not exist on jQuery.dashboard")}}}})(jQuery);
