////////////////////////////////////////////////////////////////////////////////
// v1.8.2007 12:13:58
////////////////////////////////////////////////////////////////////////////////





////////////////////////////////////////////////////////////////////////////////
// WINDOWs - START

// define popup window
var popup = window.popup;



// create new window
function xsCreateWnd(link, name, width, height, tools)
{

  // define return value
  var retValue = true;



  // set window toolbar
  var tools = tools ? tools : 'toolbar=no, location=no, status=no, directories=no, menubar=no, scrollbars=no, resizable=yes';



  // set window position
  var positionTop = (screen.height - height) / 2;
  var positionLeft = (screen.width - width) / 2;



  // open window
  if(popup != null && !popup.closed)
  {

    popup.close();

    popup = window.open(link, name, 'width=' + width + ', height=' + height + ', top= ' + positionTop + ', left= ' + positionLeft +', ' + tools);

    popup.focus();

  }

  else
  {

    popup = window.open(link, name, 'width=' + width + ', height=' + height + ', top= ' + positionTop + ', left= ' + positionLeft +', ' + tools);

    if(popup == null || typeof(popup) == "undefined")
    {

      retValue = false;

    }

  }

  return retValue; 

}



// resize window
function xsResizeWnd(width, height)
{

  window.resizeTo(width,height);

}



// close window
function xsCloseWnd()
{

  window.close();                

}

// WINDOWs - END
////////////////////////////////////////////////////////////////////////////////
