window.addEvent('domready',function(){
	var scroller = new Fx.Scroll(window,{
		link:'cancel',
		duration:100,
		transition:'quad:in:out'
	});
	if (document.getElementById('toForm'))
	{
		$('showMap').addEvent('click',function(e){
			var showMap = new Fx.Slide('map').slideIn('vertical');
			e.preventDefault();
			scroller.toElement($('map'));
		});
	}
	if (document.getElementById('calendar'))
	{
		new vlaDatePicker('calendar',{openWith: 'togglePicker'});
	}
	
		
	
	if (document.getElementById('slider'))
	{	
		//variables for making things more simple below
		var itemsHolder = $('slider');
		var myItems = $$('.title_pic');
		var thePrevBtn = $('prev_btn');
		var theNextBtn = $('next_btn');
		
		
		//create an instance of the slider, and start it up
		var mySlider = new SL_Slider({
			slideTimer: 6000,
			isPaused: false,
			container: itemsHolder,
			items: myItems,
			prevBtn: thePrevBtn,
			nextBtn: theNextBtn
		});
		mySlider.start();
		
		
		//adding a little animated rollover highlight to the play and prev/next buttons
		var origBkgdColor = thePrevBtn.getStyle('background-color');
		var newBkgdColor = "#251d7a";
		var btnArray = new Array(thePrevBtn, theNextBtn);
		
		btnArray.each(function(e, i){
			e.set('tween', {duration: 350, transition: 'cubic:out', link: 'cancel'});
		});
		
		$$('.minbtn').addEvent('click',function(){
			$('big_top').setStyle('display',"none");
			$('small_top').setStyle('display',"block");
		});
		
		
		
		$$('.maxbtn').addEvent('click',function(){
			$('small_top').setStyle('display',"none");
			$('big_top').setStyle('display',"block");
		});
		
		
	}
	
	
	
});

function popitup(url) {
    newwindow=window.open(url,'name','height=700,width=900');
    if (window.focus) {newwindow.focus()}
    return false;
}
