        var GAME_OVER = "game over", GAME_START = "game start";
		var GAME_EMPTY = "game empty";
        var DEFAULT_TARGET = "_blank";
        var AUDIO_ICON = "http://web.mlsnet.com/imgs/icons/audio.gif";
        var VIDEO_ICON = "http://web.mlsnet.com/imgs/icons/video.gif";
        var LIVE_ICON = "http://web.mlsnet.com/imgs/icons/live_l.gif";
        var ARCHIVE_ICON = "http://web.mlsnet.com/imgs/icons/archive_a.gif"
        var SHOW_DATE_LINE = false;
        var SHOW_SHORT_TEAMS = true;
        var LARGE_GRID = false;
        //Column Types Enum
        var cType = {
                "Teams":                        0,
                "Time":                         1,
                "Video":                        2,
                "AwayAudio":            3,
                "HomeAudio":            4,
                "Date":                         5,
                "VideoHighlights":      6,
                "Photo":                        7,
                "HomeAudioEsp":         8,
                "AwayAudioEsp":         9,
                "Matchcast":            10
                //"Status":                     2,
        };
        
        function MediaColumn(caption, type, width) {            
                this.captionStyle; //CSS for Caption(header) cell
                this.width = width;
                this.caption = caption;
                this.type = type;
                this.noWrap = false;
                this.align;
                this.showIcon = true;
        }
        
        function MediaGrid() {
                this.width;                             
                this.tableStyle; //CSS for a table itself
                this.cellStyle; //CSS for rendered cells
                this.oddCellStyle; //CSS for odd rows of cells
                this.dateStyle; //CSS for a date line
                this.border = 0;
                this.spacing = 0;
                this.padding = 0;
                
                this.Columns = new Array();
                this.appendColumn = _appendColumn;
                this.renderGrid = _renderGrid;
                
                function _appendColumn(mcol) {
                        if(typeof(mcol) == "object" && mcol.type != null) {
                                this.Columns.push(mcol);
                        }
                }
                
                function _renderGrid(xdo) {                     
                        var tbl = document.createElement("table");                              
                                if(this.border) tbl.setAttribute("border", this.border);
                                if(this.spacing) tbl.setAttribute("cellspacing", this.spacing);
                                if(this.padding) tbl.setAttribute("cellpadding", this.padding);
                                if(this.width) tbl.setAttribute("width", this.width);
                                if(this.tableStyle) tbl.setAttribute("class", this.tableStyle);
                        var tr = document.createElement("tr");
                        var td = document.createElement("td");
                                td.innerHTML = "&nbsp;";
                                if(this.cellStyle) td.setAttribute("class", this.cellStyle);
                        //Set Header
                        var hCol;
                        var hCell;
                        var hRow = tbl.appendChild(tr.cloneNode(false));
                      //  for(var h = 0; h < this.Columns.length; h++) {                          
                      //        hCol = this.Columns[h];
                      //        hCell = hRow.appendChild(td.cloneNode(true));                           
                      //        if(hCol.width) hCell.setAttribute("width", hCol.width);
                      //        if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                      //        if(hCol.align) hCell.setAttribute("align", hCol.align); 
                      //        if(hCol.captionStyle) hCell.setAttribute("class", hCol.captionStyle);
                      //        if(hCol.caption) hCell.innerHTML = hCol.caption;
                      //  }


                              hCol = this.Columns[0];
                              hCell = hRow.appendChild(td.cloneNode(true));                           
                              if(hCol.width) hCell.setAttribute("width", 50);
                              if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                              if(hCol.align) hCell.setAttribute("align", "center"); 
                              if(hCol.captionStyle) hCell.setAttribute("class", "sightsHead sightsBgLive1");
                              if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">Date</font>";

                              hCol = this.Columns[1];
                              hCell = hRow.appendChild(td.cloneNode(true));                           
                              if(hCol.width) hCell.setAttribute("width", 60);
                              if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                              if(hCol.align) hCell.setAttribute("align", "center"); 
                              if(hCol.captionStyle) hCell.setAttribute("class", "sightsHead sightsBgLive1");
                              if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">Time (ET)</font>";

                              hCol = this.Columns[2];
                              hCell = hRow.appendChild(td.cloneNode(true));                           
                              if(hCol.width) hCell.setAttribute("width", 68);
                              if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                              if(hCol.align) hCell.setAttribute("align", "center"); 
                              if(hCol.captionStyle) hCell.setAttribute("class", "sightsHead sightsBgLive1");
                              if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">Clubs</font>";

                              hCol = this.Columns[3];
                              hCell = hRow.appendChild(td.cloneNode(true));                           
                              if(hCol.width) hCell.setAttribute("width", 108);
                              if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                              if(hCol.align) hCell.setAttribute("align", "center"); 
                              if(hCol.captionStyle) hCell.setAttribute("class", "sightsHead sightsBgLive1");
                              if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">Match Video <img src=\"/imgs/icons/scoreboard/mlslive_transparent.gif\"></font>";

                              hCol = this.Columns[4];
                                td.innerHTML = " colspan=\"4\"";
                              hCell = hRow.appendChild(td.cloneNode(true));                           
                              if(hCol.width) hCell.setAttribute("width", 210);
                              if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                              if(hCol.align) hCell.setAttribute("align", "center"); 
                                             hCell.setAttribute("colspan", 4);
                              if(hCol.captionStyle) hCell.setAttribute("class", "sightsHead sightsBgLive1");
                              if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">Match Audio <img src=\"/imgs/icons/scoreboard/audio_transparent.gif\"><br>(Away, Home, Spanish Away, Spanish Home)</font>";

                              hCol = this.Columns[5];
                                td.innerHTML = "&nbsp;";
                              hCell = hRow.appendChild(td.cloneNode(true));                           
                              if(hCol.width) hCell.setAttribute("width", 70);
                              if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                              if(hCol.align) hCell.setAttribute("align", "center"); 
                              if(hCol.captionStyle) hCell.setAttribute("class", "sightsHead sightsBgLive1");
                              if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">Highlights <img src=\"/imgs/icons/scoreboard/icon_watch_silver.gif\"></font>";

                              hCol = this.Columns[6];
                              hCell = hRow.appendChild(td.cloneNode(true));                           
                              if(hCol.width) hCell.setAttribute("width", 64);
                              if(hCol.noWrap) hCell.setAttribute("nowrap", "nowrap");
                              if(hCol.align) hCell.setAttribute("align", "center"); 
                              if(hCol.captionStyle) hCell.setAttribute("class", "sightsHead sightsBgLive1");
                              //if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">Match&nbsp;Tracker</font>";
                              if(hCol.caption) hCell.innerHTML = "<font color=\"#FFFFFF\">VW&nbsp;Game&nbsp;Nav</font>";
							  
                        var dtOld;
                        var nRow, nCell, cGame, cCol, altColor = true;
                        for(var g = 0;g < xdo.game.length; g++) {
                                cGame = xdo.game[g];                                            
                                /* Date break row */
                                if(SHOW_DATE_LINE) {
                                        if(dtOld != cGame.date_display) {
                                                dtOld = cGame.date_display;
                                                nRow = tbl.appendChild(tr.cloneNode(false));                                    
                                                nCell = nRow.appendChild(td.cloneNode(true));
                                                nCell.setAttribute("class", this.dateStyle);                                    
                                                nCell.setAttribute("colspan", this.Columns.length);
                                                nCell.setAttribute("width", this.width);
                                                nCell.innerHTML = dtOld;
                                        }
                                }
                                altColor = (altColor)?false:true;
                                nRow = tbl.appendChild(tr.cloneNode(false)); 
                                for(var c=0;c < this.Columns.length;c++) {
                                        cCol = this.Columns[c];
                                        nCell = nRow.appendChild(td.cloneNode(true));                           
                                        if(cCol.width) nCell.setAttribute("width", cCol.width);
                                        if(cCol.align) nCell.setAttribute("align", cCol.align);         
                                        if(cCol.noWrap) nCell.setAttribute("nowrap", "nowrap");
                                        if(altColor) {nCell.setAttribute("class", this.oddCellStyle);}                          
                                        switch(cCol.type) {
                                        //Section to insert more handlers
                                                case cType.Teams:
                                                        handleTeams(cGame, nCell);
                                                        break;
                                                case cType.Time:
                                                        handleTime(cGame, nCell);
                                                        break;
                                                case cType.Date:
                                                        handleDate(cGame, nCell);
                                                        break;
                                                //case cType.Status:
                                                //      handleStatus(cGame, nCell, cCol.showIcon);
                                                //      break;
                                                case cType.Video:
                                                        handleVideo(cGame, nCell, cCol.showIcon);
                                                        break;
                                                case cType.AwayAudio:
                                                        handleAwayAudio(cGame, nCell, cCol.showIcon);
                                                        break;
                                                case cType.HomeAudio:
                                                        handleHomeAudio(cGame, nCell, cCol.showIcon);
                                                        //handleHomeAudio(cGame, nCell);
                                                        break;
                                                case cType.HomeAudioEsp:
                                                        handleHomeAudioEsp(cGame, nCell, cCol.showIcon);
                                                        break;
                                                case cType.AwayAudioEsp:
                                                        handleAwayAudioEsp(cGame, nCell, cCol.showIcon);
                                                        break;
                                                case cType.VideoHighlights:
                                                        handleVideoHilite(cGame ,nCell, cCol.showIcon);
                                                        break;
                                                case cType.Matchcast:
                                                        handleMatchcast(cGame, nCell);
                                                        break;
                                        } //End Switch
                                }//End Columns Loop
                        }//End Games Loop
                        return getOuterHTML(tbl);
                }//End _renderGrid()
        }
        
        var link = document.createElement("a");
        var newLink = function(url) {
                var nLink = link.cloneNode(true);
                        nLink.href = url;                       
                return nLink;
        }
        //Handlers
        function handleTeams(gameObj, nCell) {
                if(!isEmpty(gameObj.team_home_name) && !isEmpty(gameObj.team_away_name)) {
                        if(!SHOW_SHORT_TEAMS) {
                                nCell.innerHTML = "<B>" + gameObj.team_away_name + " @ " + gameObj.team_home_name;
                        } else {
                                nCell.innerHTML = "<B>" + gameObj.team_away + " @ " + gameObj.team_home;
                        }
                }
        }
        
        function handleTime(gameObj, nCell) {
                var result;
                var gameStatus = gameObj.status.toLowerCase();
                nCell.innerHTML = "";
                var trkLnk = nCell.appendChild(newLink("http://web.mlsnet.com/scoreboard/game.jsp?match=" + gameObj.id));
                        trkLnk.setAttribute("target", DEFAULT_TARGET);
                if(!LARGE_GRID) {
                        switch(gameStatus) {
                                case GAME_OVER:
                                        trkLnk.innerHTML = gameObj.score_display;
                                        break;
                                case GAME_START:
                                        nCell.innerHTML = gameObj.game_time + " " + gameObj.am_pm + " ";
                                        break;
		                        case GAME_EMPTY:
										nCell.innerHTML = "&nbsp;";
										break;
                                default: //Game is Live
                                        trkLnk.innerHTML = gameObj.score_display;
                        }
                } else {
                        nCell.innerHTML = gameObj.game_time + " " + gameObj.am_pm + " ";
                }
        }
        
        function handleDate(gameObj, nCell) {
                //nCell.innerHTML = gameObj.mmdd;         
                //nCell.innerHTML = gameObj.mmdd.substring(0,2);         
                if(gameObj.mmdd.substring(0,2) == 01) nCell.innerHTML = "Jan. ";
                if(gameObj.mmdd.substring(0,2) == 02) nCell.innerHTML = "Feb. ";
                if(gameObj.mmdd.substring(0,2) == 03) nCell.innerHTML = "Mar. ";
                if(gameObj.mmdd.substring(0,2) == 04) nCell.innerHTML = "Apr. ";
                if(gameObj.mmdd.substring(0,2) == 05) nCell.innerHTML = "May. ";
                if(gameObj.mmdd.substring(0,2) == 06) nCell.innerHTML = "Jun. ";
                if(gameObj.mmdd.substring(0,2) == 07) nCell.innerHTML = "Jul. ";
                if(gameObj.mmdd.substring(0,2) == 08) nCell.innerHTML = "Aug. ";
                if(gameObj.mmdd.substring(0,2) == 09) nCell.innerHTML = "Sep. ";
                if(gameObj.mmdd.substring(0,2) == 10) nCell.innerHTML = "Oct. ";
                if(gameObj.mmdd.substring(0,2) == 11) nCell.innerHTML = "Nov. ";
                if(gameObj.mmdd.substring(0,2) == 12) nCell.innerHTML = "Dec. ";

                if(gameObj.mmdd.substring(3,4) == "0") nCell.innerHTML += gameObj.mmdd.substring(4,5)
                else nCell.innerHTML += gameObj.mmdd.substring(3,5);

        }
        
        function handleMatchcast(gameObj, nCell) {
                var lnkPos = -1;
                var gameStatus = gameObj.status.toLowerCase();
				nCell.setAttribute("align", "center");
				switch(gameStatus) {
                        case GAME_OVER: //If game is over we get recap links
                                //lnkPos = (gameObj.links.link.length)?gameObj.links.link.indexOf("recap", "type"):-2;                          
                                //nCell.innerHTML = "<a target=\"_top\" href=\"\/scoreboard\/game.jsp?match=" + gameObj.id + "\">Final<\/a>"; 
                                nCell.innerHTML = "<a target=\"_top\" href=\"javascript:void(window.open('" + gameObj.links.gameday_url + "','','width=1010,height=852,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no'));\">Final<\/a>"; 
								break;
                        case GAME_START: //if game has not been startes we get preview links
                                //lnkPos = (gameObj.links.link.length)?gameObj.links.link.indexOf("preview", "type"):-2;
                                //nCell.innerHTML = "<a target=\"_top\" href=\"\/scoreboard\/game.jsp?match=" + gameObj.id + "\">Pregame<\/a>";
                                nCell.innerHTML = "<a target=\"_top\" href=\"javascript:void(window.open('" + gameObj.links.gameday_url + "','','width=1010,height=852,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no'));\">Pregame<\/a>";
								break;
                        case GAME_EMPTY:
								nCell.innerHTML = "&nbsp;";
								break;
						case "":
								nCell.innerHTML = "&nbsp;";
								break;
						default: //Live
                                //nCell.innerHTML = "<a target=\"_top\" href=\"\/scoreboard\/game.jsp?match=" + gameObj.id + "\">Live<\/a>";
                				nCell.innerHTML = "<a target=\"_top\" href=\"javascript:void(window.open('" + gameObj.links.gameday_url + "','','width=1010,height=852,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no'));\">Live<\/a>";
				}

        }
        
        function handleStatus(gameObj, nCell, showIcon) {
                var lnkPos = -1;
                var gameStatus = gameObj.status.toLowerCase();
                nCell.setAttribute("align", "center");
				switch(gameStatus) {
                        case GAME_OVER: //If game is over we get recap links
                                //lnkPos = (gameObj.links.link.length)?gameObj.links.link.indexOf("recap", "type"):-2;                          
                                nCell.innerHTML = (showIcon)?"<img border=\"0\" src=\"" + ARCHIVE_ICON + "\" alt=\"Archived Game\"/>":"&nbsp;";                 
                                break;
                        case GAME_START: //if game has not been startes we get preview links
                                //lnkPos = (gameObj.links.link.length)?gameObj.links.link.indexOf("preview", "type"):-2;
                                nCell.innerHTML = "&nbsp;";
                                break;
                        case GAME_EMPTY:
								nCell.innerHTML = "&nbsp;";
								break;
                        default: //Live
                                nCell.innerHTML = (showIcon)?"<img border=\"0\" src=\"" + LIVE_ICON + "\" alt=\"Live Game\"/>":"&nbsp;";                        
                }
                //Generate Link if status and url is present
                /*
                nCell.innerHTML = "";
                if(lnkPos > -1) {
                        if(!isEmpty(gameObj.status_display)) {
                                var sLnk = nCell.appendChild(newLink(gameObj.links.link[lnkPos].url.Text));                                     
                                sLnk.setAttribute("target", DEFAULT_TARGET);
                                sLnk.innerHTML = gameObj.status_display;
                        }
                } else if(lnkPos == -2) {
                        if(!isEmpty(gameObj.status_display)) {
                                var sLnk = nCell.appendChild(newLink(gameObj.links.link.url.Text));                                     
                                sLnk.setAttribute("target", DEFAULT_TARGET);
                                sLnk.innerHTML = gameObj.status_display;
                        }
                }
                */
        }
        
//        function handleVideo(gameObj, nCell, showIcon) {
//                if(gameObj.multimedia.media) {
//                        var vLinkPos = -1, idx, vLink, speed, game_status;
//                        //var tvIcon = "<img src=\"" + VIDEO_ICON + "\" border=\"0\"/>&nbsp;";
//                        var tvIcon = (showIcon)?"<img src=\"" + VIDEO_ICON + "\" border=\"0\"/>&nbsp;":"";
//                        if(gameObj.multimedia.media.length) {
//                                        //if (gameObj.multimedia.media[idx].state == "video_archive") { game_status = "Watch Archive"; }
//                                        //if (gameObj.multimedia.media[idx].state == "video_on") { game_status = "Watch Live"; }
//                                if((idx = gameObj.multimedia.media.indexOf("mls_tv", "key")) && idx != -1) {
//                                        vLinkPos = (gameObj.multimedia.media[idx].state == "video_off" || gameObj.multimedia.media[idx].state == "video_done")?-2:idx;
//                                        speed = gameObj.multimedia.media[idx].url.speed + "K";
//                                        if (gameObj.multimedia.media[idx].state == "video_archive") { game_status = "Watch Archive"; }
//                                        if (gameObj.multimedia.media[idx].state == "video_on") { game_status = "Watch Live"; }
//                                        if (gameObj.multimedia.media[idx].state == "video_off") { game_status = "Upcoming game"; }
//                                        if (gameObj.multimedia.media[idx].state == "video_done" &&
//                                            gameObj.status == "Game Over") { game_status = "archive soon"; }
//                                }                        
//                                if(vLinkPos >= 0) {
//                                        var urlId = gameObj.multimedia.media[vLinkPos].url.id;
//                                        nCell.innerHTML = ""; //Remove space                            
//                                        vLink = nCell.appendChild(link.cloneNode(false));
//                                        vLink.href = "javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_sub'})";
//                                        //vLink.innerHTML = tvIcon + speed;
//                                        if (gameObj.multimedia.media[vLinkPos].state == "video_archive") { game_status = "Watch Archive "; }
//                                        if (gameObj.multimedia.media[vLinkPos].state == "video_on") { game_status = "Watch Live "; }
//                                        if (gameObj.multimedia.media[vLinkPos].state == "video_off") { game_status = "Upcoming game "; }
//                                        if (gameObj.multimedia.media[vLinkPos].state == "video_done" &&
//                                            gameObj.status == "Game Over") { game_status = "archive soon "; }
//                                        vLink.innerHTML = game_status + speed;
//                                } else if(vLinkPos == -2) {
//                                        //if (gameObj.multimedia.media.state == "video_archive") { game_status = "Watch Archive "; }
//                                        //if (gameObj.multimedia.media.state == "video_on") { game_status = "Watch Live "; }
//                                        //if (gameObj.multimedia.media.state == "video_off") { game_status = "Upcoming game "; }
//                                        //if (gameObj.multimedia.media.state == "video_off" &&
//                                        //    gameObj.status == "Game Over") { game_status = "archive soon "; }
//                                        //nCell.innerHTML = tvIcon + game_status;
//                                        nCell.innerHTML = game_status + speed;
//                                }
//                                //else if (gameObj.mmdd == "06/04") { nCell.innerHTML = "postponed"; }
//                                //else if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
//                                else if (gameObj.mmdd == "") { nCell.innerHTML = ""; }
//                                else { nCell.innerHTML = "N/A"; }
//                        
//                        } else {
//                                if(gameObj.multimedia.media.key == "mls_tv") {
//                                        speed = gameObj.multimedia.media.url.speed + "K";
//                                                        if (gameObj.multimedia.media.state == "video_on") { game_status = "Watch Live "; }
//                                                        if (gameObj.multimedia.media.state == "video_off") { game_status = "Upcoming game "; }
//                                                        if (gameObj.multimedia.media.state == "video_archive") { game_status = "Watch Archive "; }
//                                                        if (gameObj.multimedia.media.state == "video_done" &&
//                                                            gameObj.status == "Game Over") { game_status = "archive soon "; }
//                                        if (gameObj.multimedia.media.state != "video_off" && gameObj.multimedia.media.state != "video_done") {
//                                                var urlId = gameObj.multimedia.media.url.id;
//                                                        if (gameObj.multimedia.media.state == "video_on") { game_status = "Watch Live "; }
//                                                        if (gameObj.multimedia.media.state == "video_off") { game_status = "Upcoming game "; }
//                                                        if (gameObj.multimedia.media.state == "video_archive") { game_status = "Watch Archive "; }
//                                                        if (gameObj.multimedia.media.state == "video_done" &&
//                                                            gameObj.status == "Game Over") { game_status = "archive soon "; }
//                                                nCell.innerHTML = ""; //Remove space                            
//                                                vLink = nCell.appendChild(link.cloneNode(false));
//                                                vLink.href = "javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_sub'})";
//                                                //vLink.innerHTML = tvIcon + game_status;
//                                                vLink.innerHTML = game_status + speed;
//                                        } else {
//                                                //nCell.innerHTML = tvIcon + game_status;
//                                                nCell.innerHTML = game_status + speed;
//                                        }
//                                }
//                                //else if (gameObj.mmdd == "06/04") { nCell.innerHTML ="postponed"; }
//                                //else if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
//                                else if (gameObj.mmdd == "") { nCell.innerHTML = ""; }
//                                else { nCell.innerHTML = "N/A"; }
//                        }
//                }
//                               // else if (gameObj.mmdd == "06/04") { nCell.innerHTML ="postponed"; }
//                               // else if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
//                                else if (gameObj.mmdd == "") { nCell.innerHTML = ""; }
//                                else { nCell.innerHTML = "N/A"; }
//                               // if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
//        }
//        


		function handleVideo(gameObj, nCell, showIcon) {
			var vLink, vKey, noVideo = true, speed, game_status, video_count, video_urls;
			var tvIcon = (showIcon)?"<img src=\"" + VIDEO_ICON + "\" border=\"0\"/>&nbsp;":"";
			if(gameObj.multimedia.media) {
				if(gameObj.multimedia.media.length) {
					noVideo = true;
					for(var vLinkPos = 0; vLinkPos < gameObj.multimedia.media.length; vLinkPos++) {
						vKey = gameObj.multimedia.media[vLinkPos].key;
						if(gameObj.multimedia.media[vLinkPos].type == "video" && (vKey == "mls_tv" )) {
							if (gameObj.multimedia.media[vLinkPos].url.length) {
								video_urls = gameObj.multimedia.media[vLinkPos].url.length;
							} else {
								video_urls = 0;
							}
							for(video_count = 0; video_count < video_urls; video_count++) {
								speed = gameObj.multimedia.media[vLinkPos].url[video_count].speed + "K";
								if (gameObj.multimedia.media[vLinkPos].state == "video_on") { game_status = "Live "; }
								if (gameObj.multimedia.media[vLinkPos].state == "video_off") { game_status = "Pregame "; }
								if (gameObj.multimedia.media[vLinkPos].state == "video_archive") { game_status = "Archive "; }
								if (gameObj.multimedia.media[vLinkPos].state == "video_done" &&	gameObj.status == "Game Over") { game_status = "archive soon "; }
								if(gameObj.multimedia.media[vLinkPos].state == "video_off" || gameObj.multimedia.media[vLinkPos].state == "video_done") {
									nCell.innerHTML = game_status;
									noVideo = false;
								} else {
									var urlId = gameObj.multimedia.media[vLinkPos].url[video_count].id;
									vLink = "<a href=\"javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_sub',gid:'" + gameObj.multimedia.media[vLinkPos].url[video_count].gid + "'})\">";
									if (gameObj.multimedia.media.state == "video_on") { game_status = "Live "; }
									if (gameObj.multimedia.media.state == "video_off") { game_status = "Pregame "; }
									if (gameObj.multimedia.media.state == "video_archive") { game_status = "Archive "; }
									if (gameObj.multimedia.media.state == "video_done" && gameObj.status == "Game Over") { game_status = "archive soon "; }
									if (video_count == 0) { nCell.innerHTML += game_status + vLink + speed + "</a>"; }
									if (video_count == 1) { nCell.innerHTML += " | " + vLink + speed + "</a>"; }
									noVideo = false;
								}
							}
						}
					}
				} else { // no media.length
					if(gameObj.multimedia.media.type == "video") {
						vKey = gameObj.multimedia.media.key;
						if(vKey == "mls_tv") {
							for(video_count = 0; video_count < gameObj.multimedia.media.url.length; video_count++) {
								speed = gameObj.multimedia.media.url[video_count].speed + "K";
								if (gameObj.multimedia.media.state == "video_on") { game_status = "Live "; }
								if (gameObj.multimedia.media.state == "video_off") { game_status = "Pregame "; }
								if (gameObj.multimedia.media.state == "video_archive") { game_status = "Archive "; }
								if (gameObj.multimedia.media.state == "video_done" && gameObj.status == "Game Over") { game_status = "archive soon "; }
								if (gameObj.multimedia.media.state == "video_off" || gameObj.multimedia.media.state == "video_done") {
									nCell.innerHTML = game_status;
									noVideo = false;
								} else {
									var urlEsId = gameObj.multimedia.media.url[video_count].id;
									//vLink = nCell.appendChild(link.cloneNode(false));
									//if(video_count == 0) vLink.innerHTML += game_status;
									//if(video_count == 1) vLink.innerHTML += " | ";
									//vLink.href = gameObj.multimedia.media[vLinkPos].url[video_count].Text;
									//vLink.href = "javascript:mediaPlayer.play({w_id:'" + urlEsId + "',catCode:'mls_game_tv',type:'v_sub'})";
									//vLink.innerHTML += speed;
									vLink = "<a href=\"javascript:mediaPlayer.play({w_id:'" + urlEsId  + "',catCode:'mls_game_tv',type:'v_sub',gid:'" + gameObj.multimedia.media.url[video_count].gid + "'})\">";
									if (video_count == 0) { nCell.innerHTML += game_status + vLink + speed + "</a>"; }
									if (video_count == 1) { nCell.innerHTML += " | " + vLink + speed + "</a>"; }
									noVideo = false;
								}
							}
						}
					}
				}
			}
			if(noVideo) { nCell.innerHTML = "&nbsp;"; } //If no audio for this column -> clean up
		}


        function handleAwayAudio(gameObj, nCell, showIcon) {
                var aLink, aKey, noAudio = true;
                var auIcon = (showIcon)?"<img src=\"" + AUDIO_ICON + "\" border=\"0\"/>&nbsp;":"";
                if(gameObj.multimedia.media) {
                        if(gameObj.multimedia.media.length) {
                                if(gameObj.multimedia.media.contains("audio", "type") && gameObj.multimedia.media.contains("Eng", "language_display") ) {
                                        //nCell.innerHTML = auIcon;
                                }       
                                noAudio = true;
                                for(var aLinkPos = 0; aLinkPos < gameObj.multimedia.media.length; aLinkPos++) {
                                        aKey = gameObj.multimedia.media[aLinkPos].key;
                                                var lang = gameObj.multimedia.media[aLinkPos].language_display;
                                                var title = gameObj.multimedia.media[aLinkPos].title;
                                      //  if(gameObj.multimedia.media[aLinkPos].type == "audio" && (aKey == "away_audio" || aKey == "alt_away_audio") && lang == "Eng" ) {
                                        if(gameObj.multimedia.media[aLinkPos].type == "audio" && (aKey == "away_audio" ) ) {

                                                if(gameObj.multimedia.media[aLinkPos].state == "audio_off" || gameObj.multimedia.media[aLinkPos].state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML += title;
                                                        noAudio = false;
                                                } else {
                                                        var urlId = gameObj.multimedia.media[aLinkPos].url.id;
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media[aLinkPos].url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML =  title;
                                                        noAudio = false;                                                
                                                }
                                        }
                                }
                        } else{
                                if(gameObj.multimedia.media.type == "audio" && gameObj.multimedia.media.language_display == "Eng") {
                                        //nCell.innerHTML = auIcon;
                                        aKey = gameObj.multimedia.media.key;
                                        if(aKey == "away_audio" || aKey == "alt_away_audio") {
                                                var lang = gameObj.multimedia.media.language_display;
                                                var title = gameObj.multimedia.media.title;
                                                if(gameObj.multimedia.media.state == "audio_off" || gameObj.multimedia.media.state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML += title;
                                                        noAudio = false;
                                                } else {
                                                        var urlEsId = gameObj.multimedia.media.url.id;
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlEsId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media.url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML =  title;
                                                        noAudio = false;        
                                                }
                                        }
                                }
                        }
                        if(noAudio) { nCell.innerHTML = "&nbsp;"; } //If no audio for this column -> clean up
                }
                                //else if (gameObj.mmdd == "06/04") { nCell.innerHTML ="postponed"; }
                                //else if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                else { nCell.innerHTML = "&nbsp;"; }
                            //    if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                if (gameObj.mmdd == "") { nCell.innerHTML = ""; }
        }
        
        function handleAwayAudioEsp(gameObj, nCell, showIcon) {
                var aLink, aKey, noAudio = true;
                var auIcon = (showIcon)?"<img src=\"" + AUDIO_ICON + "\" border=\"0\"/>&nbsp;":"";
                if(gameObj.multimedia.media) {
                        if(gameObj.multimedia.media.length) {
                                if(gameObj.multimedia.media.contains("audio", "type") && gameObj.multimedia.media.contains("Esp", "language_display") ) {
                                        //nCell.innerHTML = auIcon;
                                }       
                                noAudio = true;
                                for(var aLinkPos = 0; aLinkPos < gameObj.multimedia.media.length; aLinkPos++) {
                                        aKey = gameObj.multimedia.media[aLinkPos].key;
                                                var lang = gameObj.multimedia.media[aLinkPos].language_display;
                                                var title = gameObj.multimedia.media[aLinkPos].title;
                                        //if(gameObj.multimedia.media[aLinkPos].type == "audio" && (aKey == "away_audio" || aKey == "alt_away_audio") && lang == "Esp" ) {
                                        if(gameObj.multimedia.media[aLinkPos].type == "audio" && ( aKey == "alt_away_audio") ) {

                                                if(gameObj.multimedia.media[aLinkPos].state == "audio_off" || gameObj.multimedia.media[aLinkPos].state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML += title;
                                                        noAudio = false;
                                                } else {
                                                        var urlId = gameObj.multimedia.media[aLinkPos].url.id;
                                                                  //if(gameObj.multimedia.media[aLinkPos].url.id == "17092" ||
                                                                     //gameObj.multimedia.media[aLinkPos].url.id == "17090" ||
                                                                     //gameObj.multimedia.media[aLinkPos].url.id == "17098" ||
                                                                     //gameObj.multimedia.media[aLinkPos].url.id == "17096" ||
                                                                     //gameObj.multimedia.media[aLinkPos].url.id == "17111" ||
                                                                     //gameObj.multimedia.media[aLinkPos].url.id == "17104" )
                                                                        //{
                                                                         //       lang = "Esp";
                                                                       // }
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media[aLinkPos].url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML = title;
                                                        noAudio = false;                                                
                                                }
                                        }
                                }
                        } else{
                                if(gameObj.multimedia.media.type == "audio" && gameObj.multimedia.media.language_display == "Esp") {
                                        //nCell.innerHTML = auIcon;
                                        aKey = gameObj.multimedia.media.key;
                                        if(aKey == "away_audio" || aKey == "alt_away_audio") {
                                                var lang = gameObj.multimedia.media.language_display;
                                                var title = gameObj.multimedia.media.title;
                                                if(gameObj.multimedia.media.state == "audio_off" || gameObj.multimedia.media.state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML += title;
                                                        noAudio = false;
                                                } else {
                                                        var urlEsId = gameObj.multimedia.media.url.id;
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlEsId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media.url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML =  title;
                                                        noAudio = false;        
                                                }
                                        }
                                }
                        }
                        if(noAudio) { nCell.innerHTML = "&nbsp;"; } //If no audio for this column -> clean up
                }
                             //   else if (gameObj.mmdd == "06/04") { nCell.innerHTML ="postponed"; }
                             //   else if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                else { nCell.innerHTML = "&nbsp;"; }
                            //    if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                if (gameObj.mmdd == "") { nCell.innerHTML = ""; }
        }
        
        function handleHomeAudio(gameObj, nCell, showIcon) {
        //function handleHomeAudio(gameObj, nCell) {
                var aLink, aKey, noAudio = true;
                var auIcon = (showIcon)?"<img src=\"" + AUDIO_ICON + "\" border=\"0\"/>&nbsp;":"";
                //var auIcon = "<img src=\"" + AUDIO_ICON + "\" border=\"0\"/>&nbsp;";
                if(gameObj.multimedia.media) {
                        if(gameObj.multimedia.media.length) {
                                if(gameObj.multimedia.media.contains("audio", "type") && gameObj.multimedia.media.contains("Eng", "language_display") ) {
                                        //nCell.innerHTML = auIcon;
                                }       
                                noAudio = true;
                                for(var aLinkPos = 0; aLinkPos < gameObj.multimedia.media.length; aLinkPos++) {
                                        aKey = gameObj.multimedia.media[aLinkPos].key;
                                        //if(gameObj.multimedia.media[aLinkPos].type == "audio" && (aKey == "home_audio" || aKey == "alt_home_audio") && gameObj.multimedia.media[aLinkPos].language_display == "Eng" && gameObj.multimedia.media[aLinkPos].url.id != "17378" ) {
                                        if(gameObj.multimedia.media[aLinkPos].type == "audio" && (aKey == "home_audio" )  ) {
                                                var lang = gameObj.multimedia.media[aLinkPos].language_display;
                                                var title = gameObj.multimedia.media[aLinkPos].title;
                                                if(gameObj.multimedia.media[aLinkPos].state == "audio_off" || gameObj.multimedia.media[aLinkPos].state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML += title;
                                                        noAudio = false;
                                                } else {
                                                        var urlId = gameObj.multimedia.media[aLinkPos].url.id;
                                                                 //if(gameObj.multimedia.media[aLinkPos].url.id == "17092" ||
                                                                    //gameObj.multimedia.media[aLinkPos].url.id == "17090" ||
                                                                    //gameObj.multimedia.media[aLinkPos].url.id == "17098" ||
                                                                    //gameObj.multimedia.media[aLinkPos].url.id == "17096" ||
                                                                    //gameObj.multimedia.media[aLinkPos].url.id == "17111" ||
                                                                    //gameObj.multimedia.media[aLinkPos].url.id == "17104" )
                                                                        //{
                                                                         //       lang = "Esp";
                                                                        //}
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media[aLinkPos].url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML =  title;
                                                        noAudio = false;        
                                                }
                                        }
                                }
                        } else{
                                if(gameObj.multimedia.media.type == "audio" && gameObj.multimedia.media.language_display == "Eng") {
                                        //nCell.innerHTML = auIcon;
                                        aKey = gameObj.multimedia.media.key;
                                        if(aKey == "home_audio" || aKey == "alt_home_audio") {
                                                var lang = gameObj.multimedia.media.language_display;
                                                var title = gameObj.multimedia.media.title;
                                                if(gameObj.multimedia.media.state == "audio_off" || gameObj.multimedia.media.state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML += title;
                                                        noAudio = false;
                                                } else {
                                                        var urlEsId = gameObj.multimedia.media.url.id;
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlEsId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media.url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML =  title;
                                                        noAudio = false;        
                                                }
                                        }
                                }
                        }
                        if(noAudio) { nCell.innerHTML = "&nbsp;"; } //If no audio for this column -> clean up
                }
                              //  else if (gameObj.mmdd == "06/04") { nCell.innerHTML ="postponed"; }
                              //  else if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                else { nCell.innerHTML = "&nbsp;"; }
                              //  if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                if (gameObj.mmdd == "") { nCell.innerHTML = ""; }
        }
        
        function handleHomeAudioEsp(gameObj, nCell, showIcon) {
                var aLink, aKey, noAudio = true;
                var auIcon = (showIcon)?"<img src=\"" + AUDIO_ICON + "\" border=\"0\"/>&nbsp;":"";
                if(gameObj.multimedia.media) {
                        if(gameObj.multimedia.media.length) {
                                if(gameObj.multimedia.media.contains("audio", "type") && gameObj.multimedia.media.contains("Esp", "language_display")) {
                                        //nCell.innerHTML = auIcon;
                                }       
                                noAudio = true;
                                for(var aLinkPos = 0; aLinkPos < gameObj.multimedia.media.length; aLinkPos++) {
                                        aKey = gameObj.multimedia.media[aLinkPos].key;
                                        //if(gameObj.multimedia.media[aLinkPos].type == "audio" && (aKey == "home_audio" || aKey == "alt_home_audio") && gameObj.multimedia.media[aLinkPos].language_display == "Esp" ) {
                                        //if(gameObj.multimedia.media[aLinkPos].type == "audio" && (aKey == "home_audio" || aKey == "alt_home_audio") && ( gameObj.multimedia.media[aLinkPos].language_display == "Esp" || gameObj.multimedia.media[aLinkPos].url.id == "17378") ) {
                                        if(gameObj.multimedia.media[aLinkPos].type == "audio" && ( aKey == "alt_home_audio") ) {
                                                var lang = gameObj.multimedia.media[aLinkPos].language_display;
                                                var title = gameObj.multimedia.media[aLinkPos].title;
                                                if(gameObj.multimedia.media[aLinkPos].state == "audio_off" || gameObj.multimedia.media[aLinkPos].state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML += title;
                                                        noAudio = false;
                                                } else {
                                                        var urlId = gameObj.multimedia.media[aLinkPos].url.id;
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media[aLinkPos].url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML = title;
                                                        noAudio = false;        
                                                }
                                        }
                                }
                        } else{
                                if(gameObj.multimedia.media.type == "audio" && gameObj.multimedia.media.language_display == "Esp") {
                                        //nCell.innerHTML = auIcon;
                                        aKey = gameObj.multimedia.media.key;
                                        if(aKey == "home_audio" || aKey == "alt_home_audio") {
                                                var lang = gameObj.multimedia.media.language_display;
                                                var title = gameObj.multimedia.media.title;
                                                if(gameObj.multimedia.media.state == "audio_off" || gameObj.multimedia.media.state == "audio_done") {
                                                        //nCell.innerHTML += lang + "&nbsp;";
                                                        nCell.innerHTML +=  title;
                                                        noAudio = false;
                                                } else {
                                                        var urlEsId = gameObj.multimedia.media.url.id;
                                                        aLink = nCell.appendChild(link.cloneNode(false));
                                                        //aLink.href = gameObj.multimedia.media[aLinkPos].url.Text;
                                                        aLink.href = "javascript:mediaPlayer.play({w_id:'" + urlEsId + "',catCode:'mls_game_audio',type:'a_sub',gid:'" + gameObj.multimedia.media.url.gid + "'})";
                                                        //aLink.innerHTML = lang + "&nbsp;";
                                                        aLink.innerHTML = title;
                                                        noAudio = false;        
                                                }
                                        }
                                }
                        }
                        if(noAudio) { nCell.innerHTML = "&nbsp;"; } //If no audio for this column -> clean up
                }
                             //   else if (gameObj.mmdd == "06/04") { nCell.innerHTML ="postponed"; }
                             //   else if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                else { nCell.innerHTML = "&nbsp;"; }
                             //   if (gameObj.mmdd == "09/20" && gameObj.game_time == "8:30") { nCell.innerHTML = "postponed"; }
                                if (gameObj.mmdd == "") { nCell.innerHTML = ""; }
        }
        



//        function handleVideoHilite(gameObj, nCell, showIcon) {
//                var vLink, vKey, noVideo = true, speed, game_status, video_count = 0;
//                var tvIcon = (showIcon)?"<img src=\"" + VIDEO_ICON + "\" border=\"0\"/>&nbsp;":"";
//                if(gameObj.multimedia.media) {
//                        if(gameObj.multimedia.media.length) {
//                                if(gameObj.multimedia.media.contains("video", "type")) {
//                                        //nCell.innerHTML = tvIcon;
//                                }
//                                noVideo = true;
//                                for(var vLinkPos = 0; vLinkPos < gameObj.multimedia.media.length; vLinkPos++) {
//                                        vKey = gameObj.multimedia.media[vLinkPos].key;
//                                        if(gameObj.multimedia.media[vLinkPos].type == "video" && (vKey == "free_plays_video" )) {
//                                                video_count++;
//                                                   speed = gameObj.multimedia.media[vLinkPos].url.speed + "K";
//                                                   if (gameObj.multimedia.media.state == "video_on") { game_status = "Live "; }
//                                                   if (gameObj.multimedia.media.state == "video_off") { game_status = "Pregame "; }
//                                                   if (gameObj.multimedia.media.state == "video_archive") { game_status = "Archive "; }
//                                                   if (gameObj.multimedia.media.state == "video_done" &&
//                                                       gameObj.status == "Game Over") { game_status = "archive soon "; }
//                                                   //if (vLinkPos == 0) nCell.innerHTML += game_status;
//                                                if(gameObj.multimedia.media[vLinkPos].state == "video_off" || gameObj.multimedia.media[vLinkPos].state == "video_done") {
//                                                        nCell.innerHTML += "<font color=\"#000099\">" + speed;
//                                                        noVideo = false;
//                                                } else {
//                                                        var urlId = gameObj.multimedia.media[vLinkPos].url.id;
//                                                        var urlLink = gameObj.multimedia.media[vLinkPos].url.Text;
//                                                        vLink = nCell.appendChild(link.cloneNode(false));
//                                                        //vLink.href = gameObj.multimedia.media[vLinkPos].url.Text;
//                                                        //vLink.href = "javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_sub'})";
//                                                        vLink.href = "javascript:mediaPlayer.play({w:'" + urlLink + "',w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_free'})";
//
//                                                   //game_status = "Archive ";
//                                                   if (gameObj.multimedia.media.state == "video_on") { game_status = "Live "; }
//                                                   if (gameObj.multimedia.media.state == "video_off") { game_status = "Pregame "; }
//                                                   if (gameObj.multimedia.media.state == "video_archive") { game_status = "Archive "; }
//                                                   if (gameObj.multimedia.media.state == "video_done" &&
//                                                       gameObj.status == "Game Over") { game_status = "archive soon "; }
//                                                //if(video_count == 0) vLink.innerHTML += game_status;
//                                                if(video_count == 2) vLink.innerHTML += " | ";
//                                                   //if (vLinkPos == 0) nCell.innerHTML += game_status;
//                                                        vLink.innerHTML += "<font color=\"#000099\">" + speed;
//                                                        noVideo = false;
//                                                }
//                                        }
//                                }
//                        } else{
//                                if(gameObj.multimedia.media.type == "video") {
//                                        nCell.innerHTML = tvIcon;
//                                        vKey = gameObj.multimedia.media.key;
//                                        if(vKey == "mls_tv") {
//                                                   speed = gameObj.multimedia.media.url.speed + "K";
//                                                   if (gameObj.multimedia.media.state == "video_on") { game_status = "Live "; }
//                                                   if (gameObj.multimedia.media.state == "video_off") { game_status = "Pregame "; }
//                                                   if (gameObj.multimedia.media.state == "video_archive") { game_status = "Archive "; }
//                                                   if (gameObj.multimedia.media.state == "video_done" &&
//                                                       gameObj.status == "Game Over") { game_status = "archive soon "; }
//                                                if(gameObj.multimedia.media.state == "video_off" || gameObj.multimedia.media.state == "video_done") {
//                                                        nCell.innerHTML += "<font color=\"#000099\">" + speed;
//                                                        noVideo = false;
//                                                } else {
//                                                        var urlEsId = gameObj.multimedia.media.url.id;
//                                                        var urlLink = gameObj.multimedia.media.url.Text;
//                                                        vLink = nCell.appendChild(link.cloneNode(false));
//                                                        //vLink.href = gameObj.multimedia.media[vLinkPos].url.Text;
//                                                        //vLink.href = "javascript:mediaPlayer.play({w_id:'" + urlEsId + "',catCode:'mls_game_tv',type:'v_sub'})";
//                                                        vLink.href = "javascript:mediaPlayer.play({w:'" + urlLink + "',w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_free'})";
//                                                        vLink.innerHTML += "<font color=\"#000099\">" + speed;
//                                                        noVideo = false;
//                                                }
//                                        }
//                                }
//                        }
//                        //if(noVideo) { nCell.innerHTML = "N/A"; } //If no audio for this column -> clean up
//                }
//                        if(noVideo) { nCell.innerHTML = "N/A"; } //If no audio for this column -> clean up
//        }
//


//        function handleVideoHilite(gameObj, nCell, showIcon) {
 //                       var vLinkPos = -1, idx, vLink, noVideo = true, speed, game_status, video_count;
//                        var tvIcon = (showIcon)?"<img src=\"" + VIDEO_ICON + "\" border=\"0\"/>&nbsp;":"";
//                if(gameObj.multimedia.media) {
//                        if(gameObj.multimedia.media.length) {
//                                              //for(video_count = 0; video_count < gameObj.multimedia.media.url.length; video_count++) {
//                                                for(video_count = 0; video_count < 2; video_count++) {
//                                if((idx = gameObj.multimedia.media.indexOf("free_plays_video", "key")) && idx != -1) {
//                                        vLinkPos = (gameObj.multimedia.media[idx].state == "video_off")?-2:idx;
//                                        speed = gameObj.multimedia.media[idx].url[video_count].speed + "K";
//                                      noVideo = false;
//                                        //speed = "Watch";
//                                        if (gameObj.multimedia.media[idx].state == "video_archive") { game_status = ""; }
//                                        if (gameObj.multimedia.media[idx].state == "video_on") { game_status = ""; }
//                                }                        
//                                 if(vLinkPos >= 0) {
//                                        var urlId = gameObj.multimedia.media[vLinkPos].url[video_count].id;
//                                        var urlLink = gameObj.multimedia.media[vLinkPos].url[video_count].Text;
//                                        nCell.innerHTML = ""; //Remove space                            
//                                        vLink = nCell.appendChild(link.cloneNode(false));
//                                        vLink.href = "javascript:mediaPlayer.play({w:'" + urlLink + "',w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_free'})";
//                                        //vLink.innerHTML = tvIcon + speed;
//                                        vLink.innerHTML +=  "<font color=\"#000099\">" +  speed;
//                                      noVideo = false;
//                                } else if(vLinkPos == -2) {
//                                        //nCell.innerHTML = tvIcon + speed;
//                                        nCell.innerHTML +=  "<font color=\"#000099\">" +  speed;
//                                      noVideo = false;
//                                }
//                         }
//                        
//                        } else {
//                                if(gameObj.multimedia.media.key == "free_plays_video") {
//                                              //for(video_count = 0; video_count < gameObj.multimedia.media.url.length; video_count++) {
//                                                for(video_count = 0; video_count < 2; video_count++) {
//                                        speed = gameObj.multimedia.media.url[video_count].speed + "K";
//                                      //noVideo = false;
//                                        if (gameObj.multimedia.media.state != "video_off") {
//                                                var urlId = gameObj.multimedia.media.url[video_count].id;
//                                                var urlLink = gameObj.multimedia.media.url[video_count].Text;
//                                                nCell.innerHTML = ""; //Remove space                            
//                                                vLink = nCell.appendChild(link.cloneNode(false));
//                                                vLink.href = "javascript:mediaPlayer.play({w:'" + urlLink + "',w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_free'})";
//                                        if (gameObj.multimedia.media.state == "video_archive") { game_status = ""; noVideo = false; }
//                                        if (gameObj.multimedia.media.state == "video_on") { game_status = ""; noVideo = false; }
//                                                vLink.innerHTML +=  "<font color=\"#000099\">" +  speed;
//                                        } else {
//                                        if (gameObj.multimedia.media.state == "video_archive") { game_status = ""; }
//                                        if (gameObj.multimedia.media.state == "video_on") { game_status = ""; }
//                                                { nCell.innerHTML +=  "<font color=\"#000099\">" +  speed;
//                                              noVideo = false; }
//                                        }
//                                }
////                       } // added
//                        }
//                }
//                       // if(noVideo) { nCell.innerHTML = "N/A"; } //If no audio for this column -> clean up
//        }      







        function handleVideoHilite(gameObj, nCell, showIcon) {
                var vLink, vKey, noVideo = true, speed, game_status, video_count;
                var tvIcon = (showIcon)?"<img src=\"" + VIDEO_ICON + "\" border=\"0\"/>&nbsp;":"";
                if(gameObj.multimedia.media) {
                        if(gameObj.multimedia.media.length) {
                                if(gameObj.multimedia.media.contains("video", "type")) {
                                        //nCell.innerHTML = tvIcon;
                                }
                                noVideo = true;
                                for(var vLinkPos = 0; vLinkPos < gameObj.multimedia.media.length; vLinkPos++) {
                                        vKey = gameObj.multimedia.media[vLinkPos].key;
                                        if(gameObj.multimedia.media[vLinkPos].type == "video" && (vKey == "free_plays_video" )) {
                                               for(video_count = 0; video_count < gameObj.multimedia.media[vLinkPos].url.length; video_count++) {
                                               // for(video_count = 0; video_count < 2; video_count++) {
                                                   speed = gameObj.multimedia.media[vLinkPos].url[video_count].speed + "K";
                                                   if (gameObj.multimedia.media[vLinkPos].state == "video_on") { game_status = "Live "; }
                                                   if (gameObj.multimedia.media[vLinkPos].state == "video_off") { game_status = "Pregame "; }
                                                   if (gameObj.multimedia.media[vLinkPos].state == "video_archive") { game_status = "Archive "; }
                                                   if (gameObj.multimedia.media[vLinkPos].state == "video_done" &&
                                                       gameObj.status == "Game Over") { game_status = "archive soon "; }
                                                   //if (vLinkPos == 0) nCell.innerHTML += game_status;
                                                if(gameObj.multimedia.media[vLinkPos].state == "video_off" || gameObj.multimedia.media[vLinkPos].state == "video_done") {
                                                         //if (video_count == 0) nCell.innerHTML +=  speed;
                                                         //if (video_count == 1) nCell.innerHTML += " | " + speed;
                                                        nCell.innerHTML = '--';
														noVideo = false;
                                                } else {
													//check for vpp links;
													//BEGIN VPP CODE - remove this if the vpp links break the code
													if (gameObj.multimedia.media[vLinkPos].url[video_count].type=='flash-video')
													{
														var contentId = gameObj.multimedia.media[vLinkPos].url[video_count].Text;
														vLink = '<a href="' + contentId + '">';
														//overwrite the other data
														nCell.innerHTML = vLink + "Watch</a>";
														// and break out of the loop of url's - if we have a vpp, use it and get out.
														break;
													// else of the vpp if.  remove if this causes problems
													} else {
	                                                    var urlId = gameObj.multimedia.media[vLinkPos].url[video_count].id;
	                                                    var urlLink = gameObj.multimedia.media[vLinkPos].url[video_count].Text;
															//vLink.href = gameObj.multimedia.media[vLinkPos].url[video_count].Text;
	                                                        //vLink = nCell.appendChild(link.cloneNode(false));
															//vLink = "<a href=\"javascript:mediaPlayer.play({w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_sub',gid:'" + gameObj.multimedia.media[vLinkPos].url[video_count].gid + "'})\">";
														vLink = "<a href=\"javascript:mediaPlayer.play({w:'" + urlLink + "',w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_free',gid:'" + gameObj.multimedia.media[vLinkPos].url[video_count].gid + "'})\">";
															
	                                                   //game_status = "Archive ";
	                                                   if (gameObj.multimedia.media.state == "video_on") { game_status = "Live "; }
	                                                   if (gameObj.multimedia.media.state == "video_off") { game_status = "Pregame "; }
	                                                   if (gameObj.multimedia.media.state == "video_archive") { game_status = "Archive "; }
	                                                   if (gameObj.multimedia.media.state == "video_done" && gameObj.status == "Game Over") { game_status = "archive soon "; }
		                                                //if(video_count == 0) vLink.innerHTML += game_status;
		                                                if(video_count == 1) nCell.innerHTML += " | ";
	                                                   //if (vLinkPos == 0) nCell.innerHTML += game_status;
	                                                        nCell.innerHTML += vLink + speed + "</a>";
	                                                        noVideo = false;
													
													}// end of the VPP if
                                                }
                                           }
                                        }
                                }
                        }
						/* 
						// this comes out as a result of supporting the VPP
						// - if we don't have a url node in the media, then we don't show anything
						
						else{
                                if(gameObj.multimedia.media.type == "video" && gameObj.multimedia.media.key == "free_plays_video") {
                                        //nCell.innerHTML = tvIcon;
                                        vKey = gameObj.multimedia.media.key;
                                        if(vKey == "mls_tv") {
                                                 //vLink = nCell.appendChild(link.cloneNode(false));
                                                //for(video_count = 0; video_count < gameObj.multimedia.media.url.length; video_count++) {
                                                for(video_count = 0; video_count < 2; video_count++) {
                                                   speed = gameObj.multimedia.media.url[video_count].speed + "K";
                                                   if (gameObj.multimedia.media.state == "video_on") { game_status = "Live "; }
                                                   if (gameObj.multimedia.media.state == "video_off") { game_status = "Pregame "; }
                                                   if (gameObj.multimedia.media.state == "video_archive") { game_status = "Archive "; }
                                                   if (gameObj.multimedia.media.state == "video_done" &&
                                                       gameObj.status == "Game Over") { game_status = "archive soon "; }
                                                if(gameObj.multimedia.media.state == "video_off" || gameObj.multimedia.media.state == "video_done") {
                                                        if(video_count == 0) nCell.innerHTML += speed;
                                                        if(video_count == 1) nCell.innerHTML += " | " + speed;
                                                        noVideo = false;
                                                } else {
                                                        var urlEsId = gameObj.multimedia.media.url[video_count].id;
														var urlId = gameObj.multimedia.media.url[video_count].id;
                                                        var urlLink = gameObj.multimedia.media.url[video_count].Text;
                                                        //vLink = nCell.appendChild(link.cloneNode(false));
                                                        //if(video_count == 0) vLink.innerHTML += game_status;
                                                        if(video_count == 1) nCell.innerHTML += " | ";
                                                        //vLink.href = gameObj.multimedia.media[vLinkPos].url[video_count].Text;
                                                        vLink = "<a href=\"javascript:mediaPlayer.play({w:'" + urlLink + "',w_id:'" + urlId + "',catCode:'mls_game_tv',type:'v_free',gid:'" + gameObj.multimedia.media.url[video_count].gid + "'})\">";
														nCell.innerHTML += vLink + speed + "</a>";
                                                        noVideo = false;
                                                }
                                           }
                                        }
                                }
                        }
                        */
						//if(noVideo) { nCell.innerHTML = "N/A"; } //If no audio for this column -> clean up
                }
                        if(noVideo) { nCell.innerHTML = "&nbsp;"; } //If no audio for this column -> clean up
        }

