//----------------------------------------------------------------------------
// Function: disablelink *
// Desc: Disable the link so that the user may not select it multiple *
// times *
// Param: linkID - The link id to be disabled *
// Returns: none *
//----------------------------------------------------------------------------
function disablelink(linkID)
{
href = document.getElementById(linkID);
if (href)
{
href.disabled = true;
href.title = '';
href.href = '#';
if (href.style)
{
href.style.cursor = 'default';
}
}
}
//----------------------------------------------------------------------------
// Function: doResize *
// Desc: Maximize the div to fill the screen when the page is loaded or*
// on resizing of the browser *
// Param: none *
// Returns: none *
//----------------------------------------------------------------------------
function doResize()
{
var BrowserHeight = 0; //The value of the displayed Html page
var BrowserWidth = 0;
var BrowserOffset = 0; //Takes into account any extra space the browser adds & the
// size of the scrollbar. IE only adds the scrollbar value
var bottomtext = 0;
var wsub2 = 0;
div1 = document.getElementById("list");
div1.style.height = "200%";
div1.style.width = 0;
if (document.getElementById("bottommsg") != null)
{
BotMsg = document.getElementById("bottommsg");
if (BotMsg.offsetHeight < 20)
{
bottomtext = 20;
}
else
{
bottomtext = BotMsg.offsetHeight;
}
//The 4 is for the whitespace above & below the character
bottomtext = bottomtext + 4;
}
for (wsub2 = 0; wsub2 < 2; wsub2++)
{
if (btype != 0)
{
BrowserHeight = window.innerHeight;
BrowserOffset = 28;
BrowserWidth = window.innerWidth - 2;
}
else
{
BrowserHeight = document.body.clientHeight;
BrowserOffset = 16;
BrowserWidth = document.body.clientWidth;
}
if (div1.offsetTop < BrowserHeight)
{
if (BrowserHeight - div1.offsetTop - BrowserOffset - bottomtext >= 0)
{
div1.style.height = BrowserHeight - div1.offsetTop - BrowserOffset - bottomtext;
}
else
{
div1.style.height = 0;
}
}
else
{
div1.style.height = 0;
}
}
div1.style.width = BrowserWidth;
}
//----------------------------------------------------------------------------
// Function: doTextMsg *
// Desc: Displays the specified message in the html to prevent making a*
// request for an error on the screen. *
// Param: TextId - The value of the text string that *
// is to be displaed *
// FONTS - The font size that the web page is *
// using that is being set by the user *
// preferences *
// Returns: none *
//----------------------------------------------------------------------------
function doTextMsg(TextID, FONTS)
{
var wstring = 0;
var TextString = "";
switch (TextID)
{
case 1:
TextString = "No Item(s) Selected";
break;
case 2:
TextString = "No User Selected"
break;
case 3:
TextString = "Invalid Find command";
break;
case 4:
TextString = "No more fields can be added";
break;
case 5:
TextString = "Too many items selected";
break;
default:
TextString = "ERROR: Message not found. Please update this resource: vmcf.js";
break;
}
wstring = " " + TextString + "
"
document.getElementById("txtmsg").innerHTML = wstring;
doResize();
}
//----------------------------------------------------------------------------
// Function: LRSCvtToWebFmt *
// Desc: Convert the value from Ascii to Web format *
// Param: str - The string to be converted *
// Returns: The converted string *
//----------------------------------------------------------------------------
function LRSCvtToWebFmt(str)
{
newstr = "";
var check;
// Translation assumes using ASCII ISO-8859-1
for (wsub = 0; wsub < str.length; wsub++)
{
check = str.charAt(wsub);
switch(check)
{
case '\x26': // ampersand
newstr = newstr + "%26";
break;
case '\x20': // space
newstr = newstr + "%20";
break;
case '\x23': // number sign
newstr = newstr + "%23";
break;
case '\x27': // single quote
newstr = newstr + "%27";
break;
case '\x22': // double quote
newstr = newstr + "%22";
break;
case '\xA2': // cent sign
newstr = newstr + "%A2";
break;
case '\x3A': // colon
newstr = newstr + "%3A";
break;
case '\x2B': // plus sign
newstr = newstr + "%2B";
break;
case '\x25': // percent sign
newstr = newstr + "%25";
break;
case '\xAC': // not sign
newstr = newstr + "%AC";
break;
case '\xA6': // broken vertical bar
newstr = newstr + "%A6";
break;
case '\x5C': // back slash
newstr = newstr + "%5C";
break;
case '\xF7': // tilda
newstr = newstr + "%F7";
break;
case '\xA3': // british pound sign
newstr = newstr + "%A3";
break;
default:
newstr = newstr + str.charAt(wsub);
}
}
return newstr;
}