window.addEvent('load', function() {
	new DatePicker('.dp');
});

  // --------------------------------------- //
  // ADD MINUS TOGLE BOXES

		window.addEvent('domready', function(){
			new DatePicker('.dp');
			//-vertical
			
			var mySlide1 = new Fx.Slide('toggle_box_1');
			mySlide1.show(); 
			$('toggle_tab_1').addEvent('click', function(e)
			{
				e = new Event(e);
				mySlide1.toggle();
				e.stop();
			});
			
			var mySlide2 = new Fx.Slide('toggle_box_2');
			mySlide2.show(); 
			$('toggle_tab_2').addEvent('click', function(e)
			{
				e = new Event(e);
				mySlide2.toggle();
				e.stop();
			});
			
			var mySlide3 = new Fx.Slide('toggle_box_3');
			mySlide3.show(); 
			$('toggle_tab_3').addEvent('click', function(e)
			{
				e = new Event(e);
				mySlide3.toggle();
				e.stop();
			});
			
			


		});
		
		// SLIDESHOW START //
		window.addEvent('domready', function(){
		  var transition = 'alternate';
		  $$('input[name=transition]').addEvent('click', function(){ transition = this.value; });
		  var slideAvailable = ['fade'];
		  var slideTransition = function(){
		    switch(transition){
		      case 'alternate':
		        if(! $defined(this.count)) this.count = -1;
		        return slideAvailable[++this.count % slideAvailable.length];
		      case 'random': return slideAvailable.getRandom();
		      default: return transition;
		    }
		  }
		    var slideshow = new BarackSlideshow('menu', 'pictures', 'loading');
		});
		// <![CDATA[     

		/* 

		   The following function dynamically calculates Easter Monday's date.
		   It is used as the "redraw" callback function for the second last calendar on the page
		   and returns an empty object.

		   It dynamically calculates Easter Monday for the year in question and uses
		   the "adddisabledDates" method of the datePickercontroller Object to
		   disable the date in question.

		   NOTE: This function is not needed, it is only present to show you how you
		   might use this callback function to disable dates dynamically!

		*/
		function disableEasterMonday(argObj) { 
		        // Dynamically calculate Easter Monday - I've forgotten where this code 
		        // was originally found and I don't even know if it returns a valid
		        // result so don't use it in a prod env...
		        var y = argObj.yyyy,
		            a=y%4,
		            b=y%7,
		            c=y%19,
		            d=(19*c+15)%30,
		            e=(2*a+4*b-d+34)%7,
		            m=Math.floor((d+e+114)/31),
		            g=(d+e+114)%31+1,            
		            yyyymmdd = y + "0" + m + String(g < 10 ? "0" + g : g);         

		        datePickerController.addDisabledDates(argObj.id, yyyymmdd); 

		        // The redraw callback expects an Object as a return value
		        // so we just give it an empty Object... 
		        return {};
		};

		/* 

		   The following functions updates a span with an "English-ised" version of the
		   currently selected date for the last datePicker on the page. 

		   NOTE: These functions are not needed, they are only present to show you how you
		   might use callback functions to use the selected date in other ways!

		*/
		function createSpanElement(argObj) {
		        // Make sure the span doesn't exist already
		        if(document.getElementById("EnglishDate")) return;

		        // create the span node dynamically...
		        var spn = document.createElement('span');
		            p   = document.getElementById(argObj.id).parentNode;

		        spn.id = "EnglishDate";
		        p.parentNode.appendChild(spn);

		        // Remove the bottom margin on the input's wrapper paragraph
		        p.style.marginBottom = "0";

		        // Add a whitespace character to the span
		        spn.appendChild(document.createTextNode(String.fromCharCode(160)));
		};

		function showEnglishDate(argObj) {
		        // Grab the span & get a more English-ised version of the selected date
		        var spn = document.getElementById("EnglishDate"),
		            formattedDate = datePickerController.printFormattedDate(argObj.date, "l-cc-sp-d-S-sp-F-sp-Y", false);

		        // Make sure the span exists before attempting to use it!
		        if(!spn) {
		                createSpanElement(argObj); 
		                spn = document.getElementById("EnglishDate");
		        };

		        // Note: The 3rd argument to printFormattedDate is a Boolean value that 
		        // instructs the script to use the imported locale (true) or not (false)
		        // when creating the dates. In this case, I'm not using the imported locale
		        // as I've used the "S" format mask, which returns the English ordinal
		        // suffix for a date e.g. "st", "nd", "rd" or "th" and using an
		        // imported locale would look strange if an English suffix was included

		        // Remove the current contents of the span
		        while(spn.firstChild) spn.removeChild(spn.firstChild);

		        // Add a new text node containing our formatted date
		        spn.appendChild(document.createTextNode(formattedDate));
		};

		// ]]>
