<?php

	require_once('../news/classes/newsstories.php');
	
	/* GLOBALS */
	
	if ( isset($_REQUEST['Tag']) ) {
		$tagType = $_REQUEST['Tag'];
	}
	else {
		$tagType = NULL;
	}
	
	$selectLimit = 5;
	
	$stories = new 	NewsChannel(
						array(
							'tagType'		=> $tagType,
							'selectLimit'	=> $selectLimit
						)
					);
	

	print ' headlines = Array(); ';

	if (  $stories->stories != NULL ) {
	
		foreach( $stories->stories as $index => $currentStory ) {
			
			$headline = $currentStory->Title;
			if ( strlen($headline) > 45 ) {
				$headline = substr($headline,0,45).'...';
			}
		
			print 'headlines['.$index.'] = "<a style=\"color: #8e99d7;\" id=\"headline_link\" href=\"/NetCommunity/Page.aspx?&pid=207&Story='.$currentStory->StoryNumber.'\">'.$headline.'</a>"; ';
		
		}
	
	}
	

?>

