﻿// JScript File
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 containerid="contentarea";
var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""
var clockTimeoutID;
 function MarketTab(val)
   {
   if(val=='HS')
   {
    document.getElementById("MktTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='NewsTabSelected'  style='height: 10px; width: 66px; '>Business</td><td id='tdMC' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;MC&#39;);' style='height: 10px; width: 72px;'>Corporate</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdCR' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;CR&#39;);'  style='height: 10px; width: 98px;'> Economic</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdCA' nowrap='nowrap' class='NewsTabUnSelected'   onclick='MarketTab(&#39;CA&#39;);' style='height: 10px;  width: 90px; '>  Corporate Anno</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdOM' nowrap='nowrap' class='NewsTabUnSelected' onclick='MarketTab(&#39;OM&#39;);'  style='height: 10px;  width: 73px; '> Other Market</td><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td></tr></table>";
    GetNewsHot('4','38');
   }
   if(val=='MC')
   {
    document.getElementById("MktTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;HS&#39;);' style='height: 10px; width: 66px; '>Business</td><td id='tdMC' nowrap='nowrap' class='NewsTabSelected'  style='height: 10px; width: 72px;'>Corporate</td><td id='tdCR' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;CR&#39;);'  style='height: 10px; width: 98px;'> Economic</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdCA' nowrap='nowrap' class='NewsTabUnSelected'   onclick='MarketTab(&#39;CA&#39;);' style='height: 10px;  width: 90px; '>  Corporate Anno</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdOM' nowrap='nowrap' class='NewsTabUnSelected' onclick='MarketTab(&#39;OM&#39;);'  style='height: 10px;  width: 73px; '> Other Market</td><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td></tr></table>";
     GetNewsHot('4','40,41,42');
   }
   if(val=='CR')
   {
    document.getElementById("MktTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;HS&#39;);'  style='height: 10px; width: 66px; '>Business</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdMC' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;MC&#39;);' style='height: 10px; width: 72px;'>Corporate</td><td id='tdCR' nowrap='nowrap' class='NewsTabSelected'   style='height: 10px; width: 98px;'> Economic</td><td id='tdCA' nowrap='nowrap' class='NewsTabUnSelected'   onclick='MarketTab(&#39;CA&#39;);' style='height: 10px;  width: 90px; '>  Corporate Anno</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdOM' nowrap='nowrap' class='NewsTabUnSelected' onclick='MarketTab(&#39;OM&#39;);'  style='height: 10px;  width: 73px; '> Other Market</td><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td></tr></table>";
     GetNewsHot('5','23,24,25,26,36,43');
   }
   if(val=='CA')
   {
    document.getElementById("MktTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;HS&#39;);'  style='height: 10px; width: 66px; '>Business</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdMC' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;MC&#39;);' style='height: 10px; width: 72px;'>Corporate</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdCR' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;CR&#39;);'  style='height: 10px; width: 98px;'> Economic</td><td id='tdCA' nowrap='nowrap' class='NewsTabSelected'   style='height: 10px;  width: 90px; '>  Corporate Anno</td><td id='tdOM' nowrap='nowrap' class='NewsTabUnSelected' onclick='MarketTab(&#39;OM&#39;);'  style='height: 10px;  width: 73px; '> Other Market</td><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td></tr></table>";
    GetBSEAnn();
   }
   if(val=='OM')
   {
   document.getElementById("MktTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;HS&#39;);'  style='height: 10px; width: 66px; '>Business</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdMC' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;MC&#39;);' style='height: 10px; width: 72px;'>Corporate</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdCR' nowrap='nowrap' class='NewsTabUnSelected'  onclick='MarketTab(&#39;CR&#39;);'  style='height: 10px; width: 98px;'> Economic</td><td style='width:1px' class='NewsDivder NewsTabUnSelected'>|</td><td id='tdCA' nowrap='nowrap'  onclick='MarketTab(&#39;CA&#39;);' class='NewsTabUnSelected'   style='height: 10px;  width: 90px; '>  Corporate Anno</td><td id='tdOM' nowrap='nowrap' class='NewsTabSelected'  style='height: 10px;  width: 73px; '> Other Market</td><td style='width:5px' class='NewsTabUnSelected'>&nbsp;</td></tr></table>";
    GetNewsHot('6','12,13,14,45');
   }
  
}
function GetBSEAnn()
	{
	var requestUrl = "BseAnnAjax.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
	
	ajaxpage(1,requestUrl,'NewTd');	
    }
    function GetBSEAnnInn(srno)
	{	
	//alert(srno);	
	    document.getElementById("divNews").style.display = "inline";
	    var requestUrl = "BSEAnnDetailsAjax.aspx?IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime()+"&srno="+srno;
		ajaxpage(1,requestUrl,'NewsPop')
    }
 function IndicesTab(val)
   {
   if(val=='America')
   {
    document.getElementById("IndicesTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td id='tdHot' nowrap='nowrap' class='IndicesTabSelected'  style='height: 10px; width: 58px; '> US</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdMC' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;Asian&#39;);' style='height: 10px; width: 45px;'>Asia</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCR' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;Europian&#39;);'  style='height: 10px; width: 63px;'> Europe</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCA' nowrap='nowrap' class='IndicesTabUnSelected'   onclick='IndicesTab(&#39;African&#39;);' style='height: 10px;  width: 57px; '> Africa</td></tr></table>";
   
   }
   if(val=='Asian')
   {
    document.getElementById("IndicesTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td id='tdHot' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;America&#39;);' style='height: 10px; width: 58px; '> US</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdMC' nowrap='nowrap' class='IndicesTabSelected'  style='height: 10px; width: 45px;'>Asia</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCR' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;Europian&#39;);'  style='height: 10px; width: 63px;'> Europe</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCA' nowrap='nowrap' class='IndicesTabUnSelected'   onclick='IndicesTab(&#39;African&#39;);' style='height: 10px;  width: 57px; '>  Africa</td></tr></table>";
     
   }
   if(val=='Europian')
   {
    document.getElementById("IndicesTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td id='tdHot' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;America&#39;);'  style='height: 10px; width: 58px; '> US</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdMC' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;Asian&#39;);' style='height: 10px; width: 45px;'>Asia</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCR' nowrap='nowrap' class='IndicesTabSelected'   style='height: 10px; width: 63px;'> Europe</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCA' nowrap='nowrap' class='IndicesTabUnSelected'   onclick='IndicesTab(&#39;African&#39;);' style='height: 10px;  width: 57px; '> Africa</td></tr></table>";
  
   }
   if(val=='African')
   {
    document.getElementById("IndicesTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td id='tdHot' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;America&#39;);'  style='height: 10px; width: 58px; '> US</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdMC' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;Asian&#39;);' style='height: 10px; width: 45px;'>Asia</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCR' nowrap='nowrap' class='IndicesTabUnSelected'  onclick='IndicesTab(&#39;Europian&#39;);'  style='height: 10px; width: 63px;'> Europe</td><td style='width:1px' class='NewsDivder IndicesTabUnSelected'>|</td><td id='tdCA' nowrap='nowrap' class='IndicesTabSelected'   style='height: 10px;  width: 57px; '>  Africa</td></tr></table>";
     
   }
  
  GetIndices(val);
}

 function MarketGLTab(Exch,val)
   {

   if(val=='GAIN')
   {

    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect' width='5px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabSelect'  style='height: 10px; width: 58px; '>Gainers</td><td id='tdMC' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='height: 10px; width: 45px;'>Losers</td><td id='tdCR' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='height: 10px; width: 63px;'> Volume</td><td id='tdCA' nowrap='nowrap' class='MktTabUnSelect'   onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='height: 10px;  width: 57px; '> Value</td><td class='MktTabUnSelect' width='2px'>&nbsp;</td></tr></table>";
   GetGLValVData(document.getElementById("hdnExch").value,'GAIN')
   }
   if(val=='LOSE')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect'  width='5px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);' style='height: 10px; width: 58px; '>Gainers</td><td id='tdMC' nowrap='nowrap' class='MktTabSelect'  style='height: 10px; width: 45px;'>Losers</td><td id='tdCR' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='height: 10px; width: 63px;'> Volume</td><td id='tdCA' nowrap='nowrap' class='MktTabUnSelect'   onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='height: 10px;  width: 57px; '>  Value</td><td class='MktTabUnSelect' width='2px'>&nbsp;</td></tr></table>";
     GetGLValVData(document.getElementById("hdnExch").value,'LOSE')
   }
   if(val=='VOL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect'  width='5px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);'  style='height: 10px; width: 58px; '>Gainers</td><td id='tdMC' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='height: 10px; width: 45px;'>Losers</td><td id='tdCR' nowrap='nowrap' class='MktTabSelect'   style='height: 10px; width: 63px;'> Volume</td><td id='tdCA' nowrap='nowrap' class='MktTabUnSelect'   onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='height: 10px;  width: 57px; '> Value</td><td class='MktTabUnSelect' width='2px'>&nbsp;</td></tr></table>";
  GetGLValVData(document.getElementById("hdnExch").value,'VOL')
   }
   if(val=='VAL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect'  width='5px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);'  style='height: 10px; width: 58px; '>Gainers</td><td id='tdMC' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='height: 10px; width: 45px;'>Losers</td><td id='tdCR' nowrap='nowrap' class='MktTabUnSelect'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='height: 10px; width: 63px;'> Volume</td><td id='tdCA' nowrap='nowrap' class='MktTabSelect'   style='height: 10px;  width: 57px; '>  Value</td><td class='MktTabUnSelect'  width='2px'>&nbsp;</td></tr></table>";
     GetGLValVData(document.getElementById("hdnExch").value,'VAL')
   }
  

}
function GraphTab(val)
   {
  
   if(val=='Eq')
   {
       document.getElementById("tdGraphTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect' width='2px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabSelect'  style='height: 10px; width: 35px; '><b>Equity</b></td><td id='tdMC' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;D&#39;);' style='height: 10px; width: 45px;padding-left:3px'><b>Derivatives</b></td><td id='tdCR' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;C&#39;);'  style='height: 10px; width: 63px;'> <b>Commodity</b></td><td id='tdCA' nowrap='nowrap' class='MktTabUnSelect'   onclick='GraphTab(&#39;Crr&#39;);' style='height: 10px;  width: 57px; '> <b>Currency</b></td><td class='MktTabUnSelect'  width='1px'>&nbsp;</td></tr></table>";
       document.getElementById("Graph_Td").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='NormalBlackBold' align='center' id='tdBSE' onclick='Commonchart(&#39;BSE&#39;);SensexNiftyData(&#39;BSE&#39;);GetGLValVData(&#39;BSE&#39;,&#39;GAIN&#39;);MarketGLTab(&#39;BSE&#39;,&#39;GAIN&#39;)' style='width:15%'>BSE</td><td class='NewsDivder'>|</td><td style='width:15%' class='NormalBlack CursorHand' onclick='Commonchart(&#39;NSE&#39;);SensexNiftyData(&#39;NSE&#39;);GetGLValVData(&#39;NSE&#39;,&#39;GAIN&#39;);;MarketGLTab(&#39;NSE&#39;,&#39;GAIN&#39;)' align='center' id='tdNSE'>NSE</td><td style='width:70%;padding-right:10px' id='TD_SNDATE' class='NormalBlack' align='right'></td></tr><tr><td colspan='4' style='height:100px' valign='top'><br/><div id='BSENSEChart' >Loading.. </div></td></tr><tr><td style='height:15px'></td></tr><tr><td id='TD_SENSEXNDATA' colspan=5></td></tr><tr><td style='height:5px'></td></tr></table>";
       Commonchart('BSE');SensexNiftyData('BSE');
    }
   if(val=='D')
   {
    document.getElementById("tdGraphTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect'  width='2px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;Eq&#39;);' style='height: 10px; width:35px; '><b>Equity</b></td><td id='tdMC' nowrap='nowrap' class='MktTabSelect'  style='height: 10px; width: 45px;'><b>Derivatives</b></td><td id='tdCR' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;C&#39;);'  style='height: 10px; width: 63px;padding-left:3px'> <b>Commodity</b></td><td id='tdCA' nowrap='nowrap' class='MktTabUnSelect'   onclick='GraphTab(&#39;Crr&#39;);' style='height: 10px;  width: 57px; '>  <b>Currency</b></td><td class='MktTabUnSelect'  width='1px'>&nbsp;</td></tr></table>";
    document.getElementById("Graph_Td").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td style='width:70%;padding-right:10px' id='TD_SNDATE' class='NormalBlack' align='right'></td></td><tr><td valign='top' colspan='4'  style='height:150px' valign='top'><div id='BSENSEChart' >Loading.. </div></td><tr><td style='height:5px'></td></tr></tr><tr><td id='TD_SENSEXNDATA' colspan=5></td></tr><tr><td style='height:5px'></td></tr></table>";
    ShowNiftyChart();FutNiftyData();
   }
   if(val=='C')
   {
    document.getElementById("tdGraphTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect'  width='2px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;Eq&#39;);'  style='height: 10px; width: 35px; '><b>Equity</b></td><td id='tdMC' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;D&#39;);' style='height: 10px; width: 45px;'><b>Derivatives</b></td><td id='tdCR' nowrap='nowrap' class='MktTabSelect'   style='height: 10px; width: 63px;'> <b>Commodity</b></td><td id='tdCA' nowrap='nowrap' class='MktTabUnSelect'   onclick='GraphTab(&#39;Crr&#39;);' style='height: 10px;  width: 57px;padding-left:3px '> <b>Currency</b></td><td class='MktTabUnSelect'  width='1px'>&nbsp;</td></tr></table>";
    document.getElementById("Graph_Td").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='NormalBlackBold' align='center' id='tdBSE' onclick='ShowChartCom(&#39;Gold&#39;);ComData(&#39;GOLD&#39;);' style='width:15%'>Gold</td><td class='NewsDivder'>|</td><td style='width:15%' class='NormalBlack CursorHand' onclick='ShowChartCom(&#39;Silver&#39;);ComData(&#39;SILVER&#39;);' align='center' id='tdNSE'>Silver</td><td style='width:70%;padding-right:10px' id='TD_SNDATE' class='NormalBlack' align='right'></td></tr><tr><td valign='top' colspan='4'  style='height:150px' valign='top'><div id='BSENSEChart' >Loading.. </div></td></tr><tr><td style='height:5px'></td></tr><tr><td id='TD_SENSEXNDATA' colspan=5></td></tr><tr><td style='height:5px'></td></tr></table>";
    ShowChartCom('Gold');ComData('GOLD')
   }
   if(val=='Crr')
   {
    document.getElementById("tdGraphTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='MktTabUnSelect'  width='2px'>&nbsp;</td><td id='tdHot' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;Eq&#39;);'  style='height: 10px; width: 35px; '><b>Equity</b></td><td id='tdMC' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;D&#39;);' style='height: 10px; width: 45px;'><b>Derivatives</b></td><td id='tdCR' nowrap='nowrap' class='MktTabUnSelect'  onclick='GraphTab(&#39;C&#39;);'  style='height: 10px; width: 63px;'> <b>Commodity</b></td><td id='tdCA' nowrap='nowrap' class='MktTabSelect'   style='height: 10px;  width: 57px; '>  <b>Currency</b></td><td class='MktTabUnSelect'  width='1px'>&nbsp;</td></tr></table>";
     document.getElementById("Graph_Td").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td class='NormalBlackBold' align='center' id='tdUSD' onclick='ShowCurrChart(&#39;USD&#39;);CURRData(&#39;USD&#39;);' style='width:15%'>USD</td><td class='NewsDivder'>|</td><td style='width:15%' class='NormalBlack CursorHand' onclick='ShowCurrChart(&#39;EUR&#39;);CURRData(&#39;EUR&#39;);' align='center' id='tdEURO'>EURO</td><td class='NewsDivder'>|</td><td style='width:15%' class='NormalBlack CursorHand' onclick='ShowCurrChart(&#39;GBP&#39;);CURRData(&#39;GBP&#39;);' align='center' id='tdGBP'>GBP</td><td class='NewsDivder'>|</td><td style='width:15%' class='NormalBlack CursorHand' onclick='ShowCurrChart(&#39;JPY&#39;);CURRData(&#39;JPY&#39;);' align='center' id='tdJPY'>JPY</td><td style='width:40%;padding-right:10px' id='TD_SNDATE' class='NormalBlack' align='right'></td></tr><tr><td valign='top' colspan='10'  style='height:150px' valign='top'><div id='BSENSEChart' >Loading.. </div></td></tr><tr><td style='height:5px'></td></tr><tr><td id='TD_SENSEXNDATA' colspan=8></td></tr><tr><td style='height:5px'></td></tr></table>";
    ShowCurrChart('USD');CURRData('USD')
   }
  
}
function ShowCurrChart(Val)
{
     var links = ["AjaxCurrencyChart.aspx?InstType=USD", "AjaxCurrencyChart.aspx?InstType=GBP", "AjaxCurrencyChart.aspx?InstType=EUR"]; // link addresses
     var len = (links.length) / 2; 
      var rand = Math.floor(len*Math.random());       
        
       if(Val=='USD'){document.getElementById("tdUSD").className="NormalBlackBold"; document.getElementById("tdEURO").className="NormalBlack CursorHand";document.getElementById("tdGBP").className="NormalBlack CursorHand";document.getElementById("tdJPY").className="NormalBlack CursorHand";}
       if(Val=="EUR"){  document.getElementById("tdEURO").className="NormalBlackBold";document.getElementById("tdUSD").className="NormalBlack CursorHand";document.getElementById("tdGBP").className="NormalBlack CursorHand";document.getElementById("tdJPY").className="NormalBlack CursorHand";}
       if(Val=="GBP"){  document.getElementById("tdEURO").className="NormalBlack CursorHand";document.getElementById("tdUSD").className="NormalBlack CursorHand";document.getElementById("tdGBP").className="NormalBlackBold";document.getElementById("tdJPY").className="NormalBlack CursorHand";}
       if(Val=="JPY"){  document.getElementById("tdEURO").className="NormalBlack CursorHand";document.getElementById("tdUSD").className="NormalBlack CursorHand";document.getElementById("tdGBP").className="NormalBlack CursorHand";document.getElementById("tdJPY").className="NormalBlackBold";} 
      
          var RequestUrl="AjaxCurrencyChart.aspx?InstType="+Val;
	    var so = new SWFObject("amline/amline.swf", "BSENSEline", "235", "150", "8", "#FFFFFF");
	    so.addVariable("path", "amline/");
	    so.addParam("wmode","opaque");
	    so.addVariable("settings_file", encodeURIComponent("GoldSilverChart.xml")); 
	    so.addVariable("data_file", encodeURIComponent(RequestUrl + "&TimeStamp="+new Date().getTime()));
	    so.write("BSENSEChart");
}
//setTimeout("ShowCurrChart();", 10000); 

function ShowNiftyChart()
{
        var RequestUrl = "AjaxNiftyFutChart.aspx?InstType=FUTIDX&Symbol=NIFTY";
	    var so = new SWFObject("amline/amline.swf", "BSENSEline", "235", "150", "8", "#FFFFFF");
	    so.addVariable("path", "amline/");
	    so.addParam("wmode","opaque");
	    so.addVariable("settings_file", encodeURIComponent("GoldSilverChart.xml")); 
	    so.addVariable("data_file", encodeURIComponent(RequestUrl + "&TimeStamp="+new Date().getTime()));
	    so.write("BSENSEChart");
}

function ShowChartCom(opt)
{
	     if(opt=='Gold')
         {
         document.getElementById("tdBSE").className="NormalBlackBold";
         document.getElementById("tdNSE").className="NormalBlack CursorHand";
         }
         else
         {
           document.getElementById("tdBSE").className="NormalBlack CursorHand";
         document.getElementById("tdNSE").className="NormalBlackBold";
         }
		var so = new SWFObject("amline/amline.swf", "Bullionline", "235", "150", "8", "#ffffff");
		so.addVariable("path", "amline/");
		so.addParam("wmode","opaque");
		so.addVariable("settings_file", encodeURIComponent("GoldSilverChart.xml"));
		so.addVariable("data_file", encodeURIComponent("Commodity/BullionchartComAjax.aspx?Exchg=MCX&Symbol="+opt+"&TimeStamp="+new Date().getTime()));
		so.write("BSENSEChart");
}	
function SensexNiftyData(Exch)
{
      var RequestUrl = "AjaxSensexNifty.aspx?Exchange="+Exch;
     // alert(RequestUrl)
      ajaxpage(101,RequestUrl,'TD_SENSEXNDATA');
}
function FutNiftyData()
{
      var RequestUrl = "AjaxFutNifty.aspx?J="+new Date().getTime();
     //alert(RequestUrl)
      ajaxpage(101,RequestUrl,'TD_SENSEXNDATA');
}
function ComData(Val)
{
      var RequestUrl = "AjaxComData.aspx?InstType="+Val+"&J="+new Date().getTime();
     //alert(RequestUrl)
      ajaxpage(101,RequestUrl,'TD_SENSEXNDATA');
}
function CURRData(Val)
{
      var RequestUrl = "AjaxCurrData.aspx?InstType="+Val+"&J="+new Date().getTime();
     //alert(RequestUrl)
      ajaxpage(101,RequestUrl,'TD_SENSEXNDATA');
}

function Commonchart(val)
{
        
         if(val=='BSE')
         {
         document.getElementById("tdBSE").className="NormalBlackBold";
         document.getElementById("tdNSE").className="NormalBlack CursorHand";
         document.getElementById("BSENSEChart").innerHTML="<img src='http://content.acesphere.com/Charts/MehtaBse.png?TimeStamp="+new Date().getTime()+"' alt=''/>";
         }
         else
         {
           document.getElementById("tdBSE").className="NormalBlack CursorHand";
         document.getElementById("tdNSE").className="NormalBlackBold";
          document.getElementById("BSENSEChart").innerHTML="<img src='http://content.acesphere.com/Charts/MehtaNse.png?TimeStamp="+new Date().getTime()+"' alt=''/>";
         }
       
}

function GetIPO(Flag)
	{	var requestUrl;	
		
		if(Flag=='NFO')
		{
		    document.getElementById("tdIpoUpd").className="HmIPODeSel CursorHand";
		    document.getElementById("tdNFO").className="HmIPOSel";
		     requestUrl = "AjaxNFOData.aspx?Flag="+Flag+"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
		}
		else
		{
		   document.getElementById("tdIpoUpd").className="HmIPOSel";
		    document.getElementById("tdNFO").className="HmIPODeSel CursorHand";
		     requestUrl = "IpoAjaxData.aspx?Flag="+Flag+"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
		}
		ajaxpage(100,requestUrl,'IPOdata');
    }



function GetNewsHot(SecID,SubSec)
{	
//alert(SecID,SubSec);
   
	document.body.style.cursor = "progress";
	document.getElementById("NewTd").innerHTML = " <img src='App_Themes/Seeta/Images/loading.gif'>";
	var requestUrl = "HotnewsAjax.aspx?Sec="+ SecID +"&SubSec="+SubSec+"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
	
	ajaxpage(1,requestUrl,'NewTd');
}


function GetNewsDetail(secId,SubSecId,NewsID,opt)
{	
    var NewsWin = document.getElementById("divNews").style.display='inline';
	var requestUrl = "../News/GetNews.aspx?SecId="+ secId +"&SubSecId="+ SubSecId+"&NewsID="+NewsID+"&timeStamp="+new Date().getTime()+"opt="+opt;
    ajaxpage(1,requestUrl,'NewsPop');
}
function GetBullion()
{
	var requestUrl = "AjaxBullion.aspx?time="+ Math.random();
	 ajaxpage(1,requestUrl,'TD_Bullion');
}	

function GetDataForex()
{
	var requestUrl = "AjaxForex.aspx?Exchange="+ Math.random();
     ajaxpage(1,requestUrl,'TD_Forex');
}	
function GetGLValVData(Exchange,Opt)
{
   document.getElementById("hdnExch").value = Exchange;
  	var requestUrl = "AjaxGLValVol.aspx?Exchange="+ Exchange+"&Option="+Opt;
  	ajaxpage(1,requestUrl,'Td_GLData');
}	

function GetAdvDec(Exchange)
{
	var requestUrl = "AjaxAdvanceDecline.aspx?Exchange="+ Exchange;
     ajaxpage(1,requestUrl,'TD_AdvDec');
}	

function GetIndices(contiment)
{	
   
	var requestUrl = "AjaxInternationalIndices.aspx?id=&Contiment="+contiment;
	  ajaxpage(1,requestUrl,'IndicesData');
}
function ExchTO(Exchange)
{
        if(Exchange=='BSE')
         {
         document.getElementById("tdTBSE").className="NormalBlackBold";
         document.getElementById("tdTNSE").className="NormalBlack CursorHand";
         }
         else
         {
           document.getElementById("tdTBSE").className="NormalBlack CursorHand";
         document.getElementById("tdTNSE").className="NormalBlackBold";
         }
	var strUrl = "AjaxTurnOver.aspx?EXCHG="+ Exchange;
     ajaxpage(1,strUrl,'TD_TurnOver');
}

function ajaxpage(id,url, containerid)
{
    if(id=='100' || id=='101')
    {
     document.getElementById(containerid).innerHTML = "<table cellspacing=0 cellpadding=0 width=100%><tr><td height=20></td></tr><tr><td align=center><img src='App_Themes/Common/images/ajax-loader.gif'></td></tr></table>";
    }
    else
    {
    document.getElementById(containerid).innerHTML = "<table cellspacing=0 cellpadding=0 width=100%><tr><td height=20></td></tr><tr><td align=center><img src='App_Themes/Common/images/loader.gif'></td></tr></table>";
    }
//alert("jamir")
    var page_request = false
        if (window.XMLHttpRequest) // if Mozilla, Safari etc
        page_request = new XMLHttpRequest()
        else if (window.ActiveXObject)
        { // if IE
                try {
                    page_request = new ActiveXObject("Msxml2.XMLHTTP")
                    } 
                catch (e){
                        try{
                            page_request = new ActiveXObject("Microsoft.XMLHTTP")
                            }
                        catch (e){}
                        }
        }


        page_request.onreadystatechange=function()
        {
            loadpage(page_request, containerid)
        }
        if (bustcachevar) //if bust caching of external page
        bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
        page_request.open('GET', url+bustcacheparameter, true)
         document.body.style.cursor = "auto";	
        page_request.send(null)    
}

  
function loadpage(page_request, containerid)
{
//alert(containerid)
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
 {   
     if(containerid=='NewsPop')
     {
	        showdeadcenterdiv('490','300','divNews');
       }
   if(containerid=='TD_SENSEXNDATA')
        {
			var SNDate = document.getElementById("TD_SNDATE");
			var strData = page_request.responseText;
			if(strData != "")
			 {	
			    var arrSchm = strData.split("|");
			   
			    for(i=0; i<arrSchm.length-1; i++) 
			    {	
				    var strSchm = arrSchm[i];
				   
				    var arrSchmCode = strSchm.split("~");
				     document.getElementById(containerid).innerHTML = arrSchmCode[0];
				    
				    SNDate.innerHTML = arrSchmCode[1];
			    }
			}
	}
	
	else
	{
	
        document.getElementById(containerid).innerHTML=page_request.responseText}
    }
   
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

  function showdeadcenterdiv(Xwidth,Yheight,divid)
 { 
// First, determine how much the visitor has scrolled 

var scrolledX, scrolledY; 
if( self.pageYoffset ) { 
scrolledX = self.pageXoffset; 
scrolledY = self.pageYoffset; 
} else if( document.documentElement && document.documentElement.scrollTop ) { 
scrolledX = document.documentElement.scrollLeft; 
scrolledY = document.documentElement.scrollTop; 
} else if( document.body ) { 
scrolledX = document.body.scrollLeft; 
scrolledY = document.body.scrollTop; 
} 

// Next, determine the coordinates of the center of browser's window 

var centerX, centerY; 
if( self.innerHeight ) { 
centerX = self.innerWidth; 
centerY = self.innerHeight; 
} else if( document.documentElement && document.documentElement.clientHeight ) { 
centerX = document.documentElement.clientWidth; 
centerY = document.documentElement.clientHeight; 
} else if( document.body ) { 
centerX = document.body.clientWidth; 
centerY = document.body.clientHeight; 
} 

// Xwidth is the width of the div, Yheight is the height of the 
// div passed as arguments to the function: 
var leftoffset = scrolledX + (centerX - Xwidth) / 2; 
var topoffset = scrolledY + (centerY - Yheight) / 2; 
// The initial width and height of the div can be set in the 
// style sheet with display:none; divid is passed as an argument to // the function 
var o=document.getElementById(divid); 
var r=o.style; 
r.position='absolute'; 
r.top = topoffset + 'px'; 
r.left = leftoffset + 'px'; 
r.display = "block"; 
}