﻿var conf;
var messageDialog;

$(document).ready(function () {
	// navigation menu
	$('#nav li').hover(
				function () {
					$('ul:first', this).slideDown(100);
				},
				function () {
					$('ul:first', this).slideUp(100);
				}
			);

	// product category accordion
	$('div.productCategory').mousedown(function () {
		if ($(this).hasClass("active")) {
			$(this).removeClass('active');
			$(this).next().slideUp(600);
			return;
		}
		$(this).parent().find('.productCategorySub').slideUp(600);
		$(this).parent().find('.productCategory').removeClass('active');
		$(this).next().slideDown(600);
		$(this).addClass('active');
	});

	$('table.stripe').each(function () {
		var obj = $(this);
		obj.find('tr:odd').addClass('stripeLight');
		obj.find('tr:even').addClass('stripeDark');
		if (obj.hasClass('stripeSkipFirst'))
			obj.find('tr:first').removeClass('stripeDark');
	});

	messageDialog = new msjs_errorDialog();
});

var goDiscountBulletWait = false;
function goDiscountBullet() {
	return;
	var w = parseInt($(document).width() / 2);
	
	$(document).mousemove(function (e) {
		if (goDiscountBulletWait)
			return;
		var left = e.clientX;
		if (left > w) {
			$('#discountBulletLeft').fadeIn();
			$('#discountBulletRight').stop().fadeOut();
		} else {
			$('#discountBulletLeft').stop().fadeOut();
			$('#discountBulletRight').stop().fadeIn();
		}
		goDiscountBulletWait = true;
		setTimeout(function () { goDiscountBulletWait = false; }, 1000);
	});
}
