var NowDay=new Date();
var DateUrl="";
var ImgUrl=ImgUrlOld;
var TempDate=Date.parse(NowDay.toDateString());
function Submit1_onclick() {

            ImgUrl=ImgUrlOld;
            var freq = "";
            var tech1 = "";
            var size = "1";
            var timeframe = "";
            var voldistrib = "";
            var linetype = "";
            var style = "";
            
            if (document.all["freq"] != null)
            {
                freq = document.all["freq"].value;
                ImgUrl += "&freq=" + freq;
            }
            else
            {
                freq = "1";
                ImgUrl += "&freq=" + freq;
            }

            if (document.all["tech1"] != null)
            {
                tech1 = document.all["tech1"].value;
                ImgUrl += "&tech1=" + tech1;
            }
            else
            {
                tech1 = "1";
                ImgUrl += "&tech1=" + tech1;
            }

            if (document.all["timeframe"] != null)
            {
                timeframe = document.all["timeframe"].value;
                ImgUrl += "&timeframe=" + timeframe;
            }

            if (document.all["voldistrib"] != null)
            {
                voldistrib = document.all["voldistrib"];
                if(voldistrib.checked)
                {
                    ImgUrl += "&voldistrib=" + voldistrib.value;
                }
            }

            if (document.all["linetype"] != null)
            {
             var   a   =   document.getElementsByName("linetype");   
                  for(i=0;i<a.length;i++)   
                  {   
                      if(a[i].checked)   
                      ImgUrl += "&linetype=" + a[i].value;   
                  }   
            }

            if (document.all["style"] != null)
            {
                var   a   =   document.getElementsByName("style");   
                  for(i=0;i<a.length;i++)   
                  {   
                      if(a[i].checked)   
                      ImgUrl += "&style=" + a[i].value;   
                  } 
            }            

            document.all["quoteImg"].src=ImgUrl+DateUrl;
            return false;
}


function Button1_onclick() {
            
            var sCode="";
             var a = document.getElementsByName("DBType");   
                  for(i=0;i<a.length;i++)   
                  {   
                      if(a[i].checked)   
                      sCode= a[i].value;   
                  } 
                  
                  window.open("external_compquote.aspx?code="+sCode+","+document.all["OldStockCode"].value);
}
function WebChange(id,freq)
{       ImgUrl=ImgUrlOld;
        var name="WebChartSelect";
		if(document.getElementById(name+id)!=null){
			document.getElementById(name + id).style.display="";
			}
	for(i=1;i<=8;i=i+1) {
	if(i!=id){
		if(document.getElementById(name+i)!=null){
			 document.getElementById(name + i).style.display="none";
			    }
		    }	
		    }
            var tech1 = "";
            var size = "1";
            var timeframe = "";
            var voldistrib = "";
            var linetype = "";
            var style = "";
            

            if (document.all["tech1"] != null)
            {
                tech1 = document.all["tech1"].value;
                ImgUrl += "&tech1=" + tech1;
            }
            else
            {
                tech1 = "1";
                ImgUrl += "&tech1=" + tech1;
            }

            if (document.all["timeframe"] != null)
            {
                timeframe = document.all["timeframe"].value;
                ImgUrl += "&timeframe=" + timeframe;
            }

            if (document.all["voldistrib"] != null)
            {
                voldistrib = document.all["voldistrib"];
                if(voldistrib.checked)
                {
                    ImgUrl += "&voldistrib=" + voldistrib.value;
                }
            }

            if (document.all["linetype"] != null)
            {
             var   a   =   document.getElementsByName("linetype");   
                  for(i=0;i<a.length;i++)   
                  {   
                      if(a[i].checked)   
                      ImgUrl += "&linetype=" + a[i].value;   
                  }   
            }

            if (document.all["style"] != null)
            {
                var   a   =   document.getElementsByName("style");   
                  for(i=0;i<a.length;i++)   
                  {   
                      if(a[i].checked)   
                      ImgUrl += "&style=" + a[i].value;   
                  } 
            }
            ImgUrl += "&freq=" + freq;
            document.all["quoteImg"].src=ImgUrl+DateUrl;
            return false;			
}

function PreDay()
{
    
    NowDay.setDate(NowDay.getDate()-1)
    if(TempDate>NowDay)
    {
        document.all["NextDay"].style.display="inline";
    }
    else
    {
    document.all["NextDay"].style.display="none";
    }
    DateUrl="&EndDate=" + NowDay.getYear()+"-"+(NowDay.getMonth()+1)+"-"+NowDay.getDate();
    document.all["quoteImg"].src=ImgUrl +DateUrl; 
    return false;
}
function NextDay()
{
     NowDay.setDate(NowDay.getDate()+1)
    if(TempDate>NowDay)
    {
        document.all["NextDay"].style.display="inline";
    }
    else
    {
    document.all["NextDay"].style.display="none";
    }
    DateUrl="&EndDate=" + NowDay.getYear()+"-"+(NowDay.getMonth()+1)+"-"+NowDay.getDate();
    document.all["quoteImg"].src=ImgUrl +DateUrl; 
    return false;
}