// This code validates that the e-mail address is in correct format
		function clearemailbox(){
			if(document.FMemailalert2.Alertmail.value == "Enter your email here")
			{
				document.FMemailalert2.Alertmail.value = "";
			}
		}
		function SetEmail(c_name,expiredays){
			clearemailbox()
			var strEmail=document.FMemailalert2.Alertmail.value
			var filter = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
			if (strEmail=='')
			{		
				window.location = '../rentalalerttool.aspx'
				return true;
			}
			if(filter.test(strEmail)){
				var exdate=new Date()
				exdate.setTime(exdate.getTime()+(expiredays*24*3600*1000))
				document.cookie=c_name+ "=" +escape(strEmail)+ 
				((expiredays==null) ? "" : "; expires="+exdate) + ";path=/";
				window.location = '../rentalalerttool.aspx'
				//alert (document.cookie);
				return true;
			}
			else
			{
				alert('E-Mail is in wrong format.\n     Example:\n     name@domain.com');
				return false;
			}
		}		

//This creates the actual e-mail form for user's input
document.write('<div id="partner-contentHeaderEmailForm">')
document.write('<form name="FMemailalert2" method="post" action="../rentalalerttool.aspx">')
document.write('<span class="email_label">Get Apartment Listings Delivered To Your Inbox!</span><br />')
document.write('<label>')
document.write('<input name="Alertmail" type="text" class="uvp_home1" value="Enter your email here" size="30" onFocus=\'javascript:clearemailbox()\'>')
document.write('&nbsp;')
document.write('<input name="Hp_Email_Listings" id="Hp_Email_Listings" type="image" src="http://media.apartments.com/images/whatcounts/submit.jpg" align="absmiddle" onclick="return SetEmail(\'AptsEmail\',1)"/>')
document.write('</label>')
document.write('</form>')
document.write('</div>')