﻿jQuery.noConflict();

jQuery(document).ready(function() {
    jQuery('.navigationModuleMenu ul li a').prepend('&gt; ');
    jQuery('.navigationModuleMenu > li:nth-child(2) ul:first').addClass('products');
    //jQuery('#navigation .navigationModuleMenu').superfish();

    jQuery('.galleryItems div img').each(function() {
        jQuery(this).css('cursor', 'pointer');
        jQuery(this).hover(function() {
            this.src = this.src.replace('.jpg', '_hover.jpg');
        }, function() {
            this.src = this.src.replace('_hover.jpg', '.jpg');
        }).click(function() {
            jQuery('#galleryMain')[0].src = this.src.replace('_thumb', '').replace('_hover.jpg', '.jpg');
        });
    });

    jQuery('#defaultLeftCol .leftBox .leftBoxInner span > *').css('padding-left', '10px');

    var homeGrey = jQuery('#homeGrey');
    if (homeGrey) {
        var homeGreyChildren = homeGrey.find('.homeGreyCol *');
        if (jQuery.grep(homeGreyChildren, function(i) { return i.tagName.toLowerCase() != 'span' }).length == 0) {
            homeGrey.remove();
        }
    }

    jQuery('.ODManagement a').click(function() {
        jQuery(this).parent().parent().parent().find('.managementInfo').toggle();
    });

    jQuery('#navigation .navigationModuleMenu li').hover(function() {
        jQuery(this).addClass('sfHover');
    }, function() {
        jQuery(this).removeClass('sfHover');
    });
});

function sfHover() {
    var sfEls = jQuery('#navigation .navigationModuleMenu:first')[0].getElementsByTagName("LI");
    for (var i = 0; i < sfEls.length; i++) {
        sfEls[i].onmouseover = function() {
            this.className += " sfHover";
        }
        sfEls[i].onmouseout = function() {
            this.className = this.className.replace(new RegExp(" sfHover\\b"), "");
        }
    }
}