// Headlines from STARTREK.COM

// Copyright (c) 2007 CBS Studios Inc. All Rights Reserved.

// Create a new Headline array
function headlines ( h_title, h_url, h_pub_date, h_category_url, h_category )
{
   this.h_title = h_title
   this.h_url = h_url
   this.h_pub_date = h_pub_date
   this.h_category_url = h_category_url
   this.h_category = h_category
}


// Set default parameters
if ( typeof startrekcom_header == 'undefined')
	{ startrekcom_header = "text"; }
	
if ( typeof startrekcom_linkcolor == 'undefined')
	{ startrekcom_linkcolor = "none"; }
	
if ( typeof startrekcom_bullet == 'undefined' )
	{ startrekcom_bullet = false; }
	
if ( typeof startrekcom_date == 'undefined' )
	{ startrekcom_date = false; }
	
if ( typeof startrekcom_numheadlines == 'undefined' )
	{ startrekcom_numheadlines = 10; }
	
if ( typeof startrekcom_table == 'undefined' )
	{ startrekcom_table = false; }
	
if ( typeof startrekcom_newwindow == 'undefined' )
	{ startrekcom_newwindow = false; }

// Determine if target is this window or a new one

var target_window = "_parent";
if ( startrekcom_newwindow ) {
	target_window = "startrekcom"; }

// Fill the headlines array with the headline content and links

headlines = new Array(

   new headlines( 'Next Remastered Episode: "Tomorrow Is Yesterday"',"http://www.startrek.com/startrek/view/series/TOS/episode/68702.html","12.23.07","http://www.startrek.com/startrek/view/series/TOS/index.html","<i>Star Trek</i>" ),
   new headlines( 'Keep the conversation going on StarTrek.com boards',"http://www.startrek.com/startrek/view/news/article/2316633.html","12.18.07","http://www.startrek.com/startrek/view/news/index.html","News" ),
   new headlines( 'Okuda Logo for New Lunar Lander Unveiled',"http://www.startrek.com/startrek/view/news/article/2316574.html","12.14.07","http://www.startrek.com/startrek/view/news/index.html","News" ),
   new headlines( '"InAlienable" Premieres, "Of Gods & Men" Soon!',"http://www.startrek.com/startrek/view/news/article/2316493.html","12.14.07","http://www.startrek.com/startrek/view/news/index.html","News" ),
   new headlines( 'Jerry Goldsmith: A Personal Reminiscence',"http://www.startrek.com/startrek/view/news/article/2315413.html","12.13.07","http://www.startrek.com/startrek/view/news/index.html","News" ),
   new headlines( 'TNG20: It Was Twenty Years Ago Today (December 1987)',"http://www.startrek.com/startrek/view/features/bst/article/2314813.html","12.02.07","http://www.startrek.com/startrek/view/features/index.html","Features" ),
   new headlines( 'EDITOR\'S PICK: Suzie Plakson - "Good Luck Charm" CD',"http://www.startrek.com/startrek/view/store/news/article/2305613.html","12.14.07","http://www.startrek.com/startrek/view/store/news/index.html","Product News" ),
   new headlines( 'Etchstar Customized iPod nano Giveaway',"http://www.startrek.com/startrek/page/redirect/external?id=2312804","11.23.07","http://www.startrek.com/startrek/view/community/giveaways/index.html","Giveaways" ),
   new headlines( 'ASK KATE: Trekkies, Trekkers, Which Is It?',"http://www.startrek.com/startrek/view/community/column/2315313.html","12.05.07","http://www.startrek.com/startrek/view/community/columns/index.html","Columns" ),
   new headlines( 'POLL: Which TNG "gift" would you like this holiday season?',"http://www.startrek.com/startrek/view/community/polls/index.html","08.18.04","http://www.startrek.com/startrek/view/community/polls/index.html","Polls" ),
null);

// Determine if headlines should be presented in table format

if ( startrekcom_table )
	{ document.writeln( '<table cellpadding="4"><tr><td bgcolor="#454454" background="http://www.startrek.com/custom/headlines/images/headline_bgtile.gif"><p style="font-family:arial; font-size:11px; color:#CCCCCC">' );
	startrekcom_linkcolor = "#CCCCFF";
	}

// Write the header

if ( startrekcom_header == 'text' ) {
	document.write( '<b>Headlines from <a href="http://www.startrek.com" target="' + target_window + '">' );
	if ( startrekcom_linkcolor != 'none' )
		 { document.write( '<font color="' + startrekcom_linkcolor + '">STARTREK.COM</font>' ); }
	else { document.write( 'STARTREK.COM' ); }
	document.write( '</a></b><br>' );
	document.write( '<small>news, features and more from the official site</small><p>' );

	}

else {
	if ( startrekcom_header == 'image' ) {
	document.write( '<a href="http://www.startrek.com" target="' + target_window + '">' );
	document.write( '<img src="http://www.startrek.com/custom/headlines/images/headline_400x30.gif" width="400" height="30" border="0" alt="Visit STARTREK.COM"></a><br><br>' );

}
}


// Write the headlines to the page

for ( var $i = 0; $i < headlines.length - 1 && $i < startrekcom_numheadlines; $i++ ) {
	if ( startrekcom_bullet )
		{ document.write( '&#149;&nbsp;' ); }
	document.write( '<a href="' + headlines[$i].h_url + '" target="' + target_window + '">' );
	if ( startrekcom_linkcolor != "none" )		
		{ document.write( '<font color="' + startrekcom_linkcolor + '">' ); 	}
	document.write( headlines[$i].h_title );
		if ( startrekcom_linkcolor != "none" )
			{ document.write( '</font>' ); }
	document.writeln( "</a><br>" );

		if ( typeof startrekcom_date != 'undefined' && startrekcom_date ) {
			document.writeln( '&nbsp;&nbsp;&nbsp;<small>'
				+ headlines[$i].h_pub_date
			+ ' in ');
		
			document.write( '<a href="' + headlines[$i].h_category_url + '" target="'
				+ target_window + '">' );
		if (typeof startrekcom_linkcolor != 'undefined' )
   	{ document.write( '<font color="' + startrekcom_linkcolor + '">' ); }
			document.write( headlines[$i].h_category);
		if (typeof startrekcom_linkcolor != 'undefined'	)
    		{ document.write( '</font>' ); }
		document.writeln( '</a></small><br>'	);
	
	}
}

// Write the copyright notice

document.write('<small><br><br>&copy; 2007 CBS Studios Inc. All Rights Reserved.</small>');

//If this is a table format, write the end 	of the table

if ( startrekcom_table  )
	{ document.writeln( '</td></tr></table>' ) }

