//tickerData = document.getElementById("tickerData")
//alert(tickerData)
function CreateXmlHttp()
	{
		try
		{
			XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttp = null;
					
			}
		}
		if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttp = new XMLHttpRequest();
		}
	}

//Home page Ticker

var xmlHttp
var browser = new Browser();

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;
  }
  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

function ExchngTimeClock(Exchg) {
	 var time = new Date() 
	 var hour = time.getHours()
	 if (hour >= 10 && hour <= 20)
		  clockTimeoutID = setTimeout("getTickerData('"+ Exchg +"')",600000);
	}
function StartTicker()
{
	window.close();
	window.opener.document.getElementById("tickerData").style.display='inline';
}	
function startstop()
{
	/*document.getElementById("tickerData").style.display = 'none'
	var tick_win;
	getTickerData('BSE')
	tick_win = window.open("../ticker_pop.aspx","DetailNews1","status=1,height=120,width=800,resizable=0,scrollbars=0,left=50,top=100")
	tick_win.focus();*/
	
	var id=document.getElementById("StopImg");
	if (id.src.indexOf("tstop.gif")!=-1)
	{
		
		id.src = "../images/tplay.gif"
		document.getElementById("MarqueeId").stop();
		id.title = "Play";
	}
	else
	{
		id.src="../images/tstop.gif";
		document.getElementById("MarqueeId").start();
		id.title= "Stop";
	}
}
function mouseStart1()
    {
  //  alert("er");
        document.getElementById("MarqueeId").start();
		document.getElementById("StopImg").src="../images/tstop.gif";
		document.getElementById("StopImg").title = "Stop";
    }
    function mouseStop1()
    {
  //   alert("stop");
   	    document.getElementById("StopImg").src="../images/tplay.gif";
		document.getElementById("StopImg").title = "Play";
		document.getElementById("MarqueeId").stop();
	}
function getTickerData(Exchg)
	{
	//alert("Get"+Exchg);
		//alert("check");
		CreateXmlHttp();
		document.body.style.cursor = "progress";
		var requestUrl ="../TickerData.aspx?Exchg="+ Exchg +"&IpTrack="+ window.location.hostname +"&timeStamp="+new Date().getTime();
		//alert(requestUrl);
		if(XmlHttp)	
		{
					XmlHttp.onreadystatechange = function(){getDataResponseTicker(Exchg);};
					XmlHttp.open("GET", requestUrl,  true);
					XmlHttp.send(null);
		}
	}

function getDataResponseTicker(Exchg)
{
	if(XmlHttp.readyState == 4)
	{
		if(XmlHttp.status == 200)
		{			
			var MarqueeId = document.getElementById("MarqueeId1");
			MarqueeId.innerHTML=XmlHttp.responseText;
			document.body.style.cursor = "auto";
				
		}
	}
}

function changeTicker(Exchg)
{
//alert("Coming"+Exchg);
	if (Exchg == "BSE")
	{ 
		document.getElementById("Td_BSE").className="tickerorg"
		document.getElementById("Td_NSE").className="tickerblue"
		document.getElementById("BscId").style.cursor="default";
		document.getElementById("NscId").style.cursor="pointer";
		getTickerData('BSE');
	}
	else
	{
		document.getElementById("Td_BSE").className="tickerblue"
		document.getElementById("Td_NSE").className="tickerorg"
		document.getElementById("NscId").style.cursor="default";
		document.getElementById("BscId").style.cursor="pointer";
		getTickerData('NSE');
	}
}
function changeTickerpop(Exchg)
{
	if (Exchg == "BSE")
	{ 
		document.getElementById("AhrefBSE1").className="Ticksel"
		document.getElementById("AhrefNSE1").className="TickUnsel"
		getTickerData('BSE');
	}
	else
	{
		document.getElementById("AhrefBSE1").className="TickUnsel"
		document.getElementById("AhrefNSE1").className="Ticksel"
		getTickerData('NSE');
	}
}



