//Initialize Webpage and Page Elements
window.addEvent('domready', function( ) {
	//Center Page Contents Vertically in Screen
	if( window.getSize( ).y>$('body').getSize( ).y+$('footer').getSize( ).y+50 ) {
		//alert( ('adjust top: '+Math.floor(eval(window.getSize( ).y-($('body').getSize( ).y+$('footer').getSize( ).y+50))/2)) );
		topMargin = Math.floor(eval(window.getSize( ).y-($('body').getSize( ).y+$('footer').getSize( ).y+50))/2)+50;
		$('wrap').setStyle('height',window.getSize( ).y-2);
		$('body').setStyle('margin-top',topMargin);
		$('footer').setStyles({'position':'absolute','bottom':'0px'});
	}
	//Works :: Works Preview SlideShow
	if( $('slideshow') ) {
		window.addEvent('domready', function( ) {
			new Fx.Slideshow( 'menu','pictures','loading',{auto: true,autostart: true,autointerval: 5000} );
		});
	}
	//Web Forms :: Feedback Form
	if( $('feedbackForm') )
		initializeForm( "FeedbackForm" );
});





function setupFeedbackForm( ) {
	$('frmFeedback').setProperty('isvalid','false');
	//Setup Form Fields
	$('frmFeedback').reset( );
	$('Name').addEvent('change', function(event) { validateFormField(this,1,"This is a required field.")})
	$('Company').addEvent('change', function(event) { validateFormField(this,1,"This is a required field.")})
	$('Position').addEvent('change', function(event) { validateFormField(this,1,"This is a required field.")})
	$('EMail').addEvent('change', function(event) { validateFormField(this,32,"This is a required field.  Please supply a valid e-mail address.")})
	$('Message').addEvent('change', function(event) { validateFormField(this,1,"Please type in your message or inquiry.")})
	//Setup Form Buttons
	$('submitFeedback').addEvent('click', function(event) {
		event.stop( );
		$('frmFeedback').setProperty('ACTION',"FEEDBACK");
		submitForm("frmFeedback");
	})
	$('resetFeedback').addEvent('click', function(event) {
		event.stop( );
		resetForm("frmFeedback");
	})
}
