	function MailingIsBilling(form) {
		
		if (form.BillingSame.checked) {
		
			form.x_first_name.value = form.x_ship_to_first_name.value
			form.x_last_name.value = form.x_ship_to_last_name.value
			form.x_address.value = form.x_ship_to_address.value
			form.x_city.value = form.x_ship_to_city.value
			form.x_state.options.selectedIndex = form.x_ship_to_state.options.selectedIndex
			form.x_country.options.selectedIndex = form.x_ship_to_country.options.selectedIndex
			form.x_zip.value = form.x_ship_to_zip.value
		
		
			
		} else { 
		
			form.x_first_name.value = ""
			form.x_last_name.value = ""
			form.x_address.value = ""
			form.x_city.value = ""
			form.x_state.options.selectedIndex = 0
			form.x_country.options.selectedIndex = 0
			form.x_zip.value = ""
			
		}
	}
	
	//allows cancellation after clicking DELETE button  -- onClick="return confirmDeletion()"
	
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}
	
	function calculateAmount(form) {
			regfee = parseFloat(form.topay.value)
			msfee = parseFloat(form.msfee.options[form.msfee.options.selectedIndex].value)
			form.regfee.value = regfee + msfee
			form.x_amount.value = regfee + msfee
		
	}
	
	function validateForm(form) {

		
	//require fields		
			
		if (form.x_ship_to_first_name.value.length<1){
			alert("Please enter your first name.")
			form.x_ship_to_first_name.focus()
			form.x_ship_to_first_name.select()
			return false
		}	
			
		if (form.x_ship_to_last_name.value.length<1){
			alert("Please enter your last name.")
			form.x_ship_to_last_name.focus()
			form.x_ship_to_last_name.select()
			return false
		}


			
		if (form.x_ship_to_address.value.length<1) { 
			alert("Please enter your mailing address.")
			form.x_ship_to_address.focus()
			form.x_ship_to_address.select()
			return false
		 
		}	
			
		if (form.x_ship_to_city.value.length<1) { 
			alert("Please enter your mailing city.")
			form.x_ship_to_city.focus()
			form.x_ship_to_city.select()
			return false
		 
		}	
		
		if (form.x_ship_to_state.options[form.x_ship_to_state.options.selectedIndex].value == "") { 
			alert("Please select your mailing state.")
			form.x_ship_to_state.focus()
			return false
		}	
			
			
		if (form.x_ship_to_zip.value.length<1) { 
			alert("Please enter your mailing zipcode.")
			form.x_ship_to_zip.focus()
			form.x_ship_to_zip.select()
			return false
		 
		}		
		
		if (form.x_ship_to_country.options[form.x_ship_to_country.options.selectedIndex].value == "") { 
			alert("Please select your mailing country.")
			form.x_ship_to_country.focus()
			return false
		}
			
			
		if (form.x_phone.value.length<1) { 
			alert("Please enter your phone number.")
			form.x_phone.focus()
			form.x_phone.select()
			return false
		 
		}	
		
		if (form.x_email.value.length<1) { 
			alert("Please enter an email address.")
			form.x_email.focus()
			form.x_email.select()
			return false
		}
		
	if (form.x_email.value.length > "1") {
	
		var emailStr = form.x_email.value
		var emailPat=/^(.+)@(.+)$/
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
		var validChars="\[^\\s" + specialChars + "\]"
		var quotedUser="(\"[^\"]*\")"
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
		var atom=validChars + '+'
		var word="(" + atom + "|" + quotedUser + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
		var matchArray=emailStr.match(emailPat)
		
		if (matchArray==null) {
			alert("The email address you entered seems incorrect. (check @ and .'s)")	
			form.x_email.focus();
			form.x_email.select(); 
			form.x_email.className='hilite'   	
	    	return false;
		}
		
		var user=matchArray[1]
		var domain=matchArray[2]
	
		if (user.match(userPat)==null) {
	    	alert("The email address you entered seems incorrect. The username doesn't seem to be valid.")	    	
			form.x_email.focus();
			form.x_email.select();
			form.x_email.className='hilite'   	
	    	return false;
	    	
		}
		
		var IPArray=domain.match(ipDomainPat)
	
		if (IPArray!=null) {
		  	for (var i=1;i<=4;i++) {
		    	if (IPArray[i]>255) {
		        	alert("The email address you entered seems incorrect. The IP address is invalid.")	
		   			form.x_email.focus();
					form.x_email.select();
					form.x_email.className='hilite'   	
					return false;

		    	}
	    	}
		}
	
		var domainArray=domain.match(domainPat)
		if (domainArray==null) {
			alert("The email address you entered seems incorrect. The domain name doesn't seem to be valid.")	
			form.x_email.focus();
			form.x_email.select();
			form.x_email.className='hilite'   	
			return false;
		}
	
		var atomPat=new RegExp(atom,"g")
		var domArr=domain.match(atomPat)
		var len=domArr.length
		if (domArr[domArr.length-1].length<2 || 
	  		domArr[domArr.length-1].length>3) {
	  	 	alert("The email address you entered seems incorrect. The address must end in a three-letter domain, or two letter country.")
	  	 	form.x_email.focus();
			form.x_email.select();
			form.x_email.className='hilite'   	
			return false;

		}
	
		if (len<2) {
	   		var errStr="The email address you entered seems incorrect.  The address is missing a complete hostname."
	   		alert(errStr)
	  	 	form.x_email.focus();
			form.x_email.select();
			form.x_email.className='hilite'   	
			return false;

		}
	}
	
	
				
		
		if (form.x_card_num.value.length<1) { 
			alert("Please enter a valid credit card number.")
			form.x_card_num.focus()
			form.x_card_num.select()
			return false
		 
		}	
			
		if (form.x_exp_date.value.length<5) { 
			alert("Please enter a card expiration date.")
			form.x_exp_date.focus()
			form.x_exp_date.select()
			return false
		 
		}
		if (form.x_exp_date.value.length=5) {	
			var ok = "Y"
			var valid = "/0123456789"
			var temp;
		
			for (var i=0; i<form.x_exp_date.value.length; i++) {
				temp = "" + form.x_exp_date.value.substring(i, i+1);
					if (valid.indexOf(temp) == "-1") ok = "N";
			}
			
			if (ok == "N") {
				alert("You have entered an invalid card expiration date.");
				form.x_exp_date.focus();
				form.x_exp_date.select();
				return false;
			}
	
				
		}
	
			
		if (form.x_first_name.value.length<1) { 
			alert("Please add the first name on your credit card.")
			form.x_first_name.focus()
			form.x_first_name.select()
			return false
		 
		}
	
			
		if (form.x_last_name.value.length<1) { 
			alert("Please add the last name on your credit card.")
			form.x_last_name.focus()
			form.x_last_name.select()
			return false
		 
		}
		if (form.x_address.value.length<1) { 
			alert("Please add a billing street address.")
			form.x_address.focus()
			form.x_address.select()
			return false
		 
		}
			
		if (form.x_city.value.length<1) { 
			alert("Please add the billing city.")
			form.x_city.focus()
			form.x_city.select()
			return false
		 
		}
		
		if (form.state.options[form.state.options.selectedIndex].value == "") { 
			alert("Please select your billing state.")
			form.state.focus()
			return false
		}
		
		if (form.x_country.options[form.x_country.options.selectedIndex].value == "") { 
			alert("Please select your billing country.")
			form.x_country.focus()
			return false
		}
			
		if (form.x_zip.value.length<1) { 
			alert("Please add the billing zipcode.")
			form.x_zip.focus()
			form.x_zip.select()
			return false
		 
		}
		
	}
	
	
	



		
//////////////////////////////////////////////////////////////
//EDIT THE # SIGNS OF THE LINKS IN THE STRINGS BELOW
//////////////////////////////////////////////////////////////
submenu_divider = "<tr><td colspan=3 bgcolor='#067B8E'><img src='images/spacer.gif' height='1' width='1' border='0'></td>";
submenu_left = "<tr><td nowrap bgcolor='#489FAC' onMouseOver=this.className='submenu'; onMouseOut=this.className='';><img src='images/SubmenuCorner.gif' height='18' width='6' border='0' align='absmiddle'>";
submenu_right = "<td bgcolor='#067B8E'></td></tr>";

//ABOUT US
submenu1_Content = ""
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='about_director.php' class='menu'>From the Director</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='about_faculty.php' class='menu'>Conference Faculty</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='about_staff.php' class='menu'>Conference Staff</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='about_pastwinners.php' class='menu'>Contest Winners</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='about_sponsors.php' class='menu'>Sponsors & Partners</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='about_scholarships.php' class='menu'>Scholarship Fund</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right;


//CONFERENCES
//---------------------
submenu2_Content = ""
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='conference_summer.php' class='menu'>June Conference</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='conference_march_poetry.php' class='menu'>March Poetry Conference</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='conference_location.php' class='menu'>Location and Directions</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='https://www.sbwritersconference.com/conference_registrationS.php' class='menu'>Conference Registration</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right;


//WEEKEND INTENSIVES
//---------------------
submenu3_Content = ""
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='intensives_overview.php' class='menu'>Overview</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='intensives_workshops.php' class='menu'>Upcoming Workshops</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='intensives_location.php' class='menu'>Location and Directions</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='https://www.sbwritersconference.com/conference_registrationW.php' class='menu'>Workshop Registration</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right;

//RESOURCES
//---------------------
submenu4_Content = ""
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='http://sbwritersconference.com/enewsletter/' class='menu' target='new'>Newsletter</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='resources_links.php' class='menu'>Useful Links</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right+submenu_divider
+submenu_left+"&nbsp;&nbsp;&nbsp;<a href='about_outreach.php' class='menu'>Outreach</a>&nbsp;&nbsp;&nbsp;</td>"+submenu_right;
//////////////////////////////////////////////////////////////
// END OF RUSS EDITS
//////////////////////////////////////////////////////////////
//X POSITION OF SUBMENU
//---------------------
submenu1_x = 60;
submenu2_x = 158;
submenu3_x = 263;
submenu4_x = 550;
submenu5_x = 442;
//---------------------

function showSubmenu(whichSubmenu){
 
document.getElementById('submenu').innerHTML = "<table border='0' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF'><tr>"
+"<td><table border='0' cellspacing='0' cellpadding='0' bgcolor='#FFFFFF'>"
+submenu_divider+eval(whichSubmenu + '_Content')+submenu_divider
+"</table></td></tr></table>"
document.getElementById('submenu').style.left = eval(whichSubmenu + '_x') + 'px';
document.getElementById('submenu').style.visibility='visible';
killTimeout();
}
var timerRunning = false;
//---------------------
function hideSubmenuInit(){
	hideTimeOut = window.setTimeout('hideSubmenu()',50);
	timerRunning = true;
}
//---------------------
function hideSubmenu(){
	document.getElementById('submenu').style.visibility = 'hidden';
}
//---------------------
function killTimeout(){
	if(timerRunning){
		window.clearTimeout(hideTimeOut);
		timerRunning = false;
	}
}
