//Make sure that the user cannot user the browser back button.
//history.go(1);

var userClick = false;


//stop the user from submitting a form twice
function hasAlreadyClicked(){
    if (userClick == false){
        userClick = true;
        return true;
    }

    return false;
}

function submitByEnter(event, elemtype) {
 isOnButton=false;
 if ( elemtype=="button" ||elemtype=="textarea" ||elemtype=="button" ||elemtype == "password" || elemtype=="text" || elemtype=="checkbox" || elemtype=="select-one"){
  isOnButton=true;
 }

  // Checks at each key press for enter key.
  if ( enterPressed( event ) && userClick==false && isOnButton){
       userClick=true;
       window.document.ViewForm.submit();
       return false;
  }
return true;
}

// Dispatch to a page in a new window.
function popupPageInNamedWindow(controller, command, windowName, width, height) {

    var destPage = 'Dispatcher?controllerName=' + 
            controller + '&commandName=' +
            command;
    var winl = (screen.width-width)/2;
    var wint = (screen.height-height)/2;
    var settings  ='height=' + height + ',';
    settings +='width=' + width + ',';
    settings +='top='+wint+',';
    settings +='left='+winl+',';
    settings +='scrollbars=';
    settings +=popupWindowScrollBars()+',';
    settings +='resizable=';
    settings +=popupWindowResizable()+',';
    settings +='toolbar=';
    settings +=popupWindowToolBar()+',';
    
    settings +='menubar=';
    settings +=popupWindowMenuBar()+',';
    settings +='status=';
    settings +=popupWindowStatus()+',';
    settings +='location=';
    settings +=popupWindowLocation();
    
    var win=window.open(destPage,windowName,settings);
}


function inTextArea(event){

    element=event.srcElement;   
    
        if (element.tagName =="TEXTAREA"){
            return true;
        }

    return false;
}

// Dispatch to a page in a new window, and default the window name to the command name.
function popupPageInWindow(controller, command, width, height) {
    popupPageInNamedWindow(controller, command, command, width, height);
}

// OneVu Amendment Oct 2004 by JM start
// Overload functions to allow for an index to be added to the page parameters


    // Dispatch to a page in a new window.
    function popupPageInNamedWindow(controller, command, windowName, width, height, index) {
        var destPage = 'Dispatcher?controllerName=' + 
                controller + '&commandName=' +
                command + '&selectedItem=' + index;
        var winl = (screen.width-width)/2;
        var wint = (screen.height-height)/2;
        var settings  ='height=' + height + ',';
        settings +='width=' + width + ',';
        settings +='top='+wint+',';
        settings +='left='+winl+',';
        settings +='scrollbars=';
        settings +=popupWindowScrollBars()+',';
        settings +='resizable=';
        settings +=popupWindowResizable()+',';
        settings +='toolbar=';
        settings +=popupWindowToolBar()+',';
        
    settings +='menubar=';
    settings +=popupWindowMenuBar()+',';
    settings +='status=';
    settings +=popupWindowStatus()+',';
    settings +='location=';
        settings +=popupWindowLocation();
        
        var win=window.open(destPage,windowName,settings);
    }

    // Dispatch to a page in a new window, and default the window name to the command name.
    function popupPageInWindow(controller, command, width, height, index) {
        popupPageInNamedWindow(controller, command, command, width, height, index);
    }


    // Dispatch to a page in a new window with full browser functionality.
    function popupPageInFullBrowser(controller, command, width, height, windowScrollBars, windowResizable, windowToolBar, windowMenuBar, windowStatus, windowLocation) {

        var windowName = command;
    
        var destPage = 'Dispatcher?controllerName=' + 
                controller + '&commandName=' +
                command;
       
        var winl = (screen.width-width)/2;
        var wint = (screen.height-height)/2;
        
        var settings  ='height=' + height + ',';
        settings +='width=' + width + ',';
        settings +='top='+wint+',';
        settings +='left='+winl+',';
        settings +='scrollbars=';
        settings +=windowScrollBars+',';
        settings +='resizable=';
        settings +=windowResizable+',';
        settings +='toolbar=';
        settings +=windowToolBar+',';

    settings +='menubar=';
    settings +=windowMenuBar+',';
    settings +='status=';
    settings +=windowStatus+',';
    settings +='location=';
        settings +=windowLocation;
        
        var win=window.open(destPage,windowName,settings);
    }






// OneVu Amendment Oct 2004 by JM end

function callControllerAndPopup(controller, command, jsfunction) {
     
    // Call the controller by submitting the form.
    var form = document.ViewForm;
    form.controllerName.value = controller;
    form.commandName.value = command;
    form.elementName.value = jsfunction;
    form.formCommand.value=''; 
    form.submit();
}

function callController (viewPageEdits, command) {

  
    // Call the controller by submitting the form.
    var form = document.ViewForm;
    form.commandName.value = command;
    form.submit();
}

function callControllerWithSelectionElement( viewPageEdits, command, selectedIndex, elementName ){
    document.ViewForm.elementName.value = elementName;
    callControllerWithSelection( viewPageEdits, command, selectedIndex );
}

function callControllerWithSelection( viewPageEdits, command, selectedIndex ){
    document.ViewForm.selectedItem.value = selectedIndex;
    callController( viewPageEdits, command );
    return false;
}

/* focus on first enabled and active field in form. or first errored field */
function setFocusOnFirstElement(prmForm) {
    var form = prmForm;
    var i;
    var element;
    var focusAssigned = false;
    
    for (i=0;i < form.length ; i++) {
        element = form.elements[i];
        var elemtype = element.type ;        
        if (( elemtype=="button" ||elemtype=="textarea" ||elemtype=="button" ||elemtype == "password" || elemtype=="text" || elemtype=="checkbox") &&
            element.disabled == false ) {
            if (focusAssigned == false) {
              element.focus();            
              focusAssigned = true;
            }
            if (element.className.search(/NotValid/i) > 0) {
                 element.focus();
                 break;
            }
        }
    }    
    
    <!-- if we are on a thankyou page, i.e. no visible input fields, then if exists, set the focus to the ok button-->
    if ( typeof( window[ 'DefaultAction' ] ) == 'object' ){
      window[ 'DefaultAction' ].focus();
    }   
}


function enterPressed( event ) {
    // Check for null event.
    if ( event == null ) {
        event = window.event;
    }
    // Get the keycode off of the event depending on browser.
    if ( validNetscape() ) {
        keycode = event.which;
    }
    else {
        keycode = event.keyCode;
    }
    if (keycode == 13) {
        return true;
    }
    else { 
        return false;
    }
}

function disableEnter() {
    //return false to disable enter
    return false;
}

function initialize() {
    browserType=navigator.appName;
    browserVersion=navigator.appVersion;
}

function validNetscape() {
    if (navigator.appName.indexOf("N") != -1) {
        var version = parseInt( navigator.appVersion );
        if ( version > 0 ) {
            return true;
        }
    }
return false;
}

function validIE() {
    if (navigator.appName.indexOf("M") != -1) {
        var version = parseInt( navigator.appVersion );
        if ( version > 0 ) {
            return true;
        }
    }
return false;
}

function performSort(listProxyName, elementName, sortDirection) {
    // Move the parameters to the hidden fields in the form.
    var form = document.ViewForm;
    form.listProxyName.value = listProxyName;
    form.elementName.value = elementName;
    form.sortDirection.value = sortDirection;

    // Call the standard entry point.
    callController(false, 'CFiSORT');
}

function performFilter(listProxyName) {
    // Move the parameters to the hidden fields in the form.
    var form = document.ViewForm;
    form.listProxyName.value = listProxyName;

    // Call the standard entry point.
    callController(false, 'CFiFILTER');
}

function performChangeState(elementName, stateName, state) {
    // Move the parameters to the hidden fields in the form.
    var form = document.ViewForm;
    form.elementName.value = elementName;
    form.stateName.value = stateName;
    form.state.value = state;

    // Call the standard entry point.
    callController(false, 'CFiCHANGESTATE');
}

function performPaginate(listProxyName, pageChange, pageSize) {
    // Move the parameters to the hidden fields in the form.
    var form = document.ViewForm;
    form.listProxyName.value = listProxyName;
    form.pageChange.value = pageChange;
    form.pageSize.value = pageSize;

    // Call the standard entry point.
    callController(false, 'CFiPAGINATE');
}

function performNavigate(elementName) {
    // Move the parameters to the hidden fields in the form.
    var form = document.ViewForm;
    form.elementName.value = elementName;

    // Call the standard entry point.
    callController(false, 'CFiNAVIGATE');
    return false;
}

function performProcessForm(elementName, formCommand, command) {
    // Move the parameters to the hidden fields in the form.
    var form = document.ViewForm;
    form.elementName.value = elementName;
    form.formCommand.value = formCommand;

    // Call the standard entry point.
    callController(false, command);
}
            
function storeFilterFieldState (parmFilterFieldNameLow, parmFilterFieldNameHigh, listProxyName) {
    document.forms[0].listProxyName.value = listProxyName;
    document.forms[0].elements["filterFieldNameLow"].value = parmFilterFieldNameLow;
    document.forms[0].elements["filterFieldNameHigh"].value = parmFilterFieldNameHigh;
}

function storeFilterFieldCompare (compareFieldNameValue, listProxyName) {
    document.forms[0].listProxyName.value = listProxyName;
    document.forms[0].elements["filterFieldCompare"].value = compareFieldNameValue;
}

// Save the current drop down field value name.
var savedDropDownFieldName = "";
var savedDropDownArrayName = "";
var savedDropDownArrayDefault = "";

function displayDropDownFilter(compareFieldNameValue, listProxyName, imageName, defaultValue, arrayName) {
    storeFilterFieldCompare (compareFieldNameValue, listProxyName);

    // Save the drop down field name for use by setDropDownValue().
    savedDropDownFieldName = compareFieldNameValue;

    // Save the drop down field name for use by dropdown filter.
    savedDropDownArrayName=arrayName;
    savedDropDownArrayDefault=defaultValue;

    // Activate the popup.
    displayFilterPage ('dropdown');
}

function setDropDownValue(compareFieldValue) {

    // Use the save drop down field name to update the filter value.
    document.forms[0].elements[savedDropDownFieldName].value = compareFieldValue;

    // Submit the new filter criteria.
    callController(false, 'CFiFILTER');
}

function displayFilterPage(filterType) {
    displayFilterPageWithPrompt(filterType, 'between');
}

function displaySingleFilter(compareFieldNameValue,listProxyName, imageName, defaultValue) {
    displaySingleFilterWithPrompt(compareFieldNameValue,listProxyName, imageName, defaultValue, 'default');
}

function displaySingleFilterWithPrompt(compareFieldNameValue,listProxyName, imageName, defaultValue, filterPrompt) {
    storeFilterFieldCompare (compareFieldNameValue, listProxyName);
    displayFilterPageWithPrompt('single', filterPrompt);
}

function displayFilter(parmFilterFieldNameLow, parmFilterFieldNameHigh,listProxyName, imageName, defaultFromValue, defaultToValue) {
    document.forms[0].elements["filterFieldCompare"].value = "";
    storeFilterFieldState (parmFilterFieldNameLow, parmFilterFieldNameHigh, listProxyName);
    displayFilterPage ('between');
}

function displayDateFilter(parmFilterFieldNameLow, parmFilterFieldNameHigh,listProxyName, imageName, defaultFromValue, defaultToValue) {
    document.forms[0].elements["filterFieldCompare"].value = "";
    storeFilterFieldState (parmFilterFieldNameLow, parmFilterFieldNameHigh, listProxyName);
    displayFilterPage ('date');
}

function clearFilter(parmFilterFieldNameLow, parmFilterFieldNameHigh, listProxyName) {
    storeFilterFieldState (parmFilterFieldNameLow, parmFilterFieldNameHigh, listProxyName);
    setFilterValues ('','');
}

function containsInvalidChars(str){

        if (null == str || str == "" || str == " ") return true;

        var result = str.match(/[a-zA-Z0-9 /\-\$\_\@\.\&\+\'\£\=\#\?\:]*/);

        if ( result != null && result[0] == str ) { 
             
                return false; 
                }         
        return true;
}

function setFilterValues (fromField, toField) {

        if (containsInvalidChars(fromField)){fromField="";}
        if (containsInvalidChars(toField)){toField="";}

    var savedFilterFieldCompare = eval(document.forms[0].elements["filterFieldCompare"]).value;
    var savedFilterFieldNameLow = eval(document.forms[0].elements["filterFieldNameLow"]).value;
    var savedFilterFieldNameHigh = eval(document.forms[0].elements["filterFieldNameHigh"]).value;


    if ("" != savedFilterFieldCompare) {
        document.forms[0].elements[savedFilterFieldCompare].value = fromField;
 
    }
    if ("" != savedFilterFieldNameLow) {
        document.forms[0].elements[savedFilterFieldNameLow].value = fromField;
    }

    if ("" != savedFilterFieldNameHigh) {
        document.forms[0].elements[savedFilterFieldNameHigh].value = toField;
    }

    callController(false, 'CFiFILTER');
}

// Set the selected option in a drop down.
function setSelection(select, selectValue) {

    var valueSelected = false;
    for (var i=0; i < select.length; i++) {
        if (select.options[i].value == selectValue) {
            select.options[i].selected = true;
            valueSelected = true;
        } else {
            select.options[i].selected = false;
        }
    }
    if (!valueSelected && select.length > 0) {
        select.options[0].selected = true;
    }
}



function setSelection(select, selectValue) {
    var valueSelected = false;

    for (var i=0; i < select.length; i++) {
        if (select.options[i].value == selectValue) {
            select.options[i].selected = true;
            valueSelected = true;
        } else {
            select.options[i].selected = false;
        }
    }
    if (!valueSelected && select.length > 0) {
        select.options[0].selected = true;
    }
}

function setRadioListSelection(select, selectValue) {
    var valueSelected = false;

    for (var i=0; i < select.length; i++) {
        if (select[i].value == selectValue) {
            select[i].checked = true;
            valueSelected = true;
        } else {
            select[i].checked = false;
        }
    }
    if (!valueSelected && select.length > 0) {
        select[0].checked = true;
    }
}

// eHelp Corporation
// Copyright 1998-2002 eHelp Corporation.All rights reserved.
// RoboHelp_CSH.js
// The Helper function for WebHelp Context Sensitive Help
//     Syntax:
//     function RH_ShowHelp(hParent, a_pszHelpFile, uCommand, dwData)
//
//     hParent
//          Reserved - Use 0
//   
//     pszHelpFile
//          WebHelp: 
//               Path to help system start page ("http://www.myurl.com/help/help.htm" or "/help/help.htm")
//               For custom windows (defined in Help project), add ">" followed by the window name ("/help/help.htm>mywin")
//
//          WebHelp Enterprise: 
//               Path to RoboEngine server ("http://RoboEngine/roboapi.asp")
//               If automatic merging is turned off in RoboEngine Configuration Manager, specify the project name in the URL ("http://RoboEngine/roboapi.asp?project=myproject")
//               For custom windows (defined in Help project), add ">" followed by the window name ("http://RoboEngine/roboapi.asp>mywindow")
//
//     uCommand
//          Command to display help. One of the following:
//                    HH_HELP_CONTEXT     // Displays the topic associated with the Map ID sent in dwData
//                                          if 0, then default topic is displayed.              
//               The following display the default topic and the Search, Index, or TOC pane. 
//               Note: The pane displayed in WebHelp Enterprise will always be the window's default pane.
//                    HH_DISPLAY_SEARCH 
//                    HH_DISPLAY_INDEX
//                    HH_DISPLAY_TOC
//
//     dwData
//          Map ID associated with the topic to open (if using HH_HELP_CONTEXT), otherwise 0
//
//     Examples:
//     <p>Click for <A HREF='javascript:RH_ShowHelp(0, "help/help.htm", 0, 10)'>Help</A> (map number 10)</p>
//     <p>Click for <A HREF='javascript:RH_ShowHelp(0, "help/help.htm>mywindow", 0, 100)'>Help in custom window (map number 100)</A></p>


var gbNav6=false;
var gbNav61=false;
var gbNav4=false;
var gbIE4=false;
var gbIE=false;
var gbIE5=false;
var gbIE55=false;

var gAgent=navigator.userAgent.toLowerCase();
var gbMac=(gAgent.indexOf("mac")!=-1);
var gbSunOS=(gAgent.indexOf("sunos")!=-1);
var gbOpera=(gAgent.indexOf("opera")!=-1);

var HH_DISPLAY_TOPIC = 0;
var HH_DISPLAY_TOC = 1;
var HH_DISPLAY_INDEX = 2;
var HH_DISPLAY_SEARCH = 3;
var HH_HELP_CONTEXT = 15;

var gVersion=navigator.appVersion.toLowerCase();

var gnVerMajor=parseInt(gVersion);
var gnVerMinor=parseFloat(gVersion);

gbIE=(navigator.appName.indexOf("Microsoft")!=-1);
if(gnVerMajor>=4)
{
    if(navigator.appName=="Netscape")
    {
        gbNav4=true;
        if(gnVerMajor>=5)
            gbNav6=true;
    }
    gbIE4=(navigator.appName.indexOf("Microsoft")!=-1);
}
if(gbNav6)
{
    document.gnPageWidth=innerWidth;
    document.gnPageHeight=innerHeight;
    var nPos=gAgent.indexOf("netscape");
    if(nPos!=-1)
    {
        var nVersion=parseFloat(gAgent.substring(nPos+10));
        if(nVersion>=6.1)
            gbNav61=true;
    }
}else if(gbIE4)
{
    var nPos=gAgent.indexOf("msie");
    if(nPos!=-1)
    {
        var nVersion=parseFloat(gAgent.substring(nPos+5));
        if(nVersion>=5)
            gbIE5=true;
        if(nVersion>=5.5)
            gbIE55=true;
    }
}

function RH_ShowHelp(hParent, a_pszHelpFile, uCommand, dwData)
{
    // this function only support WebHelp
    var strHelpPath = a_pszHelpFile;
    var strWnd = "";
    var nPos = a_pszHelpFile.indexOf(">");
    if (nPos != -1)
    {
        strHelpPath = a_pszHelpFile.substring(0, nPos);
        strWnd = a_pszHelpFile.substring(nPos+1); 
    }
    if (isServerBased(strHelpPath))
        RH_ShowWebHelp_Server(hParent, strHelpPath, strWnd, uCommand, dwData);
    else
        RH_ShowWebHelp(hParent, strHelpPath, strWnd, uCommand, dwData);
}

function RH_ShowWebHelp_Server(hParent, strHelpPath, strWnd, uCommand, dwData)
{
    // hParent never used.
    ShowWebHelp_Server(strHelpPath, strWnd, uCommand, dwData);
}

function RH_ShowWebHelp(hParent, strHelpPath, strWnd, uCommand, dwData)
{
    // hParent never used.
    ShowWebHelp(strHelpPath, strWnd, uCommand, dwData);
}


function ShowWebHelp_Server(strHelpPath, strWnd, uCommand, nMapId)
{
    var a_pszHelpFile = "";
    if (uCommand == HH_HELP_CONTEXT)
    {
        if (strHelpPath.indexOf("?") == -1)
            a_pszHelpFile = strHelpPath + "?ctxid=" + nMapId;
        else
            a_pszHelpFile = strHelpPath + "&ctxid=" + nMapId;
    }
    else
    {
        if (strHelpPath.indexOf("?") == -1)
            a_pszHelpFile = strHelpPath + "?ctxid=0";
        else
            a_pszHelpFile = strHelpPath + "&ctxid=0";
    }

    if (strWnd)
        a_pszHelpFile += ">" + strWnd;

    if (gbIE4)
    {
        a_pszHelpFile += "&cmd=newwnd&rtype=iefrm";
        loadData(a_pszHelpFile);
    }
    else if (gbNav4)
    {
        a_pszHelpFile += "&cmd=newwnd&rtype=nswnd";
        var sParam = "left="+screen.width+",top="+screen.height+",width=100,height=100";
        window.open(a_pszHelpFile, "__webCshStub", sParam);
    }
    else
    {
        var sParam = "left="+screen.width+",top="+screen.height+",width=100,height=100";
        if (gbIE5)
            window.open("about:blank", "__webCshStub", sParam);
        window.open(a_pszHelpFile, "__webCshStub");
    }
}

function displayFilterPageWithPromptAndDestination(filterType, filterPrompt, destPage) {

    var h = 200;
    var w = 400;
    var windowName = 'filterWindow';

    if (filterType == 'single') {
        h = 165;
    } else if (filterType == 'date' || filterType == 'between') {
        h = 250;
    }

    // Add the filter type to the query string.
    destPage += '?filterType=' + filterType + '&filterPrompt=' + filterPrompt;

    // Add the default filter values to the query string.
    var savedFilterFieldNameLow = eval(document.forms[0].elements["filterFieldNameLow"]).value;
    if (savedFilterFieldNameLow != null && savedFilterFieldNameLow != "") {
        var fromValue = eval(document.forms[0].elements[savedFilterFieldNameLow]).value;
        if (fromValue != null && fromValue != "") {
            destPage += '&fromValue=' + fromValue;
        }
    }
    var savedFilterFieldNameHigh = eval(document.forms[0].elements["filterFieldNameHigh"]).value;
    if (savedFilterFieldNameHigh != null && savedFilterFieldNameHigh != "") {
        var toValue = eval(document.forms[0].elements[savedFilterFieldNameHigh]).value;
        if (toValue != null && toValue != "") {
            destPage += '&toValue=' + toValue;
        } 
    }
    var savedFilterFieldCompare = eval(document.forms[0].elements["filterFieldCompare"]).value;
    if (savedFilterFieldCompare != null && savedFilterFieldCompare != "") {
        var compareValue = eval(document.forms[0].elements[savedFilterFieldCompare]).value;
        if (compareValue != null && compareValue != "") {
            destPage += '&compareValue=' + compareValue;
        }
    }

    // Add the drop down information to the query string.
    if (savedDropDownArrayName != "") {
        destPage += '&arrayName=' + savedDropDownArrayName;
    }
    if (savedDropDownArrayDefault != "") {
        destPage += '&arrayDefault=' + savedDropDownArrayDefault;
    }

    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
    var settings  ='height=' + h + ',';
        settings +='width=' + w + ',';
        settings +='top='+wint+',';
        settings +='left='+winl+',';
        settings +='scrollbars=no,';
        settings +='resizable=yes,';
        settings +='toolbar=no';
    var win=window.open(destPage,windowName,settings);
    if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}

function ShowWebHelp(strHelpPath, strWnd, uCommand, nMapId)
{
    var a_pszHelpFile = "";
    if (uCommand == HH_DISPLAY_TOPIC)
    {
        a_pszHelpFile = strHelpPath + "#<id=0";
    }
    if (uCommand == HH_HELP_CONTEXT)
    {
        a_pszHelpFile = strHelpPath + "#<id=" + nMapId;
    }
    else if (uCommand == HH_DISPLAY_INDEX)
    {
        a_pszHelpFile = strHelpPath + "#<cmd=idx";
    }
    else if (uCommand == HH_DISPLAY_SEARCH)
    {
        a_pszHelpFile = strHelpPath + "#<cmd=fts";
    }
    else if (uCommand == HH_DISPLAY_TOC)
    {
        a_pszHelpFile = strHelpPath + "#<cmd=toc";
    }
    if (strWnd)
        a_pszHelpFile += ">>wnd=" + strWnd;

    if (a_pszHelpFile)
    {
        if (gbIE4)
            loadData(a_pszHelpFile);
        else if (gbNav4)
        {
            var sParam = "left="+screen.width+",top="+screen.height+",width=100,height=100";
            window.open(a_pszHelpFile, "__webCshStub", sParam);
        }
        else
        {
            var sParam = "left="+screen.width+",top="+screen.height+",width=100,height=100";
            if (gbIE5)
                window.open("about:blank", "__webCshStub", sParam);
            window.open(a_pszHelpFile, "__webCshStub");
        }
    }
}

function isServerBased(a_pszHelpFile)
{
    if (a_pszHelpFile.length > 0)
    {
        var nPos = a_pszHelpFile.lastIndexOf('.');
        if (nPos != -1 && a_pszHelpFile.length >= nPos + 4)
        {
            var sExt = a_pszHelpFile.substring(nPos, nPos + 4);
            if (sExt.toLowerCase() == ".htm")
            {
                return false;
            }
        }
    }
    return true;
}

function getElement(sID)
{
    if(document.getElementById)
        return document.getElementById(sID);
    else if(document.all)
        return document.all(sID);
    return null;
}

function loadData(sFileName)
{
    if(!getElement("dataDiv"))
    {
        if(!insertDataDiv())
        {
            gsFileName=sFileName;
            return;
        }
    }
    var sHTML="";
    if(gbMac)
        sHTML+="<iframe name=\"__WebHelpCshStub\" src=\""+sFileName+"\"></iframe>";
    else
        sHTML+="<iframe name=\"__WebHelpCshStub\" style=\"visibility:hidden;width:0;height:0\" src=\""+sFileName+"\"></iframe>";

    var oDivCon=getElement("dataDiv");
    if(oDivCon)
    {
        if(gbNav6)
        {
            if(oDivCon.getElementsByTagName&&oDivCon.getElementsByTagName("iFrame").length>0)
            {
                oDivCon.getElementsByTagName("iFrame")[0].src=sFileName;
            }
            else
                oDivCon.innerHTML=sHTML;
        }
        else
            oDivCon.innerHTML=sHTML;
    }
}

function insertDataDiv()
{
    var sHTML="";
    if(gbMac)
        sHTML+="<div id=dataDiv style=\"display:none;\"></div>";
    else
        sHTML+="<div id=dataDiv style=\"visibility:hidden\"></div>";

    document.body.insertAdjacentHTML("beforeEnd",sHTML);
    return true;
}
// eHelp Corporation
// Copyright 1998-2002 eHelp Corporation.All rights reserved.
// End of RoboHelp_CSH.js

function helpLauncher(CCHelpUrl, OnlyTOC) {
    // The main main robohelp file (accessed via
    // variable CCHelpUrl) is obtain/set in property file
    // ApplicationResourceBundle.property via value 'HelpFile'.
    //
    // OnlyTOC = if you want the help click to only display Table of Contents
    // CCHelpUrl = the main/staring Robohelp html page
    // HelpMapID = a number value that relates to the help file for a PD, this is
    // set as a property obtained from each PD's property file
    if ( OnlyTOC == 'yes') {
    RH_ShowHelp(0, CCHelpUrl, HH_DISPLAY_TOC);
    } else {
    if (helpMapID() == 'HelpMapID') {
        RH_ShowHelp(0, CCHelpUrl, HH_DISPLAY_TOC);
    } else {
        RH_ShowHelp(0, CCHelpUrl, HH_HELP_CONTEXT, helpMapID());
    }
    }
    return false;
}


function focusField()
{
    theField = document.ViewForm.defaultfield();
    if (typeof(theField) == "object") {
    theField.focus();
    }
}



function doPageLoad()
{
    // This function can be called whenever a page is displayed.

    // Give focus to the default field.
    focusField();
}



function popUp(popurl) {


    if (gbNav4)
    {
        var sParam = "left="+10+",top="+10+",width=800,height=600,scrollbars=yes";
        window.open(popurl, "__webCshStub", sParam);
    }
    else
    {
        var sParam = "left="+10+",top="+10+",width=800,height=600,scrollbars=yes";
        if (gbIE5)
            window.open("about:blank", "__webCshStub", sParam);            
        window.open(popurl, "__webCshStub");
    }
}


function changeBkgr(srcTR) {
    srcTR.className=srcTR.className+"Hover";
}


function changeBack(srcTR) {
    if(srcTR) {
        trClass = srcTR.className; 
        hoverIndex = trClass.indexOf("Hover");
        trClass = trClass.substring(0,hoverIndex);
        srcTR.className = trClass;
    }
}

function imposeMaxLength(event,Object, MaxLen)
{

 if ( event == null ) {

        event = window.event;
    }
    // Get the keycode off of the event depending on browser.
    if ( validNetscape() ) {
        keycode = event.which;
    }
    else {
        keycode = event.keyCode;
    }

 // if the user has pressed del or backapace, then let them delete a char
  if (keycode ==0 || keycode==8){
    return true;
  } 

//check the number of chars left 
  return (Object.value.length < MaxLen);
}
