	
	//script makes use of jquery countdown plugin (see jquery.countdown.js)
	$(function () {

// took down countdown clock on Friday Jan 15 when the app system went live.	
/*
		dDay = new Date($.countdown.UTCDate(-5,2010,1-1,15,9,0));//EST 2010-Jan-15, 9am
		announce = '<span style="font-size:20px;font-weight:bold">Countdown to Application Submission!</span><br />';
		announce += '<a href="' + timeline_page + '">'; //timeline_page set in head.php or head_toplevel.php
		announce += '<span style="font-size:12px">Note new submission deadlines -- application system to open Jan. 15</span>';
		announce += '</a>';

		$('#countdown_banner').countdown({
				until: dDay,
				format: 'yowdHMS',
				description: announce,
				expiryText: '<h1><a href="' + expiryURL + '">Apply Now!</a></h1>'
		});
*/
		
		// 1/15/2010 BLH. changed countdown clock area to display link below.	
		// 1/21/2010 BLH. added code to recognize application system status. 
/*
		if(app_system_status==1){
			if(app_system_appears_open==1) {
				announce = '<announce><a href="' + announceURL + '">Apply Now!</a></announce>';
				announce += '<br /><strong>Preliminary applications due by January 22nd, 11:59pm EST</strong>';
				$('#countdown_banner').html(announce);				
			} else {
				announce = '<announce>Application System Now Closed</announce>';
				announce += '<br /><strong>Public Comment Opens Next Week: ĘCheck Back Soon</strong>';
				$('#countdown_banner').html(announce);
			}	
		} else if(app_system_status==2 && pub_comment_open==1) {
			announce = '<announce><a href="' + announceURL + '">Public Commenting Now Open</a></announce>';
			$('#countdown_banner').html(announce);
		} else if(app_system_status==2 && pub_comment_open==0) {
			announce = '<announce>Application System Now Closed</announce>';
			announce += '<br /><strong>Public Comment Opens Next Week: ĘCheck Back Soon</strong>';
			$('#countdown_banner').html(announce);
		} else {
			$('#countdown_banner').empty();
		}
*/
		
		if (app_system_status==1 && app_system_appears_open==1 && pub_comment_open==0) {
			announce = '<announce><a href="' + announceURL + '">Apply Now!</a></announce>';
			announce += '<br /><strong>Preliminary applications due by January 22nd, 11:59pm EST</strong>';
			$('#countdown_banner').html(announce);				
		} else if(app_system_status==1 && app_system_appears_open==0 && pub_comment_open==0) {
			announce = '<announce>Application System Now Closed</announce>';
			announce += '<br /><strong>Public Comment Opens Next Week: Check Back Soon</strong>';
			$('#countdown_banner').html(announce);		
		} else if(app_system_status==2 && app_system_appears_open==0 && pub_comment_open==0) {
			announce = '<announce>Application System Now Closed</announce>';
			announce += '<br /><strong>Public Comment Opens Next Week: Check Back Soon</strong>';
			$('#countdown_banner').html(announce);		
		} else if(app_system_status==2 && app_system_appears_open==0 && pub_comment_open==1) {
			announce = '<announce><a href="' + announceURL + '">Public Commenting: Join the Conversation</a></announce>';
			$('#countdown_banner').html(announce);			
		} else if(app_system_status==3 && app_system_appears_open==1 && pub_comment_open==1) {
			announce = '<announce><a href="' + announceURL + '">Apply Now!</a></announce>';
			announce += '<br /><strong>Resubmissions and New Applications due by February 15th, Noon (12pm) EST</strong>'; 
			$('#countdown_banner').html(announce);
		} else if(app_system_status==4 && app_system_appears_open==0 && pub_comment_open==1) {
			/* announce = '<announce>Application System Now Closed</announce>'; */
			/* announce += '<br /><strong>Applications Available for Public Commenting Soon!</strong>'; */ 
			announce = '<announce><a href="' + announceURL + '">Public Commenting: Join the Conversation</a></announce>';
			announce += '<br /><strong>Application System Now Closed</strong>';
			$('#countdown_banner').html(announce);
		} else if(app_system_status==4 && app_system_appears_open==0 && pub_comment_open==0) {
			announce = '<announce>Application & Commenting Systems Now Closed</announce>';
			announce += '<br /><a href="' + timeline_page + '"><strong>Finalists to be Announced March 22</a></strong>';
			$('#countdown_banner').html(announce);
		} else if(app_system_status==5 && app_system_appears_open==1 && pub_comment_open==1) {
			announce = '<announce><a href="' + announceURL + '">Finalists, Upload Videos/Demos Here!</a></announce>';
			announce += '<br /><strong>Videos/demos, budget, and budget narrative due for finalists April 19</strong>'; 
		} else {
			$('#countdown_banner').empty();
		}
	});
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	