window.addEvent('domready',function(){
	if($$('a[rel=imgpopup]').length>0){
		var imgpopup = new ImgPopup();
		var imgsection = [];
		$$('a[rel=imgpopup]').each(function(el){
			el.addEvent('click',function(e){
				imgpopup.start(this.getProperty('href'));
				if(e){
					e.stop();
				}
			}.bindWithEvent(el));
			imgsection.push({
				url:el.getProperty('href'),
				caption:el.getProperty('title')
			});
		});
		imgpopup.addSection(imgsection);
	}
	if(typeof slideShowImages != 'undefined'){
		var mySlideShow = new slideShow($$('#mainimg img')[0],{
			slidetime: 2,                    
			swaptime: 5,                       
			transition: Fx.Transitions.Quad.easeInOut, 
			path: '',                          
			imgs: slideShowImages,             
			random: false                     
		});
	}
});

var isOldEnough = function(day,month,year){
	if(!day || !month || !year){
		return false;
	}
	var mustBorn = new Date(new Date().getFullYear()-18, new Date().getMonth(), new Date().getDate()).getTime();
	var born = new Date(year*1, month-1, day*1).getTime();
	if(born<=mustBorn){
		return true;
	}
	return false;
}
