function topStorObj(){
	
	document.write( '<div id="topStoryCycleFlag" style="position:absolute; visibility:hidden; overflow:hidden; top:0px; left:0; width:0; height:0;">-1</div>' );

	this.setCycleFlag = function( value ){
		if( document.getElementById('topStoryCycleFlag') ){
			document.getElementById('topStoryCycleFlag').innerHTML = value;
		}
	}
	this.getCycleFlag = function(){
		if( document.getElementById('topStoryCycleFlag') ){
			return document.getElementById('topStoryCycleFlag').innerHTML;
		}
		return;
	}

	this.doCycle = function(){
		delay = this.cycleSecond * 1000;
		if( delay ){
			this.rotation = setTimeout( "topStory.doCycle();", delay );
		}
		if( this.getCycleFlag() > 0 ){
			this.navigation('cycle');
		}
		if( this.getCycleFlag() == '-1' ) this.setCycleFlag( 1 );
	}
	
	this.selected = 0;
	this.cycleSecond = 10;
	this.obj = function(){};
	
	this.add = function( title, additional, summary, url, largeImg, sid ){
		if( ! this.story ) this.story = new Array();
		i = this.story.length;
		
		this.story[i] = new this.obj;
		
		this.story[i].title 			= title;
		this.story[i].additional 	= additional;
		this.story[i].summary 		= summary;
		this.story[i].url 				= url;
		this.story[i].largeImg 		= largeImg;
		this.story[i].sid			= sid;
	}
		
	this.view = function( id, cycle ){
		if(( id <this.story.length ) && ( id >= 0 )){
			this.selected = id;
			document.getElementById('topStory_title').innerHTML = this.story[id].title;
			document.getElementById('topStory_image').src = this.story[id].largeImg;
						
						//Set Image href - if link exists
			if(this.story[id].url){
								document.getElementById('topStory_imageAnchor').setAttribute("href",this.story[id].url);
						}else{
								document.getElementById('topStory_imageAnchor').removeAttribute("href");
						}

			//if (this.story[id].url != '') {
			//	fullStory = '<a class="visitortopstory_detail" href="'+ this.story[id].url +'">Click Here for Details</a>';
			//}
			//else {
				fullStory = '';
			//}
			document.getElementById('topStory_summary').innerHTML = this.story[id].summary + '&nbsp;' +  fullStory;
			for( j=0; j<this.story.length; j++ ){
				document.getElementById('topStory_cell_' + j).className = ( j == id ) ? 'topstory_miniselected' :'topstory_mini';
			}
			if( ! cycle ){
				clearTimeout(this.rotation);
				this.cycleSecond = 0;
				this.setCycleFlag(0);
			}
			var x;
			var tmp = document.getElementsByTagName("div"); 
   			for (x = 0; x < tmp.length; x++) {
   				if(tmp[x].className=='whatsnewImage'){
   					document.getElementById(tmp[x].id).id = 'hp_story_'+this.story[id].sid;
   				}
   			}
		}
	}
		
	this.mouseOver = function( id ){
		if( id != this.selected ){
			cellID = 'topStory_cell_' + id;
			document.getElementById(cellID).className = 'topstory_minihover';
		}
	}
		
	this.mouseOut = function( id ){
		cellID = 'topStory_cell_' + id;
		if( id != this.selected ){
			document.getElementById(cellID).className = 'topstory_mini';
		}else{
			document.getElementById(cellID).className = 'topstory_miniselected';
		}
	}
		
	this.navigation = function( command ){
		if( command == 'prev' ){
			change = ( this.selected == 0 ) ? this.story.length-1 : this.selected - 1 ;
			this.view( change );
		}else if( command == 'pause' ){
			this.cycleSecond = 0;
			this.setCycleFlag(0);
		}else if( command == 'next' ){
			change = ( this.selected == this.story.length-1  ) ? 0 : this.selected + 1 ;
			this.view( change );
		}else if( command == 'cycle' ){
			change = ( this.selected == this.story.length-1  ) ? 0 : this.selected + 1 ;
			this.view( change, true );
		}else{
			this.view( 0 );
		}
	}
}
