window.addEvent('domready', function() {
	
	//create our Accordion instance
	var myAccordion = new Accordion($('generalBodyContainer'), 'h1.toggler', 'div.element', {
		opacity: false,
		onActive: function(toggler, element){
			//toggler.setStyle('color', '#41464D');
		},
		onBackground: function(toggler, element){
			//toggler.setStyle('color', '#528CE0');
		}
	});
	// --
	if(document.getElementById('myLogin')){
		$('myLogin').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();
		//Empty the log and show the spinning indicator.
		var log = $('log_Login').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
		}});
		//Send the form.
		this.send();
		});
	}
	if(document.getElementById('myPassword')){
	$('myPassword').addEvent('submit', function(e) {
		//Prevents the default submit event from loading a new page.
		e.stop();
		//Empty the log and show the spinning indicator.
		var log = $('log_Password').empty().addClass('ajax-loading');
		//Set the options of the form's Request handler. 
		//("this" refers to the $('myForm') element).
		this.set('send', {onComplete: function(response) { 
			log.removeClass('ajax-loading');
			log.set('html', response);
		}});
		//Send the form.
		this.send();
	});
	}
	
	var otherEl = $('passwordForgot');
	var otherE2 = $('normalLogin');
	if(document.getElementById('PasswordShow')){
		$('PasswordShow').addEvent('click', function(){
			otherEl.tween('height', 300);
			otherE2.tween('height', 0);
			return false; // alternative syntax to stop the event
		});
	}
	if(document.getElementById('PasswordHide')){
		$('PasswordHide').addEvent('click', function(){
			otherEl.tween('height', 0);
			otherE2.tween('height', 300);
			return false; // alternative syntax to stop the event
		});
	}
});