jQuery.noConflict();


jQuery(document).ready(function() {


    jQuery("input, textarea").focus(function() {
        jQuery(this).animate({ backgroundColor: "#ffffff", borderColor: "#bbbbbb" }, 300);
    }).blur(function() {
        jQuery(this).animate({ backgroundColor: "#dfdfdf", borderColor: "#dfdfdf" }, 300);
    });


    jQuery("#homepage_brands > div").each(function() {
        jQuery(this).css("display", "none");
    });

    jQuery("#homepage_brands").css("display", "none");

    // z-index fix for Internet Explorer
    jQuery(function() {
        var zIndexNumber = 1000;
        jQuery('div').each(function() {
            jQuery(this).css('zIndex', zIndexNumber);
            zIndexNumber -= 10;
        });
    });


    jQuery("#dd_watches").mouseover(function() {
        jQuery("#nav_watches").attr("style", "color:#ffffff;");
    });

    jQuery("#dd_jewellery").mouseover(function() {
        jQuery("#nav_jewellery").attr("style", "color:#ffffff;");
    });

    // Dropdown Animation for Watches
    jQuery("#nav_watches").mouseover(function() {
        jQuery("#dd_watches").fadeIn("slow");
        jQuery("#nav_watches").addClass("nav_watches_hover");
        jQuery("#watcharrow").attr("src", "images/nav_arrow_hover.gif");

    });

    jQuery(".nav_watch_reset").mouseover(function() {
        jQuery("#dd_watches").css("display", "none");
        jQuery("#nav_watches").removeClass("nav_watches_hover");
        jQuery("#watcharrow").attr("src", "images/nav_arrow.gif");
        jQuery("#nav_watches").attr("style", "");
    });

    // Dropdown Animation for Jewellery
    jQuery("#nav_jewellery").mouseover(function() {
        jQuery("#dd_jewellery").fadeIn("slow");
        jQuery("#nav_jewellery").addClass("nav_jewellery_hover");
        jQuery("#jewelleryarrow").attr("src", "images/nav_arrow_hover.gif");
    });

    jQuery(".nav_jewellery_reset").mouseover(function() {
        jQuery("#dd_jewellery").css("display", "none");
        jQuery("#nav_jewellery").removeClass("nav_jewellery_hover");
        jQuery("#jewelleryarrow").attr("src", "images/nav_arrow.gif");
        jQuery("#nav_jewellery").attr("style", "");
    });

    // General reset box in header / general wrapper
    jQuery("#nav_reset").mouseover(function() {
        jQuery("#dd_watches").css("display", "none");
        jQuery("#dd_jewellery").css("display", "none");
        jQuery("#nav_watches").removeClass("nav_watches_hover");
        jQuery("#nav_jewellery").removeClass("nav_jewellery_hover");
        jQuery("#jewelleryarrow").attr("src", "images/nav_arrow.gif");
        jQuery("#watcharrow").attr("src", "images/nav_arrow.gif");
        jQuery("#nav_watches").attr("style", "");
        jQuery("#nav_jewellery").attr("style", "");
    });

    jQuery(".wrapper").mouseover(function() {
        jQuery("#dd_watches").css("display", "none");
        jQuery("#dd_jewellery").css("display", "none");
        jQuery("#nav_watches").removeClass("nav_watches_hover");
        jQuery("#nav_jewellery").removeClass("nav_jewellery_hover");
        jQuery("#jewelleryarrow").attr("src", "images/nav_arrow.gif");
        jQuery("#watcharrow").attr("src", "images/nav_arrow.gif");
        jQuery("#nav_watches").attr("style", "");
        jQuery("#nav_jewellery").attr("style", "");
    });

    jQuery("#brandnav_homepage > li.dynamic > a").click(function() {

        jQuery("#homepage_brands > div").each(function() {

            jQuery(this).css("display", "none");

        });

        jQuery("#brandnav_homepage > li > a").each(function() {
            jQuery(this).attr("class", "brandnav_off");

        });

        jQuery(this).attr("class", "brandnav_on");

        var selectedid = -1;

        jQuery("#" + this.id + " > span").each(function() {
            selectedid = jQuery(this).attr("id");
        });



        jQuery("#homepage_brand" + selectedid).fadeIn(1500);


        jQuery("#homepage_brands").slideDown();

        return false;
    });

    jQuery("#brandcloser").click(function() {
        jQuery("#brandnav_homepage > li > a").each(function() {
            jQuery(this).attr("class", "brandnav_off");

        });

        jQuery("#homepage_brands").slideUp();

    });


});






