/*  

Change the 'path_to_video' variable below if you need to place the
video files in a folder other than the 'video' folder that came with
this .zip file

It can be an absolute link (i.e. 'http://www.stationurl.com/path/to/video') or
a relative link (i.e. '../../video/');

Call Marc Parillo with NBC News Channel anytime at 704-564-0413 if you need assistance.
 
*/


path_to_video = 'video/';

window.onload = function() {
copyright();
page = 'map';

promos = new Array('NBC1','NBC2','NBC3','NBC4');
firstVid = Math.floor(Math.random()*4);
selectVid(promos[firstVid]);	

/*
today = new Date;
later = new Date;
later.setMonth(10);
later.setDate(5);
*/
}


function copyright() {
	var mydate=new Date();
	var year=mydate.getYear();
	if (year < 1000) {year+=1900;}
    document.getElementById('copyright').innerHTML = "Copyright &copy "+year+" National Broadcasting Company | All Rights Reserved";
}

function selectVid(file,div) {

var file = path_to_video+''+file;

var divs = new Array("v1","v2","v3","v4","v5","v6","v7","v8","v9","v10","v11","v12","v13","v14","v15");
for(x in divs) {
Cdiv = divs[x];
if (div == Cdiv) { document.getElementById(Cdiv).style.backgroundColor = '#EDEAD7';}
else {document.getElementById(Cdiv).style.backgroundColor = '#FFF';}
}

var navName = navigator.appName;
if(navName.indexOf("Netscape") != -1) {
 if ( document.all )
   {
      document.all['mediaplayer'].innerHTML = '<EMBED id="FFplayer" SRC="'+file+'.wmv" width="320" height="310" autostart="True" showcontrols="True" showstatusbar="True" showdisplay="True" transparentstart="True">';
   }
   else if ( document.getElementById )
   {
      document.getElementById('mediaplayer').innerHTML = '<EMBED id="FFplayer" SRC="'+file+'.wmv" width="320" height="310" autostart="True" showcontrols="True" showstatusbar="True" showdisplay="True" transparentstart="True">';
   }

}

else if(navName.indexOf("Microsoft") != -1) {
document.Player.filename= file+".wmv";
}

}
