// JavaScript Document



	
	function whole_redirect()
	{
		
		var firstName = escape(document.reserveForm.firstName.value);
		var lastName = escape(document.reserveForm.lastName.value);
		var address = escape(document.reserveForm.address.value);
		var city = escape(document.reserveForm.city.value);
		var state = escape(document.reserveForm.state.value);
		var zip = escape(document.reserveForm.zip.value);
		
<!--Phone number must be broken into parts for Paypal.-->		
		var phone = (document.reserveForm.homePhone.value);
		var areaCode = phone.substring(1,4);
		var prefix = phone.substring(5,9);
		var number = phone.substring(9,14);
		
		var itemName = escape("30-Day Wedding Hold for ");
		var wedDate = escape(document.reserveForm.weddingDate.value);
		
<!--These are the pages that Paypal returns to after the transaction.-->		
		returnURL = "http://www.princessbridestudio.com/forms/reserve/reserve_finish.html"
		cancelReturnURL = "http://www.princessbridestudio.com/forms/reserve/reserve_cancel.html"
		
	<!--This is the URL for the Paypal button. 
		initialURL ="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=kapiehl%40sbcglobal%2enet&amount=50%2e00&no_shipping=1&cn=Additional%20Information&currency_code=USD&lc=US&bn=PP%2dBuyNowBF&charset=UTF%2d8";
		
		<!--This appends the variables above to the basic URL.-->
		
		wholeURL = initialURL.concat("&item_name=",itemName, wedDate,"&first_name=",firstName,"&last_name=",lastName,"&address1=",address,"&city=",city,"&state=",state,"&zip=",zip,"&night_phone_a=",areaCode,"&night_phone_b=",prefix,"&night_phone_c=",number,"&return=",returnURL,"&cancel_return=",cancelReturnURL,"&rm=2");
		
	<!--This is the is the final value that is returned. It becomes the "redirect" value on the form and is passed to formmail after the values calculated here are appended.-->-->	
		document.reserveForm.redirect.value = wholeURL;

	
	}
