window.addEvent('domready', function()
{
	/* Tips 1 */
	var Tips1 = new Tips($$('.Tips1'));
			
	/* Tips 2 */
	var Tips2 = new Tips($$('.Tips2'), {
		initialize:function(){
			this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
		},
		onShow: function(toolTip) {
			this.fx.start(1);
		},
		onHide: function(toolTip) {
			this.fx.start(0);
		}
	});
			
	/* Tips 3 */
	var Tips3 = new Tips($$('.Tips3'), {
		showDelay: 400,
		hideDelay: 400,
		fixed: true
	});
			
	/* Tips 4 */
	var Tips4 = new Tips($$('.Tips4'), {
		className: 'custom'
	});
	
	
	
	var mySlide = new Fx.Slide('contactDiv');
	mySlide.hide();
	var mySlide2 = new Fx.Slide('emailsDiv');
	mySlide2.hide();
	var mySlide3 = new Fx.Slide('contactLog');
	mySlide3.hide();
	var mySlide4 = new Fx.Slide('log');
	mySlide4.hide();
	
	$('toggleContact').addEvent('click', function(e){				e = new Event(e);
				var log = $('contactLog_res').empty()				mySlide.toggle();
				mySlide3.slideOut();
				mySlide2.slideOut();
				mySlide4.slideOut();				e.stop();			});
	
	$('toggleContact2').addEvent('click', function(e){				e = new Event(e);
				var log = $('contactLog_res').empty()				mySlide.toggle();
				mySlide3.slideOut();
				mySlide2.slideOut();
				mySlide4.slideOut();				e.stop();			});
	
	$('toggleEmails').addEvent('click', function(e){				e = new Event(e);
				var log2 = $('log_res').empty()				mySlide2.toggle();
				mySlide4.slideOut();
				mySlide.slideOut();
				mySlide3.slideOut();				e.stop();			});
	
	$('toggleEmails2').addEvent('click', function(e){				e = new Event(e);
				var log2 = $('log_res').empty()				mySlide2.toggle();
				mySlide4.slideOut();
				mySlide.slideOut();
				mySlide3.slideOut();				e.stop();			});
	
	$('contactForm').addEvent('submit', function(e) {				/**				 * Prevent the submit event				 */				new Event(e).stop();							/**				 * This empties the log and shows the spinning indicator				 */				var log1 = $('contactLog_res').empty().addClass('ajax-loading');
				mySlide3.slideIn();				/**				 * send takes care of encoding and returns the Ajax instance.				 * onComplete removes the spinner from the log.				 */				this.send({					update: log1,					onComplete: function() {						log1.removeClass('ajax-loading');
						$('contactMessage').value= "";					}				});			});

	
	$('newsForm').addEvent('submit', function(e) {				/**				 * Prevent the submit event				 */				new Event(e).stop();							/**				 * This empties the log and shows the spinning indicator				 */				var log2 = $('log_res').empty().addClass('ajax-loading');
				mySlide4.slideIn();				/**				 * send takes care of encoding and returns the Ajax instance.				 * onComplete removes the spinner from the log.				 */				this.send({					update: log2,					onComplete: function() {						log2.removeClass('ajax-loading');					}				});			});
	
	
}); 