// JavaScript Document

// *************************************************** //
//                 NEWS FEED OBJECT #1
// *************************************************** //
function newsFeedHeader1(){
	
	document.write( 'May 19, 2010' );
		
}

function newsFeedBody1(){
	
	newNewsImage(5, 19, 2010)
	document.write( 'New Logo, New Look, New Website! <a href="news_2010.html#1" title="Read the Full Article"><img src="images/icons/goto.gif" alt="Read the Full Article" /></a>' );

}

// *************************************************** //
//                 NEWS FEED OBJECT #2
// *************************************************** //
function newsFeedHeader2(){
	
	document.write( 'Mar. 7, 2009' );
		
}

function newsFeedBody2(){
	
	document.write( 'New Project in Development' );

}


// *************************************************** //
//                 NEWS FEED OBJECT #3
// *************************************************** //
function newsFeedHeader3(){
	
	document.write( 'Feb. 13, 2009' );
		
}

function newsFeedBody3(){
	
	document.write( 'Website Updates <img src="images/icons/bullet.gif" width="7" height="7" /> Metallica - Death Magnetic Review <img src="images/icons/bullet.gif" width="7" height="7" /> Gamer&rsquo;s Lounge Details <img src="images/icons/bullet.gif" width="7" height="7" /> Kevin&rsquo;s Teeth Grinder of the Week' );

}

function newNewsImage( month, day, year ){

	today = new Date;
	var LastModifiedDate = new Date(document.lastModified);

	if( (today.getYear() - year) == 0 ){
		if( ((today.getDate()) - day) < 5 ){
			if( (today.getMonth()+1) == month ){
				document.write('<img src="images/icons/new.gif" alt="New news!" title="New news!" width="19" height="7" />&nbsp;');
			}
		}
	}

}


// Displays when the Home Page was Last Modified
// -> Converts from 24 hour time to 12 hour time <-
function index_lastmodified(){

	var lastmod = new Date( document.lastModified );
	var today = new Date( );
	var lastmod_hours;
	var lastmod_timeofday;
	
	if ( (lastmod.getHours()+1) >= 13 ){
		if( (lastmod.getHours()) == 23 ){
			lastmod_hours = (lastmod.getHours());
			lastmod_timeofday = "am";
		}
		else{
			if( (lastmod.getHours() == 12) ){
				lastmod_hours = (lastmod.getHours());
				lastmod_timeofday = "pm";	
			}
			else{
				lastmod_hours = (lastmod.getHours()-12);
				lastmod_timeofday = "pm";
			}
		}
	}
	else{
		if( (lastmod.getHours()+1) == 12 ){
			lastmod_hours = (lastmod.getHours());
			lastmod_timeofday = "pm";
		}
		else{
			if( lastmod.getHours() == 0 ){
				lastmod_hours = 12;
			}
			else{
				lastmod_hours = (lastmod.getHours());
			}
			lastmod_timeofday = "am";
		}
	}
	
	if( lastmod.getYear() == today.getYear() ){
		if( lastmod.getMonth() == today.getMonth() ){
			if( lastmod.getDate() == today.getDate() ){
				if( lastmod.getMinutes() < 10 ){
					document.write("Last updated today at "+ lastmod_hours + ":" + "0" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday );
				}
				else{
					document.write("Last updated today at "+ lastmod_hours + ":" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday );
				}
			}
			else{
				if( lastmod.getMinutes() < 10 ){
					document.write("Last updated at "+ lastmod_hours + ":" + "0" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday + " on "+(lastmod.getMonth()+1) + "/" + lastmod.getDate() + "/" + lastmod.getYear() );
				}
				else{
					document.write("Last updated at "+ lastmod_hours + ":" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday + " on "+(lastmod.getMonth()+1) + "/" + lastmod.getDate() + "/" + lastmod.getYear() );
				}
			}
		}
		else{
			if( lastmod.getMinutes() < 10 ){
				document.write("Last updated at "+ lastmod_hours + ":" + "0" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday + " on "+(lastmod.getMonth()+1) + "/" + lastmod.getDate() + "/" + lastmod.getYear() );
			}
			else{
				document.write("Last updated at "+ lastmod_hours + ":" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday + " on "+(lastmod.getMonth()+1) + "/" + lastmod.getDate() + "/" + lastmod.getYear() );
			}
		}
	}
	else{
		if( lastmod.getMinutes() < 10 ){
			document.write("Last updated at "+ lastmod_hours + ":" + "0" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday + " on "+(lastmod.getMonth()+1) + "/" + lastmod.getDate() + "/" + lastmod.getYear() );
		}
		else{
			document.write("Last updated at "+ lastmod_hours + ":" + lastmod.getMinutes() + "&nbsp;" + lastmod_timeofday + " on "+(lastmod.getMonth()+1) + "/" + lastmod.getDate() + "/" + lastmod.getYear() );
		}
	}

}
