function onFSCommand(methodName, args) {
	// appease the Brightcove MONSTER
}
function runTypekit() {
	try {
		Typekit.load();
	} catch(e){
		
	}
}	

function testLoad() {alert('loaded');}

$(document).ready(function() {

	// remove empty tr's
	var tr = $('tr td.line:empty').parent().remove();
	/*for (var i=0; i<tr.length; i++) {
		if (tr[i].innerHTML=='<td class="line"></td>' || tr[i].innerHTML=='<td class="line" colspan="3"></td>' || tr[i].innerHTML=='<td class=line></td>') {
			$(tr[i]).remove();
		}
	}*/
	// global
	
	$('table.wba_main_table').attr({'width':'950'});
	$('td.wba_topnavBG').parent().remove();
	// move store nav
	$('table:first').after($('table.logo'));
	$('td#wba_logo_bg').parent().remove();
	// title of artist list
	$('#wba_greyBar_foot .wba_ProductBar').wrapInner('<div class="headerbox din"><div></div></div>');
	$('#wba_greyBar_foot .wba_ProductBar b.green').replaceWith('<h1 class="din">ARTISTS</h1>');
	
	
	// change all cellspacing
	$('table[cellspacing=7]').attr({'cellspacing':'0'});
	$('body>table>tbody>tr>td').css('padding',0);
	$('table.wba_main_table>tbody>tr>td').css('padding','0 25px');
	$('table.wba_main_table>tbody>tr>td:last').css('padding',0);
	
	// remove more empty tr's in the nav
	tr = $('td.menubar-label').parent();
	// move recently viewed on subpages into main column
	$('td.hideme').next().append($('td#wba_greyBar_foot table.wba_prod_widget'));
	
	if (window.location.pathname!='/content/codysimpson.htm') {
	
	// Page Specific 
	$('td.wba_Bar').attr({'style':''}); // first clear out the style
	if ($('span.crumbHome').size()==0) {
		/******** HOME PAGE ONLY *********/
		$('td.wba_Bar').wrapInner('<div class="headerbox din"><div class="main"></div></div>');
		
		// Adjust Featured Products and Best Sellers so that Title goes below image
		$('table.wba_prod_widget:lt(2) a.homeProductTitle').parent().each(function() {
			$(this).parent().next().children().prepend($(this).html());
			$(this).remove();
		});
		$('table.wba_prod_widget:lt(2)a img.wba_add_to_cart_btn').each(function() {
			$(this).parent().parent().attr('align','left');
			$(this).parent().parent().parent().parent().append($(this).parent().parent());
			$(this).parent().parent().wrap('<tr valign="top"></tr>');
		});
		$('table.wba_prod_widget:lt(2) img[title=Details]').each(function() {
			$(this).parent().parent().attr('align','left');
			$(this).parent().parent().parent().parent().append($(this).parent().parent());
			$(this).parent().parent().wrap('<tr valign="top"></tr>')
		});
		
		// For Recently Viewed, move title and buylinks to right side
		$('table.wba_prod_widget:eq(2)').each(function () {
			$(this).find('table>tbody>tr>td').attr('align','left');
			$(this).find('tr:gt(0) table table').each(function () {
			$(this).appendTo($(this).parent().parent().prev().children('td'));
			$(this).parent().appendTo($(this).parent().parent().prev());
			});
		});
		
		$('table.wba_main_table>tbody>tr>td>table>tbody>tr>td>table[width=100%]').attr('width','560');
	} else {
		$('td.wba_Bar').wrapInner('<div class="headerbox din"><div></div></div>');
		$('table.wba_prod_widget').find('td[align=center]').attr({'align':'left'});
		
		/* Rearrange contents of Product Modules */
		
		$('table.wba_prod_widget:eq(0)').each(function () {
			$(this).find('tr:gt(0) table table').each(function () {
				$(this).appendTo($(this).parent().parent().prev().children('td'));
				$(this).parent().appendTo($(this).parent().parent().prev());
			});
		});
		$('table.wba_prod_widget:first').attr('id','productWidget');
		
		$('table.wba_prod_widget:eq(1)').each(function () {
				$(this).find('tr:gt(0) table table').each(function () {
					$(this).appendTo($(this).parent().parent().prev().children('td'));
					$(this).parent().appendTo($(this).parent().parent().prev());
				});
		});
		

	//	}
		/******* CONTENT / MERCHANT PAGES *******/
		if (typeof(wba_category) == 'undefined' && typeof(wba_product) == 'undefined') {
			//$('div#artist_menu').remove();
		} else {
			if (typeof(wba_category) != 'undefined' || $('title').text().indexOf('Search Results')>=0) {
				/******* CATEGORY PAGES *******/
				$('td.hideme').prepend('<div id="categoryTitle" class="headerbox din"><div><h1 class="din">'+wba_category.name+'</h1></div></div>');
				$('#sortByHeader').append('SORTED BY: '+$($('select#sortBySelect option:selected')[0]).text());
				$('td.binHead b').addClass('din');
				$('td.binHead').wrapInner('<div class="headerbox din"><div></div></div>');
				//$('table.wba_main_table>tbody>tr>td').css('padding',0);
				
				/* Remove redundant categories menu */
				if (wba_category.name=='Video/DVD' || wba_category.name=='Books') {
					while ($('tr td.binHead:first').parent().prev().size() > 0) {
						$('tr td.binHead:first').parent().prev().remove();
					}
					$('td.hideme div.headerbox:first').remove();
				}
			}
			if (typeof(wba_product) != 'undefined') {
				/******* PRODUCT PAGE *******/
				$('table.wba_main_table table table table:eq(2)').attr({'width':'90%','align':'center'});
				$('tr#wba_prod_page_lightGreyBar').next().find('>td>table>tbody>tr>td>table[width=100%]').attr('width',560);
			}
		}
		$('.hideme table:eq(0)').hide();
	}
}
	
	
	$('td.hideme b.green').addClass('din');
	$('td.hideme b.green').removeClass('green');
	$('td.wba_Bar b.green').addClass('din');
	$('td.wba_Bar b.green').removeClass('green');
	
	// remove extra pixel 
	$('img[height=1]').remove();
	$('table.wba_prod_widget:first').prev('img').remove();
	$('table.wba_prod_widget:last>table').css({'width':'542px', 'marginLeft': '6px'});
	
	
	// Clean up Footer
	$('#wba_footer_1 td:first').next().remove();
	$('#wba_footer_1').next().remove();
	$('tr#wba_footer_1 td').attr('valign','middle');
	var copyright = $('#wba_footer_2 td.footer').html();
	//$('#wba_footer_1 td:first').prepend(copyright);
	$('#wba_footer_2').remove();
	
	// Remove empty TR's and TD's
	/*var rmTds = $('td.hideme table:first tr');
	for (var i=0; i<4; i++) {
		$(rmTds[i]).remove();
	}*/
	$('td.lightGreyBar').parent().remove();
	$('tr.greyBar').remove(); // remove extra category name and pagination
	
	
	// Update star graphics
	$('div.stars-0-0 img').attr({'src':'/images/atlantic_stars_0_0.gif'});
	$('div.stars-0-5 img').attr({'src':'/images/atlantic_stars_0_5.gif'});
	$('div.stars-1-0 img').attr({'src':'/images/atlantic_stars_1_0.gif'});
	$('div.stars-1-5 img').attr({'src':'/images/atlantic_stars_1_5.gif'});
	$('div.stars-2-0 img').attr({'src':'/images/atlantic_stars_2_0.gif'});
	$('div.stars-2-5 img').attr({'src':'/images/atlantic_stars_2_5.gif'});
	$('div.stars-3-0 img').attr({'src':'/images/atlantic_stars_3_0.gif'});
	$('div.stars-3-5 img').attr({'src':'/images/atlantic_stars_3_5.gif'});
	$('div.stars-4-0 img').attr({'src':'/images/atlantic_stars_4_0.gif'});
	$('div.stars-4-5 img').attr({'src':'/images/atlantic_stars_4_5.gif'});
	$('div.stars-5-0 img').attr({'src':'/images/atlantic_stars_5_0.gif'});
	$("img[src*='stars-0-0']").attr('src','/images/atlantic_stars_0_0.gif');
	$("img[src*='stars-0-5']").attr('src','/images/atlantic_stars_0_5.gif');
	$("img[src*='stars-1-0']").attr('src','/images/atlantic_stars_1_0.gif');
	$("img[src*='stars-1-5']").attr('src','/images/atlantic_stars_1_5.gif');
	$("img[src*='stars-2-0']").attr('src','/images/atlantic_stars_2_0.gif');
	$("img[src*='stars-2-5']").attr('src','/images/atlantic_stars_2_5.gif');
	$("img[src*='stars-3-0']").attr('src','/images/atlantic_stars_3_0.gif');
	$("img[src*='stars-3-5']").attr('src','/images/atlantic_stars_3_5.gif');
	$("img[src*='stars-4-0']").attr('src','/images/atlantic_stars_4_0.gif');
	$("img[src*='stars-4-5']").attr('src','/images/atlantic_stars_4_5.gif');
	$("img[src*='stars-5-0']").attr('src','/images/atlantic_stars_5_0.gif');
	
	$("img[src*='atlantic_btn_continueshopping.gif']").attr({'width':152,'height':20});
	
	
	
	//runTypekit();
});



