﻿-// 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 url;
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 browser = new Browser();
 var dragObj = new Object();
dragObj.zIndex = 5000;
function dragStart(event, id) {

  var el;
  var x, y;

  // If an element id was given, find it. Otherwise use the element being
  // clicked on.

  if (id)
    dragObj.elNode = document.getElementById(id);
  else {
    if (browser.isIE)
      dragObj.elNode = window.event.srcElement;
    if (browser.isNS)
      dragObj.elNode = event.target;

    // If this is a text node, use its parent element.

    if (dragObj.elNode.nodeType == 3)
      dragObj.elNode = dragObj.elNode.parentNode;
  }

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Save starting positions of cursor and element.

  dragObj.cursorStartX = x;
  dragObj.cursorStartY = y;
  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;

  // Update element's z-index.

  dragObj.elNode.style.zIndex = ++dragObj.zIndex;

  // Capture mousemove and mouseup events on the page.

  if (browser.isIE) {
    document.attachEvent("onmousemove", dragGo);
    document.attachEvent("onmouseup",   dragStop);
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS) {
    document.addEventListener("mousemove", dragGo,   true);
    document.addEventListener("mouseup",   dragStop, true);
    event.preventDefault();
  }
}

function dragGo(event) {

  var x, y;

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    x = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    y = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    x = event.clientX + window.scrollX;
    y = event.clientY + window.scrollY;
  }

  // Move drag element by the same amount the cursor has moved.

  dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
  dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";

  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}

function dragStop(event) {

  // Stop capturing mousemove and mouseup events.

  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }
}


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 = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttp && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttp = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttp=false;
	        }
        }
        if (!XmlHttp && window.createRequest) 
        {
	        try 
	        {
		        XmlHttp = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttp=false;
	        }
        }
	
	}
	
	function GetXmlHttpObject(handler)
{ 
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") 
return 
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{ 
var strName="Msxml2.XMLHTTP"
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP"
} 
try
{ 
objXmlHttp=new ActiveXObject(strName)
objXmlHttp.onreadystatechange=handler 
return objXmlHttp
} 
catch(e)
{ 
alert("Error. Scripting for ActiveX might be disabled") 
return 
} 
} 
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest()
objXmlHttp.onload=handler
objXmlHttp.onerror=handler 
return objXmlHttp
}
} 


function CreateXmlHttpVV()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttpVV = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttpVV = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpVV = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttpVV && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttpVV = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpVV=false;
	        }
        }
        if (!XmlHttpVV && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpVV = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpVV=false;
	        }
        }
	
	}


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 = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttp1 && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttp1 = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttp1=false;
	        }
        }
        if (!XmlHttp1 && window.createRequest) 
        {
	        try 
	        {
		        XmlHttp1 = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttp1=false;
	        }
        }
	
	}	
	


function LookUpData(str,typ)
{ 


        if (str=="MCX")
        {
    
	     
	       // HomeTicker('MCX','F');
	        ShowVolumeValue('MCX','Val');
	        ShowBseGL('MCX','G')
        }
        else
        {
      
	       // HomeTicker('NCDEX','F');
	        ShowVolumeValue('NCDEX','Val');
	        ShowBseGL('NCDEX','G')
        }
	
} 


 
 
 function HomeTicker(ex,typ)
{

    if (ex == "")
    {

	    if (typ=="S")
	    {
	
	    document.getElementById("SF").value = "S";
	    document.getElementById("FutF").className="NormalGrayText";
	    document.getElementById("SpotS").className="NormalRedText"; 
	     document.getElementById("SpotS").style.cursor="text";
	    document.getElementById("FutF").style.cursor="pointer";
	       
	    
	    }
	    else
	    {
	
	    document.getElementById("SF").value = "F";
	    document.getElementById("FutF").className="NormalRedText";
	    document.getElementById("SpotS").className="NormalGrayText";
	    document.getElementById("SpotS").style.cursor="pointer";
	    document.getElementById("FutF").style.cursor="text"; 
	    }
    }
        else
        {	
	        if(ex=="MCX")
	        {
               if (typ=="S")
	    {
	
	    document.getElementById("SF").value = "S";
	    document.getElementById("FutF").className="NormalGrayText";
	    document.getElementById("SpotS").className="NormalRedText"; 
	     document.getElementById("SpotS").style.cursor="text";
	    document.getElementById("FutF").style.cursor="pointer";
	       
	    
	    }
	    else
	    {
	
	    document.getElementById("SF").value = "F";
	    document.getElementById("FutF").className="NormalRedText";
	    document.getElementById("SpotS").className="NormalGrayText";
	    document.getElementById("SpotS").style.cursor="pointer";
	    document.getElementById("FutF").style.cursor="text"; 
	    }
	        document.getElementById("Ech").value = "MCX";
 
	        }
	        else
	        {
        	    if (typ=="S")
	    {
	
	    document.getElementById("SF").value = "S";
	    document.getElementById("FutF").className="NormalGrayText";
	    document.getElementById("SpotS").className="NormalRedText"; 
	     document.getElementById("SpotS").style.cursor="text";
	    document.getElementById("FutF").style.cursor="pointer";
	       
	    
	    }
	    else
	    {
	
	    document.getElementById("SF").value = "F";
	    document.getElementById("FutF").className="NormalRedText";
	    document.getElementById("SpotS").className="NormalGrayText";
	    document.getElementById("SpotS").style.cursor="pointer";
	    document.getElementById("FutF").style.cursor="text"; 
	    }
	        document.getElementById("Ech").value = "NCDEX";
	      
	        }
        	
        }
        CreateXmlHttp1();
	var requestUrl="CommTicker.aspx?sid=" + Math.random() + "&Exchg="+document.getElementById("Ech").value+"&type="+document.getElementById("SF").value
	//alert(requestUrl);
	if(XmlHttp1)	
			{
					//alert("hi");
					XmlHttp1.onreadystatechange = function(){ShowTickerData();}; 
					XmlHttp1.open("GET", requestUrl,  true);
					XmlHttp1.send(null);
			}
	
}

function ShowTickerData() 
{ 

if(XmlHttp1.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttp1.status == 200)
		{			
			var TikerData   = document.getElementById("TikerData");
		var strData = XmlHttp1.responseText;
			//alert(strData);
			if(strData != "")
			{
				TikerData.innerHTML   =  "<marquee onmouseover='this.stop();' onmouseout='this.start();' trueSpeed scrollAmount='1' scrollDelay='40' height='116px' direction='up' loop='repeat' width='100%'>" +strData + "</marquee>";
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			TikerData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
} 

// for Gainers & Losers

 function ShowBseGL(ex,glctrl)
{

 if (ex == "")
    {
      //  ex=="NCDEX";
         if (glctrl=="G")
	    {
	         document.getElementById("select").className="HomeHeadSelPink";
	         document.getElementById("unselect").className="HomeHeadPink";
	     
	  
	        document.getElementById("GL").value = "G"
	    }
	    else
	    {
	    document.getElementById("select").className="HomeHeadPink";
	      document.getElementById("unselect").className="HomeHeadSelPink";
	    document.getElementById("GL").value = "L"
	    }
	 }
	 else
        {
	        if(ex=="MCX")
	        {

		        document.getElementById("MCXNCD").value = "MCX"
	        }
	        else
	        {
        	
		        document.getElementById("MCXNCD").value = "NCDEX"
	        }
        	
        }
   
        CreateXmlHttp();
        //alert(document.getElementById("GL").value);

	var requestUrl="AjaxGainerLoser.aspx?sid=" + Math.random() + "&Exchg="+document.getElementById("MCXNCD").value+"&typeGL="+document.getElementById("GL").value;
	
	
	if(XmlHttp)	
			{
					//alert("hi");
					XmlHttp.onreadystatechange = function(){ShowShowGLData();}; 
					XmlHttp.open("GET", requestUrl,  true);
					XmlHttp.send(null);
			}
	
}

function ShowShowGLData() 
{ 

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 ShowGLData   = document.getElementById("ShowGLData");
		var strData = XmlHttp.responseText;
			//alert(strData);
			if(strData != "")
			{
				ShowGLData.innerHTML   =  strData;
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			ShowGLData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
} 


// For High & Low

 function ShowVolumeValue(ex,glctrl)
{

 if (ex == "")
    {
         if (glctrl=="Val")
	    {
	      document.getElementById("ValSel").className="HomeHeadSelPink";
	      document.getElementById("VolSel").className="HomeHeadPink";
	     
	  
	    document.getElementById("VV").value = "Val"
	    }
	    else
	    {
	    document.getElementById("ValSel").className="HomeHeadPink";
	      document.getElementById("VolSel").className="HomeHeadSelPink";
	    document.getElementById("VV").value = "Vol"
	    }
	 }
	 else
        {
	        if(ex=="MCX")
	        {
	        
		        document.getElementById("MCXNCD").value = "MCX"
	        }
	        else
	        {
        	
		        document.getElementById("MCXNCD").value = "NCDEX"
	        }
        	
        }
   
        CreateXmlHttpVV();
	var requestUrl="AjaxValueVol.aspx?sid=" + Math.random() + "&Exchg="+document.getElementById("MCXNCD").value+"&typeGL="+document.getElementById("VV").value;
	//alert(requestUrl);
	
	
	if(XmlHttpVV)	
			{
					//alert("hi");
					XmlHttpVV.onreadystatechange = function(){ShowVolumeValueData();}; 
					XmlHttpVV.open("GET", requestUrl,  true);
					XmlHttpVV.send(null);
			}
	
}

function ShowVolumeValueData() 
{ 

if(XmlHttpVV.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpVV.status == 200)
		{			
			var ShowVolumeValueData   = document.getElementById("ShowVVData");
		var strData = XmlHttpVV.responseText;
			//alert(strData);
			if(strData != "")
			{
				ShowVolumeValueData.innerHTML   =  strData;
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			ShowVolumeValueData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
}

// For Chart Data

 function HomeChart(ex,symbol)
{
 var Gold=document.getElementById("GoldS");
 var Silver=document.getElementById("SilverS");
 var ChartCommS=document.getElementById("ChartCommS");
 

        if (ex == "")
        {
	        if (symbol=="GOLD") 
	        {
    	     
	           document.getElementById("GS").value = "GOLD"
	        }
	        else
	        {
    	         
	            document.getElementById("GS").value = "SILVER"
	        }
         }
        else
        {
	        if(ex=="MCX")
	        {
	          

		        document.getElementById("Ech").value = "MCX"
	        }
            else
            {
	            document.getElementById("Ech").value = "NCDEX"
            }
    	
        }
        if (symbol=="GOLD") 
	        {
    	   
	            var requestUrl="Chart.aspx?sid=" + Math.random() + "&Exchange="+document.getElementById("Ech").value +"&Symbol="+symbol ;
	            document.getElementById("ChartComm").src=requestUrl;
	        }
	    else
	    {
	     var requestUrlS="ChartS.aspx?sid=" + Math.random() + "&Exchange="+document.getElementById("Ech").value +"&Symbol="+symbol ;
	  	    document.getElementById("ChartCommS").src=requestUrlS;
	    }
	
	
	
}

function ShowGoldData() 
{ 

if(XmlHttpSymb.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpSymb.status == 200)
		{			
			var GoldData   = document.getElementById("Chart");
		var strData = XmlHttpSymb.responseText;
			//alert(strData);
			if(strData != "")
			{
				GoldData.innerHTML   =  strData;
			}
			document.body.style.cursor = "auto";	
		}
		else
		{
			GoldData.innerHTML = "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}

	
} 


/// Get Quotes


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();
		}
		if (!XmlHttpFO && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpFO = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpFO=false;
	        }
        }
	}


 


 function fillCategory()
    {
		
	    var Excha = document.getElementById("ctl00_ContentPlaceHolder1_Exchg");
	    var Symbol = document.getElementById("ctl00_ContentPlaceHolder1_ddlCategory");
		
 				
		CreateXmlHttpNew();
		document.body.style.cursor = "progress";
		var requestUrl = "CmGetCategoryAjax.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Excha.value;
		//alert(requestUrl)
		if(XmlHttpFO)	{
					XmlHttpFO.onreadystatechange = function(){fillSymbolResp(Symbol)};
					XmlHttpFO.open("GET", requestUrl,  true);
					XmlHttpFO.send(null);
				}
		
    }
 
 //Called when response comes back from server Only For Symbol
function fillSymbolResp(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpFO.readyState == 4)
	{
		
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpFO.status == 200)
		{		
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpFO.responseText
			//alert(strData)
			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 = "Category 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";		
		}
	}
}

var XmlHttpCommNews;

function CreateXmlHttpCommNews()
	{
		//Creating object of XmlHttp in IE
		try
		{
			XmlHttpCommNews = new ActiveXObject("Msxml2.XmlHttp");
		}
		catch(e)
		{
			try
			{
				XmlHttpCommNews = new ActiveXObject("Microsoft.XmlHttp");
			} 
			catch(oc)
			{
				XmlHttpCommNews = null;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if(!XmlHttpCommNews && typeof XmlHttpRequest != "undefined") 
		{
			XmlHttpCommNews = new XmlHttpRequest();
		}
		if (!XmlHttpCommNews && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpCommNews = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpCommNews=false;
	        }
        }
	}

function GetNewsDetail(secId,SubSecId,NewsID,opt)
{
    //alert(secId);
    var NewsWin = document.getElementById("divNews").style.display='inline';
	var currentDivObj;	
		
	currentDivObj = document.getElementById("TDNews");
	currentDivObj.innerHTML ="<img src=../App_Themes/images/loading.gif>"; 
	CreateXmlHttpCommNews();
	document.body.style.cursor = "progress";
	var requestUrl = "PopupNewsData.aspx?SecId="+ secId +"&SubSecId="+ SubSecId+"&NewsID="+NewsID+"&timeStamp="+new Date().getTime()+"opt="+opt;
		
	if(XmlHttpCommNews)	
	{
	    XmlHttpCommNews.onreadystatechange = function(){getDetailsResp();};
		XmlHttpCommNews.open("GET", requestUrl,  true);
		XmlHttpCommNews.send(null);					
	}
}
	
function getDetailsResp()
{
    
    // To make sure receiving response data from server is completed
	if(XmlHttpCommNews.readyState == 4)
	{
	    // To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpCommNews.status == 200)
		{
		    document.getElementById("TDNews").innerHTML = XmlHttpCommNews.responseText;
			//var strData = XmlHttpNew.responseText;
			var News= document.getElementById("divNews").style.display='inline';
			News.innerHTML = "<marquee  onmouseout='this.start();' trueSpeed scrollAmount='1' height=126px scrollDelay='150' direction='up' loop='repeat' width='100%'></marquee>";
			document.body.style.cursor = "auto";
		}
		else
		{
		    document.getElementById("TDNews").innerHTML = "<img src=../App_Themes/Common/images/ajax-loader.gif>";
		}
	}
}


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();
		}
		if (!XmlHttpFO && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpFO = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpFO=false;
	        }
        }
	}
	
	
function CreateXmlHttpEDH()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpEDH = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpEDH = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpEDH = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpEDH && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpEDH = new XMLHttpRequest();
		}
		if (!XmlHttpEDH && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpEDH = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpEDH=false;
	        }
        }
	}



function fillSymbolhome()
     {
		
	 var Excha = document.getElementById("Exchg");
	 var Symbol = document.getElementById("Symbol");		

		
		CreateXmlHttpEDH();
		document.body.style.cursor = "progress";
		var requestUrl = "CmGetSymbolAjax.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Excha.value;
		//alert(requestUrl)
		if(XmlHttpEDH)	{
					XmlHttpEDH.onreadystatechange = function(){fillSymbolResphome(Symbol)};
					XmlHttpEDH.open("GET", requestUrl,  true);
					XmlHttpEDH.send(null);
				}
		
 }
 
 //Called when response comes back from server Only For Symbol
function fillSymbolResphome(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpEDH.readyState == 4)
	{
		
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpEDH.status == 200)
		{		
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpEDH.responseText
			//alert(strData)
			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 = "Symbol 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 GetExpDatehome()
 {
        var Excha = document.getElementById("Exchg");
  		var Symbol = document.getElementById("Symbol");
 		var ExpiryDate = document.getElementById("ExpDate"); 
 				
		CreateXmlHttpEDH();
		document.body.style.cursor = "progress";
		var requestUrl = "CmGetExpDateAjax.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Excha.value +"&Symbol="+Symbol.value;
	
		if(XmlHttpEDH)	{
					XmlHttpEDH.onreadystatechange = function(){getDateResphome(ExpiryDate)};
					XmlHttpEDH.open("GET", requestUrl,  true);
					XmlHttpEDH.send(null);
				}
		
 }
 
 //Called when response comes back from server Only For Symbol
function getDateResphome(ig_)
{

	// To make sure receiving response data from server is completed
	if(XmlHttpEDH.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		if(XmlHttpEDH.status == 200)
		{
			//alert(ig_)
			//var availSchemes   = document.getElementById(ig_);
			var strData = XmlHttpEDH.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 = "Date 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 CreateXmlHttpEDH()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpEDH = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpEDH = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpEDH = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpEDH && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpEDH = new XMLHttpRequest();
		}
		if (!XmlHttpEDH && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpEDH = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpEDH=false;
	        }
        }
	}
	
function RedirectDataHome()
{

var ChkExchnge = document.getElementById("Exchg");
var Exchnge = document.getElementById("Exchg").value;
var Symbol = document.getElementById("Symbol").value;
var ChkSymbol = document.getElementById("Symbol");
var ExpDate = document.getElementById("ExpDate").value;
var UserId= document.getElementById("inp_hid1").value;
var strurl= "Home=True&Excha=" + Exchnge + "&Symbol=" + Symbol + "&ExpDate=" + ExpDate + "&UserId="+ UserId;

 if(ChkExchnge.value=="0" )
    { 
      
        alert("Please select Exchange");
       document.getElementById("Exchg").focus();
        return false;
     
        
        
    }
    
    if(ChkSymbol.value ==" ")
    {
    
     alert("Please select Symbol");
     document.getElementById("Symbol").focus();
     return false;

       
       
    }
     if(ExpDate ==" ")
    {
    
     alert("Please Select Expiry Date");
     return false;
     document.getElementById(ExpDate).focus();
    }
 
 
    

var requestUrl = "GetQuoteData.aspx?id=1&"+strurl;
var newWindow = window.open(requestUrl, '_parent');
newWindow.focus(); 
return false;


}
 
var XmlHttpQoutes;

function CreateXmlHttpQoutes()
{
	try
	{
		XmlHttpQoutes = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpQoutes = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpQoutes = false;	
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttpQoutes && typeof XMLHttpRequest != "undefined") 
	{
		   try 
	        {
		        XmlHttpQoutes = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpQoutes=false;
	        }
	}
	
	  if (!XmlHttpQoutes && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpQoutes = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpQoutes=false;
	        }
        }
	
	
}
function RedirectData(opt)
{

     if(opt == "Inner")
	{
	
	 var Excha = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange").value;
  	var Symbol = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol").value;
 	var ExpiryDate = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate").value;
 
	if(Excha==" " )
    { 
      
        alert("Please Select Exchange");
        document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange").focus();   
        return false;
         
    }
   if(Symbol==" " )
    { 
      
        alert("Please Select Symbol");
        document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol").focus(); 
        return false;
        
    }
    if(ExpiryDate==" " )
    { 
      
        alert("Please Select Expiry date");
        document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate").focus(); 
        return false;
        
    }
    
    var strUrl = document.getElementById("ctl00_ContentPlaceHolder1_txthidden");


	//var GetQuoateTbl = document.getElementById("GetQuoateTbl");
  
//	if(GetQuoateTbl.style.display=="none")
//	{
//	GetQuoateTbl.style.display = "inline";
//    }
	CreateXmlHttpQoutes();
    document.body.style.cursor = "progress";
    
        var requestUrl = "AjaxGetQuotesData.aspx?Excha="+Excha +"&Symbol="+Symbol+"&ExpDate="+ExpiryDate;
       // document.ChartCommodity.src="GetPriceChart.aspx?Excha="+Excha +"&Symbol="+Symbol+"&ExpDate="+ExpiryDate;

      
    }
    else
    {
   var strUrl = document.getElementById("ctl00_ContentPlaceHolder1_txthidden");

	//var GetQuoateTbl = document.getElementById("GetQuoateTbl");
 
    //if(GetQuoateTbl.style.display=="none")GetQuoateTbl.style.display = "inline";

	    CreateXmlHttpQoutes();
        document.body.style.cursor = "progress";
        var requestUrl = "AjaxGetQuotesData.aspx?"+strUrl.value;
       //document.ChartCommodity.src="GetPriceChart.aspx?"+strUrl.value;
     
    }
    
    
    if(XmlHttpQoutes)	
    {
	    XmlHttpQoutes.onreadystatechange = function(){getFODataResp()};
		XmlHttpQoutes.open("GET", requestUrl,  true);
		XmlHttpQoutes.send(null);
	}
	
	return false;
	
	
}

function getFODataResp()
{
  
    if(XmlHttpQoutes.readyState == 4)
	{
	   
	    if(XmlHttpQoutes.status == 200)
		{
		   // var FO_QuoteData = XmlHttpQoutes.responseText;
		    document.getElementById("TdGetQuotesData").innerHTML = XmlHttpQoutes.responseText;
		    document.body.style.cursor = "auto";
			
//			if(FO_QuoteData != "") 
//			{
//			    var arrRow = FO_QuoteData.split("|");
//				
//				for(i=0; i<arrRow.length-1; i++)
//				{
//				   document.getElementById("GQ"+i).innerHTML = arrRow[i];
//				}
//				document.body.style.cursor = "auto";
//			}	
		}
	else
	    {
			document.getElementById("TdGetQuotesData").src = " ../App_Themes/Images/ajax-loader.gif";
        }
	
	}
}

function onload()
{
RedirectData('Home');
}
var schemeObject=null;
var Fund ;
var scheme;  
var category;
 
function ProcessSearchData()
{        
    try 
    { 
        schemeObject = new ActiveXObject('Msxml2.XMLHTTP');
    }
    catch(e)
    {
        try 
        {
            schemeObject = new ActiveXObject('Microsoft.XMLHTTP'); 
        } 
        catch(e1) 
        { 
            schemeObject = null; 
        } 
    }
   if(!schemeObject && typeof XMLHttpRequest != "undefined") 
    {
	    schemeObject = new XMLHttpRequest();
	}
	if (!schemeObject && window.createRequest) 
        {
	        try 
	        {
		        schemeObject = window.createRequest();
	        } 
	        catch (e)
	        {
		        schemeObject=false;
	        }
        }
 
    
    Exch = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange");                  
    scheme = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate");                                
    category = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol");   

            
    if(schemeObject != null)
    {   
        var queryString = "CommodityData.aspx?timeStamp="+ new Date().getTime() +"&Excha="+Exch.value;  
        schemeObject.onreadystatechange = function(){ProcessSchemeData(Exch);};  
        schemeObject.open('GET', queryString ,  true); 
        schemeObject.send(null);  
    }    
    
    return false; 
}

function ProcessSchemeData(Exch)
{

    if(schemeObject.readyState == 4)
    {
        if(schemeObject.status == 200)
        {     
            var listItemc;       
            var dsRoot = schemeObject.responseXML.documentElement;
                 var ddlCat = category;  
                     var ddlScheme = scheme; 
           document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_txtFund").value =Exch.options[Exch.selectedIndex].value;
            if(dsRoot != null)        
            {                                   
//                var ddlCat = category;  
//                ddlCat.options.length=0; 
//                var ddlExpDate = scheme;  
                 ddlCat.options.length=0; 
                                       
                                      
                                      listItem = new Option("Select Category", "");
		                                 ddlCat.length=0;
                                         ddlCat.options[0] = listItem; 
                                     
                                 
                if(dsRoot.getElementsByTagName('comname')!=null)
                {
                    var textc; 
                    var valuec;
                    var CatName = dsRoot.getElementsByTagName('comname');                        
                    var CatCodes = dsRoot.getElementsByTagName('comsymbol');
                    ddlCat.length=0;
                    
                    for (var count = 0; count < CatName.length; count++)
                    {
                        textc = (CatName[count].textContent || CatName[count].innerText || CatName[count].text);
                        valuec = (CatCodes[count].textContent || CatCodes[count].innerText || CatCodes[count].text);
                        listItemc = new Option(textc, valuec,  false, false);
                        ddlCat.options[ddlCat.length] = listItemc;  
                      
                    }
  listItemc=new Option("Select Symbol", "Select Symbol")
                                              ddlCat.options[0]=listItemc;
                                              ddlCat.value="Select Symbol";
                                             
                                            listItemc = new Option("Select Expiry Date", "Select Expiry Date");
	                                        ddlScheme.length = 1;
                                            ddlScheme.options[0] = listItemc;
                }
            }  
            else
            {                                             
                ddlCat.length=0;                             
                                            listItemc = new Option("Select Symbol", "Select Symbol");
	                                        ddlCat.length = 1;
                                            ddlCat.options[0] = listItemc;   
                                            
                                            ddlScheme.length=0;
                                            listItemc = new Option("Select Expiry Date", "Select Expiry Date");
	                                        ddlScheme.length = 1;
                                            ddlScheme.options[0] = listItemc;
            }
        }    
    }
}
         
//category
var XmlHttpCat;
function CreateXmlHttpCat()
{
    try
	{
	    XmlHttpCat = new ActiveXObject("Msxml2.XMLHTTP");
    }
	catch(e)
	{
	    try
		{
		    XmlHttpCat = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
		    XmlHttpCat = null;
	    }
	}
	
	if(!XmlHttpCat && typeof XMLHttpRequest != "undefined") 
    {
	    XmlHttpCat = new XMLHttpRequest();
	}
	if (!XmlHttpCat && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpCat = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpCat=false;
	        }
        }
}
         
function ProcessCategoryData()
{
    CreateXmlHttpCat();
          
    if(XmlHttpCat)
    {   
        Fund = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExchange");
        scheme = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlExpDate");                
        category = document.getElementById("ctl00_ContentPlaceHolder1_FundCatCtrl1_ddlSymbol"); 
        
        var queryString = "CmGetExpDateAjax.aspx?Excha=" + Fund.value +"&Symbol=" + category.value;  
        XmlHttpCat.onreadystatechange = function(){ProcessData(scheme);};  
        XmlHttpCat.open('GET', queryString ,  true); 
        XmlHttpCat.send(null);  
       // document.getElementById("<%=txtCategory.ClientID%>").value=category.value;

    } 
   
    return false; 
}
        
function ProcessData(ig_)
{
    if(XmlHttpCat.readyState == 4)
	{
	    if(XmlHttpCat.status == 200)
	    {
		    var strData = XmlHttpCat.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 = "Date 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";		
		}
	}
}



var XmlHttpComm;
function CreateXmlHttpComm()
{
	try
		{
			XmlHttpComm = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttpComm = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpComm = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttpComm && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttpComm = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpComm=false;
	        }
        }
        if (!XmlHttpComm && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpComm = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpComm=false;
	        }
        }
}






function CommChangeControl(Opt)
{
  if(Opt == 'G')
     {
    
      document.getElementById("tdGainComm").className="NewsTabSelected";
	  document.getElementById("tdLoseComm").className="NewsTabSelectedWhite";
	 // document.getElementById("tdValueComm").className="TabSelectedWhite";
	 // document.getElementById("tdVolumeComm").className="TabSelectedWhite";
	
	 
     }
     else if(Opt =='L')
     {
  
     document.getElementById("tdGainComm").className="NewsTabSelectedWhite";
	  document.getElementById("tdLoseComm").className="NewsTabSelected";
	  //document.getElementById("tdValueComm").className="TabSelectedWhite";
	 // document.getElementById("tdVolumeComm").className="TabSelectedWhite";

     }
//      else if(Opt =='Vol')
//     {
//     document.getElementById("tdGainComm").className="TabSelectedWhite";
//	  document.getElementById("tdLoseComm").className="TabSelectedWhite";
//	  document.getElementById("tdValueComm").className="TabSelectedWhite";
//	  document.getElementById("tdVolumeComm").className="TabSelected";
//	 
//     }
//      else if(Opt =='Val')
//     {
//     document.getElementById("tdGainComm").className="TabSelectedWhite";
//	  document.getElementById("tdLoseComm").className="TabSelectedWhite";
//	  document.getElementById("tdValueComm").className="TabSelected";
//	  document.getElementById("tdVolumeComm").className="TabSelectedWhite";
//	
//     }
    
     else
     {
     document.getElementById("tdGainComm").className="TabSelected";
	  document.getElementById("tdLoseComm").className="TabSelectedWhite";
	 // document.getElementById("tdValueComm").className="TabSelectedWhite";
	  //document.getElementById("tdVolumeComm").className="TabSelectedWhite";
	 
     }
     
     
     
      CreateXmlHttpComm();
       var currentDivObj = document.getElementById("strData");
        
	document.body.style.cursor = "progress";

	var UserId = document.getElementById("inp_hid1").value;
	var requestUrl = "CommAjaxValueVol.aspx?typeGL="+ Opt +"&timeStamp="+new Date().getTime()+"&UserId="+UserId;
	if(XmlHttpComm!=null)	
	        {
				XmlHttpComm.onreadystatechange = function(){CommChangeControlResponse(Opt)}
				XmlHttpComm.open('GET', requestUrl,  true);
				XmlHttpComm.send(null);
			}
			 return false; 
}

function CommChangeControlResponse(Opt)
{
if(XmlHttpComm.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		var td_Id = document.getElementById("strDataComm");
	   
		if(XmlHttpComm.status == 200)//
		{
			td_Id.innerHTML =  XmlHttpComm.responseText;
				
			document.body.style.cursor = "auto";		
		}
		else
		{
			td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}
}


var XmlHttpCommVol;
function CreateXmlHttpCommVol()
{
	try
		{
			XmlHttpCommVol = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{  
				XmlHttpCommVol = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpCommVol = false;	
			}
		}
		//Creating object of XmlHttp in Mozilla and Safari 
		if (!XmlHttpCommVol && typeof XMLHttpRequest!='undefined') 
		{
	        try 
	        {
		        XmlHttpCommVol = new XMLHttpRequest();
	        } 
	        catch (e) 
	        {
		        XmlHttpCommVol=false;
	        }
        }
        if (!XmlHttpCommVol && window.createRequest) 
        {
	        try 
	        {
		        XmlHttpCommVol = window.createRequest();
	        } 
	        catch (e)
	        {
		        XmlHttpCommVol=false;
	        }
        }
}

function CommChangeVolControl(Opt)
{
  if(Opt == 'Vol')
    {
	  document.getElementById("tdValueComm").className="TabSelectedWhite";
	  document.getElementById("tdVolumeComm").className="TabSelected";
	 
     }
      else if(Opt =='Val')
     {
    
	  document.getElementById("tdValueComm").className="TabSelected";
	  document.getElementById("tdVolumeComm").className="TabSelectedWhite";
	
     }
    
     else
     {

	 document.getElementById("tdValueComm").className="TabSelected";
	 document.getElementById("tdVolumeComm").className="TabSelectedWhite";
	 
     }
     
     
     
      CreateXmlHttpCommVol();
       var currentDivObj = document.getElementById("strData");
        
	document.body.style.cursor = "progress";

	var UserId = document.getElementById("inp_hid111").value;
	var requestUrl = "CommAjaxValueVolHome.aspx?typeGL="+ Opt +"&timeStamp="+new Date().getTime()+"&UserId="+UserId;
	if(XmlHttpCommVol!=null)	
	        {
				XmlHttpCommVol.onreadystatechange = function(){CommChangeControlResponseVol(Opt)}
				XmlHttpCommVol.open('GET', requestUrl,  true);
				XmlHttpCommVol.send(null);
			}
			 return false; 
}

function CommChangeControlResponseVol(Opt)
{
if(XmlHttpCommVol.readyState == 4)
	{
		// To make sure valid response is received from the server, 200 means response received is OK
		var td_Id = document.getElementById("strDataComm1");
	   
		if(XmlHttpCommVol.status == 200)//
		{
			td_Id.innerHTML =  XmlHttpCommVol.responseText;
				
			document.body.style.cursor = "auto";		
		}
		else
		{
			td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			
			document.body.style.cursor = "auto";
		}
	}
}

function CreateXmlHttpPop()
	{
		//Creating object of XMLHTTP in IE
		try
		{
			XmlHttpPop= new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				XmlHttpPop = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch(oc)
			{
				XmlHttpPop = null;	
			}
		}
		//Creating object of XMLHTTP in Mozilla and Safari 
		if(!XmlHttpPop && typeof XMLHttpRequest != "undefined") 
		{
			XmlHttpPop = new XMLHttpRequest();
		}
	}


 function GetNewsDetailA(secId,SubSecId,NewsID,opt)
	{

        document.getElementById("divNews").style.display='inline';
	//	alert(document.getElementById('divNews'));

		CreateXmlHttpPop();
		document.body.style.cursor = "progress";
		var requestUrl = "../PopupNewsData.aspx?SecId="+ secId +"&SubSecId="+ SubSecId+"&NewsID="+NewsID+"&timeStamp="+new Date().getTime()+"opt="+opt;
		//alert(requestUrl);
		if(XmlHttpPop)	{
					XmlHttpPop.onreadystatechange = function(){getDetailsResp();};
					XmlHttpPop.open("GET", requestUrl,  true);
					XmlHttpPop.send(null);					
				}
	}
	
	function getDetailsResp()
	{
		// To make sure receiving response data from server is completed
		if(XmlHttpPop.readyState == 4)
		{
			// To make sure valid response is received from the server, 200 means response received is OK
			if(XmlHttpPop.status == 200)
			{
				
				
					document.getElementById("TdNews").innerHTML = XmlHttpPop.responseText;
					//alert(document.getElementById("TdNews").innerHTML);
				
				document.body.style.cursor = "auto";
			}
			else
			{
				
					document.getElementById("NewsId").innerHTML = "<img src=App_Themes/Common/images/ajax-loader.gif>";
				
			}
		}
	}
