﻿$(document).ready(function(){
    var price;
    var retailprice;
    var specialprice;

$(window).load(
    function() {
    $(".PriceContainer").each(
        function( intIndex ){
            price = $(this).find(".price:first");                    
            retailprice = $(this).find(".retailprice:first");
            specialprice = $(this).find(".specialprice:first");
            
            //alert("");
            if($(specialprice).text() != "")
            {
                $(price).prepend("Normal pris: ");
                $(price).append(" DKK");
                $(price).css({"font-size":"11px","text-decoration":"line-through"});
                
                
                //$(specialprice).prepend("Udsalgspris: ");
                $(specialprice).append(" DKK");
                $(specialprice).css({"font-weight":"bold","color":"#58434C"});               
            }
            else
            {
                //$(price).prepend("Pris: ");
                $(price).append(" DKK");
                $(price).css({"font-weight":"bold","color":"#58434C"});                    
            }
            
            if($(retailprice).text() != "")
            {
                var txt = $(retailprice).html().replace("DKK","");
                $(retailprice).html(txt);
                $(retailprice).append("DKK");
                
            }
            else
            {
                $(retailprice).css("display","none");
            }
                                
    });
    
//	while(x<100) {
//		$('.blink').fadeOut(2000); 
//		$('.blink').fadeIn(2000); 
//		x++;
//    }    
    }
);


    
    if ($("#RelText").text() == "")
    {
        $("#RelText").css("display","none");
    }
    
    var location = document.location.pathname.split('/');
    $("#ShopLayOut_Topmenu_TD a").each(  
        function( intIndex ){
            var href = $(this).attr("href");
            if(href == '/' + location[location.length-2] + '/' + location[location.length-1])
            {
                $(this).addClass("topmenuover");
            }
            else
                $(this).addClass("topmenu");
                
    }); 
    
    //Knapper på Orderstep1
    var isOnOrder1 = $("#ShopLayOut_Content_TD .SubmitButton_Orderstep1");
    if (isOnOrder1.length == 2)
    {
        $(isOnOrder1[0]).addClass("hentButton");
        $(isOnOrder1[1]).addClass("videreButton");
    }
    if (isOnOrder1.length == 1)
    {
        $(isOnOrder1[0]).addClass("videreButton");
    }    
    

});

