
window.addEvent('domready',function(){
	
			/////// CLONE AND CREATE COOKIES ON THE FLY
	// Create Cookie DIV
	new Element('div').setProperties({id: 'cookies'}).injectBefore( $('links') );
	// Create UL in Cookie DIV
	new Element('ul').setProperties().injectInside( $('cookies') );
	// Get Full List of LI's from Links
	var myList = $$('#links > ul > li');
	// Loop Through Links
	myList.each(function(item){
		//Get The Anchor from the looped LI's
		var myLink = item.getElement('a');
		// Clone LI with new ID x_cook
		new Element('li').setProperties({id: item.id + '_cook'}).injectInside( $('cookies').getElement('ul')  );
		// Create New Anchor with the same HREF from the cloned LI
//		new Element('a').setProperties({href: myLink.href, text: myLink.text + ' Cookie'}).injectInside( $(item.id + '_cook') );
		new Element('a').setProperties({href: myLink.href}).injectInside( $(item.id + '_cook') );
		// Get New Anchor
		var myNewLink = $(item.id + '_cook').getElement('a')
		// Create Span Tag in Anchor
		new Element('span').setProperties().injectInside( $(myNewLink) );
	
	});
	///////////
	
	
	///////// HOVER FUNCTION
	$('links').getElements('ul > li').addEvents({
		mouseover: function() {
			var myLink = this.id
			myLink = myLink.replace("_cook","")
			
			$('hero').addClass(myLink)
			$('hero').removeClass('default')
			
			$(myLink).getElements('span').addClass('hover');
			
			},
		mouseout: function() {
			var myLink = this.id
			myLink = myLink.replace("_cook","")
			
			$('hero').removeClass(myLink)
			$('hero').addClass('default')
			
			$(myLink).getElements('span').removeClass('hover');
			}
	});
	
		$('cookies').getElements('ul > li').addEvents({
		mouseover: function() {
			var myLink = this.id
			myLink = myLink.replace("_cook","")
			
			$('hero').addClass(myLink)
			$('hero').removeClass('default')
			
			$(myLink).getElements('span').addClass('hover');
			
			},
		mouseout: function() {
			var myLink = this.id
			myLink = myLink.replace("_cook","")
			
			$('hero').removeClass(myLink)
			$('hero').addClass('default')
			
			$(myLink).getElements('span').removeClass('hover');
			}
	});
	/////////////
	
	
		
	


	
});