// -----------------------------------------------------------------
// deklarations
// -----------------------------------------------------------------

var NS_URL = '/pages/vpos.aspx';
var NS_PROGRESS = 'ProgressInfo';
var NI_TIMEOUT = 1000;
var _button;

// -----------------------------------------------------------------
// functions
// -----------------------------------------------------------------

function VPosConnect(p) 
{ 
	// hide progress
	var o = MM_findObj(NS_PROGRESS);
	if (o) o.style.display = 'none';

	// enable go button again
	VPosSetButton(true);
	
	// show popup
	return CL_popupDiv(NS_URL+'?'+p, 750, 550, null, 200); 
}

function VPosShow(b,p)
{
	// disable go button
	_button = MM_findObj(b);
	
	// disable button
	VPosSetButton(false);
	
	// show popup with delay
	window.setTimeout("VPosConnect('"+p+"')", NI_TIMEOUT);
}

function VPosSetButton(enabled)
{
	// get button
	if (_button) _button.disabled = !enabled;
}

function VPosStart(name)
{
	var o = MM_findObj(name);
	if (o) o.submit();
}

function VPosPrintWindow()
{
	window.print();
}