// navigation
jQuery.fn.copyFooter = function(options) {
	
	var defaults = {};
	var options = $.extend(defaults, options);
	
	return this.each(function() {
		
		var obj = $(this);
		
		obj
			.clone()
			.appendTo("div#container div#content")
		;
		
		obj
			.remove()
		;

		
	});
};


// navigation
jQuery.fn.navigation = function(options) {
	
	var defaults = {
		"speed":300,
		"opacity":0.9
	};
	var options = $.extend(defaults, options);
	
	return this.each(function() {
		
		var obj = $(this);
		
		obj
			.find("li a")
			.each(function(){
				if ($(this).hasClass("active")) {
					$(this)
						.prepend('<span class="arrow active"></span>')
					;
				} else {
					$(this)
						.prepend('<span class="arrow"></span>')
					;
				}
			})
			
		;
		
		/*obj
			.prepend('<span class="arrow"></span>')
			.parent()
			.children("ul")
			.hide()
		;
		
		if ($(this).hasClass("active")) {
			obj
				.children("span.arrow")
				.addClass("active")
			;
		}
		
		obj
			.click(function(){
				
				if ($(this).hasClass("hasSubNav")) {
					return false;
				}
				
			})
		;
		
		obj
			.mouseenter(function(){
				
				$("div#navigation ul")
					.find("ul")
					.each(function(){
						$(this)
							.hide()
						;
					})
				;
				
				$("div#navigation ul")
					.children("li")
					.each(function(){
						$(this)
							.children("a")
							.removeClass("hovered")
						;
					})
				;
				
				if ($(this).hasClass("hasSubNav")) {
				
					$(this)
						.addClass("hovered")
						.parent()
						.children("ul")
						.fadeTo(options.speed,options.opacity)
					;
				
				}
				
			})
		;
		
		obj
			.parent()
			.find("li a")
			.mouseover(function(){
				$(this)
				    .css("text-decoration","none")
				;
				$(this)
				    .parent()
					.addClass("hovered")
				;
			})
			.mouseout(function(){
				$(this)
				    .css("text-decoration","none")
				;
				$(this)
				    .parent()
					.removeClass("hovered")
				;
			})
		;*/
		
	});
};
