var videoList = {
    container: "videoList",
    items: [],
    videos: null
}

videoList.init = function(vids){
    this.videos = vids;
    for(var sProp in vids){
        this.items.push(sProp);                
    }
    this.changeVideo(this.items[0]);
}

videoList.changeVideo = function(vid){
    
    var ofr = document.createDocumentFragment();
    var pContainer = document.getElementById(this.container);
    for(var sProp in this.videos){
        var oLi = document.createElement("li");
        if(vid != sProp){
            var oA = document.createElement("a");
            oA.href = "javascript:videoList.changeVideo('" + sProp + "');";
            oA.appendChild(document.createTextNode(this.videos[sProp]));
            oLi.appendChild(oA);
        }
        else{
            var oB = document.createElement("b");
            oB.appendChild(document.createTextNode(this.videos[sProp]));
            oLi.appendChild(oB);
        }
        ofr.appendChild(oLi);        
    }

    while(pContainer.hasChildNodes())
        pContainer.removeChild(pContainer.firstChild);

    pContainer.appendChild(ofr);
    
	var flashvars = {
		source: "/videos/" + vid + ".flv",
		color: "142146"
	}
	swfobject.embedSWF("/swf/flvplayer.swf", "videoPlayer", "480", "360", "9.0.0", "/swf/expressInstall.swf", flashvars);
}