﻿// JScript File
//=====================================================================================
//    EDEL_ajax_api - Javascript Merchant codelet API

//    EDEL_ajax_api is Merchant codelet API written in Javascript.
//    This has a object oriented interface which makes it easy to use.
//    Communication is implemented by using AJAX technology.

    /*
    Coding style:
        Methods and arguments internal to this object start with underscore.
    */
//=====================================================================================
var SiteAjaxApiPath = strSiteRoot + "Index/edelajaxapiindex.aspx";

function EDEL_ajax_api()
{
    //API - 
    this.GetIndexOverview = EDEL_ajax_api.GetIndexOverview;
    this.ShowResearchList=EDEL_ajax_api.ShowResearchList;
    this.getNSEdata = EDEL_ajax_api.getNSEdata;
    //this.getBSEdata = EDEL_ajax_api.getBSEdata;
    this.getIndexdata  = EDEL_ajax_api.getIndexdata;
    this.showGraph = EDEL_ajax_api.showGraph;
    this.indexsnapshot= EDEL_ajax_api.indexsnapshot;
};

EDEL_ajax_api.GetIndexOverview = function(callback_handle_response, exchange)
{
    var inputparam = "f=getindexoverview&ex="+ exchange;
    var con1 = new edel_communication();
    con1.send_request(callback_handle_response,SiteAjaxApiPath, "POST", null, inputparam);
};
EDEL_ajax_api.ShowResearchList = function(callback_handle_response)
{
    var inputparam = "f=showresearchlist";
    var con1 = new edel_communication();
    con1.send_request(callback_handle_response,SiteAjaxApiPath, "POST", null, inputparam);
};

EDEL_ajax_api.getNSEdata = function(callback_handle_response, cocode)
{
    var inputparam = "f=populatensedropdownlist&code="+ cocode;
    var con1 = new edel_communication();
    con1.send_request(callback_handle_response,SiteAjaxApiPath, "POST", null, inputparam);
};

EDEL_ajax_api.getIndexdata = function(callback_handle_response, exchange, cocode)
{
    var inputparam = "f=getindexdetails&ex="+ exchange +"&code="+ cocode;
    var con1 = new edel_communication();
    con1.send_request(callback_handle_response,SiteAjaxApiPath, "POST", null, inputparam);
};
EDEL_ajax_api.showGraph = function(callback_handle_response, exchange, cocode)
{
    var inputparam = "f=showGraph&ex="+ exchange +"&code="+ cocode;
    var con1 = new edel_communication();
    con1.send_request(callback_handle_response,SiteAjaxApiPath, "POST", null, inputparam);
};
EDEL_ajax_api.indexsnapshot = function(callback_handle_response, exchange, index, intStPage, intEnPage, sortCol, sortType)
{
    var inputparam = "f=indexsnapshot&ex="+ exchange +"&index="+ index+"&s="+ intStPage +"&e="+ intEnPage + "&sortc="+ sortCol +"&sortt="+ sortType;
    var con1 = new edel_communication();
    con1.send_request(callback_handle_response,SiteAjaxApiPath, "POST", null, inputparam);
};

