//SHOW SUBSCRIBE FORM
function showSubscribe()
{$('column').hide();
var email_show = $('email_text').innerHTML;
$('submitform').update('<h3>SUBSCRIBE TO NEW SOLICITATIONS</h3><form><strong>Email:</strong><input id="email" type="text" name="email" size="50" value="'+email_show+'"><br/><span class="submitletter" onclick="Subscribe()">CLICK TO SUBSCRIBE</span></form><h6 onclick="closeForm()">close</h6>').show();}


//SUBSCRIBE TO RFPS
function Subscribe()
{var email = $F('email');
if (validEmail(email)==false)
{return;}
email = email.strip().toLowerCase();
var url = 'upload/subscribe.asp?email='+email;
var myAjax = new Ajax.Request(url, {method: 'post'});
closeForm();
alert('You have subscribed to receive new solicitations.');}


//SHOW SUBMIT FORM
function showSubmit( fname, title )
{$('column').hide();
var email_show = $('email_text').innerHTML;
$('submitform').update('<h3>RFP: '+title+'</h3><form id="letter_form" action="upload/letter_upload.asp" method=post target="_top" ENCTYPE="multipart/form-data">&nbsp;<strong>Email:</strong><input id="email" type="text" name="email" size="50" value="'+email_show+'"><br><input type="file" name="SourceFile" id="SourceFile">&nbsp;<span class="submitletter" onclick="addLetter()">Upload the file &gt;&gt;</span><input id="fname" name="fname" type="hidden" value="'+fname+'" /></form><p>The proposal should be a PDF file no larger than 10MB.</li><p><h6 onclick="closeForm()">close</h6>').show();}


//SUBMIT LETTER
function addLetter()
{var email = $F('email');
if (validEmail(email)==false)
{return;}
var fname = $('SourceFile').getValue().strip();
var patt1=/.pdf/gi;
if (fname==''||null==fname||fname.match(patt1)==null)
{alert('You must choose a PDF file to upload.');
return;}
{document.forms["letter_form"].submit();
alert('Thank you! Your proposal has been received.');}}


//CLOSE FORM
function closeForm()
{$('submitform').hide();
$('column').show();}


//VALID EMAIL
function validEmail( str ) 
{str = str.strip();
if (str.length>0)
{var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(reg.test(str) == false) 
{alert('Invalid email address');
return false}
else
{return true;}}
else
{return false;}}


//SHOW ABOUT
function showAbout()
{$('page_title').update('ABOUT DCHE');
$('page_content').update('The Mission of DC Housing Enterprises is to pursue a broad range of opportunities related to real estate acquisition, rehabilitation, development and/or redevelopment and to facilitate the provision of related management and social services as needed for each project. The choice to pursue any potential transaction will be guided by the explicit goal of increasing affordable housing opportunity for low- and moderate-income families living in Washington, DC.').show();}


//SHOW PROJECTS
function showProjects()
{$('page_title').update('PROJECTS');
var target = 'page_content';
var url = 'incs/projects.asp';
var myAjax = new Ajax.Updater({success: target}, url, {method: 'get'});
$(target).update('Loading...').show();}