function startGallery() {
	var myGallery = new gallery($('myGallery'), {
		timed: true,
		showArrows: false,
		showInfopane: false,
		showCarousel: false,
		embedLinks: true,
		delay: 4000
	});
	document.gallery = myGallery;
}
window.addEvent('domready', function() {

	if ($defined($('accordion'))) {
		
		var accordion = new Accordion('h6.atStart', 'div.atStart', {
			opacity: false
		}, $('accordion'));
		 
		accordion.togglers.each(function(toggler){
			toggler.addEvent('mouseover',function(){
				this.fireEvent('click');
			});
		});
	
		accordion.elements.each(function(toggler){
			toggler.addEvent('mouseout',function(){
				accordion.display(0);
			});
		});
		
	}

	if ($defined($('myGallery'))) {
		
		startGallery();
	
	}

	if ($defined($('enquiry'))) {
		var myFormValidation = new Validate('enquiry',{
			errorClass: 'requiredfield'
		});
	}
	
	if ($defined($('ticker-container'))) {

		var scroller = new QScroller('ticker-container',{
		  duration: 3000,
		  delay: 1000,
		  auto:true,
		  direction: 'v',
		  onMouseEnter: function(){this.stop();},
		  onMouseLeave: function(){this.play();}
		});
		scroller.load();

	}
	
});

function jumpToAnchor() {
   window.location = String(window.location).replace(/\#.*$/, "") + "#enquiryform";
}