// @@  @@                          
// @@  @@                          
// @@  @@   @@@@   @@ @@@   @@@@@  
// @@@@@@  @@  @@   @@  @@ @@      
// @@  @@  @@  @@   @@  @@  @@@@   
// @@  @@  @@  @@   @@@@@      @@  
// @@  @@   @@@@    @@     @@@@@   
//                 @@@@            

// HOPS: Common Javascript.

// Force re-load of page (don't cache)?

function DisplayBusy() {
    if (typeof(BusyImgID) != "undefined") {
	    var Control = document.getElementById(BusyImgID);
	    if (Control)
    		Control.style.visibility = "visible";
    }
}

// TruncateTitle: Truncate a title string.

function HOPS_TruncateTitle(Title) {
	var NewTitle = new String(Title);
	if (MaxTitleLength && NewTitle.length > MaxTitleLength)
		NewTitle = VistaApp.Left(NewTitle, MaxTitleLength-3) + '...';
	return NewTitle;
}

// InitFindPerson: Initialise the FindPerson dialog.

function InitFindPerson(DivID, Visible) {
	var Div = document.getElementById(DivID);
	var Style = Div.style;
	if (Visible)
	    Style.visibility = 'visible';
	else
	    Style.visibility = 'hidden';
	Style.left = 32;
	Style.top = 32;
}

function HOPS_FormattedID(ID) {
    var Text = new String(ID);
    while (Text.length < 6)
        Text = '0' + Text;
    return Text;
}

function HOPS_GuideSubFolder(ID) {
    return HOPS_FormattedID(parseInt(ID / 1000) * 1000);
}