////////////////////////////////////////////////////////////////////////////////
// v2.1.2008 17:19:35
////////////////////////////////////////////////////////////////////////////////





////////////////////////////////////////////////////////////////////////////////
// WINDOWs - START

// defines popup window
var popup = window.popup;



// creates new window
function xsCreateWnd(link, name, width, height, tools)
{

  // defines returning 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;

  // opens 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;

}



// resizes window to specified dimensions
function xsResizeWndBy(width, height)
{

  window.resizeBy(width, height);

}



// resizes window by specified dimensions
function xsResizeWndTo(width, height)
{

  window.resizeTo(width, height);

}



// moves window to specified place
function xsMoveWndTo(x, y)
{

  window.moveTo(x, y);

}



// closes window
function xsCloseWnd()
{

  window.close();

}

// WINDOWs - END
////////////////////////////////////////////////////////////////////////////////
