﻿function companyGraphRedirect(id){

    if (id != ""){
        
        var index1 = -1;
        var index2 = -1;
        
        var link = document.getElementById(id).value;
    
        if (link != ""){
        
            var indexId = ""; 
            var tickerList = document.getElementById("txtTicker");
        
            if (id == "ddlIndexList"){
            
                var indexList = document.getElementById(id);
                
                if (indexList != null && indexList.tagName == "SELECT"){
                
                    if (indexList.selectedIndex > 0){
                    
                        indexId = indexList.options[indexList.selectedIndex].id;
                    }
                    
                    if (tickerList != null && indexId != ""){
                    
                        if (tickerList.value != ""){
                        
                            tickerList.value = tickerList.value + "," + indexId;//alert(indexList);
                        }
                        else{
                        
                            if (indexList != ""){
                            
                                tickerList.value = indexId;
                            }
                        }
                    }
                }
            }
        
            if (tickerList != ""){
            
                link = link + "&TickerList=" + tickerList.value;
            }
            
            window.location = link;
        }
    }
}

function graphRedirect(id){

    if (id != ""){
    
        var link = document.getElementById(id).value;
        
        if (link != ""){
        
            window.location = link;
        }
    }
}
