﻿var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)

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='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='images/ajax-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
}
}
}
 var XmlHttpHomeNews;
 function CreateXmlHomeHttpNews()
{
			 try {
  XmlHttpHomeNews = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   XmlHttpHomeNews = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   XmlHttpHomeNews = false;
  }
 }

if (!XmlHttpHomeNews && typeof XMLHttpRequest!='undefined') {
	try {
		XmlHttpHomeNews = new XMLHttpRequest();
	} catch (e) {
		XmlHttpHomeNews=false;
	}
}
if (!XmlHttpHomeNews && window.createRequest) {
	try {
		XmlHttpHomeNews = window.createRequest();
	} catch (e) {
		XmlHttpHomeNews=false;
	}
}
}
 function MarketGLTab1(Exch,val)
 {

 if(val=='GAIN')
   {

    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabSelectGON'  style='width:62px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF' onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:54px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'     class='MktTabUnSelectVolff'  onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:58px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff'   onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='  width:50px; '> &nbsp;</td><td align='center' style='border-bottom: solid 1px #e6e6e6;' width='44px'>&nbsp;</td></tr></table>";

   }
   if(val=='LOSE')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot'  class='MktTabUnSelectGOFF'  onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);' style='width:64px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOn'  style='width:56px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'     class='MktTabUnSelectVolff'  onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:60px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff' onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);'  style='width:52px; '> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center'style='border-bottom: solid 1px #e6e6e6;' width='42px'>&nbsp;</td></tr></table>";

   }
   if(val=='VOL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabUnSelectGOFF'  onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);' style=' width:63px;%; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF' onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:55px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'  class='MktTabUnSelectVolOn'   style='width:59px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff' onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='  width:51px; '>&nbsp;</td><td align='center' width='45px' style='border-bottom: solid 1px #e6e6e6;'>&nbsp;</td></tr></table>";
    
   }
   if(val=='VAL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabUnSelectGOFF'  onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);'  style=' width:64px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF'  onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:56px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'  class='MktTabUnSelectVolff'  onclick='MarketGLTab1(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:60px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectValOn' style='width:52px; '> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' width='43px' style='border-bottom: solid 1px #e6e6e6;'>&nbsp;</td></tr></table>";
   }
    GetGLValVData1(document.getElementById("hdnExch").value,val)
  

}
 function MarketGLTab2(Exch,val)
 {

 if(val=='GAIN')
   {

    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabSelectGON'  style='width:62px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF' onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:54px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'     class='MktTabUnSelectVolff'  onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:58px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff'   onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='  width:50px; '> &nbsp;</td><td align='center' style='border-bottom: solid 1px #e6e6e6;' width='44px'>&nbsp;</td></tr></table>";

   }
   if(val=='LOSE')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot'  class='MktTabUnSelectGOFF'  onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);' style='width:64px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOn'  style='width:56px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'     class='MktTabUnSelectVolff'  onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:60px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff' onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);'  style='width:52px; '> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center'style='border-bottom: solid 1px #e6e6e6;' width='42px'>&nbsp;</td></tr></table>";

   }
   if(val=='VOL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabUnSelectGOFF'  onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);' style=' width:63px;%; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF' onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:55px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'  class='MktTabUnSelectVolOn'   style='width:59px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff' onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='  width:51px; '>&nbsp;</td><td align='center' width='45px' style='border-bottom: solid 1px #e6e6e6;'>&nbsp;</td></tr></table>";
    
   }
   if(val=='VAL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabUnSelectGOFF'  onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);'  style=' width:64px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF'  onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:56px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'  class='MktTabUnSelectVolff'  onclick='MarketGLTab2(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:60px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectValOn' style='width:52px; '> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' width='43px' style='border-bottom: solid 1px #e6e6e6;'>&nbsp;</td></tr></table>";
   }
    GetGLValVData2(document.getElementById("hdnExch").value,val)
  

}
function GetGLValVData2(Exchange,Opt)
{   var url="http://daily.bhaskar.com";
 //var url=top.document.location.href;


//alert(url);  
   document.getElementById("hdnExch").value = Exchange;
  	var requestUrl = "AjaxGLValVol.aspx?Exchange="+ Exchange+"&Option="+Opt+"&url="+url;
  	ajaxpage(1,requestUrl,'Td_GLData');
}
function GetGLValVData1(Exchange,Opt)
{   var url="http://business.divyabhaskar.co.in";
 //var url=top.document.location.href;


//alert(url);  
   document.getElementById("hdnExch").value = Exchange;
  	var requestUrl = "AjaxGLValVol.aspx?Exchange="+ Exchange+"&Option="+Opt+"&url="+url;
  	ajaxpage(1,requestUrl,'Td_GLData');
}
 
 function MarketGLTab(Exch,val)
 {

 if(val=='GAIN')
   {

    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabSelectGON'  style='width:62px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF' onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:54px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'     class='MktTabUnSelectVolff'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:58px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff'   onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='  width:50px; '> &nbsp;</td><td align='center' style='border-bottom: solid 1px #e6e6e6;' width='44px'>&nbsp;</td></tr></table>";

   }
   if(val=='LOSE')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot'  class='MktTabUnSelectGOFF'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);' style='width:64px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOn'  style='width:56px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'     class='MktTabUnSelectVolff'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:60px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff' onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);'  style='width:52px; '> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center'style='border-bottom: solid 1px #e6e6e6;' width='42px'>&nbsp;</td></tr></table>";

   }
   if(val=='VOL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabUnSelectGOFF'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);' style=' width:63px;%; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF' onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:55px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'  class='MktTabUnSelectVolOn'   style='width:59px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectVAloff' onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VAL&#39;);' style='  width:51px; '>&nbsp;</td><td align='center' width='45px' style='border-bottom: solid 1px #e6e6e6;'>&nbsp;</td></tr></table>";
    
   }
   if(val=='VAL')
   {
    document.getElementById("MktGlTab").innerHTML="<table cellpadding='0' cellspacing='0' width='100%'><tr><td align='center' id='tdHot' class='MktTabUnSelectGOFF'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;GAIN&#39;);'  style=' width:64px; '>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdMC'  class='MktTabUnSelectLoseOFF'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;LOSE&#39;);' style='width:56px;'>&nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCR'  class='MktTabUnSelectVolff'  onclick='MarketGLTab(&#39;"+document.getElementById("hdnExch").value+"&#39;,&#39;VOL&#39;);'  style='width:60px;'> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' id='tdCA'  class='MktTabUnSelectValOn' style='width:52px; '> &nbsp;</td><td style='width:4px;border-bottom: solid 1px #e6e6e6;'>&nbsp;</td><td align='center' width='43px' style='border-bottom: solid 1px #e6e6e6;'>&nbsp;</td></tr></table>";
   }
    GetGLValVData(document.getElementById("hdnExch").value,val)
  

}


function GetGLValVData(Exchange,Opt)
{   var url="http://business.bhaskar.com";
 //var url=top.document.location.href;


//alert(url);  
   document.getElementById("hdnExch").value = Exchange;
  	var requestUrl = "AjaxGLValVol.aspx?Exchange="+ Exchange+"&Option="+Opt+"&url="+url;
  	ajaxpage(1,requestUrl,'Td_GLData');
}
 function ShowHomeChart1()
    {
      document.getElementById("HighLow").style.display = "none";
      document.getElementById("tdChart").style.display = "inline";
      document.getElementById("tdAnnouncement").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOff";
      document.getElementById("tdBSE").className="BSEOn";
      document.getElementById("tdAnn").className="AnnOff";
       var so = new SWFObject("../amline/amline.swf", "BSENSEline", "261px", "141px", "0", "#ffffff");
        
		so.addVariable("path", "../amline/");
		so.addParam("wmode","opaque");
		so.addVariable("preloader_color", "#e6e6e6");
		so.addVariable("settings_file", encodeURIComponent("../DainikBhaskar/Equity_settings.xml"));
		so.addVariable("data_file", encodeURIComponent("../DainikBhaskar/BSENSEchartAjax.aspx?Exchg=BSE&TimeStamp="+new Date().getTime()));
		so.write("tdChart");	
    }  
   function ShowHomeChart()
    {
      document.getElementById("HighLow").style.display = "none";
      document.getElementById("tdChart").style.display = "inline";
      document.getElementById("tdAnnouncement").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOff";
      document.getElementById("tdBSE").className="BSEOn";
      document.getElementById("tdAnn").className="AnnOff";
       var so = new SWFObject("../amline/amline.swf", "BSENSEline", "261px", "141px", "0", "#ffffff");
        
		so.addVariable("path", "../amline/");
		so.addParam("wmode","opaque");
		so.addVariable("preloader_color", "#e6e6e6");
		so.addVariable("settings_file", encodeURIComponent("../DainikBhaskar/Equity_settings.xml"));
		so.addVariable("data_file", encodeURIComponent("../DainikBhaskar/BSENSEchartAjax.aspx?Exchg=BSE&TimeStamp="+new Date().getTime()));
		so.write("tdChart");	
    }  
    function ChangeDataHL(Exchange,Option)
    { 
    var url="http://business.bhaskar.com";
      document.getElementById("HighLow").style.display = "inline";
      document.getElementById("tdChart").style.display = "none";
      document.getElementById("tdAnnouncement").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOn";
      document.getElementById("tdBSE").className="BSEOff";
      document.getElementById("tdAnn").className="AnnOff";


     if(Option=='H')
     {
      document.getElementById("tdHigh").className="highSel";
      document.getElementById("tdlow").className="LowSel";
    }
    else
    if(Option=='L')
    {
      document.getElementById("tdlow").className="highSel";
      document.getElementById("tdHigh").className="LowSel";
    }
    
   
    		var requestUrl = "AjaxHighLowData.aspx?Exchange="+Exchange+"&Option="+Option+"&timeStamp="+new Date().getTime()+"&url="+url;
  	ajaxpage(1,requestUrl,'tdGainHL');

    }  	
     function ChangeDataHL1(Exchange,Option)
    { 
    var url="http://business.divyabhaskar.co.in";
      document.getElementById("HighLow").style.display = "inline";
      document.getElementById("tdChart").style.display = "none";
      document.getElementById("tdAnnouncement").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOn";
      document.getElementById("tdBSE").className="BSEOff";
      document.getElementById("tdAnn").className="AnnOff";


     if(Option=='H')
     {
      document.getElementById("tdHigh").className="highSel";
      document.getElementById("tdlow").className="LowSel";
    }
    else
    if(Option=='L')
    {
      document.getElementById("tdlow").className="highSel";
      document.getElementById("tdHigh").className="LowSel";
    }
    
   
    		var requestUrl = "AjaxHighLowData.aspx?Exchange="+Exchange+"&Option="+Option+"&timeStamp="+new Date().getTime()+"&url="+url;
  	ajaxpage(1,requestUrl,'tdGainHL');

    }  	
      function ChangeDataHL2(Exchange,Option)
    { 
    var url="http://daily.bhaskar.com";
      document.getElementById("HighLow").style.display = "inline";
      document.getElementById("tdChart").style.display = "none";
      document.getElementById("tdAnnouncement").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOn";
      document.getElementById("tdBSE").className="BSEOff";
      document.getElementById("tdAnn").className="AnnOff";


     if(Option=='H')
     {
      document.getElementById("tdHigh").className="highSel";
      document.getElementById("tdlow").className="LowSel";
    }
    else
    if(Option=='L')
    {
      document.getElementById("tdlow").className="highSel";
      document.getElementById("tdHigh").className="LowSel";
    }
    
   
    		var requestUrl = "AjaxHighLowData.aspx?Exchange="+Exchange+"&Option="+Option+"&timeStamp="+new Date().getTime()+"&url="+url;
  	ajaxpage(1,requestUrl,'tdGainHL');

    }  	
    function OpenAnn(Opt)
    { var url="http://business.bhaskar.com";
      document.getElementById("tdAnnouncement").style.display = "inline";
      document.getElementById("tdChart").style.display = "none";
      document.getElementById("HighLow").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOff";
      document.getElementById("tdBSE").className="BSEOff";
      document.getElementById("tdAnn").className="AnnOn";

    		var requestUrl = "Ajaxannouncement.aspx?Exchange="+Opt+"&timeStamp="+new Date().getTime()+"&url="+url;
  	ajaxpage(1,requestUrl,'tdAnnouncement');

    }
      function OpenAnn1(Opt)
    { var url="http://business.divyabhaskar.co.in";
      document.getElementById("tdAnnouncement").style.display = "inline";
      document.getElementById("tdChart").style.display = "none";
      document.getElementById("HighLow").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOff";
      document.getElementById("tdBSE").className="BSEOff";
      document.getElementById("tdAnn").className="AnnOn";

    		var requestUrl = "Ajaxannouncement.aspx?Exchange="+Opt+"&timeStamp="+new Date().getTime()+"&url="+url;
  	ajaxpage(1,requestUrl,'tdAnnouncement');

    }
      function OpenAnn2(Opt)
    { var url="http://daily.bhaskar.com";
      document.getElementById("tdAnnouncement").style.display = "inline";
      document.getElementById("tdChart").style.display = "none";
      document.getElementById("HighLow").style.display = "none";
      document.getElementById("tdHighlow").className="HiglowOff";
      document.getElementById("tdBSE").className="BSEOff";
      document.getElementById("tdAnn").className="AnnOn";

    		var requestUrl = "Ajaxannouncement.aspx?Exchange="+Opt+"&timeStamp="+new Date().getTime()+"&url="+url;
  	ajaxpage(1,requestUrl,'tdAnnouncement');

    }
    
    function MatrixRefresh()
{
    BuisnessMatrix('BSE','GAIN','1'); 
   
}

function BuisnessMatrix(Exchange,Option, PNO)
{
    		var requestUrl = "AjaxbuisnessMatrix.aspx?Exchange="+Exchange+"&Option="+Option+"&timeStamp="+new Date().getTime();
  	ajaxpage(1,requestUrl,'tdBuissMatrix');

}
		
function Showdetails2(rowid,FinCode,Exchg,Cnt)
{
    var GridId,GridPlusID,GridMinusID;
    for(i=20; i<=Cnt-1; i++)
    {
        GridId="Griddetails" + i;
        GridPlusID="Grid2Plus"+ i;
        GridMinusID="Grid2Minus"+ i;
        if (i==rowid)
        {
            document.getElementById(GridId).style.display = "inline";   
            document.getElementById(GridPlusID).style.display = "none";  
            document.getElementById(GridMinusID).style.display = "inline";  
        }
        else
        {
            document.getElementById(GridId).style.display = "none";   
            document.getElementById(GridPlusID).style.display = "inline";  
            document.getElementById(GridMinusID).style.display = "none";  
        }
    }
    var tdet="Griddetails"+rowid;
    GridDetailsWindow(tdet,FinCode,Exchg,rowid);
}
function Showdetails1(rowid,FinCode,Exchg,Cnt)
{
    var GridId,GridPlusID,GridMinusID;
    for(i=10; i<=Cnt-1; i++)
    {
        GridId="Griddetails" + i;
        GridPlusID="Grid1Plus"+ i;
        GridMinusID="Grid1Minus"+ i;
           var temp ="divid" + i;
        if (i==rowid)
        { 
            document.getElementById(GridId).style.display = "inline";   
            document.getElementById(GridPlusID).style.display = "none";  
            document.getElementById(GridMinusID).style.display = "inline"; 
            document.getElementById(temp).style.display = "inline";
 
        }
        else
        {
            document.getElementById(GridId).style.display = "none";   
            document.getElementById(GridPlusID).style.display = "inline";  
            document.getElementById(GridMinusID).style.display = "none";  
            document.getElementById(temp).style.display = "none";

        }
    }
     //document.getElementById('divid').style.height = "113px"; 
   
      var tdet="Griddetails"+rowid;
     
    GridDetailsWindow(tdet,FinCode,Exchg,rowid);
}
	function hide(rowid)
	{  GridPlusID="Grid1Plus1"+ rowid;
	 GridMinusID="Grid1Minus1"+ rowid;
	    var temp ="divid1" + rowid;
	     document.getElementById(GridPlusID).style.display = "inline";  
    document.getElementById(temp).style.display = "none";
     document.getElementById(GridMinusID).style.display = "none";  
	}	
function Showdetails2(rowid,FinCode,Exchg,Cnt)
{
    var GridId,GridPlusID,GridMinusID;
    for(i=20; i<=Cnt-1; i++)
    {
        GridId="Griddetails" + i;
        GridPlusID="Grid2Plus"+ i;
        GridMinusID="Grid2Minus"+ i;
        if (i==rowid)
        {
            document.getElementById(GridId).style.display = "inline";   
            document.getElementById(GridPlusID).style.display = "none";  
            document.getElementById(GridMinusID).style.display = "inline";  
        }
        else
        {
            document.getElementById(GridId).style.display = "none";   
            document.getElementById(GridPlusID).style.display = "inline";  
            document.getElementById(GridMinusID).style.display = "none";  
        }
    }
    var tdet="Griddetails"+rowid;
    GridDetailsWindow(tdet,FinCode,Exchg,rowid);
}
function GridDetailsWindow(TdDetails,FinCode,Exchg,rowid)
{
    CreateXmlHttpGridDetails();
    var currentDivObj = document.getElementById(TdDetails);
    currentDivObj.innerHTML ="Processing...";
    document.body.style.cursor = "progress";
    
    var requestUrl = "ProfitMatrixGridDetails.aspx?FinCode="+FinCode+"&Exchg="+Exchg+"&rowid="+rowid;
    
    if(XmlHttpGridDetails!=null)	
	{
	    XmlHttpGridDetails.onreadystatechange = function(){ChangeResponseGridDetails(TdDetails,FinCode,Exchg,rowid)}
		XmlHttpGridDetails.open('GET', requestUrl,  true);
		XmlHttpGridDetails.send(null);
	}
    return false;
}
var XmlHttpGridDetails;

function CreateXmlHttpGridDetails()
{
    try
	{
		XmlHttpGridDetails = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttpGridDetails = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttpGridDetails = null;
		}
	}
	if(!XmlHttpGridDetails && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttpGridDetails = new XMLHttpRequest();
	}
}
function ChangeResponseGridDetails(TdDetails,FinCode,Exchg,rowid)
{
	if(XmlHttpGridDetails.readyState == 4)
	{
	    var td_Id = document.getElementById(TdDetails);
		if(XmlHttpGridDetails.status == 200)//
		{
		td_Id.innerHTML =  XmlHttpGridDetails.responseText;
			document.body.style.cursor = "auto";
			ShowChart_Profit_Inner(FinCode,Exchg);
					
		}
		else
		{
		    td_Id.innerHTML =  "There was a problem retrieving data from the server.";
			document.body.style.cursor = "auto";
		}
	}
}	
function ShowChart_Profit_Inner(FinCode,Exchg)
{
 // <![CDATA[		
		var so = new SWFObject("../amline/amline.swf", "SnapChart_settings", "385", "119", "1", "#ffffff");
		so.addVariable("path", "../amline/");
		so.addParam("wmode","opaque");
		so.addVariable("settings_file", encodeURIComponent("../DainikBhaskar/ProfitExcgChart.xml"));
		so.addVariable("data_file", encodeURIComponent("../DainikBhaskar/ProfitExcgChart.aspx?timenow=" + new Date().getTime() + "&FinCode="+FinCode +"&period=1Y&Exchg="+Exchg));
		so.write("flashcontentPro"+FinCode);
		// ]]>
}
function Hidedetails(Str)
{
    var GridId,GridPlusID,GridMinusID,DivID;
    GridId="Griddetails" + Str;
    GridPlusID="Grid1Plus"+ Str;
    GridMinusID="Grid1Minus"+ Str;
    document.getElementById(GridId).style.display="none";
    document.getElementById(GridPlusID).style.display="inline";
    document.getElementById(GridMinusID).style.display="none";
}
function OpenNews(Srno,PgNo)
{

        document.getElementById("divAnn").style.display = "inline";

    var requestUrl = "AnnouncmentDetails.aspx?Srno="+Srno+"&PgNo"+PgNo+"&timeStamp="+new Date().getTime();
   ajaxpage(1,requestUrl,'tdNews');  
}
function ShowIndexCtrl_Comm()
{
    document.body.style.cursor = "progress";
    
    var currentDivObj = document.getElementById("IndexControlData_Comm");
    var requestUrl = "AjaxIndexControl_Comm.aspx?timeStamp="+new Date().getTime();

     	ajaxpage(1,requestUrl,'tdIndexCtrl');

}
function ShowdetailsFull(rowid,FinCode,Exchg,Cnt)
{
    var GridId,GridPlusID,GridMinusID;


for(i=30; i<=Cnt; i++)
{ 
GridId="Griddetails" + i;
GridPlusID="Grid1Plus"+ i;
GridMinusID="Grid1Minus"+ i;
    if (i==rowid)
    {
    document.getElementById(GridId).style.display = "inline";   
    document.getElementById(GridPlusID).style.display = "none";  
    document.getElementById(GridMinusID).style.display = "inline";  
    }
  else
    {
        document.getElementById(GridId).style.display = "none";   
        document.getElementById(GridPlusID).style.display = "inline";  
        document.getElementById(GridMinusID).style.display = "none";  
    }
}
    
    
    var tdet="Griddetails"+rowid;
    GridDetailsWindow(tdet,FinCode,Exchg,rowid);
}
//Inner Pages
   function CommonTab(EXCHG,VAL)
   {
         if(VAL=='GAIN')
         {
         
         document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' class='currentTab'><a href='#'><b><c>&nbsp;&nbsp;Gainers&nbsp;&nbsp;</c></b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE'><a href='javascript:javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;LOSE&#39;)'><b>&nbsp;&nbsp;Losers&nbsp;&nbsp; </b></a></li></ul>"
         }
       else if(VAL=='LOSE')
        {
        document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' ><a href='javascript:javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;GAIN&#39;)'><b>&nbsp;&nbsp;Gainers&nbsp;&nbsp;</b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Losers&nbsp;&nbsp; </b></a></li></ul>"
        } 
     
      if(VAL=='HIGH'){document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Highs&nbsp;&nbsp;</b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;LOW&#39;)'><b>&nbsp;&nbsp;Lows&nbsp;&nbsp; </b></a></li></ul>"}
       else if(VAL=='LOW') {document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' ><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;HIGH&#39;)'><b>&nbsp;&nbsp;Highs&nbsp;&nbsp;</b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Lows&nbsp;&nbsp; </b></a></li></ul>"} 
       if(VAL=='B'){document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Only Buyers&nbsp;&nbsp;</b></a></li><li id='ulNSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;S&#39;)'><b>&nbsp;&nbsp;Only Sellers&nbsp;&nbsp; </b></a></li></ul>"}
       else if(VAL=='S') {document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;B&#39;)'><b>&nbsp;&nbsp;Only Buyers&nbsp;&nbsp;</b></a></li><li id='ulNSE'  class='currentTab'><a href='#'><b>&nbsp;&nbsp;Only Sellers&nbsp;&nbsp; </b></a></li></ul>"} 
      if(VAL=='O'){document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Out Performers&nbsp;&nbsp;</b></a></li><li id='ulNSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;U&#39;)'><b>&nbsp;&nbsp;Under Performers&nbsp;&nbsp; </b></a></li></ul>"}
       else if(VAL=='Un') {document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;O&#39;)'><b>&nbsp;&nbsp;Out Performers&nbsp;&nbsp;</b></a></li><li id='ulNSE'  class='currentTab'><a href='#'><b>&nbsp;&nbsp;Under Performers&nbsp;&nbsp; </b></a></li></ul>"} 
      if(VAL=='U'){document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;5 Days Up&nbsp;&nbsp;</b></a></li><li id='ulNSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;D&#39;)'><b>&nbsp;&nbsp;5 Days Down&nbsp;&nbsp; </b></a></li></ul>"}
        else if(VAL=='D') {document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' ><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;U&#39;)'><b>&nbsp;&nbsp;5 Days Up&nbsp;&nbsp;</b></a></li><li id='ulNSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;5 Days Down&nbsp;&nbsp; </b></a></li></ul>"} 
       if(VAL=='Value'){document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Value&nbsp;&nbsp;</b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;Volume&#39;)'><b>&nbsp;&nbsp;Volume&nbsp;&nbsp; </b></a></li></ul>"}
        else if(VAL=='Volume') {document.getElementById("CommTab").innerHTML=" <ul class='TabMenu'><li id='ulBSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;Value&#39;)'><b>&nbsp;&nbsp;Value&nbsp;&nbsp;</b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Volume&nbsp;&nbsp; </b></a></li></ul>"} 
         if(VAL=='High'){document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Highest Delivery&nbsp;&nbsp;</b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE'><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;Low&#39;)'><b>&nbsp;&nbsp;Lowest Delivery&nbsp;&nbsp; </b></a></li></ul>"}
        else if(VAL=='Low') {document.getElementById("CommTab").innerHTML="<ul class='TabMenu'><li id='ulBSE' ><a href='javascript:ShowDataMaintainStatus(&#39;"+EXCHG+"&#39;,&#39;High&#39;)'><b>&nbsp;&nbsp;Highest Delivery&nbsp;&nbsp;</b></a></li><li>&nbsp;&nbsp;&nbsp;</li><li id='ulNSE' class='currentTab'><a href='#'><b>&nbsp;&nbsp;Lowest Delivery&nbsp;&nbsp; </b></a></li></ul>"} 
 
    }
    function showDefaultSel(Exchange,Option)
	{
	 
	  
	
	// alert(Exchange);	 alert(Option);
	    var s="";
        var hasQueryString = document.URL.indexOf('_ID'); 
		var strURL = window.parent.location.href;
		s = document.URL.substring(hasQueryString+3, document.URL.length).split('/');
	   
//		if(strURL.indexOf("Option=LOSE") != -1)
//			Option = "LOSE"
//		else
//			Option = "GAIN"
//			


//alert(s[1]);
	  if(s[1]=="2" && s[2]=="U")
	  {
	  	Option='Un';
	    
	  } 
	  else if(s[1]=="3" && s[2]=="1")
	  {
	  Option = Option;
	  }
	  else if(Exchange == "Service")
	  {
	  Option = Option;
	  }
	  else
	  {
	    /// Option=s[2];
	    Option = Option;
	  }
	
	
	 CommonTab(Exchange,Option);
	 
		
		
     }
   function openNewsDetailsCom(url)
 {
         document.getElementById("divNews").style.display = "inline";
      ajaxpage(1,url,'TdNews');  
 }
 
 //Creating object of XMLHTTP For AJAX Method
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();
		}
	}
	

function SchResult()
 {
	 var txtSchName = document.getElementById("txtSchName");
	 var txtSchName = document.getElementById("txtSchName");
	 if(txtSchName.value=="Enter Company Name")
	{ 
	alert("Please Enter some text");
	txtSchName.value="";
	txtSchName.focus();
	} 
	else
		{
 		var SearchResult = document.getElementById("lbSchResult");	
 		document.getElementById("serchresult").style.display="inline";		
 		document.getElementById("Go").disabled=false;
		CreateXmlHttpNew();
		document.body.style.cursor = "progress";
		var requestUrl = "GetSchDataAjax.aspx?timeStamp="+ new Date().getTime() +"&txtSchName="+txtSchName.value;
	
		if(XmlHttpFO)	{
					XmlHttpFO.onreadystatechange = function(){fillSymbolResp(SearchResult)};
					XmlHttpFO.open("GET", requestUrl,  true);
					XmlHttpFO.send(null);
				}
				}
		
 }
 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 = "No Data Found";			
			}
			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 Redirect()
{
    var search=document.getElementById("lbSchResult").value;
   var search1=document.getElementById("lbSchResult");
        if(search=="")
        {
            alert('Select Company Name');
            
            search1.focus();
           
        }
        else
        {
            var requestUrl;
            var ID;
            var str;
          var Mode;
            ID = document.getElementById("QuoteFinder").value;
          
            if(Mode=="2")
                str=""
            else
                str="&Mode=S";
                   
            switch (ID)
            { 
                
                case "71":
                    requestUrl = "SmartQuotes.aspx?timeStamp="+ new Date().getTime() +"&FinCode="+search +str+"&id=71";        
                break;
              
                default:
                    requestUrl = "SmartQuotes.aspx?timeStamp="+ new Date().getTime() +"&FinCode="+search+str+"&id=71";        
             }
            
            window.location = requestUrl;
      
         
  
        }	
}
function Profilechart(GraphType,val,fincode,DateOpt,DateCnt)
{
//alert(GraphType);
            if(DateOpt=='D')
            {
            document.getElementById("1days").className="OptionSelected";          
            document.getElementById("1Week").className="OptionUnSelected";
            document.getElementById("1Mon").className="OptionUnSelected";
            document.getElementById("1Year").className="OptionUnSelected";
            }
             if(DateOpt=='W')
            {
            document.getElementById("1days").className="OptionUnSelected";          
            document.getElementById("1Week").className="OptionSelected";
            document.getElementById("1Mon").className="OptionUnSelected";
            document.getElementById("1Year").className="OptionUnSelected";
            }
             if(DateOpt=='M')
            {
            document.getElementById("1days").className="OptionUnSelected";          
            document.getElementById("1Week").className="OptionUnSelected";
            document.getElementById("1Mon").className="OptionSelected";
            document.getElementById("1Year").className="OptionUnSelected";
            }
             if(DateOpt=='Y')
            {
            document.getElementById("1days").className="OptionUnSelected";          
            document.getElementById("1Week").className="OptionUnSelected";
            document.getElementById("1Mon").className="OptionUnSelected";
            document.getElementById("1Year").className="OptionSelected";
            }
          document.getElementById("AdvanceChart1_hdnExchange").value=val;  
        document.getElementById("AdvanceChart1_hdnGraphType").value=GraphType;
        document.getElementById("AdvanceChart1_hdnDateOpt").value=DateOpt;
        var so = new SWFObject("../amline/amline.swf", "BSENSEline", "500", "180", "0", "#FFFFFF");
		so.addVariable("path", "../amline/");
		so.addParam("wmode","opaque");
		so.addVariable("preloader_color", "#999999");
		so.addVariable("settings_file", encodeURIComponent("../DainikBhaskar/Equity_settings.xml"));	
        so.addVariable("data_file", encodeURIComponent("../DainikBhaskar/MarketChartAjax.aspx?GraphType="+GraphType+"&DateOpt="+DateOpt+"&Exchg="+val+"&DateCnt="+DateCnt+"&fincode="+fincode+"&TimeStamp="+new Date().getTime()));
		so.write("flashcontent");
		
}
function Remove()
{
var TextSearch = document.getElementById("txtCompany").value;

        if(TextSearch == "Enter Company Name")
        {

            document.getElementById("txtCompany").value="";
        }
}
function Fill()
{
     var str=document.getElementById("txtCompany");
     strVal=str.value;
            if(strVal.substring(0,1)== " ")
	        {
	            alert("First charecter cannot be blank");
	            str.focus();
	            return false;
	        }
	        else
	        {
	            if(document.getElementById("txtCompany").value=="")
                {
                   document.getElementById("txtCompany").value="Enter Company Name";
                }
	        }

}
