$(function() {
	$($('li.categories li').get(0)).remove();

	$('#sub_navigation .head img').addClass('promo');
	$('#main_content').prepend($('body.pages_product_categories_start #sub_navigation .head img'));
	
	var basket_first = $('#head_navigation #basket a').clone();
	$(basket_first).find('br').remove();
	$(basket_first).find('span').remove();

	var basekt_second_container = document.createElement('p');
	var basket_second = $('#head_navigation #basket a').clone().text($('#head_navigation #basket span').text()); 
	$(basekt_second_container).append(basket_second);

	var basket_header = document.createElement('h3');
	$(basket_header).append(basket_first);

	var basket_container = document.createElement('div');
	$(basket_container).addClass('sub_navigation_basket');
	$(basket_container).append(basket_header);
	$(basket_container).append(basekt_second_container);
	
	$($('#quick_navigation ul li').get(0)).before(createLink('Versandkosten', 'http://' + location.hostname + '/Pages/Company/BuyingAndPayment.aspx'));
	$($('#quick_navigation ul li').get(0)).before(createLink('&Uuml;ber uns', 'http://' + location.hostname + '/Pages/Company/CompanyInformationList.aspx'));
	$($('#quick_navigation ul li').get(0)).before(createLink('Aktuelles', 'http://' + location.hostname + '/Pages/Shopping/News.aspx'));
	//$($('#quick_navigation ul li').get(0)).before(createLink('Home', 'http://' + location.hostname +'/Pages/Product/Categories.aspx?SubSetID=2749'));
	
	var liShopLink = document.createElement('li');
	$(liShopLink).attr('class', 'shopLink');
	$('#quick_navigation ul').prepend(liShopLink);
	var shopLink = document.createElement('a');	
	$(shopLink).attr('href', 'http://' + location.hostname + '/Pages/Product/Categories.aspx?SubSetID=2748');
	$(shopLink).html('Gesamt-Shop');
	$('#quick_navigation ul li.shopLink').prepend(shopLink);

	$('#sub_navigation').prepend(basket_container);
	$('#search .large').val('Suche');
	
	var accessory_manager = $('#search ul').clone();
	accessory_manager.attr('id', 'accessory_manager');
	accessory_manager.find('a').html('&nbsp;');
	$('#content').append(accessory_manager);
	
	$('#search .large').focus(function() {
		if ($('#search .large').val() == "Suche") { 
			$('#search .large').val("");
				
		}
	});
	$('#search .large').blur(function() {
		if ($('#search .large').val() == "") {
			$('#search .large').val("Suche");
						
		}
	});
});

function createLink(name, link) {
	var oListItem = document.createElement('li');
	var oLinkItem = document.createElement('a');
	$(oLinkItem).attr('href', link);
	$(oLinkItem).html(name);
	$(oListItem).append(oLinkItem);
	return oListItem;
}