function checkIWant() {
	var isGood = true;
	
	if ($F('want_yourName') == 'Your name...') {
		$('want_yourName').addClassName('errorHere');
		isGood = false;
	} else
		$('want_yourName').removeClassName('errorHere');
		
	
	if ($F('want_yourEmail') == 'Email address...') {
		$('want_yourEmail').addClassName('errorHere');
		isGood = false;
	} else
		$('want_yourEmail').removeClassName('errorHere');
	
	return isGood;
}

function submitIWant() {
	if (checkIWant()) {	
		var queryValues = $('iWantForm').serialize(true);
		$('iWantBox').innerHTML = '<br /><center><img src="staticfiles/loader-circle.gif" /><br /><br /></center>';
		new Ajax.Request('staticfiles/iWantForm.php', {
			method: 'post',
			parameters: queryValues,
			onSuccess: function(transport) {
				$('iWantBox').update(transport.responseText);
			}
		});
	}
}


function checkIWant2() {
	var isGood = true;
	
	if ($F('want_yourName2') == 'Your name...') {
		$('want_yourName2').addClassName('errorHere');
		isGood = false;
	} else
		$('want_yourName2').removeClassName('errorHere');
		
	
	if ($F('want_yourEmail2') == 'Email address...') {
		$('want_yourEmail2').addClassName('errorHere');
		isGood = false;
	} else
		$('want_yourEmail2').removeClassName('errorHere');
	
	return isGood;
}

function submitIWant2() {
	if (checkIWant2()) {	
		var queryValues = $('iWantForm2').serialize(true);
		$('iWantBox2').innerHTML = '<br /><center><img src="staticfiles/loader-circle.gif" /><br /><br /></center>';
		new Ajax.Request('staticfiles/iWantForm2.php', {
			method: 'post',
			parameters: queryValues,
			onSuccess: function(transport) {
				$('iWantBox2').update(transport.responseText);
			}
		});
	}
}

function showPopup() {
	if (!($('popupBox').visible())) {
		var windowSize = document.viewport.getDimensions();
		$('popupBox').setStyle({
			right: '20' + "px",
			top: 	((windowSize.height - $('popupBox').getHeight()) / 2) + "px"
		});
		
		new Effect.Appear($('popupBox'), { duration: .3 });
	}
}

function hidePopup() {
	if (($('popupBox').visible()))
		new Effect.Fade($('popupBox'), { duration: .3 });	
}

new Event.observe(window, 'load', function() {
	if ($('popupBox') != undefined)
		new Draggable('popupBox', { handle: 'popupBoxBorder' });
});