
////////////////////////
//Show EditMfg.aspx
////////////////////////
function showEditMfgWindow(id, reloadParent)
{
    window.parent.document.getElementById('dhtmlwindowholder').style.display='block';
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "/admin/EditMfg.aspx?id=" + id +"&reload=" + reloadParent, "Edit Manufacturer", "width=400px,height=185px,resize=0,scrolling=1,center=1", "recal")
}

////////////////////////
//Show EditCategory.aspx
////////////////////////
function showEditCatWindow(id, reloadParent)
{
    window.parent.document.getElementById('dhtmlwindowholder').style.display='block';
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "/admin/EditCategory.aspx?id=" + id +"&reload=" + reloadParent, "Edit Category", "width=400px,height=220px,resize=0,scrolling=1,center=1", "recal")
}

////////////////////////
//Show EditProduct.aspx
////////////////////////
function showEditProductWindow(id, reloadParent)
{
    window.parent.document.getElementById('dhtmlwindowholder').style.display='block';
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "/admin/EditProduct.aspx?id=" + id +"&reload=" + reloadParent, "Edit Product", "width=600px,height=550px,resize=0,scrolling=1,center=1", "recal")
}

////////////////////////
//Show EditConfig.aspx
////////////////////////
function showEditConfigWindow(id, reloadParent)
{
    window.parent.document.getElementById('dhtmlwindowholder').style.display='block';
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "/admin/EditConfig.aspx?id=" + id +"&reload=" + reloadParent, "Edit Config", "width=600px,height=550px,resize=0,scrolling=1,center=1", "recal")
}

////////////////////////
//Show View Order Window
////////////////////////
function showViewOrderWindow(id, reloadParent)
{
    window.parent.document.getElementById('dhtmlwindowholder').style.display='block';
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "/admin/Reports/ViewOrder.aspx?id=" + id +"&reload=" + reloadParent, "View Order", "width=700px,height=550px,resize=0,scrolling=1,center=1", "recal")
}

////////////////////////
//Show View Quote Window
////////////////////////
function showViewQuoteWindow(id, reloadParent)
{
    window.parent.document.getElementById('dhtmlwindowholder').style.display='block';
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "/admin/Reports/ViewQuote.aspx?id=" + id +"&reload=" + reloadParent, "View Quote", "width=700px,height=550px,resize=0,scrolling=1,center=1", "recal")
}

////////////////////////
//Show EditMarket.aspx
////////////////////////
function showEditMarketWindow(id, reloadParent)
{
    window.parent.document.getElementById('dhtmlwindowholder').style.display='block';
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "/admin/EditMarket.aspx?id=" + id +"&reload=" + reloadParent, "Edit Market", "width=400px,height=220px,resize=0,scrolling=1,center=1", "recal")
}

////////////////////////
//Ajax Spinner
////////////////////////
function onUpdating(){
        // get the update progress div
        var updateProgressDiv = $get('updateProgressDiv'); 

        //  get the gridview element        
        var gridView = $get('MainDiv');
        
        // make it visible
        updateProgressDiv.style.display = '';        
        
        // get the bounds of both the gridview and the progress div
        var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
        var updateProgressDivBounds = Sys.UI.DomElement.getBounds(updateProgressDiv);
        
        //  center of gridview
        var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
        var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);        

        //    set the progress element to this position
        Sys.UI.DomElement.setLocation (updateProgressDiv, x, y);           
    }

////////////////////////
//Ajax Spinner
////////////////////////
function onUpdated() {
        // get the update progress div
        var updateProgressDiv = $get('updateProgressDiv'); 
        // make it invisible
        updateProgressDiv.style.display = 'none';
    }

////////////////////////
//Shows/hides optional fields when editing a product
////////////////////////
function showOptional(id)
    {
        var el = document.getElementById(id);
        
        if(el.style.display=='block')
        {
            el.style.display='none';
        }
        else
        {
            el.style.display='block';
        }
        
    }
    
