function showForgottonPassword() {

    // Show the forgotton password page
    window.open('/forgotton-password.aspx', 'forgotPassword', 'width=440,height=360,resizable=no,toolbar=no,location=no,directories=no,status=yes,menubar=no');

}

function showActivationForm() {

    // Show the activation form page
    window.open('/activate-account.aspx', 'accountActivation', 'width=650,height=750,resizable=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes');

}

function showBecomeMember() {
   
    // Show the become a member page
    window.open('/become-member.aspx', 'becomeMember', 'width=700,height=650,resizable=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes');

}

function launchProductWindow(imageID) {

    // Show the activation form page
    window.open('/product-image.aspx?image_id=' + imageID, 'productImage', 'width=460,height=460,resizable=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0');

}

// Add Accordion Functionality
// Set the accordion menu if it exists on the page
$(document).ready(function() {

//    $(document).pngFix(); 

    // If the link contains the 'skincare', activate the accordion submenu
	var pageUrl = window.location.toString();

	$("ul.submenu").hide();

	if ((pageUrl.indexOf("skincare") != -1) || (pageUrl.indexOf("rewards.aspx") != -1)) {

        $("#dhtml-leftnav").accordion({
            header: "a.parent-main",
            alwaysOpen: false,
            active: "#drlewinns-skincare-menu"
        });

        $("li.skincare ul.submenu").show();

        $("#dhtml-leftnav li.topmenu a.skincare").addClass("active-menuitem");

       } else if ((pageUrl.indexOf("juice-beauty") != -1) || (pageUrl.indexOf("juice-beauty.aspx") != -1)) {

       	$("#dhtml-leftnav").accordion({
       		header: "a.parent-main",
       		alwaysOpen: false,
       		active: "#drlewinns-skincare-menu"
       	});

		
       	$("li.juice-beauty ul.submenu").show();

       	$("#dhtml-leftnav li.topmenu a.juice-beauty").addClass("active-menuitem");

       } else {

		$("#dhtml-leftnav").accordion({
            header: "a.parent",
            alwaysOpen: false
        }).accordion("activate", -1);

    }

    if (pageUrl.indexOf("/vouchers.aspx") != -1) {

        $("#dhtml-leftnav li.topmenu a.vouchers").addClass("active-menuitem");

    }

    if (pageUrl.indexOf("/jewellery-watches.aspx") != -1) {

        $("#dhtml-leftnav li.topmenu a.jewellery").addClass("active-menuitem");

    }

    if (pageUrl.indexOf("/accessories.aspx") != -1) {

        $("#dhtml-leftnav li.topmenu a.accessories").addClass("active-menuitem");

    }

    if (pageUrl.indexOf("/technology.aspx") != -1) {

        $("#dhtml-leftnav li.topmenu a.technology").addClass("active-menuitem");

    } 

    // Add the category list item last class
    $("#product-category-list li:last-child").addClass("last");

});

function gotoSkincareRewards() {

	window.location = "/members/rewards.aspx";

}

function gotoJuiceRewards() {

	window.location = "/members/rewards/juice-beauty.aspx";

}
