$(document).ready(function () {
	var dptTimer=null;
	$('.dropdown').each(function () {
		$this=$(this);
		$(this).remove();
		$('body').append($this);
	});
	
	$('.dropdown').mousemove(function () {$(this).show();});
	$('.dropdown').mouseover(function () {$(this).show();});
	$('.dropdown').mouseout(function () {$(this).hide();});

	$("#mainNav li").click(function (e) {
		window.location=$(this).find('a').attr('href');
	});
	$("#mainNav li").hover(function (e) {
		var dropAtr=$(this).find('a').attr('drop');
		$("#"+dropAtr).each(function () {
			catPos=$("#mainNav li [drop="+dropAtr+"]").offset();
			catWidth=$("#mainNav li [drop="+dropAtr+"]").width();
			this.style.left=parseInt(catPos.left)+'px';
			this.style.width=parseInt(catWidth)-1+'px';
			$(this).show();
		});
	},function (e) {
		$("#"+$(this).find('a').attr('drop')).each(function () {
			$('.dropdown').hide();
		});
	});
	$("#mainNav li a").click(function () {
		if($(this).attr('href')=='#') {
			return false;
		}
	});
	$('.drop_sub li a').hover(function () {
		$(this).prev().css('background','#6D9000');
		$(this).css('color','#FFFFFF');
	},function () {
		$(this).prev().css('background','#FFFFFF');
		$(this).css('color','#353535');
	});
	$('.drop_sub li').hover(function () {
		$(this).css('background','#6D9000');
		$(this).find('a').css('color','#FFFFFF');
	},function () {
		$(this).css('background','#FFFFFF');
		$(this).find('a').css('color','#353535');
	});
	$('.drop_sub li').click(function () {
		window.location=$(this).find('a').attr('href');
	});
});