/* Set the URLs for each video */
mymDownloadLink = "http://www.petatv.com/downloads/MYM_update_500.zip";
cotDownloadLink = "http://www.petatv.com/downloads/chew_on_this.zip";
GWDownloadLink = "http://www.petatv.com/downloads/glass_walls_paul_mccartney_peta.zip";
GW3dDownloadLink = "http://www.petatv.com/downloads/glass_walls3d.zip";

mymEmbedLink = "javascript:popUp('mymEmbed.asp')";
cotEmbedLink = "javascript:popUp('cotEmbed.asp')";
GWEmbedLink = "javascript:popUp('GWEmbed.asp')";
GW3dEmbedLink = "javascript:popUp('GW3dEmbed.asp')";

mymTrackingCode = "mymshare1209";
cotTrackingCode = "cotshare1209";
GWTrackingCode = "gwshare1209";
GW3dTrackingCode = "gw3dshare1209";

cotVideoLink = "http://www.mediapeta.com/videoplayer/video.swf?v=chew_on_this_500x375_high&ap=1";
mymVideoLink = "http://www.mediapeta.com/videoplayer/video.swf?v=MYM_update_500x375_high&ap=1";
GWVideoLink = "http://www.mediapeta.com/videoplayer/video.swf?v=glass_walls_550x375_high&ap=1";
GW3dVideoLink = "http://www.mediapeta.com/videoplayer/video.swf?v=glass_walls3d_high&ap=1";



function videoPlay(video) { 

// Change download link
theDownloadLink = eval(video+"DownloadLink");
document.getElementById("downloadLink").href = theDownloadLink;

// Change embed link
theEmbedLink = eval(video+"EmbedLink");
document.getElementById("embedLink").href = theEmbedLink;

// Change addThis link
/*
trackingCode = eval(video+"TrackingCode");
if(window.addEventListener) {//Moz,NN
document.getElementById("addThisLink").addEventListener('mouseover',function (e) {return addthis_open(this,'','http://www.meat.org/index.asp?c='+trackingCode,'Meat.org');},false);
} else {//IE
document.getElementById("addThisLink").attachEvent('onmouseover',function (e) {return addthis_open(this,'','http://www.meat.org/index.asp?c='+trackingCode,'Meat.org');});
} 
*/

// Load video in Iframe
theVideoLink = eval(video+"VideoLink");
document.getElementById('video_frame').src = theVideoLink;

// greys in/out the thumbnails
thumbnailDivs = document.getElementById('VideoSelector').getElementsByTagName('div');
for (i=0;i<thumbnailDivs.length;i++) {
		theThumbnailDiv= thumbnailDivs[i];
		/*alert (theThumbnailDiv.innerHTML);*/
		theThumbnailLink = theThumbnailDiv.getElementsByTagName('a');
		/*alert (theThumbnailLink[0].id);*/
		theThumbnail = theThumbnailLink[0].getElementsByTagName('img');
		if (theThumbnailLink[0].id == video) {
		theThumbnail[0].src = 'images/'+theThumbnailLink[0].id+'_thumbnail_selected.jpg';
		}
		else {
		theThumbnail[0].src = 'images/'+theThumbnailLink[0].id+'_thumbnail.jpg';
		}
	} // end for 

} // end function