var initSubmenu = function() {
	$('.mmi').each(function(){
		var $this = $(this);
		$this.find("li:nth-child(even)").css({backgroundColor: "#e7edf0"});
        $this.find(".sub-menu").css({opacity: 0, display: 'none', marginLeft: $this.offset().left - $this.parent().offset().left});
		$this.hover(
			function(){
				if(this.showing) {
					$(this).find("a:first").next().stop().animate({opacity: 1});
					this.showing = true;
				} else {
					$(this).find("a:first").next().css({display: "block"}).animate({opacity: 1}, "slow");
					this.showing = true;
				}
			},
			function(){
				$(this).find("a:first").next().stop().animate({opacity: 0}, "slow", function(){ $(this).css({display: "none"}).parent().get(0).showing = false; })
			}
		);
	});
}

var initLightProdBox = function() {
    $("");
}

$(document).ready(function() {
    if ($.browser.msie && $.browser.version < 7) {
        $('.card-menu li').width($(this).find('font').width());
    }
    
    $('.lpb-list .special a').mouseover(function() {
        $(this).parent().parent().addClass('hover');
    });
    $('.lpb-list .special a').mouseout(function() {
        if (!$(this).hasClass('active'))
            $(this).parent().parent().removeClass('hover');
    });
    $('.lpb-list .special a.active').parent().parent().addClass('hover');

    $('.left-col-qest .answer a').click(function() {
        $(this).blur();

        var el = $(this).parent().find('.fl-answer');
        if (el.css('display') == 'none') {
            $(this).parent().find('.fl-answer').show('fast');
        }
        else {
            $(this).parent().find('.fl-answer').hide('fast');
        }

        return false;
    });

    $('.right-col-qest .answer a').click(function() {
        $(this).blur();

        var el = $(this).parent().find('.fl-answer');
        if (el.css('display') == 'none') {
            $(this).parent().find('.fl-answer').show('fast');
        }
        else {
            $(this).parent().find('.fl-answer').hide('fast');
        }

        return false;
    });
    
    var step = 300;
    
    $('.pc-cat-body .left a').click(function() {
        $(this).blur();
        var el = $('.lpb-scroll');
        var nowScroll = el.scrollLeft();
        el.animate({'scrollLeft': '-='+step+'px'}, 'slow');
        return false;
    });
    
    $('.pc-cat-body .right a').click(function() {
        $(this).blur();
        var el = $('.lpb-scroll');
        var nowScroll = el.scrollLeft();
        el.animate({'scrollLeft': '+='+step+'px'}, 'slow');
        return false;
    });
});

function showHideAnswer(linkObj) {
 linkObj.blur();
 var faq = linkObj.parentNode;
 if(faq.className.indexOf('fl-open') < 0) faq.className = 'fl-one fl-open';
 else faq.className = 'fl-one';
 return false;
}


function showQF(linkObj) {
 linkObj.blur();
 var parent = locObj = linkObj.parentNode.parentNode, locLeft = 0, locTop = 0;
 while(parent != null) {
 locLeft += parent.offsetLeft;
 locTop += parent.offsetTop;
 parent = parent.offsetParent;
 }
 var qf = document.getElementById('qf');
 qf.style.display = 'block';
 qf.style.left = 690 ;
 qf.style.top = 20 ;
 return false;
} 