
//*
//* To add any feature, you must supply all three, featureImage, featureStory, and featureMore.
//*
var featureMore  = new Array(	
// #1
"&nbsp;&nbsp;",
// #2
"&nbsp;&nbsp;",
// #3
"&nbsp;&nbsp;"

);

var featureStory  = new Array(
// #1
"<td>Read about <a href=http://www.clarku.edu/alumni/lifeafterclark/testimonials/leahey.cfm>Cary Leahey, Class of 1974</a> and other Alumni</td></tr>",
// #2
"<td>Read about <a href=http://www.clarku.edu/alumni/lifeafterclark/testimonials/edmonds.cfm>Beth Edmonds, Class of 1972</a> and other Alumni</td></tr>",
/// #3
"<td>Read about <a href=http://www.clarku.edu/alumni/clarknews/spring05/xm.cfm>Hugh Panero, Class of '78</a> and other Alumni</td></tr>"

);
									
var featureImage    = new Array(	
// #1
"<tr valign=top><td><img src=/olc/images/CLK/leahey115.jpg border=0></td>",
// #2
"<tr valign=top><td><img src=/olc/images/CLK/edmonds115.jpg border=0></td>",
// #3
"<tr valign=top><td><img src=/olc/images/CLK/panero115.jpg border=0></td>"
);
								

									
//---------------------- DO NOT MODIFY BELOW THIS LINE ---------------------------------------//
var gl_quote 	= '';
var gl_dash	 	= '';
var gl_newline = ''; 
var gl_empty 	= '&nbsp;';
var gl_max_tries = 10;
									
									
function writeFeature()
{
	var tmpQuote;
	var tmpAuthor;
	var tmpSchool;
	var tmpBuff;
	var theDate;
	var seconds;
	var attempts = 0;
	var msgCount;
	
	msgCount = getArrayFillLength( featureImage ); 

	if( msgCount == 0 )
	{
		document.write( gl_newline + gl_empty + gl_newline );
		return( false );
	}
	
	msgCount--; //modulus is zero based

	for( i=0; i < gl_max_tries; i++ )
	{
		theDate = new Date();
		index = theDate.getSeconds() % 10;
		
//		alert( "for i=" + i + "::Seconds=" + theDate.getSeconds()+ "::msgCount=" + msgCount +  "::index=" + index );
		
		if( index <= msgCount )
		{
			theDate = null;
			break;
		}
		theDate = null;
	}


	
	if( i == gl_max_tries )
	{
		index = 0;
	}
	tmpQuote	 = featureImage[index];
	tmpAuthor = featureStory[index];
	tmpSchool = featureMore[index];

	if( tmpQuote == "" )
	{
		document.write( gl_newline + gl_empty + gl_newline );
		return false;
	}
	if( tmpAuthor == "" )
	{
		tmpAuthor = gl_empty;
	}
	if( tmpSchool == "" )
	{
		tmpSchool = gl_empty;
	}	
	tmpBuff = gl_quote + tmpQuote + gl_quote + 
	          gl_newline + gl_newline + gl_dash + 
				 tmpAuthor + gl_newline + tmpSchool +
				 gl_newline;
	document.write( tmpBuff );		
 	return true;
}

function getArrayFillLength( this_array )
{
	var count = 0;
	
	for( count=0;  count < this_array.length; count++ )
	{
		if( this_array[count] == "" )
		{
			break;
		}
	}
	return( count );	
}

