	// Indlæs Cygnet-moduler
    if(/WebKit/i.test(navigator.userAgent)){
        var _timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(_timer); cn_load();}},10);
    }else if(document.all){
        document.write("<script id=__ie_onload defer src=javascript:void(0)></script>");
        var script=document.getElementById("__ie_onload");
        script.onreadystatechange=function(){if(this.readyState=="complete"){cn_load();}}
    }else{
        document.addEventListener('DOMContentLoaded',cn_load,false);
    }

    function cn_load(){
        // Indlæs listen over moduler
        var modules=document.cn_modules;
        var i=modules.length; var j=i;
		
        // Indlæs modulerne
        if(i>0)do{
            modules[j-i]();
        }while(--i);

    }
    document.cn_modules=new Array();

	// kræver jquery
	function findreplace(el, find, rep) {
		try{$(el).html($(el).html().replace(find, rep))}catch(e){};
	}

	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 ShowCostumerDetails(){

	if ($('.LoadProfile_Orderstep1_TBL').css('display') == 'none'){
		$('.LoadProfile_Orderstep1_TBL').show()
	}else{
		$('.LoadProfile_Orderstep1_TBL').hide()
	}

}

	$(document).ready(function(){
							   
	


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// E værktøj


//		http://www.e-vaerktoej.dk/shop/indeks-30248s.html
/*
		if	(location.href.indexOf('/cms-index-over-vaerktoej.html') != -1){

$.get('ajax/test.html', function(data) {
  $('#ShopMainLayOutTable #load').html(data);
  alert('Load was performed.');
});


			$("#ShopMainLayOutTable #load").load("/shop/indeks-30248s.html #SELECTLIST");
		
		}
		*/
		
		$('#ProductInfo_MagixZoomPlus').attr('href',$('#ProductInfo_MagixZoomPlus').attr('href').replace('.jpg','-p.jpg'))
		

		$('#ProductList_TD .PHP').each(function(){
			$(this).before($(this).find('td').eq(4).text());
			$(this).hide();
		})


		if	(location.href.indexOf('30248s.html') != -1){
			var _CountSubs = $('#ShopMainLayOutTable #cnINDEX a').length;
		
			var _1Cell = Math.ceil(_CountSubs/3);
			var _2Cell = Math.ceil((_CountSubs-_1Cell)/2);
			var _3Cell = Math.ceil(_CountSubs-(_1Cell+_2Cell));

			var i = 1;
			var iDIV = 1;
			var SavedText = '';
			var SavedValue = '';
			var saveFirstletter = '';
		
			$('#ShopMainLayOutTable #cnINDEX a').each(function() {

				if ($(this).text().substring(0,1) != saveFirstletter){
					if (saveFirstletter != ''){SavedText = SavedText + '&nbsp;<br>'}
					SavedText = SavedText + '<b>'+ $(this).text().substring(0,1) +'</b><br>'
					saveFirstletter = $(this).text().substring(0,1)
				}

				SavedText = SavedText + '<a class="SubCats_Prodlink" href="'+ $(this).attr('href') +'">'+ $(this).text() +'</a><br>';
				if ((i == _1Cell && iDIV==1) || (i == _2Cell && iDIV==2) || (i == _3Cell && iDIV==3)){SavedValue = SavedValue + '<td valign="top" class="Cell'+ iDIV +'">'+ SavedText +'</td>';SavedText = '';iDIV++;i=1;}else{i++}
			})
			
			$('#cnINDEX').after('<table border="0" cellpadding="0" cellspacing="0" id="cnINDEX"><tr>'+ SavedValue +'</tr></table>')
		
			$('#cnINDEX').eq(0).remove();
		}

		LoadProfileText = '<h5 style="float:left;padding-left:10px;margin-top:0px;padding-top:2px;">Marker her, hvis du har handlet her tidligere.</h5>';
		

		if	(location.href.indexOf('/shop/frontpage.html') != -1){
			$('#ShopLayOut_Topmenu_TD a').eq(0).attr('id','ActiveSite');
		}

		if	(location.href.indexOf('/shop/specialoffer-ALL-1.html') != -1){
			$('#ShopLayOut_Topmenu_TD a').eq(1).attr('id','ActiveSite');
		}

		if	(location.href.indexOf('/shop/showbasket.html') != -1){
			$('#ShopLayOut_Topmenu_TD a').eq(2).attr('id','ActiveSite');
		}

		if	(location.href.indexOf('/shop/cms-') != -1){
			$('#ShopLayOut_Topmenu_TD a').eq(3).attr('id','ActiveSite');
		}

		if	(location.href.indexOf('/shop/order2.html') != -1){
//			$('#ShippingMethodsContainer td').html().replace('[POSTDK]','te');
//			alert($('#ShippingMethodsContainer td').text())
			$('#ShopMainLayOutTable #ShippingMethodsContainer td b').text($('#ShopMainLayOutTable #ShippingMethodsContainer td b').text().replace(/\[POSTDK\]/gi,''));
		}
		
		//
		$('.SubCats_Prodlink img').each(function(){
			$(this).after('<br>')
		});
		

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

		if	(location.href.indexOf('order1.html&showForgotPswForm=1') == -1){$('.LoadProfile_Orderstep1_TBL').hide()};
		$('.LoadProfile_Orderstep1_TBL').before('<div><input onclick="ShowCostumerDetails()" style="float:left;" type="checkbox"> '+ LoadProfileText +'</div>')
		
		if ($('#ProdPrice').text() == 'Ring for pris!'){$('.ProdHidePrice').hide();$('#ProdPrice').text('Dette produkt er midlertidigt udsolgt');}

		// For at lave en billedevisning på kategorikort
		findreplace('#COLUMNLIST table','</tr><tr>','');

		$('#COLUMNLIST a').each(function(){
			$(this).html($(this).html().replace('>','><div>'))
		});

		$('#COLUMNLIST a').each(function(){
			$(this).html($(this).html().replace('</a>','</div></a>'))
		});






		$('#ProductMenu_Table img').each(function(){
			$(this).parent().remove();
		});

		$('#ProductMenu_Table a').each(function(){
			$(this).next('br').remove()
			
			
			
	//		$(this).parent().html('<a href="'+ $(this).attr('href') +'" class="'+ $(this).attr('class') +'" title="'+ $(this).attr('title') +'"></a>')
		});

		
		


		// For skjule print på kvitering
		$('.BackGroundColor1_OrderStep4 a:parent').css('display', 'none');

		// Produktliste - Float
		$('#ShopMainLayOutTable .Frontpage_Custom_TBL tr, #ShopMainLayOutTable .ProductList_Custom_TBL tr, #ShopMainLayOutTable .Related_Custom_TBL tr').each(function(){
			$(this).find('div.ProductList:first').css({'float':'left', 'display':'inline'});
			$(this).find('div.ProductList:last').css({'float':'right', 'display':'inline'});
			$(this).find('div.ProductList').css('display', 'block');
		});
		
		
		// Giv niv's en ekstra class i tilfælde af u-tag
		$('.RootCategory_Productmenu a u').each(function(){
			$(this).parent().addClass('specialniv');
		})
/*
		// Infokort bytter om på billedeposion
		if (ProductNumber  != ''){
			if (document.getElementById('Canvas').innerHTML == ''){
			if (!document.getElementById('moveimage') == 'undefined')
			{
			document.getElementById('Canvas').innerHTML = document.getElementById('moveimage').innerHTML
			document.getElementById('moveimage').innerHTML = ''
			}
			$('#Canvas div').css('display', 'none');
			}
		}
*/
		// 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');
		}


			Keyword=Keyword.replace('&#2;','');
			Keyword=Keyword.replace('&#3;','');
			Keyword=Keyword.replace('&#4;','');
			Keyword=Keyword.replace('&#5;','');
			Keyword=Keyword.replace('&#6;','');
			Keyword=Keyword.replace('&#7;','');
			Keyword=Keyword.replace('&#8;','');
			Keyword=Keyword.replace('&#14;','');
			Keyword=Keyword.replace('&#15;','');
			Keyword=Keyword.replace('&#16;','');
			Keyword=Keyword.replace('&#17;','');
			Keyword=Keyword.replace('&#18;','');
			Keyword=Keyword.replace('&#19;','');
			Keyword=Keyword.replace('&#20;','');
			Keyword=Keyword.replace('&#21;','');
			Keyword=Keyword.replace('&#22;','');
			Keyword=Keyword.replace('&#23;','');
			Keyword=Keyword.replace('&#24;','');
			Keyword=Keyword.replace('&#25;','');
			Keyword=Keyword.replace('&#26;','');
			Keyword=Keyword.replace('&#27;','');
			Keyword=Keyword.replace('&#33;','!');
			Keyword=Keyword.replace('&#34;','""');
			Keyword=Keyword.replace('&#35;','#');
			Keyword=Keyword.replace('&#36;','$');
			Keyword=Keyword.replace('&#37;','%');
			Keyword=Keyword.replace('&#38;','&');
			Keyword=Keyword.replace('&#40;','(');
			Keyword=Keyword.replace('&#41;',')');
			Keyword=Keyword.replace('&#42;','*');
			Keyword=Keyword.replace('&#43;','+');
			Keyword=Keyword.replace('&#44;',',');
			Keyword=Keyword.replace('&#45;','-');
			Keyword=Keyword.replace('&#46;','.');
			Keyword=Keyword.replace('&#47;','/');
			Keyword=Keyword.replace('&#48;','0');
			Keyword=Keyword.replace('&#49;','1');
			Keyword=Keyword.replace('&#50;','2');
			Keyword=Keyword.replace('&#51;','3');
			Keyword=Keyword.replace('&#52;','4');
			Keyword=Keyword.replace('&#53;','5');
			Keyword=Keyword.replace('&#54;','6');
			Keyword=Keyword.replace('&#55;','7');
			Keyword=Keyword.replace('&#56;','8');
			Keyword=Keyword.replace('&#57;','9');
			Keyword=Keyword.replace('&#58;',':');
			Keyword=Keyword.replace('&#59;',';');
			Keyword=Keyword.replace('&#60;','<');
			Keyword=Keyword.replace('&#61;','=');
			Keyword=Keyword.replace('&#62;','>');
			Keyword=Keyword.replace('&#63;','?');
			Keyword=Keyword.replace('&#64;','@');
			Keyword=Keyword.replace('&#65;','A');
			Keyword=Keyword.replace('&#66;','B');
			Keyword=Keyword.replace('&#67;','C');
			Keyword=Keyword.replace('&#68;','D');
			Keyword=Keyword.replace('&#69;','E');
			Keyword=Keyword.replace('&#70;','F');
			Keyword=Keyword.replace('&#71;','G');
			Keyword=Keyword.replace('&#72;','H');
			Keyword=Keyword.replace('&#73;','I');
			Keyword=Keyword.replace('&#74;','J');
			Keyword=Keyword.replace('&#75;','K');
			Keyword=Keyword.replace('&#76;','L');
			Keyword=Keyword.replace('&#77;','M');
			Keyword=Keyword.replace('&#78;','N');
			Keyword=Keyword.replace('&#79;','O');
			Keyword=Keyword.replace('&#80;','P');
			Keyword=Keyword.replace('&#81;','Q');
			Keyword=Keyword.replace('&#82;','R');
			Keyword=Keyword.replace('&#83;','S');
			Keyword=Keyword.replace('&#84;','T');
			Keyword=Keyword.replace('&#85;','U');
			Keyword=Keyword.replace('&#86;','V');
			Keyword=Keyword.replace('&#87;','W');
			Keyword=Keyword.replace('&#88;','X');
			Keyword=Keyword.replace('&#89;','Y');
			Keyword=Keyword.replace('&#90;','Z');
			Keyword=Keyword.replace('&#91;','[');
			Keyword=Keyword.replace('&#93;',']');
			Keyword=Keyword.replace('&#94;','^');
			Keyword=Keyword.replace('&#95;','_');
			Keyword=Keyword.replace('&#96;','`');
			Keyword=Keyword.replace('&#97;','a');
			Keyword=Keyword.replace('&#98;','b');
			Keyword=Keyword.replace('&#99;','c');
			Keyword=Keyword.replace('&#100;','d');
			Keyword=Keyword.replace('&#101;','e');
			Keyword=Keyword.replace('&#102;','f');
			Keyword=Keyword.replace('&#103;','g');
			Keyword=Keyword.replace('&#104;','h');
			Keyword=Keyword.replace('&#105;','i');
			Keyword=Keyword.replace('&#106;','j');
			Keyword=Keyword.replace('&#107;','k');
			Keyword=Keyword.replace('&#108;','l');
			Keyword=Keyword.replace('&#109;','m');
			Keyword=Keyword.replace('&#110;','n');
			Keyword=Keyword.replace('&#111;','o');
			Keyword=Keyword.replace('&#112;','p');
			Keyword=Keyword.replace('&#113;','q');
			Keyword=Keyword.replace('&#114;','r');
			Keyword=Keyword.replace('&#115;','s');
			Keyword=Keyword.replace('&#116;','t');
			Keyword=Keyword.replace('&#117;','u');
			Keyword=Keyword.replace('&#118;','v');
			Keyword=Keyword.replace('&#119;','w');
			Keyword=Keyword.replace('&#120;','x');
			Keyword=Keyword.replace('&#121;','y');
			Keyword=Keyword.replace('&#122;','z');
			Keyword=Keyword.replace('&#123;','{');
			Keyword=Keyword.replace('&#124;','|');
			Keyword=Keyword.replace('&#125;','}');
			Keyword=Keyword.replace('&#126;','~');
			Keyword=Keyword.replace('&#128;','€');
			Keyword=Keyword.replace('&#130;','‚');
			Keyword=Keyword.replace('&#131;','ƒ');
			Keyword=Keyword.replace('&#132;','"');
			Keyword=Keyword.replace('&#133;','…');
			Keyword=Keyword.replace('&#134;','†');
			Keyword=Keyword.replace('&#135;','‡');
			Keyword=Keyword.replace('&#136;','ˆ');
			Keyword=Keyword.replace('&#137;','‰');
			Keyword=Keyword.replace('&#138;','Š');
			Keyword=Keyword.replace('&#139;','‹');
			Keyword=Keyword.replace('&#140;','Œ');
			Keyword=Keyword.replace('&#142;','Ž');
//			Keyword=Keyword.replace('&#145;',''');
//			Keyword=Keyword.replace('&#146;',''');
			Keyword=Keyword.replace('&#147;','"');
			Keyword=Keyword.replace('&#148;','"');
			Keyword=Keyword.replace('&#149;','•');
			Keyword=Keyword.replace('&#150;','–');
			Keyword=Keyword.replace('&#151;','—');
			Keyword=Keyword.replace('&#152;','˜');
			Keyword=Keyword.replace('&#153;','™');
			Keyword=Keyword.replace('&#158;','ž');
			Keyword=Keyword.replace('&#159;','Ÿ');
			Keyword=Keyword.replace('&#161;','¡');
			Keyword=Keyword.replace('&#162;','¢');
			Keyword=Keyword.replace('&#163;','£');
			Keyword=Keyword.replace('&#164;','¤');
			Keyword=Keyword.replace('&#165;','¥');
			Keyword=Keyword.replace('&#166;','¦');
			Keyword=Keyword.replace('&#167;','§');
			Keyword=Keyword.replace('&#168;','¨');
			Keyword=Keyword.replace('&#169;','©');
			Keyword=Keyword.replace('&#170;','ª');
			Keyword=Keyword.replace('&#171;','«');
			Keyword=Keyword.replace('&#172;','¬');
			Keyword=Keyword.replace('&#173;','­');
			Keyword=Keyword.replace('&#174;','®');
			Keyword=Keyword.replace('&#175;','¯');
			Keyword=Keyword.replace('&#176;','°');
			Keyword=Keyword.replace('&#177;','±');
			Keyword=Keyword.replace('&#178;','²');
			Keyword=Keyword.replace('&#179;','³');
			Keyword=Keyword.replace('&#180;','´');
			Keyword=Keyword.replace('&#181;','µ');
			Keyword=Keyword.replace('&#182;','¶');
			Keyword=Keyword.replace('&#183;','·');
			Keyword=Keyword.replace('&#184;','¸');
			Keyword=Keyword.replace('&#185;','¹');
			Keyword=Keyword.replace('&#186;','º');
			Keyword=Keyword.replace('&#187;','»');
			Keyword=Keyword.replace('&#188;','¼');
			Keyword=Keyword.replace('&#189;','½');
			Keyword=Keyword.replace('&#190;','¾');
			Keyword=Keyword.replace('&#191;','¿');
			Keyword=Keyword.replace('&#192;','À');
			Keyword=Keyword.replace('&#193;','Á');
			Keyword=Keyword.replace('&#194;','Â');
			Keyword=Keyword.replace('&#195;','Ã');
			Keyword=Keyword.replace('&#196;','Ä');
			Keyword=Keyword.replace('&#197;','Å');
			Keyword=Keyword.replace('&#198;','Æ');
			Keyword=Keyword.replace('&#199;','Ç');
			Keyword=Keyword.replace('&#200;','È');
			Keyword=Keyword.replace('&#201;','É');
			Keyword=Keyword.replace('&#202;','Ê');
			Keyword=Keyword.replace('&#203;','Ë');
			Keyword=Keyword.replace('&#204;','Ì');
			Keyword=Keyword.replace('&#205;','Í');
			Keyword=Keyword.replace('&#206;','Î');
			Keyword=Keyword.replace('&#207;','Ï');
			Keyword=Keyword.replace('&#208;','Ð');
			Keyword=Keyword.replace('&#209;','Ñ');
			Keyword=Keyword.replace('&#210;','Ò');
			Keyword=Keyword.replace('&#211;','Ó');
			Keyword=Keyword.replace('&#212;','Ô');
			Keyword=Keyword.replace('&#213;','Õ');
			Keyword=Keyword.replace('&#214;','Ö');
			Keyword=Keyword.replace('&#215;','×');
			Keyword=Keyword.replace('&#216;','Ø');
			Keyword=Keyword.replace('&#217;','Ù');
			Keyword=Keyword.replace('&#218;','Ú');
			Keyword=Keyword.replace('&#219;','Û');
			Keyword=Keyword.replace('&#220;','Ü');
			Keyword=Keyword.replace('&#221;','Ý');
			Keyword=Keyword.replace('&#222;','Þ');
			Keyword=Keyword.replace('&#223;','ß');
			Keyword=Keyword.replace('&#224;','à');
			Keyword=Keyword.replace('&#225;','á');
			Keyword=Keyword.replace('&#226;','â');
			Keyword=Keyword.replace('&#227;','ã');
			Keyword=Keyword.replace('&#228;','ä');
			Keyword=Keyword.replace('&#229;','å');
			Keyword=Keyword.replace('&#230;','æ');
			Keyword=Keyword.replace('&#231;','ç');
			Keyword=Keyword.replace('&#232;','è');
			Keyword=Keyword.replace('&#233;','é');
			Keyword=Keyword.replace('&#234;','ê');
			Keyword=Keyword.replace('&#235;','ë');
			Keyword=Keyword.replace('&#236;','ì');
			Keyword=Keyword.replace('&#237;','í');
			Keyword=Keyword.replace('&#238;','î');
			Keyword=Keyword.replace('&#239;','ï');
			Keyword=Keyword.replace('&#240;','ð');
			Keyword=Keyword.replace('&#241;','ñ');
			Keyword=Keyword.replace('&#242;','ò');
			Keyword=Keyword.replace('&#243;','ó');
			Keyword=Keyword.replace('&#244;','ô');
			Keyword=Keyword.replace('&#245;','õ');
			Keyword=Keyword.replace('&#246;','ö');
			Keyword=Keyword.replace('&#247;','÷');
			Keyword=Keyword.replace('&#248;','ø');
			Keyword=Keyword.replace('&#249;','ù');
			Keyword=Keyword.replace('&#250;','ú');
			Keyword=Keyword.replace('&#251;','û');
			Keyword=Keyword.replace('&#252;','ü');
			Keyword=Keyword.replace('&#253;','ý');
			Keyword=Keyword.replace('&#254;','þ');
			Keyword=Keyword.replace('&#255;','ÿ');
			
			// Hvis søgesting ikke er tom gemmer den, den i en cookie
			if (Keyword != ''){setCookie('seekform',Keyword,365);};
			var SeekCookie = getCookie('seekform');
			// Sætter string ind i formen på siden
			if (SeekCookie != ''){
				if (!document.getElementById('Keyword') == 'undefined')
				{
				document.getElementById('Keyword').value = SeekCookie;
				}
								
			};
			// Hvis Formen bliver sendt tom eller med standart-text sendes brugern til forsiden
			if (CurrencyReturnUrl == '/shop/search-1.html?keyword=' || CurrencyReturnUrl == '/shop/search-1.html?keyword=S&#248;g%20efter%20produkt'){alert('Du skal udfylde et søgeord');setCookie('seekform','',-1);location.href = '/';};

			// Overskrift til søgning
			if	(Keyword  != ''){
				$('#ProductList_TD h1').text('Søgning: '+Keyword);
			}

		
if ($('.Prices_Custom_TBL').eq(1).find('td').eq(2).text() == '0,00 DKK') {
	$('.Prices_Custom_TBL').eq(1).css('display', 'none');
	$('.ProdHidePrice').eq(10).css('display', 'none');
	$('#BUYSECTION').css('display', 'none');
	$('#ProdPrice').css({'float':'left', 'color':'red'}).text('OBS: Produktet er udgået');
}


	});


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

var includeUserfly	= false;
var userflyUserID	= 36771;

if (location.href.indexOf('/shop/order') != -1 || getCookie('includeuserfly')) {
	includeUserfly = true;
	if (location.href.indexOf('/shop/order1.html') != -1) { 
		setCookie('includeuserfly', true);                                                 
	}
}