window.addEvent('domready',function(){

	if ( $('gallery') ) {

		$('gallery').setStyles('height: 188px; overflow: hidden;');

		new Element('input',{

			'type': 'button',

			'value': 'VIEW THE SLIDESHOW',

			'styles': {

				'color': '#000000', 

				'background-color': '#ffffff', 

				'padding': '4px', 

				'border': '1px solid #000000', 

				'font-size': '0.8em',

				'margin-top': '0.8em'

			},

			'events': {

				'click': function(){Lightbox.click($('gallery').getElement('a'));}

			}

		}).injectAfter('gallery');

	}

	$$('input.calendarPopup').each(function(el,c){

		el.id = el.getAttribute('name');

		if ( el.getAttribute('id').length > 0 ) {

			popup = new Element('img',{

				'src': 'images/calendar_16.gif',

				'class': 'cal_btn',

				'id': '_btn_' + el.id,

				'styles': 'margin-left: 5px; cursor: pointer;',

				'title': 'Click here to pick a date from the Calendar'

			}).injectAfter(el.id);

			Calendar.setup({

				inputField     :    el.id,        // id of the input field

				ifFormat       :    "%m/%d/%y",             // format of the input field (even if hidden, this format will be honored)

				button         :    popup.id,               // trigger for the calendar (button ID)

				align          :    "Br",                   // alignment (defaults to "Bl")

				singleClick    :    true,

				range          :    [2000,2010]

			});

		}

	});

});