// JavaScript Document

//this function creates a movie player instance each time a movie is selected from a link.
//this function is tied to swfobject.js, and will not work without it.
//do not edit this function.
function createplayer(theFile, go, previewImage,type){
	if(type == "image"){
		var holder = document.getElementById('clip');
		holder.innerHTML = '<img src="'+theFile+'" width="400" height="250" />';
	}else{
		var s = new SWFObject("fla/mediaplayer.swf","playerID","400","250","7");
		s.addParam("allowfullscreen","true");
		s.addVariable("file",theFile);
		s.addVariable("width","400");
		s.addVariable("height","250");
		s.addVariable("displayheight","250");
		s.addVariable("overstretch","fit");
		s.addVariable("image", previewImage);
		s.addParam("wmode", "opaque")
		if (go) { s.addVariable("autostart","true"); }
		s.write("clip");
	}
}//end createplayer


//the updateDescription function is designed to ignore descArray 0. These array positions will be
//read according to their matching filenames. If the file name does not have a descriptor in the
//array, an 'undefined' value will be displayed in the "moviedesc" div on index.html.
//when a new video is added, an array position must be added as well, and the position must match
//the video's filename. Do not forget to change the number in Array(x) to match the number of possible 
//descriptions below (starting at zero)!
var descArray = new Array(15);
descArray[0] = "This is a null description. It is unused.";
descArray[1] = 'DC Reel Vrs.01 <a href=docs/dc_reel07_brief.pdf</a>';
descArray[2] = 'What if one font was the answer to our universal mysteries? What if a typeface predated mankind? And perhaps, it had been placed in our genetic code like a key to be discovered. Have you ever noticed the font of sci-fi, tabloids and science journals? <br /><br />Concept piece<br />Music: Suspicions by Genaro';
descArray[3] = 'The idea here was to take a print ad and "make it move". I imagined the oringinal direction for this Honda ad was to not foucus on a car, but on a company that is sustainable and green. <br /> Music: The Brunettes - Obligatory Raod Song';
descArray[4] = "Concept piece <br /> Music: Morcheeba - Wonders Never Cease Lyrics.";
descArray[5] = "Movie Five Description.";
descArray[6] = "Movie Six Description.";
descArray[7] = "Movie Seven Description.";
descArray[8] = "Movie Eight Description.";
descArray[9] = "Movie Nine Description.";
descArray[10] = "Movie Ten Description.";
descArray[11] = "Movie Eleven Description.";
descArray[12] = "Movie Twelve Description.";
descArray[13] = "Movie Thirteen Description.";
descArray[14] = "Movie Fourteen Description.";


//this function takes the movie's filename and matches it with the correct array position, i.e. 01.flv & descArray[1], 02.flv & descArray[2], etc.
//do not edit this function.
function updateDescription(href) {  
    //var value = Number(href.match(/\/(\d*)/)[1]);
    //var text = document.createTextNode(descArray[value]);
    var desc = document.getElementById('moviedesc');
    while (desc.firstChild) {
        desc.removeChild(desc.firstChild);
    }
    desc.innerHTML = descArray[href];
}//end updateDescription



