
		// Implement a redraw function to avoid drawing troubles in Safari
		Element.extend( { redraw: function( el ) { this.replaceWith( this.clone() ); } } );
		
		var myMooTools = new domFunction( function() {

			var mysIFRh2 = new MoosIFR( "h1", { flashsrc : "var/fonts/helvetica_condensed_bold.swf",
												typeface : "condensed",
			             				        textcolor: "#d5a054",
			             				        bgcolor  : "#000000",
		    	             				    flashvars: "textalign=left&offsetTop=0",
		        	          				    wmode    : "transparent" } );

			var mysIFRh2 = new MoosIFR( "h2", { flashsrc : "var/fonts/helvetica_condensed_bold.swf",
												typeface : "condensed",
			             				        textcolor: "#ffffff",
			             				        bgcolor  : "#000000",
		    	             				    flashvars: "textalign=left&offsetTop=0",
		        	          				    wmode    : "transparent" } );

			// variable for the list status
			var listStatus = 'closed';
	
			// setup var that holds our opened list's id
			var listOpen;

			// show list function
			var showList = function(lid) {
	
				var listId = lid.replace(/DD_/g,'');
		
				// need to check if there is an open list
				if( listStatus == "open" ) {
					// check if the open list is the same
					// as toggled list. If not, then we hide it
					if( listId != listOpen ) {
						hideList();
					}
				} 
		
				if( listStatus == "closed" ) {
					// set our list status
					listStatus = 'open';
			
					// set the curent open list id
					listOpen = listId;
			
					// show our list with a little effects
					$( listOpen ).effect( 'opacity', { duration: 500 } ).start( 0, 1 );
					$( listOpen ).effect( 'width', { duration: 250 } ).start( $( "DD_" + listOpen ).firstChild.width,
					                                                          ( $( "DD_" + listOpen ).firstChild.width + 30 ) );
					$( listOpen ).effect( 'height', { duration: 750 } ).start( 20,  ( $( listOpen ).firstChild.childNodes.length * 20 ) );

					// we add a timeout so the sublist goes away
					// if the user doesn't click/mouseover another 
					// menu item
					// (hideList).delay(15000);
	
				}

			};
	
			// hide list function
			var hideList = function() {
	
				if(listOpen) {
		
					// check if our list is shown already - if so run the effects to hide list
					if($(listOpen).getStyle('visibility') == "visible") {
						$( listOpen ).effect( 'opacity', {duration: 500} ).start( 1, 0 );
						$( listOpen ).effect( 'width', {duration: 250} ).start( ( $( "DD_" + listOpen ).firstChild.width + 30 ), 
						                                                        $( "DD_" + listOpen ).firstChild.width );
					$( listOpen ).effect( 'height', { duration: 750 } ).start( ( $( listOpen ).firstChild.childNodes.length * 20, 20 ) );
					}
			
					// set our list status
					listStatus = 'closed';
			
					// reset open list id
					listOpen = '';
				}
			};
	
	
			$$('a.navbutton').addEvent(
				'mouseover', function() {
		
					// add mouseover action to change image
					this.firstChild.src = this.firstChild.src.replace(/OFF/g,'ON');

					// optional effect for mouseover
					this.effect('opacity').custom(.5,1);
			
				} );

			$$('a.navbutton').addEvent(
				'mouseout', function() {
		
					// switch mouseout button
					this.firstChild.src = this.firstChild.src.replace(/ON/g,'OFF');
			
					// optional effect for mouseout
					this.effect('opacity').custom(.5,1);
				} );
	
			$$('a.navbutton').addEvent(
				'click', function() {
		
					// check if element has our flag for having a drop menu
					if(this.hasClass('hasSubNav')){
				
						if( this.id.replace( /DD_/g, '' ) == listOpen ) {
							// we clicked on the current open menu to close it
							hideList();
						} else {
							// pass the id of the mouseover, so we can determine 
							// which list to show
							showList(this.id);
						}
			
					}else{

						// if the button moused over does not have a list
						// then we close the list since we are obviously
						// on another button now
						if(listStatus == 'open'){
							hideList();
						}
					}	
				} );
	
		} );


