var time = 400;
NAVIGATION = jQuery.klass({
	initialize: function(arg) {

		$this = $(this.element);
		$thisA = $this.find('>a');

		$thisA.css('cursor','pointer');

		if(typeof $this.data('origbgc')=='undefined'){
			$this.data('origbgc',$thisA.css('background-color'));
			$this.data('origc',$thisA.css('color'));
		}

		if($this.attr('id') == 'l1hover'){
			$thisA.css('background-color', '#231f20');
			$thisA.css('color', 'white');
		}


		$thisA.click(function(e){

			


			$('#l1hover').animate({
				left: 0
			},{
				duration: 500,
				queue: false
			});
			$('#l1hover>a').animate({
				backgroundColor: $('#l1hover').data('origbgc'),
				color: $('#l1hover').data('origc')
			},{
				duration: 500
			});




			$this = $(this);
			$parentLi = $this.parent().animate({
				left: 92
			},{
				duration: 500,
				queue: false,
				complete: function() {
					window.location.href = $(this).find('>a').attr('href');
				}
			});

			$this.animate({
				color: '#ffffff',
				backgroundColor: '#231f20'
			},{
				duration: 500,
				queue: true
			});


			e.stopPropagation();

			return false;
		});
	},
	onmouseover: function() {
		$(this.element).css('cursor','pointer');
	},

	onclick: function() {
		e.stopPropagation();
	},

	onmouseout: function() {


	}

});



 

var link;
NAVIGATION_SUB = jQuery.klass({
	initialize: function(arg) {
		$this = $(this.element);
		$thisA = $this.find('>a');
		$thisA.css('cursor','pointer');

		$thisA.click(function(e){
			$('#l1hover').animate({
				left: 0
			},{
				duration: 500,
				queue: false
			});
			$('#l1hover>a').animate({
				backgroundColor: $('#l1hover').data('origbgc'),
				color: $('#l1hover').data('origc')
			},{
				duration: 500
			});





			$this = $(this);

			link = $(this).attr('href');





			//          a        li      ul       li
			$parentLi = $this.parent().parent().parent().animate({
				left: 92
			},{
				duration: 500,
				queue: false,
				complete: function() {
					window.location.href = link;
				}
			});


			$('#navi .subnav').parent().find('>a').animate({
				color: '#ffffff',
				backgroundColor: '#231f20'
			},{
				duration: 500,
				queue: true
			});
			

			e.stopPropagation();
			return false;
		});
	},
	onmouseover: function() {
		$(this.element).css('cursor','pointer');
	},
	onclick: function() {
		e.stopPropagation();
	},
	onmouseout: function() {
	}
});
