// Initialize accordion for main nav

window.addEvent('domready', function(){
	var mySlide = new Fx.Slide('navitems', {duration: 350});
	
	// Toggle for Main navigation header
	$('toggle1').addEvent('click', function(e){ 
		e = new Event(e);
		mySlide.toggle();
		e.stop();
	});
	// Toggle for Main navigation footer
	$('toggle2').addEvent('click', function(e){
		e = new Event(e);
		mySlide.toggle();
		e.stop();
	});

	//var scrollerW = $('scroller').getCoordinates().width;
	//var scrollContentW = $('scrollContent').getCoordinates().width;
	//var scrollKnobContainerW = $('scrollKnobContainer').getCoordinates().width;
	//alert('scroller : '+scrollerW+'\n scrollContent : '+scrollContentW+'\n scrollKnobContainer : '+scrollKnobContainerW);
	//new MooScroller('scroller', 'scrollKnob', { mode: 'vertical' });	
	
});

function startScroller() {
	//var scrollerW = $('scroller').getCoordinates().width;
	//var scrollContentW = $('scrollContent').getCoordinates().width;
	//var scrollKnobContainerW = $('scrollKnobContainer').getCoordinates().width;
	//alert('scroller : '+scrollerW+'\n scrollContent : '+scrollContentW+'\n scrollKnobContainer : '+scrollKnobContainerW);
	new MooScroller('scroller', 'scrollKnob', { mode: 'vertical' });
}
//window.addEvent('domready', startScroller);

// Add dates for drop downs in contact form
function populate(objForm,selectIndex) {
	timeA = new Date(objForm.year.options[objForm.year.selectedIndex].text, objForm.month.options[objForm.month.selectedIndex].value,1);
	timeDifference = timeA - 86400000;
	timeB = new Date(timeDifference);
	var daysInMonth = timeB.getDate();
	for (var i = 0; i < objForm.day.length; i++) {
		objForm.day.options[0] = null;
	}

	for (var i = 0; i < daysInMonth; i++) {
		objForm.day.options[i] = new Option(i+1);
	}
	
	document.f1.day.options[0].selected = true;
}

function getYears() {
	// You can easily customize what years can be used
	var years = new Array(2008,2009,2010,2011,2012)
	for (var i = 0; i < document.f1.year.length; i++) {
		document.f1.year.options[0] = null;
	}
	timeC = new Date();
	currYear = timeC.getFullYear();
	for (var i = 0; i < years.length; i++) {
		document.f1.year.options[i] = new Option(years[i]);
	}
	document.f1.year.options[2].selected=true;
}

window.onLoad = getYears;

