jQuery(document).ready(function ( $ ) {
	// Popout tab
	$( ".popout-tab" ).popoutTab();
	
	var swf;

	swfobject.addDomLoadEvent( function()
	{
		var flashVars = {};
		flashVars.applicationURL = "One3OneWeb.swf";
		flashVars.assetsURL = "assets.assets";

		var params = {};
		params.quality				= "autolow";
		params.wmode				= "opaque";
		params.allowscriptaccess	= "always";
		params.allowfullscreen		= "false";
		params.scale				= "showAll";
		params.base					= "/inc/interactive/one3one";

		var attributes = {};
		attributes.id				= "flash_jsswf";
		attributes.name				= "flash_jsswf";

		swfobject.embedSWF(
			"/inc/interactive/one3one/One3OneWebLoader.swf",
			"flash",
			"960",
			"540",
			"9",
			"/inc/interactive/expressInstall.swf",					
			flashVars,
			params,
			attributes
		);
		swf = document.getElementById( "flash_jsswf" );

		SWFAddress.setTracker( "Tracker" );
	});
});



(function(a){a.pluginConstructor=function(b,e,d){var c=d[0];if(e[c])return a.pluginMethodProxy.call(this,b,e,c,Array.prototype.slice.call(d,1));else if(typeof c==="object"||!c)return a.pluginMethodProxy.call(this,b,e,"construct",d);else a.error("Method "+c+" does not exist on jQuery."+b)};a.pluginMethodProxy=function(b,e,d,c){var h=[],g=this.each(function(i){var f;if(a(this).data(b)){if(d!=="construct")f=e[d].apply(this,c)}else{a(this).data(b,{target:a(this)});d!=="construct"&&e.construct.apply(this, c);f=e[d].apply(this,c)}if(f!==undefined)h[i]=f});if(g.length>0)g=a.extend(g,h);return g};a.pluginDestruct=function(b){a(window).unbind("."+b);a(this).removeData(b)}})(jQuery);


( function( $ )
{
    var plugin = "popoutTab";

	var fullWidth = null;
	var restWidth = 0;

    var construct = function()
    {
		var scope = this;

		fullWidth = $( this ).width();
		hideNow.call( scope );

		$( this ).hover( function()
		{
			show.apply( scope );
		},
		function()
		{
			hide.apply( scope );
		});
    };

    var destruct = function()
    {
        $.pluginDestruct.call( this, plugin );
    };

	var show = function()
	{
		var scope = $( this );

		scope.animate( { width: fullWidth }, { duration: 300, queue: false } );
	};

	var hide = function()
	{
		var scope = $( this );

		scope.animate( { width: restWidth }, { duration: 300, queue: false } );
	};

	var showNow = function()
	{
		$( this ).width( fullWidth );
	};

	var hideNow = function()
	{
		$( this ).width( restWidth );
	};

    var methods = {
        construct: function() { return construct.apply( this, arguments ); },
        destruct: function() { return destruct.apply( this, arguments ); }
    };

    $.fn[ plugin ] = function() { return $.pluginConstructor.call( this, plugin, methods, arguments ); };	

})( jQuery );
