$(document).ready(function(){
	$("#Unsubscribe").mouseover(function(){
		$("#NewsletterFrm").find("input[name='action']").attr("value", "unsubscribe");
		$("#NewsletterFrm").find("input[name='success_url']").attr("value", "http://www.vaiva.dk/frameldt.html");
		$("#NewsletterFrm").find("input[name='failure_url']").attr("value", "http://www.vaiva.dk/frameldt.html");
	});
	$("#Subscribe").mouseover(function(){
		$("#NewsletterFrm").find("input[name='action']").attr("value", "subscribe");
		$("#NewsletterFrm").find("input[name='success_url']").attr("value", "http://www.vaiva.dk/tilmeld.html");
		$("#NewsletterFrm").find("input[name='failure_url']").attr("value", "http://www.vaiva.dk/tilmeld.html");
	});
	if($(".LoadProfile_Orderstep1_TBL").length > 0){
		var $form = $("form").filter(function(){
			if ($(this).attr("name") == "Orderstep1Form"){
				return true;
			}
			return false;
		});
		$("#ShopMainLayOutTable .Heading_Orderstep1_TBL").next().attr("id", "hr");
		$("#ShopMainLayOutTable .LoadProfile_Orderstep1_TBL").insertAfter($form);
		$("#ShopMainLayOutTable .Heading_Orderstep1_TBL").next().insertAfter($form);
	}
	if($("#FieldD4_0").length > 0){
		$("#FieldD4_0 td:first").html("")
	}
	if($("#Field8_0").length > 0){
		$("#Field8_0 td:first").html("")
	}
	if($("#ShopMainLayOutTable .CustomerData_Orderstep1_TBL").length > 0){
		$("#ShopMainLayOutTable .CustomerData_Orderstep1_TBL tr:eq(1)").find("tr[id*='Field']").find("input").css("width", "220px")
		
		$("#lcity").css("width", "160px")
		$("#city").css("width", "160px")
		$("#lzipcode").css("width", "50px")
		$("#zipcode").css("width", "50px")
	}
	
	$("td[id='TopSpaceLinks']").hover(function(){
		$(this).css("background", "url('/images/design/Da/TopMenu/topBgOver.png') repeat-x")
		$(this).css("cursor", "pointer")
		if($(this).find("a").parent().attr("id") != "TopSpaceLinks"){
			$(this).find(".TopSpaceSubLinks").css("display", "block")
		}
	},function(){
		$(this).css("background", "none");
		if($(this).find("a").parent().attr("id") != "TopSpaceLinks"){
			$(this).find(".TopSpaceSubLinks").css("display", "none")
		}
	});
	
	$("td[id='TopSpaceLinks']").click(function(){
		if($(this).find("a").parent().attr("id") == "TopSpaceLinks"){
			var link = $(this).find("a").attr("href");
			location.href = link;
		}
	});
	
	if($("#ProdGrpDescPart1").length > 0){
		if($("#ProdGrpDescPart1 img").length < 1){
			$("#ProdGrpDescPart1").parent().remove();
		}
	}
	
	if($("#BreadCrumb").text() == ""){
		$("#BreadCrumb").parent().remove();
	}
	
	$(".Frontpage_Custom_TBL > tbody > tr > td").css("text-align", "center");
	$(".Basket_TD").click(function(){
		location.href = "/shop/showbasket.html"
	});
	$(".Basket_TD").css("cursor", "pointer")
	
	$(".Frontpage_Custom_TBL td div strike").each(function(){
		if($(this).html().indexOf("&nbsp;DKK") != -1){
			$(this).html($(this).html().replace("&nbsp;DKK", ""))
		}
	});
	
});


