var qs = new Querystring();

var videoArr = new Array();
videoArr.push({title:"The McGinnis Tradition",flv:"Movie_07_(mcgin_1)",duration:"02:02",thumb:"videoThumbTradition.jpg"});
videoArr.push({title:"Foley Fresh Seafood",flv:"Movie_00_(mcgin_sea)",duration:"00:32",thumb:"videoThumbSeafood.jpg"});
videoArr.push({title:"McGinnis Old Fashion Ham",flv:"Movie_01_(mcgin_2)",duration:"00:31",thumb:"videoThumbHam.jpg"});
videoArr.push({title:"McGinnis Family Holiday",flv:"Movie_02_(mcgin_fall_2)",duration:"00:31",thumb:"videoThumbFall.jpg"});
videoArr.push({title:"The McGinnis Meat Shop",flv:"Movie_03_(mcgin_fall_3)",duration:"00:32",thumb:"videoThumbFall2.jpg"});
videoArr.push({title:"Easy Meal Solutions",flv:"Movie_04_(mcgin_fall_4)",duration:"00:31",thumb:"videoThumbFall3.jpg"});
videoArr.push({title:"Our Promise of Quality",flv:"Movie_05_(mcgin_ham_fyi)",duration:"02:02",thumb:"videoThumbHam2.jpg"});
videoArr.push({title:"A McGinnis Thanksgiving",flv:"Movie_06_(mcgin_fall_1)",duration:"02:01",thumb:"videoThumbFall4.jpg"});

var videoId = qs.get("id");
if(videoId == undefined || videoId < 1 || videoId > videoArr.length){
	videoId = 1;
}

var videoFile;
videoFile = videoArr[videoId-1].flv;

var videoDuration;
videoDuration = videoArr[videoId-1].duration;

function writeVideoDescription(){
	var descrip = '<span class="header">'+videoArr[videoId-1].title+'</span><br />'+
                  '<span class="subheader">Duration: <span style="font-weight:normal;">'+videoArr[videoId-1].duration +'</span></span>';
	document.write(descrip);
}

function writeVideoThumbnails(){
	var numPerRow = 3;
	var thumbBlock = "";
	var rowNum = 1;
	for(i=0;i<videoArr.length;i++){
	
		thumbBlock += '<div class="videoThumbContainer">'+
						'<div class="videoThumb"><a href="/tv/tv.aspx?id='+(i+1)+'"><img src="/tv/images/'+videoArr[i].thumb+'" alt="" border="0" width="145" height="103" /></a></div>'+
						'<div class="videoThumbTitle"><a href="/tv/tv.aspx?id=1" class="plainOrange" style="font-size: 10px;">'+videoArr[i].title+'</a></div>'+
						'<div class="videoThumbDuration" style="font-size: 10px;">Duration: '+videoArr[i].duration+'</div>'+
						'<div class="clear"></div>'+
					  '</div>';
	}
	document.write(thumbBlock);
}