jQuery(document).ready(
	function(){
		
		jQuery("table#ProductList tbody").css("overflow", "visible");		
		jQuery("td#Favorites_TD span:first span").addClass("Heading_Customer");
		jQuery("td#Favorites_TD span:first span, td#Favorites_TD span:first").css("font-size", "");
		jQuery("td#Favorites_TD span:first span, td#Favorites_TD span:first").css("padding-bottom", "0px");
		jQuery("td#Favorites_TD span:first span, td#Favorites_TD span:first").css("height", "auto");
		
		jQuery("td.ProductInfo_TD img[id^=ProdInfoImage]").addClass("varekortfoto");
		
		jQuery("td.ProductInfo_TD img[id^=ProdInfoImage]").parent().addClass("varekortfotoparent");
		

		
		jQuery("tr.Price_ProductInfo_TR").parent().parent().attr("width", "0");
		jQuery("tr.Price_ProductInfo_TR").parent().parent().css("float", "right");
		
		
		jQuery("td.ProductInfo_TD span#varenavn").parent().parent().css("display", "none"); // fjern varenavn-linien
		jQuery("td.ProductInfo_TD span.Stockmessage_Productinfo").each( // tilføj tekst på lervering-linien
			function( intIndex ){
				var tmphtml = jQuery(this).html();
				if (tmphtml=="") {
					jQuery(this).html("Levering");
				}
			}
		);
		
		jQuery("td.ProductInfo_TD td.Price_ProductInfo, td.ProductInfo_TD td.PriceText_ProductInfo_TD").attr("width", "auto");
			jQuery("span.BuyButton_ProductInfo").parent().parent().parent().parent().css("float", "right");
			jQuery("tr.Price_ProductInfo_TR").parent().parent().parent().addClass("varekortprisbox");
	
		
		// antal tekst foran inputboks
		jQuery("table#BUYSECTION td").css("vertical-align", "top");	
		// var tmp = jQuery("td.ProductInfo_TD input#amount").parent().html();
		// if (tmp) {
			// alert("test");
			// var tmp = tmp.replace("<br>", " ");
			// var tmp = tmp.replace("<br/>", " ");
			// jQuery("td.ProductInfo_TD input#amount").parent().html(tmp);
		// }
	// 	jQuery("td.ProductInfo_TD input#amount").parent().prepend("<br/>Antal: ");
	// 	jQuery("td.ProductInfo_TD input#amount").parent().css("width", "130px");
	// 	jQuery("td.ProductInfo_TD input#amount").parent().css("text-align", "right");
	// 	
		jQuery("td.varekortprisbox").parent().css("width", "184px");
		jQuery("td.varekortprisbox").parent().parent().css("width", "184px");
		jQuery("td.varekortprisbox").parent().parent().parent().css("width", "184px");
	
		jQuery("hr.TableLines_ProductInfo").parent().css("text-align", "left");
		
		// forskydelser af bokse i højre side af varekortet
		if (jQuery.browser.msie) {
			jQuery("td.ProductInfo_TD td.varekortfotoparent").addClass("varekortbox_ie");
		}
		else {
			jQuery("td.ProductInfo_TD td.varekortfotoparent").addClass("varekortbox_nonie");
			
		}
	
		// forskydelse af prisboks på varekort
		var tmp_h = 0;
		jQuery("td.Description_Productinfo").each(
			function( intIndex ){
				 tmp_h = jQuery(this).height();
			}
		);
		if (jQuery.browser.msie) {
			// jQuery("td.varekortprisbox").css("top", "-100px;");
		}
		else {
			jQuery("td.ProductInfo_TD td.varekortprisbox").parent().css("position", "absolute");
			jQuery("td.ProductInfo_TD td.varekortprisbox").parent().css("margin-top", (70-tmp_h)+"px");
		}
		
		
		// newsletter formular på forsiden
		jQuery("input.newsletter_name").click(function() { 
			if (jQuery(this).attr("value") == 'Navn') {
				jQuery(this).attr("value", "");
			}
		});
		jQuery("input.newsletter_email").click(function() { 
			if (jQuery(this).attr("value") == 'E-mail') {
				jQuery(this).attr("value", "");
			}
		});		
		jQuery("input.newsletter_name").blur(function() { 
			if (jQuery(this).attr("value") == '') {
				jQuery(this).attr("value", "Navn");
			}
		});		
		jQuery("input.newsletter_email").blur(function() { 
			if (jQuery(this).attr("value") == '') {
				jQuery(this).attr("value", "E-mail");
			}
		});	
		
		jQuery("a#newsletterafmeld").click(function() {
			jQuery('input#add').attr('value', '');
			jQuery('input#remove').attr('value', 'Afmeld');
			jQuery('form#maillisttilmeld').submit();
		});
		
		jQuery("a#newslettertilmeld").click(function() {
			jQuery('input#add').attr('value', 'Tilmeld');
			jQuery('input#remove').attr('value', '');
			jQuery('form#maillisttilmeld').submit();
		});
	});

