﻿function OpenHelp(url)
{
	var winWidth = 650;
	var winHeight = 440;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;

    var ticker = document.getElementById('ctl00_ContentPlaceHolder2_Company_Ticker');
    var symbol = "";

    if(ticker == null)
    {
        ticker = document.getElementById("_tickerName");
        
        if(ticker == null)
        {
            ticker = document.getElementById("_studyTicker");
        }

        if(ticker == null)
        {
            ticker = document.getElementById("ctl00_ContentPlaceHolder2_ctl00__tickerSymbol");
            if(ticker != null)
            {
                symbol = ticker.value;
            }
        }
        else
        {
            if(ticker != null)
            {
                symbol = ticker.innerText;
            }
        }
    }
    else
    {
        symbol = ticker.innerText;
        
        if(symbol == null)
        {
            symbol = ticker.firstChild.data;
        }
        
        if(symbol == null)
        {
            symbol = ticker.value;
        }
    }

    if(symbol != null)
    {
        var str = new String(url);
            
        url = str.replace("<CompanyTicker>", symbol);
        url = url.replace("<CompanyTicker>", symbol);
    }

	var help = window.open(url,'Help','left=' + winLeft + ',top=' + winTop + ',width=' + winWidth + ',height=' + winHeight + ',location=yes, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no '); 
		
    help.focus();
}
function OpenSite(url)
{
	var winWidth = 650;
	var winHeight = 440;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
   
	var help = window.open(url,'Help','left=' + winLeft + ',top=' + winTop + ',width=' + winWidth + ',height=' + winHeight + ',location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no '); 
		
    help.focus();
}
function OpenCompanyWebSite()
{
	var winWidth = 650;
	var winHeight = 440;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
   
    var url = "http://" + document.getElementById('ctl00_ContentPlaceHolder2_Company_WebURL').value;
   
    if(url != "http://")
    {
	    var companySite = window.open(url,'Help','left=' + winLeft + ',top=' + winTop + ',width=' + winWidth + ',height=' + winHeight + ',location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no '); 
		
        companySite.focus();
    }
}
function OpenTickerWebSite()
{
	var winWidth = 650;
	var winHeight = 440;
	var winLeft = (screen.width-winWidth)/2;
	var winTop = (screen.height-winHeight)/2;
    var url;
    
    if(document.getElementById('_companyURL') != null)
    {
        url = "http://" + document.getElementById('_companyURL').value;
    }
    else if(document.getElementById('_companyWebsite') != null)
    {
        url = "http://" + document.getElementById('_companyWebsite').innerHTML;
    }
   
    if(url != "http://")
    {
	    var companySite = window.open(url,'Help','left=' + winLeft + ',top=' + winTop + ',width=' + winWidth + ',height=' + winHeight + ',location=no, menubar=no, resizable=yes,scrollbars=yes, titlebar=no, toolbar=no '); 
		
        companySite.focus();
    }
}
function OpenFull(url)
{
	var full = window.open(url);
		
    full.focus();
}
function SetAction(action)
{
    document.getElementById("_webForm").action = action;
    
    theForm.submit();
}
function OpenHelpSystem()
{
	var helpSystem = window.open("help/index.html");
		
    helpSystem.focus();
}