﻿function Browser() {
    var ua, s, i;
    this.isIE = false;
    this.isNS = false;
    this.version = null;
    ua = navigator.userAgent;
    s = "MSIE";
    if ((i = ua.indexOf(s)) >= 0) {
        this.isIE = true;
        this.version = parseFloat(ua.substr(i + s.length));
        return;
    }

    s = "Netscape6/";
    if ((i = ua.indexOf(s)) >= 0) {
        this.isNS = true;
        this.version = parseFloat(ua.substr(i + s.length));
        return;
    }

    // Treat any other "Gecko" browser as NS 6.1.
    s = "Gecko";
    if ((i = ua.indexOf(s)) >= 0) {
        this.isNS = true;
        this.version = 6.1;
        return;
    }
}
var browser = new Browser();
var clockTimeoutID;








//Global Variables
var XmlHttp;
function CreateXmlHttp() {
    //Creating object of XMLHTTP in IE
    try {
        XmlHttp = new ActiveXObject("Msxml2.XmlHttp");
    }
    catch (e) {
        try {
            XmlHttp = new ActiveXObject("Microsoft.XmlHttp");
        }
        catch (oc) {
            XmlHttp = null;
        }
    }
    //Creating object of XMLHTTP in Mozilla and Safari 
    if (!XmlHttp && typeof XMLHttpRequest != "undefined") {
        XmlHttp = new XMLHttpRequest();
    }
}
var XmlHttp1;
function CreateXmlHttp1() {
    //Creating object of XMLHTTP in IE
    try {
        XmlHttp1 = new ActiveXObject("Msxml2.XmlHttp");
    }
    catch (e) {
        try {
            XmlHttp1 = new ActiveXObject("Microsoft.XmlHttp");
        }
        catch (oc) {
            XmlHttp1 = null;
        }
    }
    //Creating object of XMLHTTP in Mozilla and Safari 
    if (!XmlHttp1 && typeof XMLHttpRequest != "undefined") {
        XmlHttp1 = new XMLHttpRequest();
    }
}

var XmlHttp2;
function CreateXmlHttp2() {
    //Creating object of XMLHTTP in IE
    try {
        XmlHttp2 = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e) {
        try {
            XmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch (oc) {
            XmlHttp2 = null;
        }
    }
    //Creating object of XMLHTTP in Mozilla and Safari 
    if (!XmlHttp2 && typeof XMLHttpRequest != "undefined") {
        XmlHttp2 = new XMLHttpRequest();
    }
}


//For Loading ticker from TickerData.aspx Using AJAX
function getTickerData(Exchg) {
    /*var ImgBSE= document.getElementById("HomeTop1_TickerCtrl1_ImgBSE");
    var ImgNSE= document.getElementById("HomeTop1_TickerCtrl1_ImgNSE");
				
    if (Exchg =='BSE')
    {
    ImgBSE.src="../images/TikkerBSEon.gif"
    ImgNSE.src="../images/TikkerNSEon.gif"
    ImgBSE.className="Nsehand"
    ImgNSE.className="Bsehand"
    }
			   
    else{
    ImgNSE.src="../images/TikkerNSE.gif"
    ImgBSE.src="../images/TikkerBSE.gif"
    ImgNSE.className="Nsehand"
    ImgBSE.className="Bsehand"
    }*/

    CreateXmlHttp2();
    document.body.style.cursor = "progress";
    //document.getElementById("MarqueeId").innerHTML = " <img src='../images/loading1.gif'>";

    var requestUrl = "../TickerData.aspx?Exchg=" + Exchg + "&IpTrack=" + window.location.hostname + "&timeStamp=" + new Date().getTime();

    if (XmlHttp2) {
        XmlHttp2.onreadystatechange = function() { getDataResponse(Exchg); };
        XmlHttp2.open("GET", requestUrl, true);
        XmlHttp2.send(null);
    }
}

//Called when response comes back from server Only For Ticker
function getDataResponse(Exchg) {
    // To make sure receiving response data from server is completed
    if (XmlHttp2.readyState == 4) {
        // To make sure valid response is received from the server, 200 means response received is OK
        if (XmlHttp2.status == 200) {
            var arrCol, Time, Code, CompName, ClPrice, DiffVal, DiffImg;
            var ExchgDet = "", stkDet = "";
            var MarqueeId = document.getElementById("MarqueeId");
            var Mq_Data = XmlHttp2.responseText;

            if (Mq_Data != "")
                var arrRow = Mq_Data.split("|");

            for (i = 0; i < arrRow.length - 1; i++) {
                arrCol = arrRow[i].split("~");
                CompName = arrCol[1];
                ClPrice = arrCol[2];
                DiffVal = arrCol[3];
                if (DiffVal > 0) {
                    clss = "<span class='TickerGreenBold'>"
                    //DiffImg= "<img align='absmiddle' src='../images/up.gif'>";
                }
                else if (DiffVal < 0) {
                    clss = "<span class='TickerRedBold'>"
                    //DiffImg="<img align='absmiddle' src='../images/down.gif'>";
                }
                else {
                    clss = "<span class='TickerBlueBold'>"
                    //DiffImg= "<img align='absmiddle' src='../images/eq.gif'>";						
                }

                if (i == 0) ExchgDet = arrCol[0] + " &nbsp; " + CompName + ": " + ClPrice + " [" + clss + DiffVal + "</span>]&nbsp;&nbsp;&nbsp;"; else stkDet += "<a href='../Company_Info/DetailedQuotes.aspx?id=25&cocode=" + arrCol[0] + "' class='TickerText'>" + CompName + "</a> &nbsp; " + ClPrice + " [" + clss + DiffVal + "</span>]  &nbsp;";
                //if(i==0)ExchgDet = arrCol[0] +" &nbsp; "+ CompName +": "+ ClPrice +" " + clss + DiffVal +"</span>&nbsp;&nbsp;&nbsp;";else stkDet += "<a href='../profile/ScripSearch.aspx?opt=0&cocode=" + arrCol[0] + "&id=12' class='TickerText'>" + CompName + "</a> &nbsp; " + ClPrice +" "+ clss + DiffVal +"</span>  &nbsp;";
            }
            if (browser.isIE)
                MarqueeId.innerHTML = "<marquee onmouseover='this.stop();' id='marq' onmouseout='this.start();' trueSpeed scrollAmount='1' scrollDelay='35' direction='left' loop='repeat' width='100%'>" + ExchgDet + stkDet + "</marquee>";
            else
                MarqueeId.innerHTML = ExchgDet + stkDet;
            document.body.style.cursor = "auto";

        }
    }
}
/*function ExchngTimeClock(Exchg)
{
var time = new Date()
var hour = time.getHours()
if (hour >= 10 && hour <= 20)
clockTimeoutID = setTimeout("getTickerData('"+ Exchg +"')",600000);
}*/

//Instead of Pop up Window
function GetNewsDetails(secId, SubSecId, SrNo) {
    var NewsWin = document.getElementById("cm_window").style.display = 'inline';
    var currentDivObj = document.getElementById("NewsId");
    currentDivObj.innerHTML = "<img src=../images/loading1.gif>";
    CreateXmlHttp1();
    document.body.style.cursor = "progress";
    var requestUrl = "../Equity_Market/NewsData1.aspx?SecId=" + secId + "&SubSecId=" + SubSecId + "&SrNo=" + SrNo + "&IpTrack=" + window.location.hostname + "&timeStamp=" + new Date().getTime();
    if (XmlHttp) {
        XmlHttp.onreadystatechange = function() { getNewsDetails(); };
        XmlHttp.open("GET", requestUrl, true);
        XmlHttp.send(null);
    }
}
//Called when response comes back from server Only For NewsData
function getNewsDetails() {
    // To make sure receiving response data from server is completed
    if (XmlHttp.readyState == 4) {
        // To make sure valid response is received from the server, 200 means response received is OK
        if (XmlHttp.status == 200) {
            document.getElementById("NewsId").innerHTML = XmlHttp.responseText;
            document.body.style.cursor = "auto";
        }
        else
            document.getElementById("NewsId").innerHTML = "<img src='../images/loading1.gif'>";
    }
}
function ChkScheme() {

    var scheme1 = document.getElementById("ctl05_Drp_Scheme1")
    var scheme2 = document.getElementById("ctl05_Drp_Scheme2")
    if (scheme1.value == scheme2.value) {
        alert("Please select a Category");
        return false;
    }
    document.location = "InnerPageMf.aspx?Eid=414&CatId=" + document.getElementById("ctl05_drp_Category").selectedIndex + "&sch1Id=" + document.getElementById("ctl05_Drp_Scheme1").selectedIndex + "&sch2Id=" + document.getElementById("ctl05_Drp_Scheme2").selectedIndex + "&sch1=" + document.getElementById("ctl05_Drp_Scheme1").value + "&sch2=" + document.getElementById("ctl05_Drp_Scheme2").value
    return false;
}
function NewsDetail1(SrNo, secId, SubSecId, opt) {
    var NewsWin = document.getElementById("cm_window").style.display = 'inline';
    var currentDivObj;
    if (opt == "main") {
        currentDivObj = document.getElementById("NewsId");
        currentDivObj.innerHTML = "<img src=../images/loading1.gif>";
    }
    else if (opt == "in") {
        currentDivObj = document.getElementById("NewsId1");
        currentDivObj.innerHTML = "<img src=../images/loading1.gif>";
    }
    else {
        currentDivObj = document.getElementById("NewsId2");
        currentDivObj.innerHTML = "<img src=../images/loading1.gif>";
    }
    CreateXmlHttp();
    document.body.style.cursor = "progress";
    var requestUrl = "../NewsData.aspx?SecId=" + secId + "&SubSecId=" + SubSecId + "&SrNo=" + SrNo + "&IpTrack=" + window.location.hostname + "&timeStamp=" + new Date().getTime();
    if (XmlHttp) {
        XmlHttp.onreadystatechange = function() { getDetails(opt); };
        XmlHttp.open("GET", requestUrl, true);
        XmlHttp.send(null);
    }
}


function SelectScheme(ig_, ig_a, ig_b)
 {
    var fund = document.getElementById("ctl05_drp_FundHouse");
    var category = document.getElementById("ctl05_drp_Category");
    var scheme = document.getElementById("ctl05_drp_Scheme");

    CreateXmlHttp();
    document.body.style.cursor = "progress";
    var requestUrl = "/clientSide/MF_SchemeData.aspx?IpTrack=" + window.location.hostname + "&timeStamp=" + new Date().getTime() + "&Fund=" + fund.value + "&Category=" + category.value;
   // document.write(requestUrl)
    if (XmlHttp)
     {
         XmlHttp.onreadystatechange = function()
        {
         getSchemeResp(scheme) 
         };
        XmlHttp.open("GET", requestUrl, true);
        XmlHttp.send(null);
    }
}

function getSchemeResp(ig_) {
    // To make sure receiving response data from server is completed
    if (XmlHttp.readyState == 4) {
        // To make sure valid response is received from the server, 200 means response received is OK
        if (XmlHttp.status == 200) {
            //var availSchemes   = document.getElementById(ig_);
            var strData = XmlHttp.responseText
            if (strData != "") {
                var arrSchm = strData.split("|");
                ig_.length = 0;
                for (i = 0; i < arrSchm.length - 1; i++) {
                    var strSchm = arrSchm[i];
                    var arrSchmCode = strSchm.split("~");
                    ig_.options[i] = new Option();
                    ig_.options[i].value = arrSchmCode[0];
                    ig_.options[i].text = arrSchmCode[1];
                }
            }
            else {
                ig_.length = 0;
                ig_.options[0] = new Option();
                ig_.options[0].value = "";
                ig_.options[0].text = "Scheme is not available";
            }
            document.body.style.cursor = "auto";
        }
        else {
            ig_.length = 0;
            ig_.options[0] = new Option();
            ig_.options[0].value = "";
            ig_.options[0].text = "server is not ready";
            document.body.style.cursor = "auto";
        }
    }
}	
function getDetails(opt) {
    // To make sure receiving response data from server is completed
    if (XmlHttp.readyState == 4) {
        // To make sure valid response is received from the server, 200 means response received is OK
        if (XmlHttp.status == 200) {

            if (opt == "main")
                document.getElementById("NewsId").innerHTML = XmlHttp.responseText;
            else if (opt == "in")
                document.getElementById("NewsId1").innerHTML = XmlHttp.responseText;
            else
                document.getElementById("NewsId2").innerHTML = XmlHttp.responseText;
            document.body.style.cursor = "auto";
        }
        else {
            if (opt == "main")
                document.getElementById("NewsId").innerHTML = "<img src='../images/loading1.gif'>";
            else if (opt == "in")
                document.getElementById("NewsId1").innerHTML = "<img src='../images/loading1.gif'>";
            else
                document.getElementById("NewsId2").innerHTML = "<img src='../images/loading1.gif'>";
        }
    }
}




function GetNewsDetails(secid, subsecid, sno) {

    var newWin = window.open("../Equity_Market/NewsDetails.aspx?secid=" + secid + "&subsecid=" + subsecid + "&sno=" + sno + "", 'MyWindow2', 'x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=580,height=450,screenX=0,screenY=0,left=210,top=200');
}

function GetIPOResearchNews(secid, subsecid, sno) {
    var newWin = window.open("../IPO_Monitor/IPOResDetails.aspx?secid=" + secid + "&subsecid=" + subsecid + "&sno=" + sno + "", 'MyWindow2', 'x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=580,height=450,screenX=0,screenY=0,left=210,top=200');
}
function NewsPop(sno) {
    var newWin = window.open("NewsData.aspx?srno=" + sno + "", 'MyWindow2', 'x=0,y=0,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width=580,height=450,screenX=0,screenY=0,left=210,top=200');
}
function poping(cocode, yrc, Mode) {
    window.open("QuartNotes.aspx?cocode=" + cocode + "&yrc=" + yrc + "&Mode=" + Mode, "present", "height=350,width=500,scrollbars=yes,resizable=yes")

}
/*function PopResults(cocode,Mode)
{
window.open("MoreResults.aspx?cocode=" + cocode + "&Mode="+Mode,"present","height=450,width=700,scrollbars=yes,resizable=yes")
	
}*/

function ShowA2Z(redUrl_, Index) {

    var A2ZIndexId = document.getElementById("A2ZTd");
    if (A2ZIndexId.innerHTML == "") {
        var A2Z = ""; A2ZClass = "";
        for (i = 65; i <= 90; i++) {
            var Alpha = String.fromCharCode(i);
            A2ZClass = (Index == Alpha) ? "IndexLinkSel" : "IndexLink";
            A2Z += "<a href='" + redUrl_ + "&Index=" + Alpha + "' class=" + A2ZClass + ">" + Alpha + "</a>";
        }
        A2ZClass = (Index == "0-9") ? "IndexLinkSel" : "IndexLink";
        A2ZIndexId.innerHTML = A2Z + "<a href='" + redUrl_ + "&Index=0-9' class=" + A2ZClass + ">0-9</a>";
    }
    else
        A2ZIndexId.innerHTML = "";
}

//More details
function GetMore(co_code, M) {

    document.getElementById('B' + co_code).style.display = 'none';
    document.getElementById('E' + co_code).style.display = 'inline';

    if (document.getElementById("Disp_Co_code").value != "") {
        document.getElementById('B' + document.getElementById("Disp_Co_code").value).style.display = 'inline';
        document.getElementById('E' + document.getElementById("Disp_Co_code").value).style.display = 'none';

    }
    document.getElementById("Disp_Co_code").value = co_code;
}

function CloseSec(co_code) {
    document.getElementById('B' + co_code).style.display = 'inline';
    document.getElementById('E' + co_code).style.display = 'none';
    document.getElementById("Disp_Co_code").value = "";
}

//For Today Meetings

function GetMoreToday(co_code, M) {

    document.getElementById('BT' + co_code).style.display = 'none';
    document.getElementById('ET' + co_code).style.display = 'inline';

    if (document.getElementById("Disp_Co_codeT").value != "") {
        document.getElementById('BT' + document.getElementById("Disp_Co_codeT").value).style.display = 'inline';
        document.getElementById('ET' + document.getElementById("Disp_Co_codeT").value).style.display = 'none';

    }
    document.getElementById("Disp_Co_codeT").value = co_code;

}

//For Forth Meetings

function GetMoreForth(co_code, M) {

    document.getElementById('B' + co_code).style.display = 'none';
    document.getElementById('E' + co_code).style.display = 'inline';

    if (document.getElementById("Disp_Co_codeF").value != "") {
        document.getElementById('B' + document.getElementById("Disp_Co_codeF").value).style.display = 'inline';
        document.getElementById('E' + document.getElementById("Disp_Co_codeF").value).style.display = 'none';

    }
    document.getElementById("Disp_Co_codeF").value = co_code;

}

function showSnapChart(code, period) {
    var period;
    var periodVal = period.substr(0, 1);
    var period = period.substr(1, 1)
    document.getElementById("SnapChart").src = "mfchart.aspx?MFcode=" + code + "&Period=" + period + "&periodval=" + periodVal;
}
function showAssetChart(code, opt) {
    var opt;
    document.getElementById("AssetChart").src = "AssetChart.aspx?MFcode=" + code + "&ChartType=" + opt;
    document.getElementById("SectorChart").src = "Sector_Chart.aspx?MFcode=" + code + "&ChartType=" + opt;
}
function CloseSecForth(co_code) {
    document.getElementById('B' + co_code).style.display = 'inline';
    document.getElementById('E' + co_code).style.display = 'none';
    document.getElementById("Disp_Co_codeF").value = "";

}

function CloseSecToday(co_code) {
    document.getElementById('BT' + co_code).style.display = 'inline';
    document.getElementById('ET' + co_code).style.display = 'none';
    document.getElementById("Disp_Co_codeT").value = "";

}
/*More in corp info*/
function GetMoreUnique(fromdate, M) {

    document.getElementById('BU' + fromdate).style.display = 'none';
    document.getElementById('EU' + fromdate).style.display = 'inline';

    if (document.getElementById("Disp_fromdate").value != "") {
        document.getElementById('BU' + document.getElementById("Disp_fromdate").value).style.display = 'inline';
        document.getElementById('EU' + document.getElementById("Disp_fromdate").value).style.display = 'none';

    }
    document.getElementById("Disp_fromdate").value = fromdate;
}

function CloseSecUnique(fromdate) {
    document.getElementById('BU' + fromdate).style.display = 'inline';
    document.getElementById('EU' + fromdate).style.display = 'none';
    document.getElementById("Disp_fromdate").value = "";
}


//Script for menu getquotes

function Keying(txtcname) {
    var txtcname = document.getElementById("EquityGetQuote1_txtcname");

    if (txtcname.value == "Company Name") {
        txtcname.value = "";
        txtcname.value = String.fromCharCode(event.keyCode);
        return false;
    }
    else if (event.keyCode == 13) {
        SearchText();
        return false;
    }
}
function CategoryRetHome(Type) {
    var Type;
    var EquityId = document.getElementById("CategoryReturn1_EquityId");
    var DebtId = document.getElementById("CategoryReturn1_DebtId");
    var BalancedId = document.getElementById("CategoryReturn1_BalancedId");
    var EquImg = document.getElementById("Equ");
    var DebImg = document.getElementById("Deb");
    var HybImg = document.getElementById("Hyb");

    switch (Type) {
        case "EQUITY":
            EquImg.src = "../../images/EquityOn.gif";
            DebImg.src = "../../images/DebtOff.gif";
            HybImg.src = "../../images/HybridOff.gif";
            EquityId.style.display = "inline";
            EquImg.style.cursor = "none";
            DebtId.style.display = "none";
            DebImg.style.cursor = "hand";
            BalancedId.style.display = "none";
            HybImg.style.cursor = "hand";


            break;
        case "DEBT":
            EquImg.src = "../../images/EQuityOff.gif";
            DebImg.src = "../../images/DebtOn.gif";
            HybImg.src = "../../images/HybridOff.gif";
            EquityId.style.display = "none";
            EquImg.style.cursor = "hand";
            DebtId.style.display = "inline";
            DebImg.style.cursor = "none";
            BalancedId.style.display = "none";
            HybImg.style.cursor = "hand";


            break;
        case "BALANCED":
            EquImg.src = "../../images/EQuityOff.gif";
            DebImg.src = "../../images/DebtOff.gif";
            HybImg.src = "../../images/HybridOn.gif";
            EquityId.style.display = "none";
            EquImg.style.cursor = "hand";
            DebtId.style.display = "none";
            DebImg.style.cursor = "hand";
            BalancedId.style.display = "inline";
            HybImg.style.cursor = "none";


            break;
    }
}

function EmptyText(ObjId) {
    if (ObjId.value == "Company Name")
        ObjId.value = "";
}

function FillText(ObjId) {
    if (ObjId.value == "")
        ObjId.value = "Company Name";
}

//function SearchText() {
//    var txtcname = document.getElementById("EquityGetQuote1_txtcname");

//    if ((txtcname.value == "") || (txtcname.value == "Company Name")) {
//        alert("Enter few characters to search");
//        txtcname.value = "";
//        txtcname.focus();
//        return false;
//    }
//    else {
//        var Url = "http://www.idbipaisabuilder.cmlinks.com/market_content/CMEquity.aspx?CM_Target=/Company_Info/CompanySearch.aspx?schtxt=" + txtcname.value + "&id=25";
//        //window.location=http://www.paisabuilder.in/Market_Content/CMEquity.aspx; 
//        //var StrUrl = "../Company_Info/CompanySearch.aspx?schtxt="+txtcname.value+"&id=25";
//        window.parent.location = Url;


//    }
//    return true;
//}


//For top performers data
function loadGLData(Period, Category, TopGl) {
   
    CreateXmlHttp1()
    document.body.style.cursor = "progress";
    var TopGl;
    if (Period == '')
        Period = "1YEAR";
    if (Category == '')
        Category = "ALL";
    /// <reference path="MFtopglData.aspx" />

    var requestUrl = "/clientSide/MFtopglData.aspx?Period=" + Period + "&Cat=" + Category + "&TopGl=" + TopGl;

   // document.write(requestUrl);
    if (XmlHttp1) {
        XmlHttp1.onreadystatechange = function() { GLResponse(TopGl)}
        XmlHttp1.open("GET", requestUrl, true);
        XmlHttp1.send(null);
    }
}

function GLResponse(TopGl) {
    // To make sure receiving response data from server is completed
    
    if (XmlHttp1.readyState == 4) {
        // To make sure valid response is received from the server, 200 means response received is OK
        
        if (XmlHttp1.status == 200)//TopBotPerformers
        {
            var GainerId = document.getElementById("TopBotPerformers1_GainerId"); //TopBotPerformers1_GainerId
            
            var LoserId = document.getElementById("TopBotPerformers1_LoserId");
            var strGlData = XmlHttp1.responseText;
          
            
            if (TopGl == 'T')
                GainerId.innerHTML = strGlData;
            else
                LoserId.innerHTML = strGlData;

            document.body.style.cursor = "auto";
        }
        else {
            if (TopGl == 'T')
                GainerId.innerHTML = "There was a problem retrieving data from the server.";
            else
                LoserId.innerHTML = "There was a problem retrieving data from the server.";

            document.body.style.cursor = "auto";
        }
    }
}
//end
//For top performers inner data
function loadGLDataInner(Period, Category, TopGl) {
    CreateXmlHttp1()
    document.body.style.cursor = "progress";
    var TopGl;
    if (Period == '')
        Period = "1YEAR";
    if (Category == '')
        Category = "ALL";

    var requestUrl = "/ClientSide/MFtopglData.aspx?opt=Inn&Period=" + Period + "&Cat=" + Category + "&TopGl=" + TopGl;

    if (XmlHttp1) {
        XmlHttp1.onreadystatechange = function() { GLinnerResponse(TopGl) }
        XmlHttp1.open("GET", requestUrl, true);
        XmlHttp1.send(null);
    }
}

function GLinnerResponse(TopGl) {
    // To make sure receiving response data from server is completed
    if (XmlHttp1.readyState == 4) {
        // To make sure valid response is received from the server, 200 means response received is OK

        if (XmlHttp1.status == 200)//TopBotPerformers
        {
            var GainerId = document.getElementById("ctl05_GainerId");
            var LoserId = document.getElementById("ctl05_LoserId");
            var strGlData = XmlHttp1.responseText
            if (TopGl == 'T')
                GainerId.innerHTML = strGlData;
            else
                LoserId.innerHTML = strGlData;

            document.body.style.cursor = "auto";
        }
        else {
            if (TopGl == 'T')
                GainerId.innerHTML = "There was a problem retrieving data from the server.";
            else
                LoserId.innerHTML = "There was a problem retrieving data from the server.";

            document.body.style.cursor = "auto";
        }
    }
}
//end
//For Market commentry
function getMarketNews1(subsecid) {
    CreateXmlHttp1();
    // document.body.style.cursor = "progress";
    var MktCom = document.getElementById("Mkt_Commentary1_MarketNews");
    MktCom.innerHTML = "<img src=../images/loading1.gif>";
    var requestUrl = "GetMktCommentary.aspx?subsecid=" + subsecid + "&IpTrack=" + window.location.hostname + "&timeStamp=" + new Date().getTime();
    // alert(requestUrl);
    if (XmlHttp) {
        XmlHttp.onreadystatechange = function() { getNewsData1(MktCom); };
        XmlHttp.open("GET", requestUrl, true);
        XmlHttp.send(null);

    }
}

function getNewsData1(id) {

    if (XmlHttp.readyState == 4) {

        if (XmlHttp.status == 200) {
            id.innerHTML = XmlHttp.responseText;
        }
        //document.body.style.cursor = "normal";
    }

}
function SelectScheme2() {
    var category = document.getElementById("ctl05_drp_Category");
    CreateXmlHttp();
    document.body.style.cursor = "progress";
    //document.getElementById("_ctl0_Mf_Loading").style.display="inline";

    
    var requestUrl = "/clientside/SelectSchemeData.aspx?Category=" + category.value;
    
    if (XmlHttp) {
        XmlHttp.onreadystatechange = function() { getSchemeResp2() };
        XmlHttp.open("GET", requestUrl, true);
        XmlHttp.send(null);
    }
}

function getSchemeResp2() {

    // To make sure receiving response data from server is completed
   
    if (XmlHttp.readyState == 4) {
        // To make sure valid response is received from the server, 200 means response received is OK
        var Scheme1 = document.getElementById("ctl05_Drp_Scheme1")
        var Scheme2 = document.getElementById("ctl05_Drp_Scheme2")


        if (XmlHttp.status == 200) {
            document.getElementById("SchemeTD").style.display = "inline";
            //document.getElementById("_ctl0_Mf_Loading").style.display="none";

            var strData = XmlHttp.responseText
            if (strData != "") {
               
                var arrSchm = strData.split("|");
                Scheme1.length = 0;
                Scheme2.length = 0;
                for (i = 0; i < arrSchm.length - 1; i++) {
                    var strSchm = arrSchm[i];
                    var arrSchmCode = strSchm.split("~");
                    Scheme1.options[i] = new Option();
                    Scheme1.options[i].value = arrSchmCode[0];
                    Scheme1.options[i].text = arrSchmCode[1];
                    Scheme2.options[i] = new Option();
                    Scheme2.options[i].value = arrSchmCode[0];
                    Scheme2.options[i].text = arrSchmCode[1];
                }
            }
            else {
                Scheme1.length = 0;
                Scheme1.options[0] = new Option();
                Scheme1.options[0].value = "";
                Scheme1.options[0].text = "Scheme is not available";
                Scheme2.length = 0;
                Scheme2.options[0] = new Option();
                Scheme2.options[0].value = "";
                Scheme2.options[0].text = "Scheme is not available";
            }


            document.body.style.cursor = "auto";
        }
        else {
            Scheme1.length = 0;
            Scheme1.options[0] = new Option();
            Scheme1.options[0].value = "";
            Scheme1.options[0].text = "server is not ready";
            document.body.style.cursor = "auto";
            Scheme2.length = 0;
            Scheme2.options[0] = new Option();
            Scheme2.options[0].value = "";
            Scheme2.options[0].text = "server is not ready";
            document.body.style.cursor = "auto";
        }
    }
}	


