function openAWindow(url,winName, w, h)
{
  var popup, widgets;
  if (!w)
  {
    w='950';
  }
  if (!h)
  {
    h='720';
  }
   if (!winName)
  {
    winName='popup';
  }
  widgets = "width=" + w +",height="+h + ",scrollbars=1,resizable=1";
  popup = window.open(url,winName.replace(/ /, ''),widgets);
  popup.focus();
}

/**
 * returns handle to window after opening it
 */
function getAWindow(url,winName, w, h)
{
  var popup, widgets;
  if (!w)
  {
    w='950';
  }
  if (!h)
  {
    h='720';
  }
     if (!winName)
  {
    winName='popup';
  }
  widgets = "width=" + w +",height="+h + ",scrollbars=1,resizable=1";
  popup = window.open(url,winName.replace(/ /, ''),widgets);
  popup.focus();
  return popup;
}


function windowAVManager(url)
{
  if (window.opener)
  {
    if (window.opener.name == "activityviewer")
    {
     self.close();
    }
     else
   {
     window.location=url;
   }
  }
   else
   {
     window.location=url;
   }
}


$(document).ready(function () {
  if (window.name == "popup")
  {
  $("#navBar").children("#crumb").children("ul").children("li").hide();
  $("#navBar").children("#crumb").append("<ul><li><button onCLick='window.close()'>Close</button></li></ul>");
  }
    $("#CloseButton").click(window.close);

});
