function viewDownloadFile(xFilename)
{
    if(xFilename.length > 0)
    {
         Shadowbox.open({
            content:    xFilename,
            player:     "iframe",
            title:      "File Viewer",
            height:     580,
            width:      780
        });
    }
}


function refreshDimProducts()
{
    var oForm = document.frmDownloads;

    if(oForm)
    {
        var iSelectedRange = oForm.dimrange[oForm.dimrange.selectedIndex].value;
        var arrProdParts;
        for(var i=0; i < oForm.dimproduct.length; i++)
        {
            if(oForm.dimproduct[i].value.length > 0)
            {
                arrProdParts = oForm.dimproduct[i].value.split('_');

                if(arrProdParts[0] == iSelectedRange)
                {
                    oForm.dimproduct[i].style.display = '';
                }
                else
                {
                    oForm.dimproduct[i].style.display = 'none';
                }
            }
        }

        oForm.dimproduct.selectedIndex = 0;
    }
}

function viewDimensions()
{
    var oForm = document.frmDownloads;

    if(oForm)
    {
        var szSelectedProduct = oForm.dimproduct[oForm.dimproduct.selectedIndex].value;

        var arrProductParts = szSelectedProduct.split('_');
        var szFilename = arrProductParts[2];

        if(szFilename.length > 0)
        {
             Shadowbox.open({
                content:    '../../uploads/crosswater/dimensions/' + szFilename,
                player:     "iframe",
                title:      "File Viewer",
                height:     580,
                width:      780
            });
        }
    }
}