// Script: my.SmoothBox
// Version: 1.0.1
// Framework: Mootools 1.2 
// Auther: Michel Frömmgen 

// PARAMETER YOU CAN CHANGE //------------------------------------------------------------------------------

var	selectors 	   = '#fehlermeldung',  // you can add CSS-paths, several classes and IDs separated by comma 
	startheight	   = '20',				// strat-height for animation
	endheight	   = '160',				// end-height for animation, resize start-height to given value
	startwidth	   = '300',				// start-width for animation
	endwidth	   = '300',				// end-width for animation, resize start-width to given value
	startfontsize  = '0',				// strat-font-size for animation
	endfontsize	   = '13',				// end-font-size for animation, resize strat-font-size to given value
	startopacity   = '0',				// start-opacity: (0, 0.1, 0.3,... 0.9 until 1)
	endopacity     = '0.9',				// step down until 0 for transparents (1, 0.9, 0.8,... 0.1 until 0)
	bgcolor		   = '#849d0e'			// background-color for given selectors 
	
// START OF PROGRAM - DO NOT TOUCH THE CODE BELLOW //-------------------------------------------------------

window.addEvent('domready', function(){
	
	var list = $$(selectors);
		list.each(function(element) { 

		var fx = new Fx.Morph(element, {duration: 1000, transition: Fx.Transitions.linear});
		
 
		$('submit').addEvent('click', function(){
			fx.start({
				'opacity': [startopacity, endopacity],
				'height': [startheight, endheight],
				'width': [startwidth, endwidth],
				'font-size': [startfontsize, endfontsize],
				'background-color': bgcolor
				
				
			});
		});

		$('closePanel').addEvent('mouseover', function(){
			fx.start({
				'opacity': [endopacity , startopacity],
				'height': [endheight, startheight],
				'width': [endwidth, startwidth],
				'font-size': [endfontsize, startfontsize]		
			});	
		});
 
	});

// Make element draggable //							 
	var draglist = $$('.drag');          	// draglist contains all Class-Name  
 		draglist.each(function(element) { 	// All Class-Names adress by "element"		 

		 element.makeDraggable({
			}); 

	});
}); //end of domready

// END OF PROGRAM // ---------------------------------------------------------------------------------------