var userId =        'SI06836';     // {string}             Unique identifier for Share International media; required.
var playerType =    'popup';       // {popup*|inline}      Popup (new) window or inline (inpage) placement.
var playerMenu =    'true';        // {true|false*}        'true' for jukebox style player; 'false' for single video.
var playerSize =    '100';         // {100*|200|full}      Relative player size, in percent, or full screen.
var playerQuality = 'high';        // {high*|low|          Relative quality of the Flash stream.
var mediaId =       '';	           // {string}             If no default media is preferred, then set to ''.
var mediaSuite =    '1';           // {1*|2|3|4|5}         Suite of media selections (jukebox only).
var mediaType =     'video';       // {video*|audio}       Not yet implemented.

var qsArray = new Array('userId','mediaId','mediaSuite','mediaType','playerType','playerMenu','playerSize','playerQuality','playerBgColor');
var playerMenu = window.playerMenu || 'true';
if (playerMenu) {var winWidth = 625; var winHeight = 400;} else {var winWidth = 360; var winHeight = 375;}
var leftPos = Math.round((screen.availWidth - winWidth)/2).toString();
var topPos = Math.round((screen.availHeight - winHeight)/2).toString();
var winDefinition = 'width='+winWidth+',height='+winHeight+',top='+topPos+',left='+leftPos+',menubar=0,toolbar=0,status=1,resizable=1,scrollbars=0,dependent=0';

function playMedia(mId) {
  if (mId) mediaId = mId;
  var winQS='';for(var i=0;i<qsArray.length;i++){try{winQS+='&'+qsArray[i]+'='+escape(eval(qsArray[i]).toString())}catch(e){}}winQS=winQS.substring(1,winQS.length);
  var winURL = 'http://www.Share-Media.org/ShareMediaPlayer.html?' + winQS;
  var winHandle = window.open(winURL,'ShareMedia',winDefinition); 
  if (winHandle) {
    return false;
  } else {
    var targ; var e = window.event;
    if (e.target) {targ = e.target;}
    else if (e.srcElement) {targ = e.srcElement;}
    if (targ.nodeType == 3) {targ = targ.parentNode;}
    targ.href = winURL;
    return true;
    }}

