function submitForm() {
	var myForm = $('eviteSubmit');

	// Check if all the fields are valid, and display message if not
	
	// Submit the form
	myForm.submit();
}

function submitPreview(direction) {
	var myForm = $('eviteSubmit');
	$('submitEviteType').value = direction;

	// Submit the form
	myForm.submit();
}

var currTab = 'artwork';

function setTab(newTab) {
	if (currTab != newTab) {

		oldSrc = new String($(currTab + 'TopTab').src);
		oldSrc = oldSrc.replace(/_on.gif/, "_off.gif");
		//alert('setting old to ' + oldSrc);
		$(currTab + 'TopTab').src = oldSrc;
		
		newSrc = new String($(newTab + 'TopTab').src);
		newSrc = newSrc.replace(/_off.gif/, "_on.gif");
		//alert('setting new to ' + newSrc);
		$(newTab + 'TopTab').src = newSrc;
		//alert(newTab);

		//alert($(currTab + "Tab").style.display);
		//Element.hide(currTab + "Tab");
		//Element.show(newTab + "Tab");
		//show(newTab + "Tab");	
		$(currTab + 'Tab').style.display = 'none';
		$(newTab + 'Tab').style.display = 'block';
		//alert($(currTab + 'Tab').style.display);
		currTab = newTab;
		
		
	}
	return false;
}

function setChoice(type, title1, title2, filename) {
	$('selectedImageDisplay').src = filename;
	var theHTML;
	if (type == 'artwork') {
		theHTML = '<p><i>Title:</i> ' + title2 + '<br /><i>Artist:</i> ' + title1 + '</p>';
	}
	else if (type == 'agency') {
		theHTML = '<p><i>Agency:</i> ' + title1 + '</p>';
	}
	else if (type == 'cause') {
		theHTML = '<p><i>Cause:</i> ' + title1 + '</p>';
	}
	$('selectedInfo').innerHTML = theHTML;
	Field.focus('toEmail');
	$('chosenImageType').value = type;
	$('chosenImageFilename').value = filename;
	$('chosenImageTitle1').value = title1;
	$('chosenImageTitle2').value = title2;
	return false;
}