
//GET Quotes Commodity
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 CreateXmlHttpNew()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpFO = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpFO = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpFO = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpFO && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpFO = new XMLHttpRequest();
		}
	}

//Home page Ticker

var XmlHttpFO
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);
	}


// For Commodity Ticker Data
function TickerDataCom(ex,typ)
{ 
    CreateXmlHttpNew();
    //alert(document.getElementById("TickerComm1_Ddl_FS"));
    //var DDL2=document.getElementById("TickerComm1_Ddl_FS").value;
    //alert(DDL2);
    var url="TickerComData.aspx?sid=" + Math.random() + "&typ="+typ+"&Exchg="+ex
    //alert(url);
    XmlHttpFO.onreadystatechange = function(){LoadTickerData()};
    XmlHttpFO.open("GET", url , true)
    XmlHttpFO.send(null)
} 

function LoadTickerData() 
{ 	
	if (XmlHttpFO.readyState==4 || XmlHttpFO.readyState=="complete")
	{ 
		document.getElementById("TickerComm1_TD1").innerHTML=XmlHttpFO.responseText 
       
    } 
}


//----ticker---

function changeselection(exchng)
	{    
	   	
	   	if(exchng=="NCDEX")
	   	{
		  	//alert("NCDEX");
		  	document.getElementById("FS").value="NCDEX";
		  	document.getElementById("TPRM1").className="BNPOnTab";
		  	document.getElementById("TPRM2").className="BNGOffTab";
		  	TickerDataCom('NCDEX','S');
	   	}
	   	else
	   	{
			//alert("MCX");
			document.getElementById("FS").value="MCX";
			document.getElementById("TPRM1").className="BNGOffTab";
			document.getElementById("TPRM2").className="BNPOnTab";
			TickerDataCom('MCX','S');
			
	   	}
	}
	
	
	

function StartTicker()
{
	window.close();
	window.opener.document.getElementById("tickerData1").style.display='inline';
}	

    
    
   
