﻿// Open a window.
function openWindow(url, name, windowWidth, windowHeight)
{
    var newWindow =
        window.open(url, name, 
        'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=' + windowWidth + ',height=' + windowHeight + ',top=5,left=5');
    newWindow.focus();
    return;
}

// Open a window for a video.
function openVideoWindow(vid)
{
    var newWindow =
        window.open('video_player.html?vid=' + vid, vid, 
        'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=700,height=550,top=5,left=5');
    newWindow.focus();
    return;
}

// Get URL parameter.
function getURLParam(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

