// File: popup.js
//**********
// Copyright(C) 2002 by OCLC Online Computer Library Center, Inc.
// OCLC proprietary information: the enclosed materials contain
// proprietary information of OCLC Online Computer Library
// Center, Inc. and shall not be disclosed in whole or in any
// part to any third party or used by any person for any purpose,
// without written consent of OCLC, Inc. Duplication of
// any portion of these materials shall include this notice.
//**********

/**
 * Open an external URL
 */
function openExternalWindow(url, name)
{
      var win = window.open(url, name);
      if (win)
      {
         win.focus();
      }
}



/**
 * Open a limited window w/o menubar, toolbar, etc.
 */
function openLimitedWindow(url, name, width, height, scrollable)
{
   var features = "height="+height+", width="+width+",menubar=false,toolbar=false,resizable=yes";
   if (scrollable)
   {
      features += ",scrollbars";
   }
   var win = window.open(url, name, features, true);
   if (win)
   {
      win.focus();
   }
}


/**
 * Open a FAQ window with the indicated faq page`
 */
function openFaqWindow(page)
{
   openLimitedWindow(page, "Faq", 550, 400, true);
}


/**
 * Open a Course Details window with the indicated page`
 */
function openCourseDetails(page)
{
   openLimitedWindow(page, "CourseDetails", 550, 400, true);
}

/**
 * Open a Paid Course window with the indicated page`
 */
function openPaidCourse(page)
{
   openLimitedWindow(page, "PaidCourse", 550, 400, true);
}

/**
 * Open a Glossary window with the indicated glossary page`
 */
function openGlossaryWindow(page)
{
   openLimitedWindow(page, "Glossary", 550, 400, true);
}


/**
 * Open a SendToFriend window with the indicated page`
 */
function openSendToFriendWindow(page)
{
   openLimitedWindow(page, "SendToFriend", 550, 400, true);
}


/**
 * Open a Site Help window with the indicated help page`
 */
function openSiteHelpWindow(page)
{
   openLimitedWindow(page, "SiteHelp", 550, 400, true);
}


/**
 * Open a Privacy Policy window with the indicated policy page
 */
function openPrivacyPolicyWindow(page)
{
   openLimitedWindow(page, "PrivacyPolicy", 550, 400, true);
}

function openWhatsThisWindow(page)
{
   openLimitedWindow(page, "WhatsThis", 550, 300, true);
}

/**
 * Open a Legal Terms window with the indicated page
 */
function openTermsWindow(page)
{
   openLimitedWindow(page, "LegalTerms", 550, 400, true);
}

/**
 * Open a Copyright window with the indicated copyright page`
 */
function openCopyrightWindow(page)
{
   openLimitedWindow(page, "Copyright", 550, 400, true);
}


/**
 * Open a Contribute window with the indicated contribute page`
 */
function openContributeWindow(page)
{
   openLimitedWindow(page, "Contribute", 550, 400, true);
}


/**
 * Open a Tour window with the indicated tour page`
 */
function openTourWindow(page)
{
   openLimitedWindow(page, "Tour", 550, 400, true);
}


/**
 * Open a Course Details window with the indicated course detail page`
 */
function openCourseWindow(page)
{
   openLimitedWindow(page, "Course", 550, 400, true);
}


/**
 * Set this message in the status bar
 */
function setStatus(msg)
{
   window.defaultStatus = " ";
   window.status = msg;
   return true;
}


/**
 * Clear the message in the status bar
 */
function clearStatus()
{
   setStatus("");
}


/**
 * Returns the key code for the given event or window.event if event is null.
 * Returns null if not WC3.
 */
function getEventKeyCode(event)
{
   if (isNull(event))
   {
      event = window.event
   }
   if (WC3)
   {
      return event.keyCode;
   }
   else
   {
      return null;
   }
}

// End of popup.js






