//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 * @package Starweb Webshop System
 * @version See version-file
 * @copyright Copyright (c) 2000 - 2008, Ehandelslogik i Lund AB
 * 
 * @author Ehandelslogik i Lund AB, org.no 556696-9019  (Starweb)
 *  Country: Sweden
 *  Homepage: www.starweb.se
 *  E-mail: support@starweb.se
 * 
 * License:
 * This program is not "free" software and restrictions apply!
 * This file as well as all other files containing the code to our software may ONLY be used and/or redistributed with written permission from us.
 * You'll find information regarding our conditions and pricing on our homepage. Contact us immediately if any of these conditions are not clear.
 */
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
 * @name Function: Open Popup Window
 * @access public
 *
 * @param string sUrl
 * @param int iWdtNr
 * @param int iHgtNr
 * @param boolean bIsResizable
 */
var oWnd = null;
function OpenPopupWnd(sUrl, iWdtNr, iHgtNr, bIsResizable)
{
   var iLeftNr = ((screen.width / 2) - (iWdtNr / 2));
   var iTopNr = ((screen.height / (2 - iHgtNr)) / (2 - (iHgtNr / 10)));
   
   var sFeatures = 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars='
      + bIsResizable + ', resizable=' + bIsResizable + ', width=' + iWdtNr + ', height=' + iHgtNr
         + ',alwaysRaised=yes, left=' + iLeftNr + ', top=' + iTopNr + ',screenX=0, screenY=0';
   
   
   // Close opened window
   if(oWnd && !oWnd.closed)
   { oWnd.close(); }
   
   
   
   oWnd = window.open(sUrl, "OpenPopupWnd", sFeatures);
   oWnd.location.href = sUrl;
   if(!oWnd.opener){ oWnd.opener = self; }
   oWnd.focus();
}
