/* ----- Main Menu functions ----- */

function paymentOptionStyle(){
    var doc = document.getElementById("payment_frame").contentWindow.document;
    var html = doc.getElementsByTagName("html")[0];
    var head = html.getElementsByTagName("head")[0];
    var siteLink = document.createElement("link")
    siteLink.rel = "stylesheet";
    siteLink.media = "screen";
    siteLink.type = "text/css";
    siteLink.href = "../css/payment_area.css";
    head.appendChild(siteLink);
}

function priceSlider(minVal, maxVal){
	if(minVal!=maxVal){
		$slider = $("#slider");
		$amountMin = $("#amountMin");
		$amountMax = $("#amountMax");
		$milestone1 = $("#milestone1");
		$slider.slider({
			range: true, // necessary for creating a range slider
			min: parseInt(minVal), // minimum range of slider
			max: parseInt(maxVal), // maximimum range of slider
			values: [parseInt(minVal), parseInt(maxVal)], //initial range of slider
			slide: function(event, ui){ // This event is triggered on every mouse move during slide.
				$amountMin.val(ui.values[0]);
				$amountMax.val(ui.values[1]);
				$('.ui-slider-range').css('background-image', imageUrl);
				
			},
			stop: function(event, ui){
				imageUrl = $('.ui-slider-range').css("background-image").replace('_over', '');
				$('.ui-slider-range').css('background-image', imageUrl);
				// Add the over again so when the user slides it will be shown
				imageUrl = $('.ui-slider-range').css("background-image").replace(".png", "_over.png");
				//Call ajax function here so the products are updated.
				// Example
				// $products.load('ajaxSlider.php?minValue='+ui.values[0]+'&maxValue='+ui.values[1],'',function() });
				EndecaHelperJS.refreshProductsByPriceRange(ui.values[0], ui.values[1]);
			}
			
		});
		imageUrl = $('.ui-slider-range').css("background-image").replace(".png", "_over.png");
		//preLoadImagePath = imageUrl.replace('url("','');
		//preLoadImagePath = preLoadImagePath.replace('")','');
		//jQuery.preLoadImages("slider_gradient_over.png", "preLoadImagePath");
		$amountMin.val($slider.slider("values", 0));
		$milestone1.html($slider.slider("values", 0));
		$amountMax.val($slider.slider("values", 1));
		var children = 0;
		if ($amountMax.val() - $amountMin.val() < 5) {
			children = $amountMax.val() - $amountMin.val() + 1;
		}
		else {
			children = $('#price-milestone-wrapper').children().size();
		}
		var mileStoneValue = new Number(0);
		var newPos = 0;
		var range = $slider.slider("values", 1) - $slider.slider("values", 0);
		var newValue = 0;
		for (i = 1; i <= children; i++) {
			if (i != 1) {
				mileStoneValue += (1 / (children - 1));
				newValue = Number($slider.slider("values", 0) + (range * mileStoneValue)).toFixed();
				$("#milestone" + i).html(newValue);
				var leftMargin = (100 / (children - 1)) * (i - 1);
				$("#milestone" + i).css("left", leftMargin + "%");
			}
			// 6.5 is the half the width of the slider button in px
			/*newPos = ($("#milestone"+ i).width()/2) - 5;
			
			 
			
			 $("#milestone"+ i).offset({top:$("#milestone"+ i).offset().top,   left:$("#milestone"+ i).offset().left - newPos });*/
			
		}
		
		$("#amountMin").blur(function(){
			$slider.slider("values", 0, Math.min($slider.slider("values", 1), parseInt($(this).val())));
			$(this).val(Math.min($slider.slider("values", 1), parseInt($(this).val())));
			EndecaHelperJS.refreshProductsByPriceRange($slider.slider("values", 0), $slider.slider("values", 1));
			
		});
		$("#amountMax").blur(function(){
			$slider.slider("values", 1, Math.max($slider.slider("values", 0), parseInt($(this).val())));
			$(this).val(Math.max($slider.slider("values", 0), parseInt($(this).val())));
			EndecaHelperJS.refreshProductsByPriceRange($slider.slider("values", 0), $slider.slider("values", 1));
		});
	}else{
		$("#page #main_content_wrapper .cl-side .price-range-container").css("display", "none");
	 
	}
}

var ddmenuitem = 0;
var delay = true;
var currentMenu;
$(document).ready(function(){
	$("#main-menu").mouseleave(function(){
		delay = true;
	});
});
	

function menuOpen(){

currentMenu =$(this);
 if(delay){
    
		$(this).addClass("delay");
		var timeout = setTimeout("delayMenuOpen()",500);
		 ddmenuitem = $(this).find("ul");
	
 }else{
    $(this).addClass("selected");

    ddmenuitem = $(this).find("ul").css("visibility", "visible");
     //  $("#page_shadow").addClass("products-background");
    $("#menu-shadow").css("display", "block");
 }
}

 function delayMenuOpen(){
 //alert(delay);
    if(delay){
		if($(currentMenu).hasClass("delay")){
       $(currentMenu).addClass("selected");
		delay = false;
        ddmenuitem = $(currentMenu).find("ul").css("visibility", "visible");
         //  $("#page_shadow").addClass("products-background");
        $("#menu-shadow").css("display", "block");
		}
    }
    
 }
function menuClose(){
    $(this).removeClass("delay");
    $(this).removeClass("selected");
    ddmenuitem.css("visibility", "hidden");
    $("#menu-shadow").css("display", "none");
    //  $("#page_shadow").removeClass("products-background");
	
	 //delay = true;
	
}


/* ----- end Main Menu ----- */

function repopulateShippingAddress(){
    if ($("#WC_MSOrderItemDetails_div_3_1ItemDetails_td_1_1 #WC_MSOrderItemDetails_div_3_1").length > 0) {
        if ($(".shippingMethods").length > 0) {
            $('shippingMethods').remove();
        }
        if ($(".shippingAddressTextArea").length > 0) {
            $('shippingAddressTextArea').remove();
        }
        if ($(".shippingAddressSelect").length > 0) {
            $('shippingAddressSelect').remove();
        }
        
        $("#WC_MSOrderItemDetails_td_1_1 select").clone(false).removeAttr("id").removeAttr('onchange').addClass('shippingAddressSelect').appendTo($(".shippingAddress"));
        $('.shippingAddressSelect').change(function(){
            $('#WC_MSOrderItemDetails_td_1_1 select').val($(this).val());
            $('#WC_MSOrderItemDetails_td_1_1 select').trigger("onchange");
        });
        
        $("#WC_MSOrderItemDetails_td_1_1 .shipping_address_MS_shipping_info_page div div:eq(0)").clone().addClass('shippingAddressTextArea').attr("id", "shippingAddressTextArea").appendTo($(".shippingAddress"));
        
        if ($(".editAddress").length == 0) {
            $("#WC_MSOrderItemDetails_td_1_1 .shipping_address_MS_shipping_info_page div div:eq(1)").clone().removeAttr("id").addClass('editAddress').appendTo($(".shippingAddress"));
        }
        if ($(".createAddress").length == 0) {
            $("#WC_MSOrderItemDetails_td_1_1 .shipping_address_MS_shipping_info_page div div:eq(2)").clone().removeAttr("id").addClass('createAddress').appendTo($(".shippingAddress"));
        }
        refreshShipingMethodData();
    }
}

function arrangeShippingBilling(){
    if ($("#WC_MSOrderItemDetails_td_1_1 #WC_MSOrderItemDetails_div_3_1").length > 0) {
        $("<div class='shippingAddress'> </div>").prependTo('#shipping');
        $("<h2>Shipping Address</h2>").prependTo('.shippingAddress');
        repopulateShippingAddress();
        $(".radioWrapper input:radio").click(function(){
            $(".radioWrapper").removeClass("selected");
            $("input:checked").parent().addClass("selected");
        });
        $(".radioWrapper").click(function(){
            $(".radioWrapper").removeClass("selected");
            $(this).find("input:radio").attr("checked", true);
            $("input:checked").parent().addClass("selected");
        });
    }
}

function refreshShipingMethodData(){
    count = 1;
    var html = '<div class="shippingMethods"></div>';
    $(html).insertAfter('.shippingAddress');
    var displayApplianceMethod = false;
    var displayAccessoryMethod = false;
    var applianceMethods = [];
    var accessoryMethods = [];
    while ($('#WC_MSOrderItemDetails_td_1_' + count).length > 0) {
        orderValue = $('#orderItem_' + count).val();
        //10551 is for appliances 10601 is for accesories
        ffmCenter = $('#ffmCenter_' + count).val();
        if (ffmCenter == "10551") {
            if (displayApplianceMethod == false) {
                displayApplianceMethod = true;
                var applianceSelected = $('#WC_MSOrderItemDetails_td_2_' + count + ' select').val();
                $('#MS_ShippingMode_' + orderValue + " option").each(function(){
                    applianceMethods[$(this).val()] = $(this).text();
                });
            }
            applianceMethods[0] = 'WC_MSOrderItemDetails_td_2_' + count;
            $('#WC_MSOrderItemDetails_td_2_' + count + ' select').addClass("applianceSelect");
        }
        if (ffmCenter == "10601") {
            if (displayAccessoryMethod == false) {
                var accessorySelected = $('#WC_MSOrderItemDetails_td_2_' + count + ' select').val();
                $('#MS_ShippingMode_' + orderValue + " option").each(function(){
                    accessoryMethods[$(this).val()] = $(this).text();
                });
                displayAccessoryMethod = true;
            }
            accessoryMethods[0] = 'WC_MSOrderItemDetails_td_2_' + count;
            $('#WC_MSOrderItemDetails_td_2_' + count + ' select').addClass("accessorySelect");
        }
        $('#WC_MSOrderItemDetails_td_1_' + count).addClass("shippingAddressTD");
        $('#WC_MSOrderItemDetails_td_2_' + count).addClass("shippingModeTD");
        count++;
    }
    if (displayApplianceMethod == true) {
        html = '<h2>Shipping Method for Appliances</h2>';
        $(html).appendTo('.shippingMethods');
        //html = '<input type="hidden" id="applianceShippingModeID" value="'+applianceMethods[0]+'" name="applianceShippingModeID">';
        //$(html).appendTo('.shippingMethods');
        for (var i in applianceMethods) {
        
            if (applianceSelected == i) {
                html = '<div onclick="changeSelectValues(' + i + ',\'' + applianceMethods[0] + '\');" class="radioWrapper selected"><input onchange="changeSelectValues(' + i + ',\'' + applianceMethods[0] + '\');" type="radio" name="appliance" value="' + i + '" checked="checked"> <span>' + applianceMethods[i] + '</span></div>';
                $(html).appendTo('.shippingMethods');
            }
            else 
                if (i != 0) {
                    html = '<div onclick="changeSelectValues(' + i + ',\'' + applianceMethods[0] + '\');" class="radioWrapper"><input onchange="changeSelectValues(' + i + ',\'' + applianceMethods[0] + '\');" type="radio" name="appliance" value="' + i + '"> <span>' + applianceMethods[i] + '</span></div>';
                    $(html).appendTo('.shippingMethods');
                }
        }
    }
    if (displayAccessoryMethod == true) {
        html = '<h2>Shipping Method for Accessories</h2>';
        $(html).appendTo('.shippingMethods');
        //	html = '<input type="hidden" id="accessoryShippingModeID" value="'+accessoryMethods[0]+'" name="accessoryShippingModeID">';
        //	$(html).appendTo('.shippingMethods');
        for (var i in accessoryMethods) {
            if (accessorySelected == i) {
                html = '<div onclick="changeSelectValues(' + i + ',\'' + accessoryMethods[0] + '\');" class="radioWrapper selected"><input onchange="changeSelectValues(' + i + ',\'' + accessoryMethods[0] + '\');" type="radio" name="accessory" value="' + i + '" checked="checked"><span>' + accessoryMethods[i] + '</span></div>';
                $(html).appendTo('.shippingMethods');
            }
            else 
                if (i != 0) {
                    html = '<div onclick="changeSelectValues(' + i + ',\'' + accessoryMethods[0] + '\');" class="radioWrapper"><input onchange="changeSelectValues(' + i + ',\'' + accessoryMethods[0] + '\');" type="radio" name="accessory" value="' + i + '"><span>' + accessoryMethods[i] + '</span></div>';
                    $(html).appendTo('.shippingMethods');
                }
        }
    }
}

function changeSelectValues(value, selectorId){
    $('#' + selectorId + ' select').val(value);
    $('#' + selectorId + ' select').trigger("onchange");
}

//dojo.addOnLoad(arrangeShippingBilling);

$(document).ready(function(){
    //arrangeShippingBilling();
    /*pop up for no support for ie6 */
    if ($.browser.msie && $.browser.version == "6.0") {
        $("#MessageArea").load("/other-assets/en_GB/ie6-popup/ie6.html");
        $("#MessageArea").dialog({
            modal: true,
            autoOpen: true
        });
    }
    /*end pop up for no support for ie6 */
    /*
    $("#main-menu > li").mouseenter(function(){
		var menu = $(this);
        setTimeout(function(){
            menu.addClass("selected");
            ddmenuitem = menu.find("ul").css("visibility", "visible");
            $("#menu-shadow").css("display", "block");
        }, 800);
        
    });*/
	$("#main-menu > li").mouseenter(menuOpen);
    $("#main-menu > li").mouseleave(menuClose);
    //  myaccountpage toggle menus
    $("span.header").bind("click", myAccountMenu);
    
    // set the value of the search input field
    if ($("#searchTermValue").html() && $("#searchTermValue").html().length > 0) {
        $("#searchTerm").val($("#searchTermValue").html());
    }
    // magnifying glass functionality for UK:
    $("#header .textsearch-container .glassLink").click(function(){
        $("#header .textsearch-container .search-textbox").focus();
        return false;
    });
    $("#header .textsearch-container .search-textbox").focus(function(){
        this.select();
    });
    
    // [checkout] Shipping Method Drop-Down width
    if ($.browser.msie) {
        $("select").fixSelect(200);
    }
    
});

/*
 Andrey Bolanos
 Fix select dropdown list in IE (width doesn't display full text / cut off)
 http://plugins.jquery.com/node/15415
 */
$.fn.fixSelect = function(minWidth){
    return (!($.browser.msie && $.browser.version < 9)) ? this : this.each(function(){
        if (this.tagName.toLowerCase() == 'select') {
            var el = this, $this = $(this), minWidth = minWidth ? minWidth : el.offsetWidth, elementWidth = $this.outerWidth(), $wrapper = $('<span class="selectFix"></span>').css({
                display: ($this.css('display') == 'block') ? 'block' : 'inline-block',
                cssFloat: $this.css('float'),
                overflowX: 'hidden',
                overflowY: 'visible',
                width: minWidth
            }), naturalWidth;
            $.each('marginTop marginRight marginBottom marginLeft'.split(' '), function(i, prop){
                $wrapper.css(prop, $this.css(prop));
                $this.css(prop, 0);
            });
            if ($this.is(':visible')) {
                $this.width('auto');
                naturalWidth = $this.outerWidth();
                $this.width(minWidth);
                $this.wrap($wrapper).bind('mousedown keyup applyfix', function(){
                    $this.width((naturalWidth < elementWidth) ? minWidth : 'auto');
                    if ($.browser.version == 6) 
                        $this.css('marginLeft', 1);
                }).blur(function(){
                    $this.width(minWidth);
                    if ($.browser.version == 6) 
                        $this.css('marginLeft', 0);
                }).bind('initfix', function(){
                    $this.width('auto');
                    naturalWidth = $this.outerWidth();
                    $this.width(minWidth);
                });
            }
        }
    });
}

function myAccountMenu(){

    var htmlText = $(this).html();
    
    if (htmlText == "Recent Orders") {
        if ($(this).hasClass('expanded')) {
            $(this).parent().removeClass('expanded');
            $(this).removeClass('expanded');
        }
        else {
            $(this).addClass('expanded');
            $(this).parent().addClass('expanded');
        }
        
        
        $(".order_status_table").toggle();
    }
    else 
        if (htmlText == "Products Recently Added to Wishlist") {
            if ($(this).hasClass('expanded')) {
                $(this).parent().removeClass('expanded');
                $(this).removeClass('expanded');
            }
            else {
                $(this).addClass('expanded');
                $(this).parent().addClass('expanded');
            }
            $("#four-grid").toggle();
        }
        else {
            exit;
        }
    
}

function toggleClass(e, add, remove){
    e.preventDefault();
    $(".body588").removeClass(remove);
    $(".body588").addClass(add);
}

function showInfo(e, classy, state){
    e.preventDefault();
    $(".personal-information").removeClass(classy);
    $(".form-div").addClass(classy);
    $(".form-div").addClass(state);
}

$(document).ready(function(){

    /*Uk MywishList page it's used to make the left menu same size as the content*/
    
    //$("#page #left_nav").height($(document).height());	
    $(".product_detail_page .product-carousel .carousel-item a").click(function(e){
        selectPic(e, this)
    });
    $("#page.product_detail_page .video_box .closeLink").click(function(){
        $("#page.product_detail_page .video_box img").trigger("click");
        return false;
    });
    $(".color-available li").click(colorPicker);
    //positionMiniCart();
    $(".ContactUs .ok_button").click(function(e){
        e.preventDefault();
        showHide(".contactus_form", "")
    });
    $(".ContactUs .send_request a").click(function(e){
        e.preventDefault();
        showHide(".thank_submission", "#by_e-mail_box,#by_mail_box,#by_phone_box,.tittle_text,.contactus_form")
    });
    $("#SameShippingAndBillingAddress").click(copyAddress);
    
    
    /*addressbook_.php*/
    $(document).ready(function(){
        $(".btn_edit").click(function(){
            $('.edit-form').show();
            $('#view-form').hide();
            $('.btn_remove').hide();
            $('.btn_edit').hide();
            $('.btn_update').show();
            
        });
        $(".btn_update").click(function(){
            $('.edit-form').hide();
            $('#view-form').show();
            $('.btn_remove').show();
            $('.btn_edit').show();
            $('.btn_update').hide();
        });
    });
    
    /*END addressbook_.php*/
    
    
    BindCompareCheckBoxes();
    
    /* ----- End Product List Page ----- */
    /* --------------------------------- */
    
    $(".PersonalInformationPage a.edit-button").click(function(e){
        showInfo(e, "showdiv", "")
    });
    $(".PersonalInformationPage a.update_link").click(function(e){
        showInfo(e, "showdiv", "error")
    });
    
    /* ----- language drop down ----- */
    $("#header .language-select").click(function(){
        if ($("#header .language-list").is(":visible")) {
            $("#header .language-list").fadeOut("fast");
        }
        else {
            $("#header .language-list").fadeIn("fast");
        }
        return false;
    });
    
    
    $("#header .language-list ul li a").click(function(){
        var lang = $(this).html();
        $("#header .language-select .current-language").html(lang);
        
        $("#header .language-list").fadeOut("fast");
        return false;
    });
    
    
    /*
     $( "#box .packages .summary .add-to-cart" ).click( function()
     {
     $( "#popup-added-to-cart" ).fadeIn( "fast" );
     $( "#popup-added-to-cart" ).center();
     return false;
     });
     
     */
    /*This is the functionality of the selector for display adress
     * by: Melania Gonzalez
     */
    $("#dropdown_1_a.adress-select").toggle(function(){
        $("#dropdown_1.adress-list").show();
        return false;
    }, function(){
        $("#dropdown_1.adress-list").hide();
        return false;
    });
    
    $("#dropdown_1_a.adress-select ul li a").toggle(function(){
        $("#dropdown_1.adress-list").show();
        return false;
    }, function(){
        $("#dropdown_1.adress-list").hide();
        return false;
    });
    /*END of code for select
     * by: Melania Gonzalez
     */
    $("#popup-added-to-cart a").click(function(){
        $("#popup-added-to-cart").fadeOut("fast");
        return false;
    });
    
    
    $("#box .choose-a-coupon").click(function(){
        $("#popup-choose-coupon").fadeIn("fast");
        $("#popup-choose-coupon").center();
        return false;
    });
    
    $("#popup-choose-coupon a").click(function(){
        $("#popup-choose-coupon").fadeOut("fast");
        return false;
    });
    
    
    $("#box .shipping-costs-container .shipping-costs-link").click(function(){
        $("#popup-shipping-costs").fadeIn("fast");
        $("#popup-shipping-costs").center();
        return false;
    });
    
    $("#popup-shipping-costs .close").click(function(){
        $("#popup-shipping-costs").fadeOut("fast");
        return false;
    });
    
    $("#box .promo-codes .ok").click(function(){
        $("#box .promo-codes .error-message").html("This code is not valid");
        return false;
    });
    
    
    $("#returning-customer-container .sign-in").click(function(){
        $("#returning-customer-container .email-error").slideDown("fast");
        $("#returning-customer-container .password-error").slideDown("fast");
        return false;
    });
    
    
    
    
    $("#order_details .increment, #order_details .decrement").click(function(){
        $("#popup-quantity-error").fadeIn("fast");
        $("#popup-quantity-error").center();
    });
    
    $("#popup-quantity-error .close").click(function(){
        $("#popup-quantity-error").fadeOut("fast");
        return false;
    });
    
    
    $(".table-compare-products .section-toggle").toggle(function(){
        var section = $(this).attr("section");
        $(".table-compare-products ." + section).fadeOut("fast");
        $(this).addClass("collapsed");
        var $dif = $(this).find("span.differences").fadeIn("fast");
        return false;
    }, function(){
        var section = $(this).attr("section");
        $(".table-compare-products ." + section).fadeIn("fast");
        $(this).removeClass("collapsed");
        var $dif = $(this).find("span.differences").fadeOut("fast");
        return false;
    });
    
    $(".table-compare-products .remove").click(function(){
        var col = $(this).attr("column");
        $(".table-compare-products ." + col).fadeOut("fast");
    });
    
    
    $(".search-results-page .button-compare").click(function(){
        var compares = "";
        $(".search-results-page .compare-checkbox:checked").each(function(index){
            if (compares.length > 0) {
                compares += "&";
            }
            compares += "compare[]" + "=" + $(this).attr("sku");
        });
        window.location = "CompareProductsDisplay.html?" + compares;
        return false;
    });
    
});


/* ----- Product Details Page ----- */

$(document).ready(function(){
    $(".send_share_link").click(function(){
        $("#popup-send-to-friend").show();
        return false;
    });
    
});

/*
 function closeAll()
 {
 $( ".selected" ).removeClass( "selected" );
 $( ".open" ).fadeOut( "fast" );
 }
 */
/* positions the mini cart hover over popup */
/*
 function positionMiniCart()
 {
 var pos = $( "#header .header_line2 a.popUpLinkHover" ).offset();
 if ( pos )
 {
 //	$( "#quick_cart_container" ).css( "left", ( pos.left - 20 ) + "px" );
 }
 }
 $( window ).resize( function()
 {
 positionMiniCart();
 });
 */
function copyAddress(e){
    //e.preventDefault();
    if ($(this).attr("checked")) {
        var source = $("#my_account_billing input");
        var dest = $("#my_account_shipping input");
        for (var i = 0; i < source.length - 1; i++) {
            $(dest[i + 1]).val($(source[i]).val());
        }
        var source = $("#my_account_billing select");
        var dest = $("#my_account_shipping select");
        for (var i = 0; i < source.length; i++) {
            $(dest[i]).val($(source[i]).val());
        }
    }
}

function colorPicker(e){
    selectPic(e, this, false);
    var text = $(this).children("img").attr("alt");
    $(".color-available li img").removeClass("selected");
    $(this).children("img").addClass("selected");
    $(this).closest("ul").siblings("p.selected_color").html(text);
}

var pictureProduct = "";

function selectPic(e, obj, flag){
    e.preventDefault();
    var c = $(obj).attr("className");
    var tempSelector = "";
    c = c.split(" ");
    var i = 0;
    while (c[i].indexOf("src|") == -1) {
        i++;
    }
    c = c[i].split("|");
    //Added the selector .video_box to avoid image load problems 
    tempSelector = ".video_box " + c[3];
    //Set original picture here 
    if (pictureProduct == "") 
        pictureProduct = $(tempSelector).attr("src");
    //Set a loading image
    $(tempSelector).attr("src", "/wcsstore/WERStorefrontAssetStore/images/colors/color2/loading.gif");
    //Set the new image
    $(tempSelector).attr("src", c[1]);
    $(tempSelector).click(selectPicOnClick);
    
    if (!flag) 
        $("#large img").attr("src", c[1].replace(".jpg", "_zoom.jpg"));
    $(c[3]).parent().next().css("display", "none");
    $(obj).parent().parent().parent().siblings(".video_box").css("margin-bottom", "100px");
    $(obj).parent().parent().parent().siblings(".video_box").css("width", "650px");
    $("#page.product_detail_page .video_box .closeLink").css("display", "block");
}

function selectPicOnClick(){
    $("#page.product_detail_page .video_box .closeLink").css("display", "none");
    $("#page.product_detail_page .video_box img").attr("src", pictureProduct);
    $(this).parent().next().css("display", "block");
    $(this).parent().css("margin-bottom", "0px");
    $(this).parent().css("width", "350px");
}

function showHide(show, hide){
    $(show).css("display", "block");
    $(hide).css("display", "none");
}

/* --------------------------- */
/* ----- Glossary Popups ----- */

var glossaryPos;

// fired when someone clicks on a ? icon
function glossaryPopup(storeId, catalogId, langId, term, obj){
    var link = "/webapp/wcs/stores/servlet/WHRGlossaryPopupDisplayView?storeId={0}&catalogId={1}&langId={2}&term={3}";
    //	var link = "ajax_glossary.php?storeId={0}&catalogId={1}&langId={2}&term={3}";
    
    //link = link.replace( "{0}", storeId ).replace( "{1}", catalogId ).replace( "{2}", langId ).replace( "{3}", term ); WHPUK-822
    link = link.replace("{0}", storeId).replace("{1}", catalogId).replace("{2}", langId).replace("{3}", encodeURIComponent(term));
    glossaryPos = $(obj).offset();
    
    if ($("#question-tooltip").length > 0) {
        $("#question-tooltip").remove();
    }
    
    $.ajax({
        url: link,
        success: glossaryPopupSuccess
    });
    
    return false;
}

// positions the glossary popup, loads the data that was returned
function glossaryPopupSuccess(data, textStatus, xhr){
    $("#page").append(data + '<div class="glossPos">' + ' - ' + glossaryPos.top + '</div>');
    if ($.browser.webkit) {
        $("#question-tooltip").css({
            "top": glossaryPos.top - $("#page").position().top + "px",
            "left": ((glossaryPos.left - $("#page").position().left) - 171) + "px"
        });
    }
    else {
        $("#question-tooltip").css({
            "top": glossaryPos.top - $("#page").position().top + "px",
            "left": glossaryPos.left - $("#page").position().left + "px"
        });
    }
    $("#question-tooltip .closeLink").click(function(){
        $("#question-tooltip").fadeOut("fast");
        return false;
    });
    
    $("#question-tooltip").fadeIn("fast");
}

/* ----- END Glossary Popups ----- */
/* ------------------------------- */

/* ------------------------- */
/* ----- Glossary Page ----- */

$(document).ready(function(){
    $("#page.glossary .category ul.category_item li a").click(function(){
        if ($(this).parent().hasClass("expanded")) {
            $(this).parent().removeClass("expanded");
            $(this).siblings(".glossary_content").slideUp("fast");
        }
        else {
            $(this).parent().addClass("expanded");
            $(this).siblings(".glossary_content").slideDown("fast");
        }
        return false;
    });
    
    
    $("#page.glossary #glossary a.open-all").click(function(){
        $("#page.glossary .category ul.category_item li").each(function(){
            if (!$(this).hasClass("expanded")) {
                $(this).addClass("expanded");
            }
            $("#page.glossary .category ul.category_item li .glossary_content").slideDown("fast");
        });
        return false;
    });
    
    
    $("#page.glossary #glossary a.close-all").click(function(){
        $("#page.glossary .category ul.category_item li").each(function(){
            if ($(this).hasClass("expanded")) {
                $(this).removeClass("expanded");
            }
            $("#page.glossary .category ul.category_item li .glossary_content").slideUp("fast");
        });
        return false;
    });
    
});

/* ----- END Glossary Page ----- */
/* ----------------------------- */


/* ----- FAQ Page ----- */

$(document).ready(function(){

    $(".open-close li.close-link a").click(function(e){
        expandCollapse(e, this, 1)
    });
    $(".open-close li.open-link a").click(function(e){
        expandCollapse(e, this, 2)
    });
    
    $(".send-print li.print-a print-a").click(function(e){
        $(".open-close li.open-link a").click();
    });
    
    $("#page.faqPage .open-link .open-a").click(function(){
        $("#page.faqPage .content-faq .faqList .faqItem .faqQuestion .faqAnswer").each(function(){
            if (!$(this).hasClass("expanded")) {
                $(this).addClass("expanded");
            }
            $("#page.faqPage .content-faq .faqList .faqItem .faqQuestion .faqAnswer").slideDown("fast");
        });
        return false;
    });
    
    $("#page.faqPage .close-link .close-a").click(function(){
        $("#page.faqPage .content-faq .faqList .faqItem .faqQuestion .faqAnswer").each(function(){
            if ($(this).hasClass("expanded")) {
                $(this).removeClass("expanded");
            }
            $("#page.faqPage .content-faq .faqList .faqItem .faqQuestion .faqAnswer").slideUp("fast");
        });
        return false;
    });
});


// This will bind the click events of the Compare checkboxes on the product list page
function BindCompareCheckBoxes(){
    searchResultConf();
    fixStyleProductListPage();
    fixPersonalInformation();
    // Add compare checkboxes the event Click   
    $(".compare-product .compare-product-chk").click(CompareCheckBoxes);
    if (getCookie(cookieItemProducts) != null) {
        getCheckboxCookie();
    }//end if cookie
    $(".compare-product a.compare_link").click(function(e){
        e.preventDefault();
        var itemsChecked;
        if (getCookie(cookieItemProducts) == null) 
            itemsChecked = 0;
        else {
            var arrayItems = getCookie(cookieItemProducts).split("|");
            itemsChecked = arrayItems.length - 1
        }
        if ($(this).siblings(".compare-product-chk").attr("checked") == true) {
            $(this).siblings(".compare-product-chk").attr("checked", false);
            $(this).siblings(".compare-product-chk").click();
            $(this).siblings(".compare-product-chk").attr("checked", false);
        }
        else {
            if (itemsChecked < 4) {
                $(this).siblings(".compare-product-chk").attr("checked", true);
                $(this).siblings(".compare-product-chk").click();
                $(this).siblings(".compare-product-chk").attr("checked", true);
            }
            else {
                showPopupCss("#compare-products-error-popup-v2");
            }
        }
    });
    /*End*/
}

/*This method is going to update the values and styles chechbox and also management the cookie of the items to compare
 By: Victor Redondo Quiros, July 23, 2010
 */
function CompareCheckBoxes(){
    var itemsChecked;
    if (getCookie(cookieItemProducts) == null) 
        itemsChecked = 0;
    else {
        var arrayItems = getCookie(cookieItemProducts).split("|");
        itemsChecked = arrayItems.length - 1
    }
    if (itemsChecked <= 4) {
        if ($(this).attr("checked") == true) {
            if (itemsChecked < 4) {
                var tempItems;
                if (getCookie(cookieItemProducts) == null) {
                    setCookie(cookieItemProducts, "");
                    tempItems = "";
                }
                else 
                    tempItems = getCookie(cookieItemProducts);
                
                tempItems += $(this).attr("sku") + "|"
                setCookie(cookieItemProducts, tempItems);
            }
            else {
                $(this).attr("checked", false);
                showPopupCss("#compare-products-error-popup-v2");
            }
        }
        else {
            var sku = $(this).attr("sku");
            var arrayItems = getCookie(cookieItemProducts).split("|");
            var tempItems = "";
            var index = 0;
            for (index = 0; index < arrayItems.length; index++) {
                if ((sku != arrayItems[index]) && (arrayItems[index] != "")) {
                    tempItems += arrayItems[index] + "|";
                }
                else {
                    $(".product-list-header-controls .product-list-header .compare-controls ul li .checked:eq(" + index + ")").attr("sku", "");
                    $(".product-list-header-controls .product-list-header.list-bottom .compare-controls ul li .checked:eq(" + index + ")").attr("sku", "");
                }//end if sku
            }//end for arrayItems
            setCookie(cookieItemProducts, tempItems);
        }//end if checked
        getCheckboxCookie();
    }
    else {
        $(this).attr("checked", false);
        showPopupCss("#compare-products-error-popup-v2");
    }//end if itemsChecked
}

/*This method is going to swicht the style names of the checkboxs and sku values too
 By: Victor Redondo Quiros, July 23, 2010
 */
var IE = /*@cc_on!@*/ false;

function getCheckboxCookie(){
    if (getCookie(cookieItemProducts) != null) {
        var arrayItems = getCookie(cookieItemProducts).split("|");
        var itemsChecked = arrayItems.length - 1;
        $(".compare-controls ul li .checked").removeClass("checked").addClass("unchecked");
        var selector = ".product-list-header-controls .product-list-header .compare-controls ul li .unchecked:lt(" + itemsChecked + ")";
        if ($(".product_detail_page").length == 0) {
            $(selector).removeClass("unchecked").addClass("checked");
            selector = ".product-list-header-controls .product-list-header.list-bottom .compare-controls ul li .unchecked:lt(" + itemsChecked + ")";
            $(selector).removeClass("unchecked").addClass("checked");
        }
        else {
            selector = ".compare-controls ul li .unchecked:lt(" + itemsChecked + ")";
            $(selector).removeClass("unchecked").addClass("checked");
        }
        var indexItem = 0;
        for (indexItem = 0; indexItem <= itemsChecked; indexItem++) {
            var valueIndex = arrayItems[indexItem];
            if (valueIndex != "") {
                if ($(".product_detail_page").length == 0) {
                    selector = ".product-list-header-controls .product-list-header .compare-controls ul li .checked:eq(" + indexItem + ")";
                    $(selector).attr("sku", valueIndex);
                    selector = ".product-list-header-controls .product-list-header.list-bottom .compare-controls ul li .checked:eq(" + indexItem + ")";
                    $(selector).attr("sku", valueIndex);
                    selector = ".compare-product .compare-product-chk[sku|=" + valueIndex + "]";
                }
                else {
                    selector = ".compare-controls ul li .checked:eq(" + indexItem + ")";
                    $(selector).attr("sku", valueIndex);
                    selector = ".compare-product .compare-product-chk[sku|=" + valueIndex + "]";
                }//end if product_detail_page        
                $(selector).attr("checked", true);
            }//end if valueIndex
        }//end for arrayItems
        var counter = itemsChecked;
        if (IE) 
            counter = counter + "&nbsp;";
        $(".compare-controls .compare-link .count").html(counter);
        if (itemsChecked == 1) {
            $(".compare-controls .compare-link .count").html("");
        }
    }
    else {
        $(".compare-controls ul li .checked").removeClass("checked").addClass("unchecked");
        $(".compare-controls ul li .compare-prod").attr("sku", "");
        $(".compare-controls .compare-link .count").html("");
    }
}


//Content Pages - Landing Pages
$(document).ready(function(){
    var object = ".expanded_freshness";
    $(object).click(function(e){
        content_landing_expandCollapse(e, this, object, 0)
    });
    
    object = ".expanded_defrosting";
    $(object).click(function(e){
        content_landing_expandCollapse(e, this, object, 0)
    });
    
});

function content_landing_expandCollapse(e, This, object, openall){

    if ($(This).hasClass('expanded')) {
        $(This).removeClass('expanded');
    }
    else {
        $(This).addClass('expanded');
    }
    
    $(object + ".content").toggle();
}

function cleanCookie(){
    if (getCookie(cookieLocation) != null) {
        if (getCookie(cookieLocation) != location.pathname) {//is not a refresh
            if ($(".product_detail_page").length == 0) {
                var tempCookie;
                tempCookie = "";
                setCookie(cookieItemProducts, tempCookie);
                var currentPath = "";
                currentPath = location.pathname;
                setCookie(cookieLocation, currentPath);
                var currentSearchTerm = "";
                currentSearchTerm = getUrlVars()["searchTerm"];
                if (currentSearchTerm == undefined) 
                    currentSearchTerm = "";
                setCookie(cookieSearchTerm, currentSearchTerm);
                cleanCompareBoxs();
            }
        }
        else {
            var currentSearchTerm = "";
            currentSearchTerm = getUrlVars()["searchTerm"];
            if (currentSearchTerm == undefined) 
                currentSearchTerm = "";
            if (getCookie(cookieSearchTerm) != null) {
                if (getCookie(cookieSearchTerm) != currentSearchTerm) {
                    var tempCookie;
                    tempCookie = "";
                    setCookie(cookieItemProducts, tempCookie);
                    setCookie(cookieSearchTerm, currentSearchTerm);
                    cleanCompareBoxs();
                }
            }
            else {
                setCookie(cookieSearchTerm, currentSearchTerm);
            }
        }
    }
    else {
        var currentSearchTerm = "";
        currentSearchTerm = getUrlVars()["searchTerm"];
        if (currentSearchTerm == undefined) 
            currentSearchTerm = "";
        setCookie(cookieLocation, location.pathname);
        setCookie(cookieSearchTerm, currentSearchTerm);
    }
}

/*
 * Config variables for make enable the cookie functionality
 * By: Victor Redondo Quiros
 * */
var cookieOptions = {
    path: '/',
    expires: 10
};
var cookieItemProducts = "compareItemsUk";
var cookieLocation = "locationPathUk";
var cookieSearchTerm = "searchTermPathUk";

$(window).load(function(){
    cleanCookie();
});

function getCookie(cookieName){
    return $.cookie(cookieName);
}

function setCookie(cookieName, cookieValue){
    $.cookie(cookieName, cookieValue, cookieOptions);
}

/*This method get the parameters from the URL
 By: Victor Redondo Quiros, 9 Ago, 2010*/
function getUrlVars(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

function cleanCompareBoxs(){
    var tempCookie;
    tempCookie = "";
    setCookie(cookieItemProducts, tempCookie);
    $(".compare-product .compare-product-chk").attr("checked", false);
    $(".compare-controls ul li .checked").removeClass("checked").addClass("unchecked");
    $(".compare-controls ul li .compare-prod").attr("sku", "");
    $(".compare-controls .compare-link .count").html("");
}

/*
 * This method put the events mouse over and out for the products, basically it enable the
 * background animation when the user put the mouse over or out from it
 * By: Victor Redondo Quiros, 29 July,2010
 */
$(window).load(function(){
    $("#quick_cart .container .list .product").mouseover(quickCartProductMouseOver);
    $("#quick_cart .container .list .product").mouseout(quickCartProductMouseOut);
    $(".close_shopping_cart .close_shopping_cart_item").click(function(e){
        e.preventDefault();
        $(this).closest(".quick_cart_container").css("visibility", "hidden");
    });
});

/*
 * This method catch the event mouseOver from the products on the quickCart
 * By: Victor Redondo Quiros, 29 July,2010
 */
function quickCartProductMouseOver(){
    $(this).next().height($(this).height());
    $(this).addClass("order_link_bg");
    $(this).next().addClass("order_link_bg");
}

/*
 * This method catch the event mouseOut from the products on the quickCart
 * By: Victor Redondo Quiros, 29 July,2010
 */
function quickCartProductMouseOut(){
    $(this).removeClass("order_link_bg");
    $(this).next().removeClass("order_link_bg");
}

/*
 * This is for the Share in the Wishlist. Makes visible the right nav and sends focus to form
 * Juan Jimenez, Jul/29/2010
 */
function wishListBind(){
    $("div#right_nav").css('display', 'none');
    $("input#SendWishListForm_Recipient_Email").focus();
}

/*
 * Add product to cart (change button on ajax success)
 * Andrey Bolanos Sandoval Ago/02/2010
 */
function successAddedItemToCart(buttonAddToCartRef){
    // When button is clicked location change to NULL, �maybe it should link to cart page?
    $(buttonAddToCartRef).removeClass("add-to-cart").addClass("added-to-cart").html("In Your Cart").removeAttr("href");
}

/*Scripts necesary for the Content pages*/

/*starts our_history script___Andres Lopez*/
$(document).ready(function(){
    $(".date_lst li a").click(selected_date);
});
function selected_date(e){
    e.preventDefault();
    $(".date_lst li a img").css("visibility", "hidden");
    $(this).children().css("visibility", "visible");
    
    $(".date").removeClass("selected");
    var className = $(this).attr("class");
    var selector = "#" + className.split("-")[1];
    $(selector).addClass("selected");
}

/*ends our history script*/

/*starts our_vision script___Allan Estrada*/

$(document).ready(function(){
    $(".descriptions_lst li a").click(selected_item);
});
function selected_item(e){
    e.preventDefault();
    $(".descriptions_lst li a img").css("visibility", "hidden");
    $(this).children().css("visibility", "visible");
    
    $(".descriptions").removeClass("selected");
    var className = $(this).attr("class");
    var selector = "#" + $(this).attr("class");
    $(selector).addClass("selected");
}

/*starts your_carrer_at_whirpool script___Andres Lopez*/
$(document).ready(function(){
    $("#your_career_whirlpool_content ul.career_boxes li .testimonial_box .testimonials_link").click(selected_test);
    $(".test_pop .closeLink").click(closeTestPop);
    
    $("#amountMin").focus(function(){
        // Select input field contents
        this.select();
    });
    
    $("#amountMax").focus(function(){
        // Select input field contents
        this.select();
    });
    
});
$(document).ready(function(){
    $("#why_work_whirlpool_content .testimonial_box .testimonial_link").click(selected_test);
});
function selected_test(e){
    e.preventDefault();
    var selector = $(this).attr("id");
    
    $(".test_pop").css("display", "none");
    
    switch (selector) {
        case "test_Content1":
            showPopupCss("#intcartestimony");
            break;
        case "test1":
            showPopupCss("#careertesti1");
            break;
        case "test2":
            showPopupCss("#careertesti2");
            break;
        case "test3":
            showPopupCss("#careertesti3");
            break;
        case "test6":
            showPopupCss("#careertesti6");
            break;
    }
}

function closeTestPop(e){
    $(".test_pop").fadeOut("fast");
    return false;
    
}

/*ends your_carrer_at_whirpool script*/
function searchResultConf(){
    if ($(".search-results-page").length > 0) {
        var currentSearchTerm = "";
        //Sometimes when filter, the searchTerm var contains some text after a '#' char
        try {
            currentSearchTerm = (getUrlVars()["searchTerm"]).split('#')[0];
        } 
        catch (err) {
            currentSearchTerm = "";
        }
        if (currentSearchTerm != undefined) {
            if (currentSearchTerm != "") {
                $(".search-results-page").highlight(currentSearchTerm);
                $("#ajaxRefreshURL").removeHighlight();
            }
        }
        if ($("div.list-view").length > 0) {
            $("div.list-view .product-row").each(function(){
                var titleHeight = $(this).find(".product-title-link").height();
                $(this).find(".product-primaryactiongroup").css("marginTop", "-" + titleHeight + "px");
                $(this).find(".image-group").css("marginTop", "-" + titleHeight + "px");
            });
        }
        //Line moved here, because an IE bug
        $("#left_nav_container").css("height", ($("#content_wrapper_box").height() - 66) + "px");
    }
}

function printPage(){
    window.print();
}

$(document).ready(function(){
    if ($("#page.product_detail_page").length > 0) {
        $("input.color-product-radio").click(function(){
            $(".color-available li").unbind("click");
            $("input.color-product-radio").attr("checked", false);
            $(this).attr("checked", true);
        });
    }
});
function fixStyleProductListPage(){
    if ($("#page.productlist-page").length > 0) {
        if ($("div.list-view").length > 0) {
            $("div.list-view .product-row").each(function(){
                var titleHeight = $(this).find(".product-title-link").height();
                if ($(this).find(".add-to-cart").length > 0) {
                    $(this).find(".add-to-cart").css("marginTop", "21px");
                    $(this).find(".add-to-wishlist").css("marginTop", "8px");
                }
                $(this).find(".product-primaryactiongroup").css("top", "-" + titleHeight + "px");
                if ($.browser.webkit) {
                    $(this).find("a.product-link").css("paddingLeft", "20px");
                }
                
            });
        }
    }
}

$(document).ready(function(){
    //fixHeadCrumbBar
    if ($("#page.OrderShippingBillingView .crumb").length > 0) {
        var htmlChanged = $("#page.OrderShippingBillingView .crumb").html().replace("|", " ");
        htmlChanged = jQuery.trim(htmlChanged);
        htmlChanged = htmlChanged.replace(/\n/g, ' ');
        htmlChanged = htmlChanged.replace("|", ' ');
        htmlChanged = htmlChanged.replace(/[|]/g, ' ');
        $("#page.OrderShippingBillingView .crumb").html(htmlChanged);
        $("#page.OrderShippingBillingView .crumb span:gt(0)").each(function(){
            if ($(this).hasClass("on")) {
                $(this).before("<img src='/images/arrow_status_green.jpg' style='vertical-align: bottom;'>");
            }
            else {
                $(this).before("<img src='/images/arrow_status_grey.jpg' style='vertical-align: bottom;'>");
            }
        });
    }
    
    if ($("#page.OrderSummary .crumb").length > 0) {
        var htmlChanged = $("#page.OrderSummary .crumb").html().replace("|", " ");
        htmlChanged = jQuery.trim(htmlChanged);
        htmlChanged = htmlChanged.replace(/\n/g, ' ');
        htmlChanged = htmlChanged.replace("|", ' ');
        htmlChanged = htmlChanged.replace(/[|]/g, ' ');
        $("#page.OrderSummary .crumb").html(htmlChanged);
        $("#page.OrderSummary .crumb span:gt(0)").each(function(){
            if ($(this).hasClass("on")) {
                $(this).before("<img src='/images/arrow_status_green.jpg' style='vertical-align: bottom;'>");
            }
            else {
                $(this).before("<img src='/images/arrow_status_grey.jpg' style='vertical-align: bottom;'>");
            }
        });
    }
    
    //FixHeigthMemberPages
    if (($("#page.ContentPage.submenu").length > 0) ||
    ($("#page.ContentPage.generic").length > 0) ||
    ($("#page.ContentPage.glossary").length > 0) ||
    ($("#page.search-results-page").length > 0)) {
        if ($("#left_nav").height() < $("#left_nav").next().height()) {
            $("#left_nav").css("height", $("#left_nav").next().height() + "px");
        }
        else {
            var tempHeight = $("#left_nav").height() + 8;
            $("#left_nav").next().css("height", tempHeight + "px");
            $("#left_nav").css("height", tempHeight + "px");
        }
        if ($(".leftnav-title").height() < $(".leftnav-title").next().height()) {
            $(".leftnav-title").css("height", $(".leftnav-title").next().height() + "px");
        }
        else {
            var tempHeight = $(".leftnav-title").height() + 8;
            $(".leftnav-title").next().css("height", tempHeight + "px");
            $(".leftnav-title").css("height", tempHeight + "px");
        }
        if ($(".left_nav_container").height() < $(".left_nav_container").next().height()) {
            var tempHeight = $(".left_nav_container").next().height() - 78;
            $(".left_nav_container").css("height", tempHeight + "px");
        }
        else {
            var tempHeight = $(".left_nav_container").height() + 8;
            $(".left_nav_container").next().css("height", tempHeight + "px");
            $(".left_nav_container").css("height", tempHeight + "px");
        }
    }
    //fixContactUsPage
    if ($("#page.ContactUs").length > 0) {
        $("#page.ContactUs").addClass("ContentPage");
    }
});
function fixPersonalInformation(){
    if ($("#WC_PersonalInfoExtension_mobile_div_mobileCountryCode").length > 0) {
        var parentPhoneExt = $("#WC_PersonalInfoExtension_mobile_div_mobileCountryCode").parent();
        $(parentPhoneExt).children("input").before("#WC_PersonalInfoExtension_mobile_div_mobileCountryCode");
    }
}

/*fix position of discover whirlpool tab on page like 404,500 and session timeout*/
$(document).ready(function(){
    if (($("#error404").length > 0) || (($("#error500").length > 0)) || (($("#session").length > 0))) {
        $("#main-menu .menu .menu-header-short").css("left", 215 + "px");
    }
});


/* script for Glamour page backrgound*/
$(document).ready(function (){
	if(($("#glamour").length > 0)){
		$("#page").css("background","none").css("marginTop","45px");
		$("body").css("background","url('../images/bg_glamour-line.jpg') no-repeat scroll center 0 #FFFFFF");
	}
});
/* script for Max limited edition page background*/
$(document).ready(function (){
	if(($("#max").length > 0)){
		$("#page").css("background","none").css("marginTop","45px");
		$("body").css("background","url('../images/bg_sensing.jpg') no-repeat scroll center 0 #FFFFFF");
	}
});
/* script for Fusion background*/
$(document).ready(function (){
	if(($(".fusion_page").length > 0)){
		$("#page").css("background","none").css("marginTop","45px");
		$("body").css("background","url('../images/bg_sensing.jpg') no-repeat scroll center 0 #FFFFFF");
	}
});
/* script for Ambient Page Fusion */
$(document).ready(function (){
	if(($(".ambient_page").length > 0)){
		$("#page").css("background","none").css("marginTop","45px");
		$("body").css("background","url('/images/en_GB/marketing-landing-pages/ambient/bg_ambient-line.jpg') no-repeat scroll center 0 #FFFFFF");
	}
});
/* script for nova page backrgound*/
$(document).ready(function (){
	if(($("#nova").length > 0)){
		$("#page").css("background","none").css("marginTop","45px");
		$("body").css("background","url('/images/en_GB/marketing-landing-pages/nova/LP_Nova_UK_background.jpg') no-repeat scroll center 0 #FFFFFF");
	}
});
