function openWindow(url, msg, width, height)
{
		if(msg && !confirm(msg)) return false;
		
		if(!width) width=800;
		if(!height) height=600;
		// TODO change location to no
		features = 'scrollbars=yes,resizable=yes,height=' + height + ',width=' + width +',status=yes,toolbar=no,menubar=no,location=yes,left=' + window.screenLeft + ',top=' + window.screenTop;
		window.name = 'PopupCaller';
		window.open (url, 'PopupWindow', features);
		
		return false;
}

function confirmDialog(message)
{
	if(!message)
		return confirm('Do you want to delete this item?');
	else
		return confirm(message);
}

function findCntrl(cntrl) { 
  var idName ;
  
  for(var i = 0; i < document.all.length; i++){
		idName = document.all(i).id;
		if (0 <= idName.indexOf(cntrl) )
		{
			return document.all(i);
		}
	}
	return null;
}

// set focus on a given control
function setEditFocus(cntrl) {

	var anObj;
	anObj = findCntrl(cntrl);
	if(anObj != null) anObj.focus();
}

