var Site = {
		
	start: function(){

		Site.fixExplorer();
		//if( Browser.Engine.trident4 ) Site.ie6();
		
		if( $$('.external') ) Site.setExternals($$('.external'));
		if( $$('.texthover') ) Site.overText($$('.texthover'));
		
		var myMenu = new MenuMatic({
			id: 'navigation',
			matchWidthMode: false,
			stretchMainMenu: true,
			opacity: 100,
			fixHasLayoutBug: true,
			
			onPositionSubMenu_complete:function(classRef){                     
                classRef.btn.addClass('hover');
            },
			onHideSubMenu_complete:function(classRef){                     
                classRef.btn.removeClass('hover');
            } 
               
		});
		
		if( $('last_nav')) {
			$$('#last_nav ul ul').setStyle('display','none');
			
			$$('#last_nav ul a').addEvent('click', function(e){
								
				var ul = this.getNext('ul');
				 
				if (ul != null) {
					new Event(e).stop();
					if (ul.getStyle('display') == 'none') 
						ul.setStyle('display', 'block');
					else 
						ul.setStyle('display', 'none');
					
				}
			});
			

		}
	},
		
	setExternals: function(els){
		els.addEvent('click', function(ev){ window.open(this.href); new Event(ev).stop(); return; });
	},

	fixExplorer: function() {
		$('container').getElements('input[type=radio]').setStyle('border', '0');
		$('container').getElements('input[type=checkbox]').setStyle('border', '0');
		
		$$('input').addEvents({
			'focus': function(){ this.addClass('highlight');},
			'blur': function(){ this.removeClass('highlight');}
		});
		
		$$('textarea').addEvents({
			'focus': function(){ this.addClass('highlight');},
			'blur': function(){ this.removeClass('highlight');}
		});
		
		$$('select').addEvents({
			'focus': function(){ this.addClass('highlight');},
			'blur': function(){ this.removeClass('highlight');}
		});
	},
	
	overText: function(els) {
		els.addEvents({
			'focus': function(){ 
				this.store('defaultvalue', this.value);
				this.value = ''; 
			},
			'blur': function(){ 
				if( this.value=='' ) {
					this.value = this.retrieve('defaultvalue');
				}
			}
		});	
	}
};

window.addEvent('domready', function(){ Site.start(); });