var ActivateNewBasket = '';
var AlertWhenChoiseMissing = '';


function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
	{
	c_start=c_start + c_name.length+1;
	c_end=document.cookie.indexOf(";",c_start);
	if (c_end==-1) c_end=document.cookie.length;
	return unescape(document.cookie.substring(c_start,c_end));
	}
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}


function findreplace(el, find, rep) {
	try{$(el).html($(el).html().replace(find, rep))}catch(e){};
}

function ShowCostumerDetails(){

	if ($('.LoadProfile_Orderstep1_TBL').css('display') == 'none'){
		$('.LoadProfile_Orderstep1_TBL').show()
	}else{
		$('.LoadProfile_Orderstep1_TBL').hide()
	}

}

function ShowSendForm(){

	if ($('.FormTB').css('display') == 'none'){
		$('.FormTB').fadeIn('slow')
	}else{
		$('.FormTB').hide()
	}

}

domReady(function(){


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LLOYD


	if (location.href.indexOf('showbasket.html') != -1){
		if ($('.Related_Custom_TBL').length != 0){
		$('.Related_Custom_TBL').before('<div class="SecProdLines" style="width:646px !important;width:657px;margin-left:28px;">Du kunne også være interesseret i:</div>')
		}
	}

	$('.FormTB').before('<br><br><strong><a href="javascript:ShowSendForm();">Klik her for at sende listen til en anden...</a></strong><br><br>');


	if ($.browser.safari) {
//		old_alert("("+ ($.browser.safari) +")("+ ($.browser.chrome) +")");
	}

	
	if ($('#ShopMainLayOutTable .SpecialDes img').length == 0){$('.SpecialDes_Span').hide();}

	if ($('#ShopMainLayOutTable #ShopLayOut_Topmenu_TD .B2B').length != 0){$('#ShopMainLayOutTable #ShopLayOut_Topmenu_TD').prepend('<div class="B2BText">Alle priser er inkl. moms</div>');}else{$('.FavBN').remove();}

	if ($('.LoadProfile_Orderstep1_TBL b').text() == ''){$('.LoadProfile_Orderstep1_TBL b').parent().hide();}
	
	if (location.href.indexOf('frontpage.html') != -1){
		
		$('#ShopMainLayOutTable #Main_TD').css('width','100%');
		$('#ShopMainLayOutTable #ShopLayOut_ProductMenu_TD').remove();

	}

	if ($('#ShopMainLayOutTable #RootCatagory').val() == 1){
		$('#ShopMainLayOutTable #ProductmenuContainer_DIV').prepend('<div class="MenuHeader">HERRESKO</div>');
		$('#ShopMainLayOutTable .HeadMenu').eq(0).css('color','#e3001b')
	}

	if ($('#ShopMainLayOutTable #RootCatagory').val() == 2){
		$('#ShopMainLayOutTable #ProductmenuContainer_DIV').prepend('<div class="MenuHeader">DAMESKO</div>');
		$('#ShopMainLayOutTable .HeadMenu').eq(1).css('color','#e3001b')
	}

	if ($('#ShopMainLayOutTable #RootCatagory').val() == 3){
		$('#ShopMainLayOutTable #ProductmenuContainer_DIV').prepend('<div class="MenuHeader">TILBEHØR</div>');
		$('#ShopMainLayOutTable .HeadMenu').eq(2).css('color','#e3001b')
	}

	$('#ShopMainLayOutTable .BackgroundColor1_Productlist, #ShopMainLayOutTable .BackgroundColor2_Productlist').each(function(){
		$(this).addClass('ProdLines')
	})

	$('#ShopMainLayOutTable .ProductList_Custom_TBL tr, #ShopMainLayOutTable .Related_Custom_TBL tr').each(function(){
		$(this).find('td.ProdLines:last .Prod').css('background-image','none')
	})

	$('#ShopMainLayOutTable .ProductList_Custom_TBL tr:last, #ShopMainLayOutTable .Related_Custom_TBL tr:last').parent().parent().parent().parent().parent().parent().each(function(){
		$(this).find('.ProdOverlay').css('background-image','none')
	})
	
	$('#ShopMainLayOutTable .Prod').parent().each(function(){
		_Title = $(this).find('a').eq(0).attr('title');
		$(this).attr('title',_Title);
		$(this).css('cursor','hand');
	})

	$('#ShopMainLayOutTable .Prod').click(function() {
		_Href  = $(this).find('a').eq(0).attr('href');
		window.location.href(_Href);
	});


	$('#ShopMainLayOutTable .PromoCats tr').each(function(){
		if ($(this).find('a').length != 0){
			$(this).css('cursor','pointer')
		}
	})



	$('#ShopMainLayOutTable .PromoCats tr').click(function() {
		if ($(this).find('a').length != 0){
			_Href  = $(this).find('a').eq(0).attr('href');
			window.location.href(_Href);
		}
	});
	
	$('#ShopMainLayOutTable .SubCatBox').each(function(){
		_Title = $(this).find('h2').eq(0).text();
		$(this).attr('title',_Title);
		$(this).css('cursor','hand');
	})

	$('#ShopMainLayOutTable .SubCatBox').click(function() {
		_Href  = $(this).find('a').eq(0).attr('href');
		window.location.href(_Href);
	});
	
	$('#ShopMainLayOutTable .ProdImageCanvas a').eq(4).css('margin-right','0px');

/*
	$('#ShopMainLayOutTable .ShowBasket_ProductLine_Description_TD').each(function(){
		$(this).find('a').eq(0).hide();
		$(this).find('a').eq(1).hide();
		$(this).find('.ShowBasket_SimpleVariants_DIV').hide();
		ThisLink = $(this).find('a').attr('href')
		$(this).find('a').eq(1).before('<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" style="float:left;" class="NewProdLines"><tr><td valign="center" width="115"><a href="'+ ThisLink +'" title="'+ $(this).find('a').eq(1).text() +'">'+ $(this).find('a').eq(0).html() +'</a></td><td valign="center"><a href="'+ ThisLink +'" title="'+ $(this).find('a').eq(1).text() +'"><strong>'+ $(this).find('a').eq(1).text() +'</strong><br>'+ $(this).find('.ShowBasket_SimpleVariants_DIV').text() +'</a></td></tr></table>')
		$(this).find('.NewProdLines').after('&nbsp;<br>&nbsp;<br>');
	})
*/

	$('#BoxedContentTABLE').before('<div class="ProdTab1">Beskrivelse</div>');
	$('#BoxedContentTABLE').before('<div class="ProdTab2">Levering</div>');
	$('#BoxedContentTABLE').before('<div class="ProdTab3">Mere</div>');

	$('#BoxedContentTABLE span').eq(2).hide();
	$('#BoxedContentTABLE span').eq(2).next('br/').hide();
	$('#BoxedContentTABLE span').eq(3).hide();

//	$('.BoxedContent h2').css('margin','0px');
//	$('.BoxedContent h2').addClass('ProdInfoH2');

	$('.ProdTab1').click(function() {
		
		$('.ProdTab1').css('background','#ffffff');
		$('.ProdTab2').css('background','#ececec');
		$('.ProdTab3').css('background','#ececec');
		
		$('#ShopMainLayOutTable #BoxedContentTABLE h1').eq(0).show();
		$('#BoxedContentTABLE span').eq(1).show();
		$('#BoxedContentTABLE span').eq(2).hide();
		$('#BoxedContentTABLE span').eq(3).hide();
		/*
		$('.ProdTab1').css('border-bottom','1px solid #ffffff');
		$('.ProdTab2').css('border-bottom','1px solid #cccccc');
		$('.ProdTab3').css('border-bottom','1px solid #cccccc');
		*/
	});

	$('.ProdTab2').click(function() {
		
		$('.ProdTab1').css('background','#ececec');
		$('.ProdTab2').css('background','#ffffff');
		$('.ProdTab3').css('background','#ececec');
		
		$('#ShopMainLayOutTable #BoxedContentTABLE h1').eq(0).hide();
		$('#BoxedContentTABLE span').eq(1).hide();
		$('#BoxedContentTABLE span').eq(2).show();
		$('#BoxedContentTABLE span').eq(3).hide();
		/*
		$('.ProdTab1').css('border-bottom','1px solid #cccccc');
		$('.ProdTab2').css('border-bottom','1px solid #ffffff');
		$('.ProdTab3').css('border-bottom','1px solid #cccccc');
		*/
	});

	$('.ProdTab3').click(function() {
		
		$('.ProdTab1').css('background','#ececec');
		$('.ProdTab2').css('background','#ececec');
		$('.ProdTab3').css('background','#ffffff');
		
		$('#ShopMainLayOutTable #BoxedContentTABLE h1').eq(0).hide();
		$('#BoxedContentTABLE span').eq(1).hide();
		$('#BoxedContentTABLE span').eq(2).hide();
		$('#BoxedContentTABLE span').eq(3).show();
		/*
		$('.ProdTab1').css('border-bottom','1px solid #cccccc');
		$('.ProdTab2').css('border-bottom','1px solid #cccccc');
		$('.ProdTab3').css('border-bottom','1px solid #ffffff');
		*/
	});


	if ($('#ShopMainLayOutTable #basket .TotalProducts').text() != 0){$('#ShopMainLayOutTable #basket').css('background-image','url(/images/template/background-basket-green.png)')}


	if	(location.href.indexOf('?msg=thanks') != -1){
		$('.KundeTable').parent().hide();
		$('#Thanks').show();
	}


//	$('#ShopMainLayOutTable #OrderStep1_TD .CustomerData_Orderstep1_TBL table tr').eq(0).hide();
	$('#ShopMainLayOutTable #Field0_0').hide();

	SearchText1 = 'Desværre ingen produkter at vise for denne søgning';
	SearchText2 = 'Desværre ingen produkter i kategorien: <b>[[CATEGORYNAME]]</b><p><a href="/shop/search-1.html?keyword=[[CATEGORYNAME]]">Klik her for at prøve søge efter produkter</a></p>';
	LoadProfileText = '<strong style="color:#e3001b;">Medlem af LLOYD Kundeklub? Klik her ></strong><br>';

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


		// Loader productmenu
		if	(location.href.indexOf('frontpage.html') == -1){cn_init_menu(document.getElementById('ProductMenu_Table'),1)};

		// Fjerner bindestreg i starten af et produktnavn
		$('.niv1, .niv2, .niv3, .niv4, .niv5').each(function(){
			if ($(this).text().substring(0,1) == '-'){
				$(this).text($(this).text().substring(1,999))
			}
		})
		
		// identificere alle menupunkter - tildeler class
		var iMenu = 1;
		$('#ShopLayOut_Topmenu_TD a').each(
			function() {
				if (this.className != 'TopMenuSpace') $(this).attr('id', 'menu'+iMenu++);
			}
		)

		// Floater indhold i liste
		ProdCount = 1
		$('#ShopMainLayOutTable .Prod').each(function() {
			
			if (ProdCount == 1){$(this).parent().attr('align','left')};
			if (ProdCount == 3){$(this).parent().attr('align','right')};
			if (ProdCount == 3){ProdCount = 1}else{ProdCount++};
		
		})
/*
		$('#ShopMainLayOutTable .LoadProfile_Orderstep1_TBL td').eq(4).prepend($('#ShopMainLayOutTable .LoadProfile_Orderstep1_TBL td').eq(7).html())
		
		$('#ShopMainLayOutTable .LoadProfile_Orderstep1_TBL tr').eq(3).remove();
		$('#ShopMainLayOutTable .LoadProfile_Orderstep1_TBL table').after('<br><hr>');

		$('#ShopMainLayOutTable .LoadProfile_Orderstep1_TBL td').eq(2).attr('width','155')
*/
		$('.ProdPrice').each(function(){
			$(this).html($(this).html().toLowerCase().replace('</strike>8<strike></strike>8<strike>','88'))
			$(this).html($(this).html().toLowerCase().replace('</strike>8<strike>','8'))
			$(this).html($(this).html().toLowerCase().replace('</strike>&nbsp;</strike>','</strike>'))
			$(this).html($(this).html().toLowerCase().replace('</strike>8<strike>','8'))
		});


		$('.KundeKlub').click(function() {
			window.location.href = '/shop/cms-kundeklub.html'
		});

		$('.VisitShop').click(function() {
			window.location.href = '/shop/cms-lloyd-koebenhavn.html'
		});

		$('.FacebookDIV').click(function() {
			window.location.href = 'http://www.facebook.com/lloydshoes?sk=app_121977467916134'
		});

		// Hvis taget <i></i> er i text så lav hide på den
		$('.niv1, .niv2, .niv3, .niv4, .niv5, .SubCats_Prodlink').each(function(){
			$(this).find('i').text('')
		})

	if	(location.href.indexOf('shop/cms') != -1 || location.href.indexOf('search-1.html') != -1 || location.href.indexOf('b2blogin.html') != -1 || location.href.indexOf('favorites.html') != -1){
		$('#ProductmenuContainer_DIV').remove();
	}

	if	($('#RootCatagory').val() != undefined && $('#RootCatagory').val() != ''){
		$('#ShopMainLayOutTable .DivBoxes').css('padding-top','20px')
	}

	if	(location.href.indexOf('order1.html') != -1){
		// Funktion til skjul af "handlet her tidligere"
		if	(location.href.indexOf('order1.html&showForgotPswForm=1') == -1){$('.LoadProfile_Orderstep1_TBL').hide()};
		if ($('.LoadProfile_Orderstep1_TBL').html().indexOf('logout=1') == -1){$('.LoadProfile_Orderstep1_TBL').before('<div onclick="ShowCostumerDetails()" id="HandleBefore" style="cursor:hand;">'+ LoadProfileText +'</div>')}

		if ($('.LoadProfileNotFound_Orderstep1').text() != ''){
			$('.LoadProfile_Orderstep1_TBL').show()
		}

	}

	if	(location.href.indexOf('pg-dd.html') != -1){
		$('body').hide();
	}

		// Skjuler menu i step2, step3, step4
		if	(location.href.indexOf('order1.html') != -1 || location.href.indexOf('order2.html') != -1 || location.href.indexOf('order3.html') != -1 || location.href.indexOf('pg-dd.html') != -1 || location.href.indexOf('pay.dandomain.dk/securetunnel.asp') != -1){
//			$('#ProductmenuContainer_DIV, .box').css('display','none');
//			$('#ProductmenuContainer_DIV').after('')
		}


		// Indhold der flytter posison
		DivContent = function() {  
			if ($('#MoveTo').length == 1){  
				$('#MoveTo').html($('#MoveFrom').html()); 
				$('#MoveFrom').remove();  
				clearInterval(DivContentTimer); 
			}  
		} 
		DivContentTimer = setInterval('DivContent()', 100);


		// Rettelse af tabeller
		$('table').each(function(){
			$(this).attr('border','0').attr('cellpadding','0').attr('cellspacing','0')
		});

		// Steps står pænt
		if (location.href.indexOf('shop/showbasket.html') != -1){
			$('#ShowBasket_TD a').each(function(){
				if ($(this).attr('href') == "javascript:history.go(-1);")$(this).remove();
				if ($(this).attr('href') == "/shop/basket.asp?caller=showbasket&removeall=1")$(this).remove();
		//		if ($(this).attr('href') == "/shop/order1.html"){$(this).eq(0).remove();}
				return false;
			});
		}

		if (location.href.indexOf('shop/order1.html') != -1){
			GetHeader = $('#OrderStep1_TD h1').text();
			$('#OrderStep1_TD').prepend('<h1>'+ GetHeader +'</h1>')
			$('.Heading_Orderstep1_TBL').remove();

			$('#Orderstep1_AlternativeDelivery_Enabled_CHECKBOX').parent().wrap('<label for="Orderstep1_AlternativeDelivery_Enabled_CHECKBOX"></label>')
			$('#ShopMainLayOutTable #NyhedsbrevLabel').parent().find('input').attr('id','ReciveMaillist').css('background','#FFFFFF')
			$('#ReciveMaillist').parent().attr('colspan','4')
			$('#ReciveMaillist').parent().wrapInner('<span class="ReciveMaillistClass"><label for="ReciveMaillist"></label></span>')
			
			$('#ShopMainLayOutTable .ReciveMaillistClass').after('<br><table border="0" cellpadding="0" cellspacing="0" id="ForCode"><tr>'+ $('#Field10_0').html() +'</tr></table>');
			
			if ($('#ShopMainLayOutTable #NyhedsbrevLabel').parent().find('input').is(':checked')){
				$('#ForCode').show();
			}else{
				$('#ForCode').hide();
			}
			
			$('#ShopMainLayOutTable #NyhedsbrevLabel').parent().find('input').click(function() {
				if ($(this).is(':checked')){$('#ForCode').show();}else{$('#ForCode').hide();}
			});
			
			$('#Field10_0').remove();
			
			if ($('.LoadProfile_Orderstep1_TBL').html().indexOf('logout=1') != -1){$('#ShopMainLayOutTable #NyhedsbrevLabel').parent().hide();}

		}

		if (location.href.indexOf('shop/order2.html') != -1){
			GetHeader = $('#OrderStep2_TD h1').text();
			$('#OrderStep2_TD').prepend('<h1>'+ GetHeader +'</h1>')
			$('#OrderStep2_TD .BackgroundColor1_Orderstep2 tr').eq(0).remove();
			$('#OrderStep2_TD .BackgroundColor1_Orderstep2 tr').eq(0).remove();
			$('.SubmitButton_Orderstep1, .SubmitButton_Orderstep2, #SubmitButton_Gem').val('');
		}

		if (location.href.indexOf('shop/order3.html') != -1){

			// Tildele table's ID'er i steps
			var i = 1;
			$('.CustomerInfo_OrderStep3 table').each(
				function() {
					$(this).attr('id', 'CustomerInfo_OrderStep3_Table'+i++)
				}
			)

			GetHeader = $('#OrderStep3_TD h1').text();
			$('#OrderStep3_TD').prepend('<h1>'+ GetHeader +'</h1>')
			$('#OrderStep3_TD .Heading_OrderStep3').remove();
			$('#OrderStep3_TD .CustomerInfo_OrderStep3 br:lt(2)').remove();
			$('#OrderStep3_TD .BackGroundColor1_OrderStep3 tr').eq(0).find('td br:lt(2)').remove();
			$('#OrderStep3_TD .CustomerInfo_OrderStep3 td').eq(0).find('br:lt(1)').remove();
			$('.SubmitButton_OrderStep3').val('');
		}

		if (location.href.indexOf('shop/order4.html') != -1){
			GetHeader = $('#OrderStep4_TD h1').text();
			$('#OrderStep4_TD').prepend('<h1>'+ GetHeader +'</h1>')
			$('#OrderStep4_TD .BackGroundColor1_OrderStep4 tr').eq(0).remove();
		}

		// Ekstra billeder på varekort
		$('#ShopMainLayOutTable #ProdImage a:gt(0)').addClass('SProdImages');

});



$(document).ready(function(){



if (ActivateNewBasket){
	
		$('#BasketChoise').show();

		$('.BaksetBoxTBL .yes').click(function() {
			ProdNumberCN = $(this).parent().parent().find('td.cell2').attr('prodnumber');

			setCookie(ProdNumberCN,'1',1)

			location.href = '/shop/showbasket.html?add=1&amount=1&productid='+ ProdNumberCN;
		});

		$('.BaksetBoxTBL .no').click(function() {

			ProdNumberCN = $(this).parent().parent().find('td.cell2').attr('remurl');

			setCookie(ProdNumberCN,'1',1)
			
			$('#ShopMainLayOutTable .ShowBasket_ProductLine_Description_TD a').each(function(){
				if($(this).attr('href').indexOf(ProdNumberCN) != -1){
					location.href = $(this).parent().parent().parent().parent().parent().parent().find('.ShowBasket_ProductLine_ActionButtons_TD a').eq(2).attr('href');
				}else{
					location.href = '/shop/showbasket.html';
				}
			})
		});
		
		GoToStep1 = true;
		
		$('#ShopMainLayOutTable .BaksetBoxTBL .cell2').each(function(){
				
			if($('.ShowBasket_Custom_TBL').html().indexOf($(this).attr('remurl')) != -1){
				$(this).find('.no').attr('src','/images/template/nej_graa.jpg');
			}else if(getCookie($(this).attr('remurl'))=='1'){
				$(this).find('.yes').attr('src','/images/template/ja_graa.jpg');
			}else{
				GoToStep1 = false
			}
			
		})
	
		if(GoToStep1){
			$('.InsertBN').html('<a href="/shop/order1.html"><img border="0" src="/images/template/BN-videre.png" class="VidereStep1"></a>')
		}else{
			$('.InsertBN').html('<img border="0" src="/images/template/BN-videre1.png" onclick="old_alert(\''+ AlertWhenChoiseMissing +'\');" class="VidereStep1">')
		}
		
		$('.Related_Custom_TBL, .SecProdLines, .RemoveIfNewBasket').remove();
		$('.tilvalgDIV').show();
		
}

		if (location.href.indexOf('p.html') != -1){
			
			
			ProdPriceJS = $('.ProdPriceSPAN').eq(0).text().replace('.','').replace(',','.')
			if(parseInt(ProdPriceJS)>=FreeShipValue){
				$('#ShopMainLayOutTable .ProductInfo_MagixZoomPlus_MainImage_TABLE').eq(0).before('<div align="left" class="FreeShippingLabel"><img src="/images/template/freeshipping.png"></div>')
			}
	
		}




		// Indsætte rettebilleder på possition
		$('#CustomerInfo_OrderStep3_Table3').each(function(){
			$(this).css('width', '100%');
			$(this).before('<input type="button" style="float:right;position:relative;top:25px;" value=" ret data " onClick="history.go(-2)">');
		})
		$('#CustomerInfo_OrderStep3_Table4').each(function(){
			$('#CustomerInfo_OrderStep3_Table4').css('width', '100%');
			$(this).before('<input type="button" style="float:right;position:relative;top:25px;" value=" ret data " onClick="history.go(-1)">');
		})

		// Fjerne link i bestillingsoversigt i step
		$('.BackGroundColor1_OrderStep3 table table table td a').each(function(){
			this.removeAttribute('href')
		})
		
		//Ny linie efter postlogo
		$('#ShippingMethodsContainer table td img').each(function(){
			$(this).after('<br>')
		})

		// For skjule print icon på kvitering
		$('.BackGroundColor1_OrderStep4 a:parent').css('display', 'none');

		
		// Ved fejlside
		if ($('#ProductList_TD').text() == ''){
		
			if	(location.href.indexOf('search-1.html') != -1){					
				$('#ProductList_TD').html('<h1>Søgning: '+ Keyword +'</h1><div class="PriductListBackground" style="padding-top:40px;padding-bottom:30px;text-align:center;">'+ SearchText1 +'</div>')
			}else{
				$('#ProductList_TD').html('<h1>[[CATEGORYNAME]]</h1><div class="PriductListBackground" style="padding-top:40px;padding-bottom:30px;text-align:center;">'+ SearchText2 +'</div>')
			}

		$('.EmtyList').attr('align', 'center').css('margin-top','60px')

		}

		// Ved fejlside skriver den Kategorinavn i stedet for [[CATEGORYNAME]]
		if (document.getElementById('ProductList_TD') != null){
			if ($('#ProductList_TD').html().indexOf('[[CATEGORYNAME]]') != -1){
				
				if (Keyword != ''){$('.EmtyList a').css('display', 'none');}
				
				$('#ProductList_TD *').each(function(){
					if ($('#ProductList_TD').html().indexOf('[[CATEGORYNAME]]') != -1){
						findreplace('#ProductList_TD','[[CATEGORYNAME]]',$('.Activ_Productmenu').text());
					}
				})
			}
		}
		
		// Insætter pris i fragt hvor der ikke står noget som standart
		if ($('#ShippingFee').html()  != null){
			if	($('#ShippingFee').html() == ''){
					$('#ShippingFee').text('0,00 DKK')
			}
		}
		
		// Finder alle p-tag og hvis de er tomme så skjul dem
		$('p').each(function(){
			if ($(this).html()  == ''){
				$(this).remove();
			}
		})

		$('.Description_Productinfo').each(function(){
			if ($(this).html()  == ''){
				$(this).remove();
			}
		})


		// Sætter overskrift på Anbefal
		$('#TipFriend_TD').html('<h1>Anbefal</h1>'+$('#TipFriend_TD').html());

		// Laver brede på table 100% på anbefal siden
		findreplace('#TipFriend_TD','400','100%');

		// Overskrift til nyheder
		if	(location.href.indexOf('news-ALL-1.html') != -1){
			$('#ProductList_TD h1').text('Nyheder');
		}

		// Overskrift til tilbud
		if	(location.href.indexOf('specialoffer-ALL-1.html') != -1){
			$('#ProductList_TD h1').text('Tilbud');
		}

		for (i=1; i<256; i++){
			var re = new RegExp('&#(' + i + ');', 'g');
			Keyword = Keyword.replace(re, String.fromCharCode(i))
		}

		// Overskrift til søgning
		if	(Keyword  != ''){
			$('#ProductList_TD h1').text('Søgning: '+Keyword);
		}

		// Hvis søgestring ikke er tom gemmer den, den i en cookie
		if (Keyword != ''){setCookie('seekform',Keyword,365);};
		
		var SeekCookie = getCookie('seekform');

		// Hvis Formen bliver sendt tom eller med standart-text sendes brugern til forsiden
		if (CurrencyReturnUrl == '/shop/search-1.html?keyword='){alert('Du skal udfylde et søgeord');setCookie('seekform','',-1);location.href = '/';};

		SearchValue = "Indtast søgeord";
		$('#ShopMainLayOutTable form input.SearchField_SearchPage').val(SearchValue).click(function(){if($(this).attr('value') == SearchValue){$(this).val('')}}).blur(function(){if($(this).attr('value') == ''){$(this).val(SearchValue)}})

		// Sætter string ind i formen på siden
		if (SeekCookie != ''){$('#ShopMainLayOutTable form input.SearchField_SearchPage').attr('value', SeekCookie);};

		NewsletterValue = "Indtast din e-mail";
		$('form.FormNewsletter input.email').val(NewsletterValue).click(function(){if($(this).attr('value') == NewsletterValue){$(this).val('')}}).blur(function(){if($(this).attr('value') == ''){$(this).val(NewsletterValue)}})

		// Finder alle speciale elementer og hvis de er tomme så skjul dem
		if ($('#ShopMainLayOutTable #Canvas').html()  == ''){
			$('#ShopMainLayOutTable #Canvas').remove();
		}
		if ($('#ShopMainLayOutTable #Selector').html()  == ''){
			$('#ShopMainLayOutTable #Selector').remove();
		}

		// Retter op på enkelte produkter i relaterede eller kunder købte også på varekort
		var RelatedCount = 0;
		$('#ShopMainLayOutTable .Related_Custom_TBL .Prod').each(function(){
		+RelatedCount++
		})

		var AlsoBoughtCount = 0;
		$('#ShopMainLayOutTable .CustomersAlsoBought_Custom_TBL .Prod').each(function(){
		+AlsoBoughtCount++
		})
		
		if (RelatedCount == 1){$('.Related_Custom_TBL').attr('width', '33%');}
		if (RelatedCount == 2){$('.Related_Custom_TBL').attr('width', '66%');}
		if (RelatedCount == 3){$('.Related_Custom_TBL').attr('width', '100%');}

		if (AlsoBoughtCount == 1){$('.CustomersAlsoBought_Custom_TBL').attr('width', '33%');}
		if (AlsoBoughtCount == 2){$('.CustomersAlsoBought_Custom_TBL').attr('width', '66%');}
		if (AlsoBoughtCount == 3){$('.CustomersAlsoBought_Custom_TBL').attr('width', '100%');}

		// Skjuler Amount-felt i relaterede og knder købte også
		

		// Fjerner Amauontfelt i Prod-liste
		$('.TextInputField_Productlist').hide();

		// Ændre alle tilbud og nyhed til store på varekort
		$('.ProductInfo_TD .ImageRelative .label').each(function(){
			$(this).html($(this).html().replace('tilbud.png','tilbud-big.png'))
			$(this).html($(this).html().replace('nyhed.png','nyhed-big.png'))
		})

		// Skjul variantstreg hvis ingen variant er der...
		$('.Variants').each(function(){
			if ($(this).html() == ''){
				$('.VariantsLine').css('display', 'none');
			}
		})

//		$('.Prices_Custom_TBL td').attr('align','left')

});






// Denne funktion sørger for automatisk at tilpasse indholdet er en menu
function cn_init_menu(menu,level){
	// Hent indhold i menuen
	var list=menu.rows;
	var i=list.length; var j=i;

	// Gennemgå punkterne
	if(i>0)do{
		// Hent en reference til punktet
		var tmp=list[j-i].cells; tmp=tmp[tmp.length-1];

		// Tjek om det er en undermenu
		var x=tmp.getElementsByTagName('table')[0];
		if(x){
			cn_init_menu(x,level+1);
			continue;
		}

		// Tjek om det er et almindeligt punkt
		tmp=tmp.getElementsByTagName('a');
		var x=tmp[0];
		var y=tmp[1];
		
		if (tmp.length>2)
		{
			tilfoej = '';
			if (tmp[2].innerHTML.substring(0,3)=='<u>') tilfoej = 'specialniv'
			tmp[2].innerHTML='<div class="niv'+level+' '+tilfoej+'">'+tmp[2].innerHTML+'</div>';
		}
		if(y&&x&&y.parentNode==x.parentNode) 
		{
			if (tmp.length<3)
			{
				tilfoej = '';
				if (y.innerHTML.substring(0,3)=='<u>') tilfoej = 'specialniv'
				y.innerHTML='<div class="niv'+level+' '+tilfoej+'">'+y.innerHTML+'</div>';
			}
		}
		else if(x)
		{
			tilfoej = '';
			if (x.innerHTML.substring(0,3)=='<u>') tilfoej = 'specialniv'
			x.innerHTML='<div class="niv'+level+' '+tilfoej+'">'+x.innerHTML+'</div>';		
		}
	}while(--i);
}

