﻿// JScript File

function EditDownload (DownloadID)
{
    window.open ('frmDocumentDetail.aspx?ID=' + DownloadID ,'frmDocumentDetail','toolbar=no,height=450,width=525,top=' + (screen.height - 450)/2 +',left=' + (screen.width-525)/2 + ',');
}

function EditUser (CustomerID)
{
    window.open ('frmCustomerDetail.aspx?ID=' + CustomerID ,'frmCustomerDetail','toolbar=no,height=585,width=525,top=' + (screen.height - 585)/2 +',left=' + (screen.width-525)/2 + ',');
}

function EditProduct (ProductID)
{
    window.open ('frmAdminProductDetail.aspx?ID=' + ProductID ,
        'frmAdminProductDetail','toolbar=no,height=425,width=670,top=50,left=50 ' );
}

function OpenPODisclaimer ()
{
       window.open ('PODisclaimer.aspx?',
        'PODisclaimer','toolbar=no,height=200,width=300,top=' + 
        (screen.height - 200)/2 +',left=' + (screen.width-300)/2 + ',');
}

function ViewTransaction (TranID, TranType)
{    
    switch (TranType)
    {
      
        case 1: //Customer Credit
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=642,width=550,top=' + 
                (screen.height - 642)/2 +',left=' + (screen.width-525)/2 + ',');              
            break;
        case 2: //Customer Debit         
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=642,width=550,top=' + 
                (screen.height - 642)/2 +',left=' + (screen.width-525)/2 + ',');            
            break;
        case 5: //Vendor Credit
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=642,width=550,top=' + 
                (screen.height - 642)/2 +',left=' + (screen.width-525)/2 + ',');            
            break;
        case 6: //Vendor Debit
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=642,width=550,top=' + 
                (screen.height - 642)/2 +',left=' + (screen.width-525)/2 + ',');            
            break;
        case 9: //Bank Transaction
            break;
        case 10: //Transfer        
            break;
        case 3: //Customer Invoice
            window.open ('frmAdminTransactionInvoice.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=575,width=550,top=' + 
                (screen.height - 550)/2 +',left=' + (screen.width-550)/2 + ',');
            break;
        case 7: //Vendor Invoice
             window.open ('frmAdminTransactionInvoice.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=575,width=550,top=' + 
                (screen.height - 550)/2 +',left=' + (screen.width-550)/2 + ',');
            break;
        case 4: //Customer Payment
             window.open ('frmAdminTransactionPayment.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=575,width=525,top=' + 
                (screen.height - 375)/2 +',left=' + (screen.width-525)/2 + ',');
            break;
        case 8: //Vendor Payment
            window.open ('frmAdminTransactionPayment.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=575,width=525,top=' + 
                (screen.height - 375)/2 +',left=' + (screen.width-525)/2 + ',');
            break;
    }
   
}
function ViewTransactionNew (TranID)
{    
window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=575,width=550,top=' + 
                (screen.height - 600)/2 +',left=' + (screen.width-525)/2 + ',');          
}
function RefreshParent()
{
    window.opener.RefreshData();
}
function CloseWindow()
{    
    window.close();
}

function DrawInfoPanelTop()
{
    var strText = '';
    strText = '<table width="100%" cellspacing=0 cellpadding=0>';    
    strText += '<tr height=25>';
    strText += '<td class="PanelHeaderLeft" width=6></td>';
    strText += '<td align=left valign=middle class="PanelHeaderMiddle">';
    document.write (strText);
}

function DrawInfoPanelMiddle()
{  
    var strText = '';   
    strText += '</td>';
    strText += '<td class="PanelHeaderRight" width=6></td>';
    strText += '</tr>';
    strText += '<tr>';                   
    strText += '<td class="PanelDetailLeft">&nbsp;</td>';
    strText += '<td align=left  valign=top class="PanelDetailMiddle">';
    document.write (strText);
}

function DrawInfoPanelBottom()
{  
    var strText = '';   
    strText += '</td>';
    strText += '<td class="PanelDetailright">&nbsp;</td>';
    strText += '</tr>';
    strText += '</table>';    
    document.write (strText);
}

function OpenProductDetail (ProductID)
{
    window.open ('frmProductDetail.aspx?ID=' + ProductID ,
        'frmAdminProductDetail','scrollbars=yes,toolbar=no,height=600,width=625,top=' + 
        (screen.height - 600)/2 +',left=' + (screen.width-625)/2 + ',');
}

function OpenAdvertisement(strFileName)
{
    window.open (strFileName ,
        'frmAdvertisement','scrollbars=yes,toolbar=no,height=300,width=500,top=' + 
        (screen.height - 300)/2 +',left=' + (screen.width-500)/2 + ',');
}

function OpenDealerPromo(strFileName)
{
    window.open (strFileName ,
        'frmDealerPromo','scrollbars=yes,toolbar=no,height=300,width=500,top=' + 
        (screen.height - 300)/2 +',left=' + (screen.width-500)/2 + ',');
}

function ViewActivation(ID)
{
    window.open ('frmActivationDetail.aspx?ID=' + ID ,
                'frmActivationDetail','scrollbars=yes,toolbar=no,height=650,width=525,top=' + 
                (screen.height - 650)/2 +',left=' + (screen.width-525)/2 + ',');
}



//Open Report fucntion
function OpenReport (ID, ReportName)
{    
    //OpenProgressBar (1);
    window.open ('frmReportViewer.aspx?ID=' + ID + '&ReportName=' + ReportName ,'frmReportViewer',
                    'top=0,left=0,toolbar=no,scrollbars=yes,height=' + (screen.height - 100) + ',width=' + (screen.width-5) + ',');
    //OpenProgressBar (0);
}

//Open Report function Ends Here

function OpenProductViews(ProductID)
{
   window.open('frmproductAdditionalViews.aspx?pid=' + ProductID ,'frmproductAdditionalViews','scrollbars=yes,toolbar=no,height=550,width=510,top=' + 
        (screen.height - 550)/2 +',left=' + (screen.width-510)/2 + ',');
}

function OpenOrderingVideos()
{
   window.open('../training/ordering.html' ,'OrderingVideo','scrollbars=yes,toolbar=no,height=550,width=710,top=' + 
        (screen.height - 550)/2 +',left=' + (screen.width-710)/2 + ',');
}

function OpenAccountingVideos()
{
   window.open('../training/accounting.html' ,'AccountingVideo','scrollbars=yes,toolbar=no,height=550,width=710,top=' + 
        (screen.height - 550)/2 +',left=' + (screen.width-710)/2 + ',');
}

function OpenBatchesVideos()
{
   window.open('../training/batches.html' ,'BatchesVideo','scrollbars=yes,toolbar=no,height=550,width=710,top=' + 
        (screen.height - 550)/2 +',left=' + (screen.width-710)/2 + ',');
}

function ViewDiscrepencyDetails(BatchID)
{
    window.open('frmDiscrepencyDetails.aspx?BID=' + BatchID ,'DiscrepencyDetails','scrollbars=yes,toolbar=no,height=390,width=650,top=' +
        (screen.height - 650)/2 +',left=' + (screen.width-525)/2 + ',');
}

