/* Markup Changes
----------------------------------------------------------------------------- */


	$(window).load(function() {

		if ($('body').hasClass('section-checkout')) { markup(); }

	});

	function markup() {

/* REMOVE EMPTY BANNER CONTAINERS
----------------------------------------------------------------------------- */

		$('div.banner').each(function(){
		
			if ($(this).children().length == 0) {
		
				$(this).remove();
				
			}
		
		});
		

/* CHANGE 'BUY ANOTHER' TO 'UPDATE QUANTITIES'
----------------------------------------------------------------------------- */


		$('a.another').text('Update Quantities');
	

/* CHANGE 'CART' TO 'BASKET'
----------------------------------------------------------------------------- */

	
		if ($('#basket').length > 0) {

			
			$('#basket h3 span:first, #basket h3 em').remove();
			$('#basket h3').before('<a class="basket" href="/basket">Shopping Basket<a>');
			$('#basket h3:contains("Shopping Cart")').text("Shopping Basket");
			$('#basket p:contains("Cart")').text("Your Basket is empty");
			$('#basket a.change').text("Your Cart");
			$('#basket h3 span').text('products');
			$('#basket').show();

		}

		if (page == "basket") {

			$('div.widget-cart.empty h3').text("Shopping Basket");
			$('div.widget-cart.empty p').text("Your Basket is Empty");
			$('div.widget-cart tr.code em').text("Have a Promo Code? Enter It Here");

		}
		
		if (page == "added") {

			$('div.widget-cart tr.code em').text("Promo Code");

		}
		
		if (page == "payment") {

			$('div.widget-cart tr.code em').text("Have a Promo Code? Enter It Here");

		}
		

/* REARRANGE PRODUCT DETAILS
----------------------------------------------------------------------------- */


		if (page == "product") {

			// Prepend 'SKU' to product number
			$('div.widget-item.display div.topic').find('small').prepend('SKU-');

			// Remove empty DL
			if ($('div.widget-item.display dl').length == "1") {

				$('div.widget-item.display dl').remove();

			}

		}
		

/* CHANGE 'HOW MANY?' TO 'QUANTITY'
----------------------------------------------------------------------------- */


		if (page == "product") {
		
			$('div.widget-item.display label em').text('Quantity');
		
		}


/* MOVE ALERT WIDGET
----------------------------------------------------------------------------- */


		$('#footer div.widget-alert').insertBefore('#page');


/* REMOVE PRICE FROM FEATURED PRODUCTS
----------------------------------------------------------------------------- */


		if (page == "index") {

			$('#featured_products li').each(function() {

				$(this).children('dl').children('dt:last').remove();

			});

		}


/* REMOVE 'EVERYTHING' FROM TAG LIST
----------------------------------------------------------------------------- */


		if (page == "browse") {

			$('#tags div.widget-tag li:first').remove();

		}


/* REMOVE 'BY' FROM INGREDIENT'S SCIENTIFIC NAME
----------------------------------------------------------------------------- */
				

		if (page == "glossary") {
		
			$('div.widget-editorial.browse ul li').each(function() {
			
				var scientificName = $(this).children('em').text().replace(/By /,"");
				$(this).children('em').text(scientificName);
			
			});
		
		}

		if (page == "ingredient") {
		
			var scientificName = $('div.widget-editorial.display > em').text().replace(/By /,"");
			$('div.widget-editorial.display > em').text(scientificName);
		
		}


/* UPDATE CHECKOUT PAGES
----------------------------------------------------------------------------- */

	
		$('#page-signin ol#steps li.shipping strong').html('<var>1</var> Shipping');
		$('#page-signin div.cliqueid').remove();


	}
	
