// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function LoadElement_Select( objElementToLoad, arryValuesToLoad )
{
    var i = 0;

    if ( objElementToLoad )
    {
        Js_UnLoad_Select_All( objElementToLoad );

        for ( i = 0; i < arryValuesToLoad.length; i++ )
        {
            objElementToLoad.options[ i ] = new Option( arryValuesToLoad[i], arryValuesToLoad[i] );
        }

    }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetValue_ElementText2( strElementName, strDefaultValue )
{
    var obj_Element = GetObj_HtmlElement( strElementName );

    var str_ToReturn = "";

    if ( obj_Element )
    {
    	if ( obj_Element.value == '' ) { str_ToReturn = strDefaultValue; }
    	else { str_ToReturn = obj_Element.value; }
    }

    return str_ToReturn;
}

function GetValue_ElementText( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        str_ToReturn = obj_Element.value;
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetCheckedValue_ElementRadio( strElementName )
{
}

function SetValue_ElementRadio( strElementName, strValueMatch )
{
    // var obj_Element = GetObj_HtmlElement( strElementName );
    var obj_Element = eval( "document.forms[0]." + strElementName );

    var str_ToReturn = "";

    var int_Index = 0;

    // alert( obj_Element );

    if ( obj_Element )
    {
        // str_ToReturn = obj_Element.value;

/**/
        // alert( obj_Element.length );

        for ( int_Index = 0; int_Index < obj_Element.length; int_Index++ )
        {
            // alert( obj_Element[ int_Index ].value );
            if ( strValueMatch == obj_Element[ int_Index ].value )
            {
            	obj_Element[ int_Index ].checked = true;
            }
            else
            {
            	obj_Element[ int_Index ].checked = false;
            }

            // if ( obj_Element[ int_Index ].checked ) { str_ToReturn = obj_Element[ int_Index ].value; }
        }
    }
/**/

    return str_ToReturn;
}

function GetValue_ElementRadio( strElementName )
{
    // var obj_Element = GetObj_HtmlElement( strElementName );
    var obj_Element = eval( "document.forms[0]." + strElementName );

    var str_ToReturn = "";

    var int_Index = 0;

    // alert( obj_Element );

    if ( obj_Element )
    {
        // str_ToReturn = obj_Element.value;

/**/
        // alert( obj_Element.length );

        for ( int_Index = 0; int_Index < obj_Element.length; int_Index++ )
        {
            // alert( obj_Element[ int_Index ].value );

            if ( obj_Element[ int_Index ].checked )
            {
                str_ToReturn = obj_Element[ int_Index ].value;
            }
        }
    }
/**/

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

/**/

function GetValueText_ElementSelect( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        if ( obj_Element.selectedIndex )
        {
            str_ToReturn = obj_Element.options[ obj_Element.selectedIndex ].value;
            str_ToReturn = str_ToReturn + "+" + obj_Element.options[ obj_Element.selectedIndex ].text;
        }
    }

    return str_ToReturn;
}

/**/

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

/**/

function GetText_ElementSelect2( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );
    var int_Indx = 0;
    var str_Text = "";
    var str_ToReturn = "";

    if ( obj_Element )
    {
        for ( int_Indx = 0; int_Indx < obj_Element.options.length; int_Indx++ )
        {
            str_Text = obj_Element.options[ int_Indx ].text;
            // alert( int_Indx + "\n" + obj_Element.options[ int_Indx ].value + "\n" + str_Value + "\n" + obj_Element.options[ int_Indx ].selected );
            if ( obj_Element.options[ int_Indx ].selected == true )
            {
                return str_Text;
            }
        }
    }

    return str_ToReturn;
}

function GetValue_ElementSelect2( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );
    var int_Indx = 0;
    var str_Value = "";
    var str_ToReturn = "";

    if ( obj_Element )
    {
        for ( int_Indx = 0; int_Indx < obj_Element.options.length; int_Indx++ )
        {
            str_Value = obj_Element.options[ int_Indx ].value;
            // alert( int_Indx + "\n" + obj_Element.options[ int_Indx ].value + "\n" + str_Value + "\n" + obj_Element.options[ int_Indx ].selected );
            if ( obj_Element.options[ int_Indx ].selected == true )
            {
                return str_Value;
            }
        }
    }

    return str_ToReturn;
}

function GetValue_ElementSelect( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        if ( obj_Element.selectedIndex )
        {
            str_ToReturn = str_ToReturn + obj_Element.options[ obj_Element.selectedIndex ].value;
        }
    }

    return str_ToReturn;
}

/**/

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

/**/

function GetText_ElementSelect( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        if ( obj_Element.selectedIndex )
        {
            str_ToReturn = obj_Element.options[ obj_Element.selectedIndex ].text;
        }
    }

    return str_ToReturn;
}

/**/

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetObj_Ifrm( strIfrmId )
{
    var ObjStr_NavigatorInfo = ( new String( navigator.userAgent ) ).toUpperCase();

    if ( ObjStr_NavigatorInfo.indexOf( 'FIREFOX' ) > 0 )
    {
        // obj_DocumentDetails = document.documentElement;
        return document.getElementById( strIfrmId );
    }
    else
    {
        // return GetObj_HtmlElement( strIfrmId );
        return eval( "document." + strIfrmId );
    }

    return null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetObj_Ifrm_DcmntFrm( objIfrm )
{
    var ObjStr_NavigatorInfo = ( new String( navigator.userAgent ) ).toUpperCase();

    if ( ObjStr_NavigatorInfo.indexOf( 'FIREFOX' ) > 0 )
    {
        // obj_DocumentDetails = document.documentElement;
        return objIfrm.contentDocument.forms[0];
    }
    else
    {
        return objIfrm.document.forms[ 0 ];
    }

    return null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetObj_Ifrm_DcmntLctn( objIfrm )
{
    var ObjStr_NavigatorInfo = ( new String( navigator.userAgent ) ).toUpperCase();

    if ( ObjStr_NavigatorInfo.indexOf( 'FIREFOX' ) > 0 )
    {
        // obj_DocumentDetails = document.documentElement;
        return objIfrm.contentDocument.location;
    }
    else
    {
        return objIfrm.document.location;
    }

    return null;
}
/* ********** */
function GetObj_HtmlElement_MatchByIdOrByName( strIdOrNm, strMtch ) {
    var int_Indx = 0;
    var int_Max = 0;
    var obj_Itm = null;
    var obj_ToReturn = null;
    var objArry_Elements = document.forms[0].elements;
    var str_Vl = "";
    int_Max = objArry_Elements.length - 1;
    for ( int_Indx = int_Max; int_Indx >= 0; int_Indx-- ) {
        obj_Itm = objArry_Elements[ int_Indx ];
        if ( eval( "obj_Itm." + strIdOrNm ) ) {
            str_Vl = eval( "obj_Itm." + strIdOrNm );
            if ( str_Vl == strMtch ) {
                obj_ToReturn = obj_Itm;
            }
        }
    }
    return obj_ToReturn;
}
/* ********** */
function GetObj_HtmlElement_MtchByIdByNm( objArry, strIdOrNm, strMtch ) {
    var int_Indx = 0;
    var str_Vl = "";
    var obj_Itm = null;
    var obj_ToReturn = null;
    for ( int_Indx = 0; int_Indx < objArry.length; int_Indx++ ) {
        obj_Itm = objArry[ int_Indx ];
        if ( eval( "obj_Itm." + strIdOrNm ) ) {
            str_Vl = eval( "obj_Itm." + strIdOrNm );
            if ( str_Vl == strMtch ) {
                obj_ToReturn = obj_Itm;
            }
        }
    }
    return obj_ToReturn;
}
/* ********** */
function GetObj_HtmlElement_ById( strElementId )
{
    var str_ElmntNms = "";
    var obj_ToReturn = null;

    for ( var i = 0; i < document.forms[0].elements.length; i++ )
    {
        currentObj = document.forms[0].elements[i];
        currentObjName = currentObj.id;

        if ( currentObjName == strElementId )
        {
            obj_ToReturn = currentObj;
        }
        // str_ElmntNms = str_ElmntNms + "\n" + currentObjName;
    }
    // alert( str_ElmntNms );
    return obj_ToReturn;
}

function GetObj_HtmlElement( strElementName )
{
    for ( var i = 0; i < document.forms[0].elements.length; i++ )
    {
        currentObj = document.forms[0].elements[i];
        currentObjName = currentObj.name;

        if ( currentObjName == strElementName )
        {
            // bln_ToReturn = true;
            return currentObj;
        }
    }

    return null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetObj_HtmlLink( strLnkNm, strByNmOrId )
{
    var currentObj = null;
    var currentObjName = null;
    var i = 0;
    var str_AlrtMsg = '';

    for ( i = 0; i < document.links.length; i++ )
    {
        currentObj = document.links[i];
        if ( eval( "currentObj." + strByNmOrId ) )
        {
            currentObjName = eval( "currentObj." + strByNmOrId );
            str_AlrtMsg = str_AlrtMsg + '\n' + currentObjName + ' =? ' + strLnkNm;
            if ( currentObjName == strLnkNm )
            {
                return currentObj;
            }
        }
    }
    // alert( str_AlrtMsg );

    return null;

}

function GetObj_HtmlLinkByName( strByNmOrId )
{

    var currentObj = null;
    var currentObjName = null;
    var i = 0;

    for ( i = 0; i < document.links.length; i++ )
    {
        currentObj = document.links[i];
        // alert( "currentObj." + strByNmOrId );
        if ( eval( "currentObj." + strByNmOrId ) )
        {
            currentObjName = eval( "currentObj." + strByNmOrId );
            if ( currentObjName == strLnkNm )
            {
                return currentObj;
            }
        }
    }

    return null;

}

function GetObj_HtmlImage( strImageName )
{
    for ( var i = 0; i < document.images.length; i++ )
    {
        currentObj = document.images[i];
        currentObjName = currentObj.name;

        if ( currentObjName == strImageName )
        {
            // bln_ToReturn = true;
            return currentObj;
        }
    }

    return null;
}

function GetObj_HtmlImageById( strImageId )
{
    for ( var i = 0; i < document.images.length; i++ )
    {
        currentObj = document.images[i];
        currentObjName = currentObj.id;

        if ( currentObjName == strImageId )
        {
            // bln_ToReturn = true;
            return currentObj;
        }
    }

    return null;
}

function SetObjPrpty_HtmlImg_Src( strImgHndl, strSrc )
{
    var obj_Img = GetObj_HtmlImage( strImgHndl );
    if ( obj_Img ) { obj_Img.src = strSrc; }
}

function GetObj_HtmlCheckBox( strCheckBoxName )
{
    var obj_Element = eval( "document.forms[0]." + strCheckBoxName );

    if ( obj_Element )
    {
        return obj_Element;
    }
    else
    {
        return null;
    }
}

function GetObj_HtmlCheckBoxByForm( objForm, strCheckBoxName )
{
    return ( eval( 'objForm.' + strCheckBoxName ) );
}

function GetBln_HtmlCheckBoxIsChecked( strCheckBoxName )
{
    return ( eval( 'document.forms[0].' + strCheckBoxName + '.checked' ) );
}

function GetValue_HtmlCheckBox( strCheckBoxName, strAddKey )
{
/*
    var i = 0;
    var obj_CheckBoxes = eval( "document.forms[0]." + strCheckBoxName );
    var obj_Temp = null;
    var str_ToReturn = "";

    for ( i = 0; i < obj_CheckBoxes.length; i++ )
    {
        obj_Temp = null;
        obj_Temp = obj_CheckBoxes[i];

        if ( obj_Temp.checked )
        {
            str_ToReturn = AddTo_StringList( str_ToReturn, obj_Temp.name, strAddKey );
        }
    }

    return str_ToReturn;
*/
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_InlineFrame( strNameHandle, strHandleId, strSrc, strWidth, strHeight, strFrameBorder, strMarginWidth, strMarginHeight, strScrolling, strAlign, strSpaceV, strSpaceH )
{
    // <iframe name="vp" id="vp" src="/mapfiles/home3.html"></iframe>
    /*
    SRC: URL of the document to go in the frame
    HEIGHT: height of the inline frame
    WIDTH: width of the inline frame
    NAME: name of this inline frame
    LONGDESC: URL of a long description of the contents of the frame
    FRAMEBORDER: if the frame should have a border around it
    MARGINWIDTH: internal left/right margin for the frame
    MARGINHEIGHT: internal top/bottom margin for the frame
    SCROLLING: if the frame should have scroll bars
    ALIGN: alignment of the frame object to text around it
    VSPACE: space above and below the frame
    HSPACE: space to the left and right of the frame 
    */
    var str_ToReturn = "";

    if ( ( strNameHandle != "" ) && ( strSrc != "" ) )
    {
        str_ToReturn = "<iframe name='" + strNameHandle + "'";

        // if ( strOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='JavaScript:" + strOnClick + "'"; }
        if ( strHandleId != "" ) { str_ToReturn = str_ToReturn + " id='" + strHandleId + "'"; }
        if ( strSrc != "" ) { str_ToReturn = str_ToReturn + " src='" + strSrc + "'"; }
        if ( strWidth != "" ) { str_ToReturn = str_ToReturn + " width='" + strWidth + "'"; }
        if ( strHeight != "" ) { str_ToReturn = str_ToReturn + " height='" + strHeight + "'"; }
        if ( strFrameBorder != "" ) { str_ToReturn = str_ToReturn + " frameborder='" + strFrameBorder + "'"; }
        if ( strMarginWidth != "" ) { str_ToReturn = str_ToReturn + " marginwidth='" + strMarginWidth + "'"; }
        if ( strMarginHeight != "" ) { str_ToReturn = str_ToReturn + " marginheight='" + strMarginHeight + "'"; }
        if ( strScrolling != "" ) { str_ToReturn = str_ToReturn + " scrolling='" + strScrolling + "'"; }
        if ( strAlign != "" ) { str_ToReturn = str_ToReturn + " align='" + strAlign + "'"; }
        if ( strSpaceV != "" ) { str_ToReturn = str_ToReturn + " vspace='" + strSpaceV + "'"; }
        if ( strSpaceH != "" ) { str_ToReturn = str_ToReturn + " hspace='" + strSpaceH + "'"; }

        str_ToReturn = str_ToReturn + "></iframe>";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Hidden( strName, strValue )
{
    // <input type="hidden" name="hddn_Temp" value="1">
    var str_ToReturn = "";

    if ( ( strName != "" ) && ( strValue != "" ) )
    {
        str_ToReturn = "<input type='hidden' name='" + strName + "'";

        // if ( strOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='JavaScript:" + strOnClick + "'"; }
        if ( strValue != "" ) { str_ToReturn = str_ToReturn + " value='" + strValue + "'"; }

        str_ToReturn = str_ToReturn + ">";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Radio( strName, strOnClick, strValue )
{
    // <input type="radio" name="radiobutton01" value="3days">
    var str_ToReturn = "";

    if ( ( strName != "" ) && ( strValue != "" ) )
    {
        str_ToReturn = "<input type='radio' name='" + strName + "'";

        // if ( strOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='JavaScript:" + strOnClick + "'"; }
        if ( strValue != "" ) { str_ToReturn = str_ToReturn + " value='" + strValue + "'"; }

        str_ToReturn = str_ToReturn + ">";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_HyperLink( strName, strHref, strClass, strOnClick, strDisplayText )
{
    // <a href="JavaScript:void(0);" class="srch-nvgtn">images</a>
    var str_ToReturn = "";

    if ( ( strHref != "" ) && ( strDisplayText != "" ) )
    {
        str_ToReturn = "<a";

        if ( strName != "" ) { str_ToReturn = str_ToReturn + " name='" + strName + "'"; }
        if ( strHref != "" ) { str_ToReturn = str_ToReturn + " href='" + strHref + "'"; }
        if ( strClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strClass + "'"; }
        if ( strOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='" + strOnClick + "'"; }
        if ( strDisplayText != "" ) { str_ToReturn = str_ToReturn + ">" + strDisplayText; }

        str_ToReturn = str_ToReturn + "</a>";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Select( strName )
{
    // <select name="ad01"><option value=""></option></select>
    var str_ToReturn = "";

    if ( strName != "" )
    {
        str_ToReturn = "<select name='" + strName + "'><option value=''>select</option></select>";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function Js_UnLoad_Select_All( obj_Select )
{
    var i = 0;
    
    for ( i = obj_Select.options.length; i > 0; i-- )
    {
        obj_Select.options[ i - 1 ] = null;
    }
}

function LoadSelect_OptionDefault( strName, strValue, strText )
{
/*
    // <select name="ad01"><option value=""></option></select>
    if ( eval( strName ) )
    {
        if ( eval( strName + ".options" ) )
        {
             eval( "Js_UnLoad_Select_All( '" + strName + "' );" );
             // obj_slct_Date.options[ 0 ] = new Option( "dd", "" );
             eval( strName + ".options[ 0 ] = new Option( '" + strText + "', '" + strValue + "' )" );
        }
    }
*/
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function LoadSelect_Options( strName, strArryValue, strArryText )
{
    var int_Index = 0;
    var str_Value = "";
    var str_Text = "";

    var ObjLcl_Element = GetObj_HtmlElement( strName );
    // <select name="ad01"><option value=""></option></select>
    if ( ObjLcl_Element )
    {
        if ( ObjLcl_Element.options )
        {
             Js_UnLoad_Select_All( ObjLcl_Element );
             // obj_slct_Date.options[ 0 ] = new Option( "dd", "" );
             for ( int_Index = 0; int_Index < strArryValue.length; int_Index++ )
             {
                 str_Value = strArryValue[ int_Index ];
                 str_Text = strArryText[ int_Index ];
                 // eval( strName + ".options[ " + int_Index + " ] = new Option( '" + strText + "', '" + strValue + "' )" );
                 ObjLcl_Element.options[ int_Index ] = new Option( str_Text, str_Value );
             }
        }
    }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Input_2( strName, strType, strSize, strMaxLength, strOnClick, strValue, strClass )
{
    // <input type="text" name="lastname" size="20">
    var str_ToReturn = "";

    if ( ( strName != "" ) && ( strType != "" ) )
    {
        str_ToReturn = "<input type='" + strType + "' name='" + strName + "'";

        if ( strSize != "" ) { str_ToReturn = str_ToReturn + " size='" + strSize + "'"; }
        if ( strMaxLength != "" ) { str_ToReturn = str_ToReturn + " maxlength='" + strSize + "'"; }
        if ( strOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='" + strOnClick + "'"; }
        if ( strClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strClass + "'"; }
        if ( strValue != "" ) { str_ToReturn = str_ToReturn + " value='" + strValue + "'"; }

        str_ToReturn = str_ToReturn + "/>";
    }

    return str_ToReturn;
}

function BuildHtml_Input( strName, strSize, strMaxLength, strOnClick, strValue, strClass )
{
    // <input type="text" name="lastname" size="20">
    var str_ToReturn = "";

    if ( ( strName != "" ) && ( strSize != "" ) )
    {
        str_ToReturn = "<input type='text' name='" + strName + "'";

        if ( strSize != "" ) { str_ToReturn = str_ToReturn + " size='" + strSize + "'"; }
        if ( strMaxLength != "" ) { str_ToReturn = str_ToReturn + " maxlength='" + strSize + "'"; }
        if ( strOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='" + strOnClick + "'"; }
        if ( strClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strClass + "'"; }
        if ( strValue != "" ) { str_ToReturn = str_ToReturn + " value='" + strValue + "'"; }

        str_ToReturn = str_ToReturn + "/>";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Button( strType, strName, strValue, strOnClick )
{
    // <input type='button' name='bttn_Send' value=''/>
    var str_ToReturn = "";

    if ( ( strType != "" ) && ( strName != "" ) && ( strValue != "" ) )
    {
        str_ToReturn = "<input type='" + strType + "' name='" + strName + "' value='" + strValue + "'";
        if ( strOnClick != "" )
        {
            str_ToReturn = str_ToReturn + " onclick='JavaScript:" + strOnClick + "'";
        }
        str_ToReturn = str_ToReturn + "/>";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Button_2( strType, strName, strValue, strOnClick, strClass )
{
    // <input type='button' name='bttn_Send' value=''/>
    var str_ToReturn = "";

    if ( ( strType != "" ) && ( strName != "" ) && ( strValue != "" ) )
    {
        str_ToReturn = "<input type='" + strType + "' name='" + strName + "' value='" + strValue + "'";
        if ( strOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='JavaScript:" + strOnClick + "'"; }
        if ( strClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strClass + "'"; }
        str_ToReturn = str_ToReturn + "/>";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Image( strImgSrc, strImgHandle, strImgBorder, strImgWidth, strImgHeight, strImgClass, strImgOnClick )
{
    // <img src="<?= $StrDir_Image ?>/logo/reflected.2.gif" border="0"/>
    var str_ToReturn = "";

    if ( strImgSrc != "" )
    {
        str_ToReturn = "<img src='" + strImgSrc + "'";
        if ( strImgHandle != "" ) { str_ToReturn = str_ToReturn + " name='" + strImgHandle + "'"; }
        if ( strImgBorder != "" ) { str_ToReturn = str_ToReturn + " border='" + strImgBorder + "'"; }
        if ( strImgWidth != "" ) { str_ToReturn = str_ToReturn + " width='" + strImgWidth + "'"; }
        if ( strImgHeight != "" ) { str_ToReturn = str_ToReturn + " height='" + strImgHeight + "'"; }
        if ( strImgClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strImgClass + "'"; }
        if ( strImgOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='" + strImgOnClick + "'"; }
        str_ToReturn = str_ToReturn + "/>";
    }

    return str_ToReturn;
}

function BuildHtml_Image2( strImgSrc, strImgId, strImgHandle, strImgBorder, strImgWidth, strImgHeight, strImgClass, strImgOnClick, strImgStyle )
{
    // <img src="<?= $StrDir_Image ?>/logo/reflected.2.gif" border="0"/>
    var str_ToReturn = "";

    if ( strImgSrc != "" )
    {
        str_ToReturn = "<img src='" + strImgSrc + "'";
        if ( strImgId != "" ) { str_ToReturn = str_ToReturn + " id='" + strImgId + "'"; }
        if ( strImgHandle != "" ) { str_ToReturn = str_ToReturn + " name='" + strImgHandle + "'"; }
        if ( strImgBorder != "" ) { str_ToReturn = str_ToReturn + " border='" + strImgBorder + "'"; }
        if ( strImgWidth != "" ) { str_ToReturn = str_ToReturn + " width='" + strImgWidth + "'"; }
        if ( strImgHeight != "" ) { str_ToReturn = str_ToReturn + " height='" + strImgHeight + "'"; }
        if ( strImgClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strImgClass + "'"; }
        if ( strImgOnClick != "" ) { str_ToReturn = str_ToReturn + " onclick='" + strImgOnClick + "'"; }
        if ( strImgStyle != "" ) { str_ToReturn = str_ToReturn + " style='" + strImgStyle + "'"; }
        str_ToReturn = str_ToReturn + "/>";
    }

    return str_ToReturn;
}


// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_TableWrapper1x1( strTblCntnts, 
                                    strTblId, 
                                    strTblHandle, 
                                    strTblBorder, 
                                    strTblWidth, 
                                    strTblHeight, 
                                    strTblClass, 
                                    strTblStyle, 
                                    strTblCllPddng, 
                                    strTblCllSpcng, 
                                    strTblTdAlgn, 
                                    strTblTdValgn,
                                    strTblTdClss,
                                    strTblTdStyl )
{
    var str_ToReturn = "";

    if ( strTblCntnts != "" )
    {
        str_ToReturn = "<table";
        if ( strTblId != "" ) { str_ToReturn = str_ToReturn + " id='" + strTblId + "'"; }
        if ( strTblHandle != "" ) { str_ToReturn = str_ToReturn + " name='" + strTblHandle + "'"; }
        if ( strTblBorder != "" ) { str_ToReturn = str_ToReturn + " border='" + strTblBorder + "'"; }
        if ( strTblWidth != "" ) { str_ToReturn = str_ToReturn + " width='" + strTblWidth + "'"; }
        if ( strTblHeight != "" ) { str_ToReturn = str_ToReturn + " height='" + strTblHeight + "'"; }
        if ( strTblClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strTblClass + "'"; }
        if ( strTblStyle != "" ) { str_ToReturn = str_ToReturn + " style='" + strTblStyle + "'"; }
        if ( strTblCllPddng != "" ) { str_ToReturn = str_ToReturn + " cellpadding='" + strTblCllPddng + "'"; }
        if ( strTblCllSpcng != "" ) { str_ToReturn = str_ToReturn + " cellspacing='" + strTblCllSpcng + "'"; }
        str_ToReturn = str_ToReturn + ">";
        str_ToReturn = str_ToReturn + "<tr>";
        str_ToReturn = str_ToReturn + "<td";
        if ( strTblTdAlgn != "" ) { str_ToReturn = str_ToReturn + " align='" + strTblTdAlgn + "'"; }
        if ( strTblTdValgn != "" ) { str_ToReturn = str_ToReturn + " valign='" + strTblTdValgn + "'"; }
        if ( strTblTdClss != "" ) { str_ToReturn = str_ToReturn + " class='" + strTblTdClss + "'"; }
        if ( strTblTdStyl != "" ) { str_ToReturn = str_ToReturn + " style='" + strTblTdStyl + "'"; }
        str_ToReturn = str_ToReturn + ">";
        if ( strTblCntnts != "" ) { str_ToReturn = str_ToReturn + strTblCntnts; }
        str_ToReturn = str_ToReturn + "</td>";
        str_ToReturn = str_ToReturn + "</tr>";
        str_ToReturn = str_ToReturn + "</table>";
    }

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function BuildHtml_Div( strDvCntnts, strDvId, strDvClass, strDvStyle )
{
    var str_ToReturn = "";

    if ( strDvCntnts != "" )
    {
        str_ToReturn = "<div";

        if ( strDvId != "" ) { str_ToReturn = str_ToReturn + " id='" + strDvId + "'"; }

        if ( strDvClass != "" ) { str_ToReturn = str_ToReturn + " class='" + strDvClass + "'"; }
        if ( strDvStyle != "" ) { str_ToReturn = str_ToReturn + " style='" + strDvStyle + "'"; }

        str_ToReturn = str_ToReturn + ">";

        if ( strDvCntnts != "" ) { str_ToReturn = str_ToReturn + strDvCntnts; }

        str_ToReturn = str_ToReturn + "</div>";
    }

    return str_ToReturn;
}

function BuildHtml_DivDeprecated( strHndl, strClss, strStyl, strInnrHtml )
{
    // <a href="JavaScript:void(0);" class="srch-nvgtn">images</a>
    var str_ToReturn = "";

    str_ToReturn = "<div";

    if ( strHndl != "" ) { str_ToReturn = str_ToReturn + " id='" + strHndl + "'"; }
    if ( strClss != "" ) { str_ToReturn = str_ToReturn + " class='" + strClss + "'"; }
    if ( strStyl != "" ) { str_ToReturn = str_ToReturn + " style='" + strStyl + "'"; }

    str_ToReturn = str_ToReturn + ">";

    if ( strInnrHtml != "" ) { str_ToReturn = str_ToReturn + strInnrHtml; }

    str_ToReturn = str_ToReturn + "</div>";

    return str_ToReturn;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function OnFocus_AccentBox( strObjHandle )
{
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function StylActn_SetBorder( objToSet, strStyleToSet )
{
    if ( objToSet.style )
    {
        objToSet.style.border = strStyleToSet;
    }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function SetSelect_Element( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );
    if ( obj_Element ) { obj_Element.select(); }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function SetFocus_Element( strElementName )
{
    var obj_Element = GetObj_HtmlElement( strElementName );
    if ( obj_Element ) { obj_Element.focus(); }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function SetValue_ElementText( strElementName, strValueToSet )
{
    var obj_Element = GetObj_HtmlElement( strElementName );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        obj_Element.value = strValueToSet;
    }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function SetValue_ElementSelect( strElementName, strValueToSet )
{
    var obj_Element = GetObj_HtmlElement( strElementName );

    var i = 0;

    if ( obj_Element )
    {
        for ( i = 0; i < obj_Element.options.length; i++ )
        {
            if ( obj_Element.options[ i ].value == strValueToSet )
            {
                obj_Element.selectedIndex = i;
                obj_Element.options[ i ].selected = true;
            }
            else
            {
                obj_Element.options[ i ].selected = false;
            }
        }
    }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetObj_ParentHtmlElement( strElementName )
{
    var currentObj = null;
    var currentObjName = "";

    for ( var i = 0; i < self.parent.document.forms[0].elements.length; i++ )
    {
        currentObj = self.parent.document.forms[0].elements[i];
        currentObjName = currentObj.name;

        if ( currentObjName == strElementName )
        {
            // bln_ToReturn = true;
            return currentObj;
        }
    }

    return null;
}

function GetValue_ParentElementSelect( strElementName )
{
    var str_PrntElmnt = "self.parent.document.forms[0]." + strElementName;

    var obj_Element = eval( str_PrntElmnt );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        if ( obj_Element.selectedIndex )
        {
            str_ToReturn = str_ToReturn + obj_Element.options[ obj_Element.selectedIndex ].value;
        }
    }

    return str_ToReturn;
}

function GetValue_ParentElementText( strElementName )
{
    var str_PrntElmnt = "self.parent.document.forms[0]." + strElementName;

    var obj_Element = eval( str_PrntElmnt );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        str_ToReturn = obj_Element.value;
    }

    return str_ToReturn;
}

function GetText_ParentElementSelect( strElementName )
{
    var str_PrntElmnt = "self.parent.document.forms[0]." + strElementName;

    var obj_Element = eval( str_PrntElmnt );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        if ( obj_Element.selectedIndex )
        {
            str_ToReturn = obj_Element.options[ obj_Element.selectedIndex ].text;
        }
    }

    return str_ToReturn;
}

function GetValue_OpenerElementText( strElementName )
{
    var str_PrntElmnt = "self.opener.document.forms[0]." + strElementName;

    var obj_Element = eval( str_PrntElmnt );

    var str_ToReturn = "";

    if ( obj_Element )
    {
        str_ToReturn = obj_Element.value;
    }

    return str_ToReturn;
}
