	window.addEvent('domready', function(){										 
		//Main menu behaviors
		if(document.id('drop_down_menu')){
			document.id('drop_down_menu').getElements('li.menu').each( function( elem ){
				var list = elem.getElement('ul.links');	
				var alink = elem.getFirst('a')
				var pos = 'upperLeft'
				if(elem.hasClass('alignRight')) pos = 'upperRight'
				if(list){
					list.inject(document.id('menu-container'),'bottom');
					list.position({
						relativeTo: alink,
						position: pos,
						edge: pos,
						offset: {x:0, y:40}
					});			
					list.fade('hide')
					list.setStyle('display', 'block')		
					list.addEvents({
						'mouseenter' : function(){ 	
							list.fade('in');
							alink.addClass('active')				
						},
						'mouseleave' : function(){ 
							list.fade('out');				
							alink.removeClass('active')				
						}
					});
					elem.addEvents({
						'mouseenter' : function(){ 	
							list.fade('in');				
						},
						'mouseleave' : function(){ 
							list.fade('out');				
						}
					});
				}
			})
		}
		
		$$('img.highlite').each(function(e){ //highlite effect on all images with class="highlite"
		  var fade = new Fx.Tween(e, {property:'opacity', wait:false});
		  fade.set(1);
		  e.addEvent('mouseover', function(){
			fade.start(.7);
		  });
		  e.addEvent('mouseout', function(){
			fade.start(1);
		  });
		});
		
		if(document.id('googleSearch')){
			document.id('googleSearch').addEvent('focus',function(){//apply google background behavior
				this.setStyle('background-image','url(_img/bg-google-search-active.gif)')
			});
			document.id('googleSearch').addEvent('blur',function(){
				if(this.get('value')=='')this.setStyle('background-image','url(_img/bg-google-search.gif)')
			});
		}
		
		
		/*if(document.id('divLeftMenuContent') && document.id('divRightMenuContent') && document.id('pageBody')){//set left and right columns to same height
			var height = document.id('pageBody').getSize().y-50;
			var topHt = 0;
			if(document.id('divRightColTop')) topHt = document.id('divRightColTop').getSize().y+10
			document.id('divLeftMenuContent').setStyle( 'height',  (height) + 'px' );
			document.id('divRightMenuContent').setStyle( 'height',  (height-topHt) + 'px' );
		}*/
				
	})
	
	
    // Keypress supressor to handle the "Enter" key for the search box
    function googleKeypress(e) {

        var charCode;

        // FFox & IE
        if (e && e.which) {
            charCode = e.which;
        }
        else if (window.event) {
            e = window.event;
            charCode = e.keyCode;
        }

        if (charCode == 13) {
            e.returnValue = false;
            if(window.event)
              e.cancel = true;
            else
            {
              e.stopPropagation();
              e.preventDefault();
            }
            searchRedirect();
        }
    }

	// Redirects the search request
    function searchRedirect() {
        var searchVal = document.getElementById("googleSearch").value;
        window.location = "http://search.eeye.com/search?q=" + encodeURIComponent(searchVal) + "&btnG=Search&site=default_collection&client=new_site_frontend&proxystylesheet=new_site_frontend&output=xml_no_dtd"
    }	
