
window.addEvent('domready', function() {
	//select the first button
	var button1 = $('btn-enquiries');
	//select the first content element
	var content1 = $('accordian');
	//make another button option
	if($('img-map')) var button2 = $('img-map');

	//The height transition we attach to 'contentElement1'
	var b1Toggle = new Fx.Style('accordian', 'height',{duration: 1500});
	var b2Toggle = new Fx.Style('accordian', 'height',{duration: 1500});

	//add an onclick event listener to button1
	button1.addEvent('click', function(){
		//toggle height transition (hide-show)
		if(content1.getStyle('height').toInt() > 0){
			//hide
			b1Toggle.start(0);
		}else{
			//show
			b1Toggle.start(c1Height);
		}
		return false;
	});
	
	//add an onclick event listner to optional img-map
	if($('img-map'))
	{
		button2.addEvent('click', function(){
			//toggle height transition (hide-show)
			if(content1.getStyle('height').toInt() > 0){
				//hide
				b1Toggle.start(0);
			}else{
				//show
				b1Toggle.start(c1Height);
			}
			return false;
		});
	}

	//set css display:block for the contentElements
	content1.setStyle('display','block');

	//get the scrollSize of the contentElements
	var c1Height = content1.getSize().scrollSize.y;
});
