﻿///<reference path="jquery-1-3-2-vsdoc.js" />

$(document).ready(function()
{
	jQuery(".header .nav li.more").hover(
		function()
		{
			var $this = jQuery(this).addClass('hover');
			var pos = $this.position();
			jQuery('ul', $this).css({ display: 'block', left: -1, top: $this.height() });
		},
		function()
		{
			var $this = jQuery(this).removeClass('hover');
			jQuery('ul', $this).css({ display: 'none' });
		});

});

$(document).ready(function()
{
	var $hotBox = jQuery('.hotProductBox')
	if ($hotBox.length == 0)
		return;

	var old = jQuery('li a.name', $hotBox)[0];

	jQuery('li', $hotBox).eq(0).addClass('curr');

	jQuery('li a.name', $hotBox).mouseover(function()
	{
		if (old == this)
			return;

		jQuery(old).parent().removeClass('curr');
		jQuery(this).parent().addClass('curr');
		old = this;

	});
});

$(document).ready(function()
{
	var $box = $('.certBox');
	var $certs = $('li', $box);
	var step = 191;
	var dist = 300;
	var timer = null;
	var len = $certs.length * step
	$('ul', $box).css('width', len * 2);
	$('ul', $box).append($certs.clone());

	function movie()
	{
		var m = parseInt($('ul', $box).css('marginLeft'));
		m -= step;
		$('ul', $box).animate({ 'marginLeft': m }, dist, 'swing', function() { if (m + len <= 0) $('ul', $box).css('marginLeft', 0) });
	};

	function start() { timer = setInterval(movie, 3000); }
	function stop() { if (timer == null) return; clearInterval(timer); timer = null; }
	function init() { if ($box.length == 0) return; $('a', $box).hover(function() { stop(); }, function() { start(); }); start(); }

	init();
});
	
