﻿// JScript File
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=275,width=525,top=' + 
        (screen.height - 275)/2 +',left=' + (screen.width-525)/2 + ',');
}

function ViewTransaction (TranID, TranType)
{    
    switch (TranType)
    {
        case 1: //Customer Credit
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=250,width=525,top=' + 
                (screen.height - 250)/2 +',left=' + (screen.width-525)/2 + ',');              
            break;
        case 2: //Customer Debit         
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=250,width=525,top=' + 
                (screen.height - 250)/2 +',left=' + (screen.width-525)/2 + ',');            
            break;
        case 5: //Vendor Credit
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=250,width=525,top=' + 
                (screen.height - 250)/2 +',left=' + (screen.width-525)/2 + ',');            
            break;
        case 6: //Vendor Debit
            window.open ('frmAdminTransactionNote.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=250,width=525,top=' + 
                (screen.height - 250)/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=475,width=550,top=' + 
                (screen.height - 475)/2 +',left=' + (screen.width-550)/2 + ',');
            break;
        case 7: //Vendor Invoice
             window.open ('frmAdminTransactionInvoice.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=475,width=550,top=' + 
                (screen.height - 475)/2 +',left=' + (screen.width-550)/2 + ',');
            break;
        case 4: //Customer Payment
             window.open ('frmAdminTransactionPayment.aspx?ID=' + TranID ,
                'frmAdminTransaction','scrollbars=yes,toolbar=no,height=375,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=375,width=525,top=' + 
                (screen.height - 375)/2 +',left=' + (screen.width-525)/2 + ',');
            break;
    }
   
}

function RefreshParent()
{
    window.opener.RefreshData();
}
function CloseWindow()
{    
    window.close();
}

function DrawInfoPanelTop()
{
    var strText = '';
    strText = '<table width="100%" cellspacing=0 cellpadding=0>';    
    strText += '<tr height=20>';
    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=375,width=525,top=' + 
                (screen.height - 375)/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

// JScript File

function CreateFormHeaderGray (Caption)
{
    var strScript;
    strScript = '<tr height=20>\n';
    strScript += '<td class="CurveGrayFormHeaderLeft"   style="width:8px;"></td>\n';
    strScript += '<td class="CurveGrayFormHeaderMiddle">' + Caption + '</td>\n';
    strScript += '<td class="CurveGrayFormHeaderMiddle"  style="width:8px;"></td>\n';
    strScript += '</tr>\n';
    strScript += '<tr>\n';
    strScript += '<td class="FormBorderGray"></td>\n';
    strScript += '<td>\n';
    strScript += '<table width="100%" cellpadding=3 cellspacing=0 class="FormBorderGray">\n';        
    document.write (strScript);
}

function CreateFormFooterGray ()
{
    var strScript;    
    strScript = '</table>\n';
    strScript += '</td>\n';
    strScript += '<td class="FormBorderGray"></td>\n';
    strScript += '</tr>\n';
    strScript += '<tr height=20>\n';
    strScript += '<td class="CurveGrayFormFooterLeft" colspan=2></td>\n';
    strScript += '<td class="CurveGrayFormFooterRight" ></td>\n';
    strScript += '</tr>\n';    
    document.write (strScript);
}

function CreateFormHeaderOrange (Caption)
{
    var strScript;
    strScript = '<tr height=20>\n';
    strScript += '<td class="CurveOrangeFormHeaderLeft"   style="width: 8px"></td>\n';
    strScript += '<td class="CurveOrangeFormHeaderMiddle">' + Caption + '</td>\n';
    strScript += '<td class="CurveOrangeFormHeaderMiddle"  style="width: 8px"></td>\n';
    strScript += '</tr>\n';
    strScript += '<tr>\n';
    strScript += '<td class="FormBorderOrange"></td>\n';
    strScript += '<td>\n';
    strScript += '<table width="100%" cellpadding=3 cellspacing=0 class="FormBorderOrange">\n';    
    document.write (strScript);
}

function CreateFormFooterOrange ()
{
    var strScript;    
    strScript = '</table>';
    strScript += '</td>';
    strScript += '<td class="FormBorderOrange"></td>\n';
    strScript += '</tr>';
    strScript += '<tr height=20>';
    strScript += '<td class="CurveOrangeFormFooterLeft" colspan=2></td>';
    strScript += '<td class="CurveOrangeFormFooterRight" ></td>';
    strScript += '</tr>  ';
    document.write (strScript);
}


function CreateFormHeaderGreen (Caption)
{
    var strScript;
    strScript = '<tr height=20>\n';
    strScript += '<td class="CurveGreenFormHeaderLeft"  style="width: 8px"></td>\n';
    strScript += '<td class="CurveGreenFormHeaderMiddle">' + Caption + '</td>\n';
    strScript += '<td class="CurveGreenFormHeaderMiddle" style="width: 8px"></td>\n';
    strScript += '</tr>\n';
    strScript += '<tr>\n';
    strScript += '<td class="FormBorderGreen"></td>\n';
    strScript += '<td >\n';
    strScript += '<table width="100%" cellpadding=3 cellspacing=0 class="FormBorderGreen">\n';        
    document.write (strScript);
}

function CreateFormFooterGreen ()
{
    var strScript;    
    strScript = '</table>';
    strScript += '</td>';
    strScript += '<td class="FormBorderGreen"></td>\n';
    strScript += '</tr>';
    strScript += '<tr height=20>';
    strScript += '<td class="CurveGreenFormFooterLeft" colspan=2></td>';
    strScript += '<td class="CurveGreenFormFooterRight"></td>';
    strScript += '</tr>  ';
    document.write (strScript);
}

function CreateFormHeaderGreenNormal (Caption)
{
    var strScript;
    strScript = '<tr height=20>\n';
    strScript += '<td class="CurveGreenFormHeaderLeft"  style="width: 8px"></td>\n';
    strScript += '<td class="CurveGreenFormHeaderMiddle">' + Caption + '</td>\n';
    strScript += '<td class="CurveGreenFormHeaderMiddle" style="width: 8px"></td>\n';
    strScript += '</tr>\n';
    strScript += '<tr>\n';
    strScript += '<td class="FormBorderGreenNormal"></td>\n';
    strScript += '<td >\n';
    strScript += '<table width="100%" cellpadding=3 cellspacing=0 class="FormBorderGreenNormal">\n';        
    document.write (strScript);
}

function CreateFormFooterGreenNormal ()
{
    var strScript;    
    strScript = '</table>';
    strScript += '</td>';
    strScript += '<td class="FormBorderGreenNormal"></td>\n';
    strScript += '</tr>';
    strScript += '<tr height=20>';
    strScript += '<td class="CurveGreenFormFooterLeft" colspan=2></td>';
    strScript += '<td class="CurveGreenFormFooterRight"></td>';
    strScript += '</tr>  ';
    document.write (strScript);
}

function OpenImage (ImageFileName)
{   
    window.open (ImageFileName,'sdfs','');
}