/* BRAVADO */
/* Javascript Functions: Transmission
--------------------------------------------------------------------------------- */

	
	$(window).load(function() {
	
	$('#footer div.widget-alert').insertBefore('#content'); 
	
	
/* PLATFORM DETECTION
----------------------------------------------------------------------------- */


	if (navigator.platform.match('Mac')) {
	
		$('body').addClass('mac');
	
	}


/* PATTERN + LIBRARY INITIALIZATION
----------------------------------------------------------------------------- */


	if(section == 'transmission' || section == 'account' || section == 'store') {
	
	
		// PLUGIN: CLIQUE ACTIONS (Replaces submit buttons with text links)
		try { $('input[type=submit]').cliqueActions(); } catch (error) { alert('Error: Missing Clique Actions Plugin'); }
	
	}

	$('div.widget-item div.preorder ul.actions a.submit').text('Add to Cart');
	
	cufon();
	tabs();
	

/*  MARKUP CHANGES
----------------------------------------------------------------------------- */


	$('#account a.submit').text('Save Changes');
	$('table tr.item td.picture img').wrap('<span></span>');

	
/* END POST-LOAD FUNCTIONS
----------------------------------------------------------------------------- */


	});


/* FUNCTION: CUFON REPLACEMENTS
----------------------------------------------------------------------------- */


	function cufon() {
	
		var gotham_bold = [
			
			'div.widget-cart h3',
			'div.widget-item h3',
			'div.widget-subscribe h3',
			'#page-help #content h3',
			'#page-account #content h3',
			'#page-account #content h4',
			'h4 a',
			'#steps li',
			'div.topic em',
			'ul.navigation li',
			'ul.heading li',
			'ul.actions a, table a.action',
			'#footer a'
			
		];

		Cufon.replace(gotham_bold, { fontFamily: 'Gotham Rounded Bold', hover: true });
		
		$(gotham_bold.toString()).css('visibility', 'visible');
				
	}
	
	
/* FUNCTION: INITIALIZE TABS
----------------------------------------------------------------------------- */


	function tabs() {
	

		// JAVASCRIPT TABS
		$('div.tabbed').children('ul.tabs').tabs({

			fxSlide: false,

			click: function() {
			
				Cufon.refresh();

			}, load: function() {

				Cufon.refresh();

			}, show: function() {

				Cufon.refresh();

			}

		});

	}


