function createGiveAwayForm() {
	if (!window.giveAwayForm) {
		giveAwayForm = createForm();
		giveAwayForm.setTitle("Giveaway Entry Form",{fontSize:'16px'})
		
		var a = ['	<table width="351" border="0" cellpadding="4" cellspacing="4">'
				,'		<tr>'
				,'			<td width="154"><strong>First Name:</strong></td>'
				,'			<td width="185"><input type="text" name="fname" /></td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td><strong>Last Name:</strong></td>'
				,'			<td><input type="text" name="lname" /></td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td><strong>E-mail:</strong></td>'
				,'			<td><input type="text" name="email" /></td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td><strong>Address:</strong></td>'
				,'			<td><input type="text" name="address"/></td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td><strong>City:</strong></td>'
				,'			<td><input type="text" name="city"/></td>'
				,'		</tr>'
				,'		<tr>'
				,'<td><strong>State:</strong></td>'
				,'<td><input type="text" name="state" size="2" maxlength="2" /></td>'
				,'</tr>'
				,'<tr>'
				,'<td><strong>Zip:</strong> </td>'
				,'<td><input name="zip" type="text" size="5" /></td>'
				,'</tr>'
				,'<tr>'
				,'    <td colspan="2"><span style="color:#666;">Please send me RentMidland offers and updates <input type="checkbox" defaultVal="checked" name="mail" /></span></td>'
				,'</tr>'
				,'<tr>'
				,'    <td class="legal" colspan="2"><input type="hidden" name="send" value="send"><input type="hidden" name="category" defaultVal="2" value="2">Giveaway limited to one entry per e-mail address. Winner to be notified via e-mail. Prize will be mailed. Giveaway ends 11:59 P.M. June 15. Winner will be drawn June 16.</td>'
				,'</tr>'
				,'</table>'];
		
		
		giveAwayForm.formBody.innerHTML = a.join('');
		giveAwayForm.onEnterKey = function(){
			var errors = [];
			if (trim(this.form.fname.value) == "" || trim(this.form.lname.value) == "" || trim(this.form.city.value) == "" || trim(this.form.state.value) == "" || trim(this.form.zip.value) == "" || trim(this.form.email.value) == ""){
				errors.push('A first and last name is required.');
			}
			if (trim(this.form.state.value) == ""){
				errors.push('State is required.');
			}
			if (trim(this.form.city.value) == ""){
				errors.push('City is required.');
			}
			if (trim(this.form.address.value) == ""){
				errors.push('An address is required.');
			}
			if (trim(this.form.zip.value) == ""){
				errors.push('Zip Code is required.');
			}
			if (trim(this.form.email.value) == "" || !testEmail(this.form.email.value)){
				errors.push('A valid e-mail is required.');
			}
			if (!errors.length) {
				//alert(this.form.serialize());
				var oThis = this;				
				new Ajax.Request('ajax/submitgiveaway.php',{
					parameters : this.form.serialize()
					,onSuccess : function(t){
						eval(t.responseText);
					}
					,onException : function(t,e){alert('Xception:44'+e.message)}
				});
			} else {
				alert(errors.join("\n"));	
			}
		}.bind(giveAwayForm);
		
	}
	giveAwayForm.button.innerHTML = 'Enter Giveaway!';
	giveAwayForm.push().center().focus().resetVals().show();
	giveAwayForm.button.setStyle({fontWeight:'bold',backgroundColor:'#68970d'});
	var formHdr = document.getElementsByClassName('formHdr');
	formHdr[0].setStyle({borderBottom:'1px solid #CCC',backgroundColor:'#eee'});
	var formFooter = document.getElementsByClassName('formFooter');
	formFooter[0].setStyle({borderTop:'1px solid #CCC',backgroundColor:'#eee'});
}
function createContactComplexForm(title,complex) {
	if (!window.complexContactForm) {
		
		complexContactForm = createForm({/*disableDragDrop:true,*/shadowWidth:0,shadowOpacity:0});
		complexContactForm.setTitle('<strong>Contact:</strong> '+title,{fontSize:'14px',fontWeight:'normal',fontFamily:'verdana'})
		var days = Array();
		days.push('<option value=""> </option>');
		for(var x = 1;x<32;x++) {
			days.push('<option value="'+x+'">'+x+'</option>');
		}
		
		var now = new Date();
		var years = Array();
		years.push('<option value=""> </option>');
		for(var y = 1;y<=1;y++) {
			var yr = now.getFullYear();
			years.push('<option value="'+yr+'">'+yr+'</option>');	
		}
		
		
		var a = ['	<table width="351" border="0" cellpadding="4" cellspacing="4">'
				,'		<tr>'
				,'			<td width="104"><strong>Your Name:*</strong></td>'
				,'			<td><input type="text" name="fname" id="fname" /></td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td><strong>Your e-mail:*</strong></td>'
				,'			<td><input type="text" name="femail" id="femail" /></td>'
				,'		</tr>'
				,'			<td><strong>Confirm e-mail:*</strong></td>'
				,'			<td><input type="text" name="fconfirmemail" id="fconfirmemail" /></td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td><strong>Your Phone:*</strong></td>'
				,'			<td><input type="text" name="fphone" id="fphone" /></td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td><strong>Move-In Date:*</strong></td>'
				,'			<td>'
				,'				Month <select name="fmoveindate_month" id="fmoveindate_month">'
				,'					<option value=""></option>'
				,'					<option value="January">January</option>'
				,'					<option value="February">February</option>'
				,'					<option value="March">March</option>'
				,'					<option value="April">April</option>'
				,'					<option value="May">May</option>'
				,'					<option value="June">June</option>'
				,'					<option value="July">July</option>'
				,'					<option value="August">August</option>'
				,'					<option value="September">September</option>'
				,'					<option value="October">October</option>'
				,'					<option value="November">November</option>'
				,'					<option value="December">December</option>'
				,'				</select>'
				,'				Day <select name="fmoveindate_day" id="fmoveindate_day">'
				,					days.join('')
				,'				</select>'
				,'				Year <select name="fmoveindate_year" id="fmoveindate_year">'
				,					years.join('')
				,'				</select>'
				,'			</td>'
				,'		</tr>'
				,'		<tr>'
				,'			<td colspan="2"><input type="hidden" defaultVal="1" name="send" id="send"><input type="hidden" defaultVal="'+complex+'" name="complex"><div style="margin-bottom:3px;"><strong>Comments/Questions:</strong></div><textarea rows="4" cols="50" name="finquiry" id="finquiry"></textarea></td>'
				,'		</tr>'
				,'	</table>'];
		
		
		complexContactForm.formBody.innerHTML = a.join('');
		complexContactForm.onEnterKey = function(){
			var errors = [];
			if (!trim(this.form.fname.value)){
				errors.push('Your full name is required.');
			}
			if (!trim(this.form.femail.value) | !trim(this.form.fconfirmemail.value)) {
				errors.push('A valid e-mail is required.');
			} else if (trim(this.form.femail.value) && trim(this.form.fconfirmemail.value) && trim(this.form.femail.value) != trim(this.form.fconfirmemail.value)){
				errors.push('E-mail and Confrim E-mail do not match.');
			} else if (!testEmail(this.form.femail.value)) {
				errors.push('Invalid e-mail address.');
			}
			if (!trim(this.form.fmoveindate_month.value) || !trim(this.form.fmoveindate_day.value) || !trim(this.form.fmoveindate_year.value)) {
				errors.push('Move-in date is required.');	
			}
			if(!trim(this.form.finquiry.value)) {
				errors.push('Please write a question or comment.');	
			}
			if (!errors.length) {
				var oThis = this;
				new Ajax.Request('ajax/contactcomplex.php',{
					parameters : this.form.serialize()
					,onSuccess : function(t){
						eval(t.responseText);
					}
					,onException : function(t,e){alert('Xception:44'+e.message)}
				});
			} else {
				alert(errors.join("\n"));	
			}
		}.bind(complexContactForm);
		
	}
	complexContactForm.button.innerHTML = 'Submit';
	complexContactForm.button.setStyle({fontWeight:'bold',backgroundColor:'#68970d'});
	complexContactForm.push().center().focus().resetVals().show();
	var formHdr = document.getElementsByClassName('formHdr');
	formHdr[0].setStyle({borderBottom:'1px solid #CCC',backgroundColor:'#eee'});
	
	var formFooter = document.getElementsByClassName('formFooter');
	formFooter[0].setStyle({borderTop:'1px solid #CCC',backgroundColor:'#eee'});
	//theForm[0].style.zIndex = 999;
	//complexContactForm.setStyle({position:'absolute',top:'100px'});
	//alert(complexContactForm.getStyle('zIndex'));
}