// YAHOO! utilities shortcuts
var yAnim = YAHOO.util.Anim;
var yEasing = YAHOO.util.Easing;
var yElement = YAHOO.util.Element;

// store key elements
var contactForm = new yElement('contactFormContainer');
var contactSending = new yElement('sendingContainer');

function submitcontactinfo() {
	// simulate a form submission transition

	var postParams = Form.serialize("emailform");
	new Ajax.Updater("contactFormContainer", '/app/pmre/feProperty/submitcontactinfo' ,{postBody: postParams});	

	contactForm.setStyle('display', 'none');
	contactSending.setStyle('display', 'block');
	
	function resetContactForm() {
		contactForm.setStyle('display', 'block');
		contactSending.setStyle('display', 'none');
	}

	setTimeout(resetContactForm, 4000);
	
	/* "blinds" effect attempt
	// capture the height of the sending message box
 	contactSending.setStyle('display', 'block');
 	contactSending.setStyle('overflow', 'hidden');
 	var sendingH = contactSending.get('offsetHeight');
	contactSending.setStyle('display', 'none');
	
	// create the animations
 	var formIn = new yAnim(contactForm.get('element'), {height:{to:contactForm.get('offsetHeight')}}, 1, yEasing.easeOut);
 	var formOut = new yAnim(contactForm.get('element'), {height:{to:0}}, 1, yEasing.easeOut);
 	var sendingIn = new yAnim(contactSending.get('element'), {height:{to:sendingH}}, 1, yEasing.easeOut);
 	var sendingOut = new yAnim(contactSending.get('element'), {height:{to:0}}, 1, yEasing.easeOut);
	
	// animation handlers
	function showSending() {
		contactForm.setStyle('display', 'none');
		contactSending.setStyle('height', 0);
		contactSending.setStyle('display', 'block');
		sendingIn.animate();
		setTimeout(hideSending, 3000);
	}
	
	function hideSending() {
		sendingOut.animate();
	}
	
	function showForm() {
		contactSending.setStyle('display', 'none');
		contactSending.set('offsetHeight', sendingH);
		contactForm.setStyle('display', 'block');
		formIn.animate();
	}
 	
 	// attach animation listeners
 	formOut.onComplete.subscribe(showSending);
 	sendingOut.onComplete.subscribe(showForm);
 	
 	// start the animation
 	formOut.animate();
 	*/
}