﻿// JScript File

function showMedia(id) {
  if (id != ""){
    document.getElementById("mediabrowser").style.display = "none";
    document.getElementById("mediaviewer").style.display = "block";
    
    
    // load up the player with the correct file
    var so = new SWFObject('/js/mediabox/mediaplayer.swf','mpl','240','180','7');
    so.addParam('allowfullscreen','true');
    so.addParam('allowscriptaccess','always');
    so.addVariable('displayheight','180');
    so.addVariable('file',mediaUrls[id]);
    so.addVariable('height','180');
    so.addVariable('image', mediaThumbs[id]);
    so.addVariable('width','240');
    so.addVariable('overstretch','true');
    so.addVariable('showicons','false');
    so.addVariable('autostart','true');
    so.write('theplayer');
    
    document.getElementById("themediainfo").innerHTML = mediaDescriptions[id];
  }
}



function closeViewer() {
  document.getElementById("theplayer").innerHTML = "";
  document.getElementById("themediainfo").innerHTML = "";
  
  document.getElementById("mediabrowser").style.display = "block";
  document.getElementById("mediaviewer").style.display = "none";
}

