﻿// JScript File

function LaunchMasterModalPopup(DialogTitle, DialogHeight, DialogWidth, DialogURL, DialogParameterNames, DialogParameterValues, DelimiterCharacter) {
    /* Getting Delimiter Parameters */

    var strParameters = '';
    var astrParamNames = DialogParameterNames.split(DelimiterCharacter);
    var astrParamValues = DialogParameterValues.split(DelimiterCharacter);
    var intMaxDim = astrParamNames.length;
    var intIdx = 0;
    var scwidth;
    var scheight;


    for (intIdx == 0; intIdx < intMaxDim; intIdx++) {
        strParameters = strParameters + astrParamNames[intIdx] + '=' + astrParamValues[intIdx] + '&';
    }
    if (strParameters != '') {
        strParameters = '?' + strParameters;
    }

    scwidth = DialogWidth;
    scheight = DialogHeight;
    document.getElementById('ctl00_ifraPage').src = DialogURL + strParameters;
    if (DialogTitle == 'Ecr' || DialogTitle == 'OtherCr' || DialogTitle == 'Sales' || DialogTitle == 'Vex') {

        if (screen.width < 1024) {
            scwidth = screen.width - 50;
        }
        else {
            scwidth = DialogWidth;
        }

        if (screen.height < 768) {
            scheight = screen.height - 200;
        }
        else {
            scheight = DialogHeight;
        }
    }
   
    document.getElementById('ctl00_ifraPage').height = scheight;
    document.getElementById('ctl00_ifraPage').width = scwidth;
    document.getElementById('ctl00_Panel1').style.height = scheight;
    document.getElementById('ctl00_Panel1').style.width = scwidth;

    document.getElementById('ctl00_Panel1').style.overflow = '';
    //to make flash invisible due to popup problem
    //document.getElementById('ctl00_dmenu').style.visibility = 'hidden';
    document.getElementById('ctl00_cmdCloseMasterModalPopup').style.visibility = 'visible'
    document.getElementById('ctl00_cmdLaunchMasterModalPopup').click();
}

function CloseMasterModalPopup() {

    document.getElementById('ctl00_cmdCloseMasterModalPopup').onclick();

}


function CloseMasterModalPopupBid() {
    document.getElementById('ctl00_cmdCloseMasterModalPopup').onclick();
}


function CloseMasterModalPopupBidwithrefresh() {
    document.getElementById('ctl00_cmdCloseMasterModalPopup').onclick();
    document.getElementById('ctl00_btnrefresh').click();

}

function CloseModelExtender() {
    document.getElementById('ctl00_ifraPage').src = 'about:blank';
    $find('ModalPopupExtender1').hide()
    //document.getElementById('ctl00_dmenu').style.visibility='visible';
}

function OpenModelExtender() {
    $find('ModalPopupExtender1').show()
}



       
