var Dropdown = Class.create();
Dropdown.prototype = {
	initialize: function() {	
		this.startObserving();
    },
    startObserving: function(){
    	document.observe('mouseover', (function(event){
    		var target1 = event.findElement('div#nav')    		
    		var target2 = event.findElement('div#nav ul li');
    		
    		if (!target1&&!target2) {
    			//$(this.dropdownlist).hide();    	
    			this.hidedropdown();
    		}else if(target1||(target2&&target2.style.display!='none')){
    			//console.log('T2 = '+target2.style.display);
    			this.showdropdown();
    		}
			event.stop();
    	}).bind(this));		
    } , 
	
    showdropdown: function(){
    	$$('div#nav ul li').each(function(s){s.show();});
    	$('dropdown').style.height = '250px';
    	//$('dropdown').style.display = 'block';
    	$$('div#nav ul').each(function(s){
			s.style.height='250px';
			//s.style.height='125px';
			//s.style.display = 'block';
		});
	} ,
	hidedropdown: function(){
		$$('div#nav ul li').each(function(s){s.hide();});
		$$('div#nav ul li.head').each(function(s){s.show();});
		$$('div#nav ul').each(function(s){s.style.height='30px';});
		$('dropdown').style.height = '30px';
	}
}
