
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function GetObj_Div( strDivHandle )
{
    // var obj_ToReturn = null;

    if ( document.getElementById )
    {
        if ( document.getElementById( strDivHandle) )
        {
            // obj_ToReturn = document.getElementById( strDivHandle);
            return document.getElementById( strDivHandle);
        }
    }
    else if ( document.all )
    {
        if ( document.all[ strDivHandle] )
        {
            // obj_ToReturn = document.all[ strDivHandle ];
            return document.all[ strDivHandle ];
        }
    }
    else if ( document.layers )
    {
        if ( document.layers[ strDivHandle] )
        {
            // obj_ToReturn = document.layers[ strDivHandle];
            return document.layers[ strDivHandle ];
        }
    }

    // return obj_ToReturn;
    return null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function Dv_Write( objToWrite, strToWrite )
{
    if ( objToWrite )
    {
        // alert( objToWrite.innerHTML );
        objToWrite.innerHTML = strToWrite;
    }
}

function DvActn_WriteViaHandle( strDvHndl, strToWrite )
{
    var obj_DivToWrite = GetObj_Div( strDvHndl );
    if ( obj_DivToWrite )
    {
        // alert( objToWrite.innerHTML );
        obj_DivToWrite.innerHTML = strToWrite;
    }
    obj_DivToWrite = null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetDivProps( strDvHndl, strPstn, strIntLft, strIntWdth, strIntHght )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div )
    {
        if ( obj_Div.style )
        {
            if ( strPstn != "" ) { obj_Div.style.position = strPstn; }
            if ( strIntLft != "" ) { if ( strIntLft == "0" ) { obj_Div.style.left = "" + strIntLft; } else { obj_Div.style.left = strIntLft + "px"; } }
            if ( strIntWdth != "" ) { if ( strIntLft == "0" ) { obj_Div.style.width = "" + strIntWdth; } else { obj_Div.style.width = strIntWdth + "px"; } }
            if ( strIntHght != "" ) { if ( strIntHght == "0" ) { obj_Div.style.height = "" + strIntHght; } else { obj_Div.style.height = strIntHght + "px"; } }
        }
    }
    obj_Div = null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetDivProps2( strDvHndl, strPstn, strIntTp, strIntLft, strIntWdth, strIntHght, strBckgrndClr, strOvrflw )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div )
    {
        if ( obj_Div.style )
        {
            if ( strPstn != "" ) { obj_Div.style.position = strPstn; }
            if ( strIntTp != "" ) { if ( strIntTp == "0" ) { obj_Div.style.top = "" + strIntTp; } else { obj_Div.style.top = strIntTp + "px"; } }
            if ( strIntLft != "" ) { if ( strIntLft == "0" ) { obj_Div.style.left = "" + strIntLft; } else { obj_Div.style.left = strIntLft + "px"; } }
            if ( strIntWdth != "" ) { if ( strIntLft == "0" ) { obj_Div.style.width = "" + strIntWdth; } else { obj_Div.style.width = strIntWdth + "px"; } }
            if ( strIntHght != "" ) { if ( strIntHght == "0" ) { obj_Div.style.height = "" + strIntHght; } else { obj_Div.style.height = strIntHght + "px"; } }
            if ( strBckgrndClr != "" ) { obj_Div.style.backgroundColor = strBckgrndClr; }
            if ( strOvrflw != "" ) { obj_Div.style.overflow = strOvrflw; }
        }
    }
    obj_Div = null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetDivProps3( strDvHndl, strDsply, strPstn, strIntTp, strIntLft, strIntWdth, strIntHght, strBckgrndClr, strOvrflw, strBrdr )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div )
    {
        if ( obj_Div.style )
        {
            if ( strDsply != "" ) { obj_Div.style.display = strDsply; }
            if ( strPstn != "" ) { obj_Div.style.position = strPstn; }
            if ( strIntTp != "" ) { if ( strIntTp == "0" ) { obj_Div.style.top = "" + strIntTp; } else { obj_Div.style.top = strIntTp + "px"; } }
            if ( strIntLft != "" ) { if ( strIntLft == "0" ) { obj_Div.style.left = "" + strIntLft; } else { obj_Div.style.left = strIntLft + "px"; } }
            if ( strIntWdth != "" ) { if ( strIntLft == "0" ) { obj_Div.style.width = "" + strIntWdth; } else { obj_Div.style.width = strIntWdth + "px"; } }
            if ( strIntHght != "" ) { if ( strIntHght == "0" ) { obj_Div.style.height = "" + strIntHght; } else { obj_Div.style.height = strIntHght + "px"; } }
            if ( strBckgrndClr != "" ) { obj_Div.style.backgroundColor = strBckgrndClr; }
            if ( strOvrflw != "" ) { obj_Div.style.overflow = strOvrflw; }
            if ( strBrdr != "" ) { obj_Div.style.border = strBrdr; }
        }
    }
    obj_Div = null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetDivBgImg( strDvHndl, strBgImgPth, strPstnV, strPstnH, strRpt )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div )
    {
        if ( obj_Div.style )
        {
            if ( strBgImgPth != "" ) { obj_Div.style.backgroundImage = "url(" + strBgImgPth + ")"; }
            if ( ( strPstnV != "" ) && ( strPstnH != "" ) ) { obj_Div.style.backgroundPosition = strPstnV + " " + strPstnH; }
            if ( strRpt != "" ) { obj_Div.style.backgroundRepeat = strRpt; }
        }
    }
    obj_Div = null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetDivOvrflw( strDvHndl, strOvrflw )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div && obj_Div.style )
    {
        if ( strOvrflw != "" ) { obj_Div.style.overflow = strOvrflw; }
    }
    obj_Div = null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvGet_Width( strToChop )
{
    // var obj_String = new String( strToChop );
    // return obj_String.replace( /px/gi, "" );
    return ( new String( strToChop ) ).replace( /px/gi, "" );
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvGet_PixelValue( strToChop )
{
    // var obj_String = new String( strToChop );
    // return obj_String.replace( /px/gi, "" );
    return ( new String( strToChop ) ).replace( /px/gi, "" );
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvGet_InnerHtml( objToWrite )
{
    var str_ToReturn = "";
    if ( objToWrite ) { str_ToReturn = objToWrite.innerHTML; }
    return str_ToReturn;
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_SetClass( objDivToSet, strClassToSet )
{
    if ( objDivToSet )
    {
        objDivToSet.className = strClassToSet;
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_SetWidthHeight( objDivToSet, intWidthToSet, intHeightToSet )
{
    if ( objDivToSet.style )
    {
        objDivToSet.style.width = intWidthToSet + "px";
        objDivToSet.style.height = intHeightToSet + "px";
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_SetWidthHeightViaHandle( strDivHandle, intWidthToSet, intHeightToSet )
{
    var obj_DivToSet = GetObj_Div( strDivHandle );
    if ( obj_DivToSet.style )
    {
        obj_DivToSet.style.width = intWidthToSet + "px";
        obj_DivToSet.style.height = intHeightToSet + "px";
    }
    obj_DivToSet = null;
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_SetWidth( objDivToSet, intWidthToSet )
{
    if ( objDivToSet.style )
    {
        objDivToSet.style.width = intWidthToSet + "px";
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_SetHeight( objDivToSet, intHeightToSet )
{
    if ( objDivToSet.style )
    {
        objDivToSet.style.height = intHeightToSet + "px";
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetBackgroundColor( objDivToSet, strColorToSet )
{
    if ( objDivToSet.style )
    {
        objDivToSet.style.backgroundColor = strColorToSet;
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetColor( objDivToSet, strColorToSet )
{
    if ( objDivToSet.style )
    {
        objDivToSet.style.color = strColorToSet;
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_Move( objDivToMove, intPositionX, intPositionY )
{
    if ( objDivToMove.style )
    {
        objDivToMove.style.left = intPositionX + "px";
        objDivToMove.style.top = intPositionY + "px";
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_MoveH( objDivToMove, intPositionX )
{
    if ( objDivToMove.style )
    {
        objDivToMove.style.left = intPositionX + "px";
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvAction_MoveV( objDivToMove, intPositionY )
{
    if ( objDivToMove.style )
    {
        objDivToMove.style.top = intPositionY + "px";
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_Manipulate( strDivHandle, intDivWidth, intDivHeight, intDivPositionX, intDivPositionY )
{
    var obj_DivToManipulate = null;
    obj_DivToManipulate = GetObj_Div( strDivHandle );
    DvAction_SetWidthHeight( obj_DivToManipulate, intDivWidth, intDivHeight );
    DvAction_Move( obj_DivToManipulate, intDivPositionX, intDivPositionY );
    obj_DivToManipulate = null;
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_Show( objToShowOrHide )
{
    if ( objToShowOrHide )
    {
        if ( objToShowOrHide.style )
        {
            objToShowOrHide.style.display = 'block';
        }
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_Hide( objToShowOrHide )
{
    if ( objToShowOrHide )
    {
        if ( objToShowOrHide.style )
        {
            objToShowOrHide.style.display = 'none';
        }
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_Show_2( objToShowOrHide )
{
    if ( objToShowOrHide )
    {
        if ( objToShowOrHide.style )
        {
            objToShowOrHide.style.display = 'block';
            objToShowOrHide.style.visibility = 'visible';
        }
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_Hide_2( objToShowOrHide )
{
    if ( objToShowOrHide )
    {
        if ( objToShowOrHide.style )
        {
            objToShowOrHide.style.display = 'none';
            objToShowOrHide.style.visibility = 'hidden';
        }
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_ShowViaHandle( strDvHndl )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div )
    {
        if ( obj_Div.style )
        {
            obj_Div.style.display = 'block';
            obj_Div.style.visibility = 'visible';
        }
    }
    obj_Div = null;
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_SetDisplayViaHandle( strDvHndl, strDsply, strVsblty )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div )
    {
        if ( obj_Div.style )
        {
            obj_Div.style.display = strDsply;
            obj_Div.style.visibility = strVsblty;
        }
    }
    obj_Div = null;
}

function DvActn_HideViaHandle( strDvHndl )
{
    var obj_Div = GetObj_Div( strDvHndl );
    if ( obj_Div )
    {
        if ( obj_Div.style )
        {
            obj_Div.style.display = 'none';
            obj_Div.style.visibility = 'hidden';
        }
    }
    obj_Div = null;
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_ShowHide( objToShowOrHide )
{
    if ( objToShowOrHide )
    {
        if ( objToShowOrHide.style )
        {
            if ( objToShowOrHide.style.display == 'block' )
            {
                objToShowOrHide.style.display = 'none';
            }
            else
            {
                objToShowOrHide.style.display = 'block';
            }
        }
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_ShowOrHide_Invert( strElementName, intFlag )
{
    switch ( intFlag )
    {
        case 0:
            DvActn_Hide( GetObj_Div( strElementName ) );
            break;
        case 1:
            DvActn_Show( GetObj_Div( strElementName ) );
            break;
    }
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_ShowOrHide_Normal( strElementName, intFlag )
{
    switch ( intFlag )
    {
        case 0:
            DvActn_Show( GetObj_Div( strElementName ) );
            break;
        case 1:
            DvActn_Hide( GetObj_Div( strElementName ) );
            break;
    }
}

// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_IbIntlz( strDvHndl, strPstn, strLft, strWdth, strHght )
{
    var obj_Dv = GetObj_Div( strDvHndl );
    if ( obj_Dv )
    {
        if ( obj_Dv.style )
        {
            obj_Dv.style.position = strPstn;
            if ( strLft != "" ) { obj_Dv.style.left = strLft; }
            obj_Dv.style.width = strWdth + "px";
            obj_Dv.style.height = strHght + "px";
        }
    }
    obj_Dv = null;
}

// ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

function DvActn_HideAllMapItems( map )
{
	var obj_Div = null;
	var objKey = null;
	var str_DvHndl = '';
    for ( objKey in map )
    {
    	str_DvHndl = map[ objKey ];
    	obj_Div = GetObj_Div( str_DvHndl );
    	if ( obj_Div )
    	{
    		if ( obj_Div.style )
    		{
	    		obj_Div.style.display = 'none';
	    		obj_Div.style.visibility = 'hidden';
    		}
    	}
    }
    obj_Div = null;
    objKey = null;
}

function DvActn_ShowAllMapItems( map, strBlockOrInline )
{
	var obj_Div = null;
	var objKey = null;
	var str_DvHndl = '';
    for ( objKey in map )
    {
    	str_DvHndl = map[ objKey ];
    	obj_Div = GetObj_Div( str_DvHndl );
    	if ( obj_Div )
    	{
    		if ( obj_Div.style )
    		{
	    		obj_Div.style.display = strBlockOrInline;
	    		obj_Div.style.visibility = 'visible';
    		}
    	}
    }
    obj_Div = null;
    objKey = null;
}
