function HideFutureCastControls()
{
HideThis("FutureCastPlayerControls")
HideFutureCastLegend();
HideFutureCastProgressBar();

if ((hostTypeBase == "5")||(hostTypeBase == "1"))
{HideThis("opacityBarBG");}

}

function ShowFutureCastControls()
{
ShowThis("FutureCastPlayerControls");

if ((hostTypeBase == "5")||(hostTypeBase == "1"))
{ShowThis("opacityBarBG");}

}

function FutureCastReset()
{
    ShowThis("FutureCastPlay");
    HideThis("FutureCastPause");   
   
}

function FutureCastControl(action)
{
    
    HideFutureCastProgressBar();

    map.FutureCastController(action);

    switch (action)
    {
    case "play":
        ShowThis("FutureCastPause");
        HideThis("FutureCastPlay");
        break;
    default:
        ShowThis("FutureCastPlay");
        HideThis("FutureCastPause");
        break;
    }    

}

function FutureCastMouseover(img)
{
    switch (img.id)
    {
    case "imgFutureCastBack":
        SetImageSrc(img.id,"FutureCastPlayer/control_rewind_hover.png" );
        break;
    case "imgFutureCastStop":
        SetImageSrc(img.id,"FutureCastPlayer/control_stop_hover.png" );
        break;
    case "imgFutureCastPlay":
        SetImageSrc(img.id,"FutureCastPlayer/control_play_hover.png" );
        break;
    case "imgFutureCastPause":
        SetImageSrc(img.id,"FutureCastPlayer/control_pause_hover.png" );
        break;
    case "imgFutureCastForward":
        SetImageSrc(img.id,"FutureCastPlayer/control_forward_hover.png" );
        break;
    }

}

function FutureCastMouseout(img)
{
    switch (img.id)
    {
    case "imgFutureCastBack":
        SetImageSrc(img.id,"FutureCastPlayer/control_rewind.png" );
        break;
    case "imgFutureCastStop":
        SetImageSrc(img.id,"FutureCastPlayer/control_stop.png" );
        break;
    case "imgFutureCastPlay":
        SetImageSrc(img.id,"FutureCastPlayer/control_play.png" );
        break;
    case "imgFutureCastPause":
        SetImageSrc(img.id,"FutureCastPlayer/control_pause.png" );
        break;
    case "imgFutureCastForward":
        SetImageSrc(img.id,"FutureCastPlayer/control_forward.png" );
        break;
    }

}

function HideFutureCastProgressBar()
{
HideThis("FutureCastLoadingProgress");
HideThis("FutureCastProgressBar");
HideThis("FutureCastProgressBarLargeShell");
}

function ShowFutureCastProgressBar()
{
ShowThis("FutureCastProgressBar");
ShowThis("FutureCastLoadingProgress");
ShowThis("FutureCastProgressBarShell");
ShowThis("FutureCastProgressBarLargeShell");
}

function FutureCastLoading(percent)
{
    if (percent >= 100) {HideFutureCastProgressBar(); return;}   

    //small progress bar
    var progressbar = GetElement("FutureCastProgressBar");

    var maxWidth = ((hostTypeBase == "5") ? 100 : 79); 

    progressbar.style.width = (percent * (maxWidth * .01)) + "px";

    //large progress bar
    progressbar = GetElement("FutureCastProgressBarLarge");
    maxWidth = 292; 
    progressbar.style.width = (percent * (maxWidth * .01)) + "px";

    ShowFutureCastProgressBar();

}

function FutureCastCreateOpacitySlider()
{

    var A_TPL = {
                'b_vertical' : false,
                'b_watch': true,
                'n_controlWidth': tpSlider_n_controlWidth,
                'n_controlHeight': tpSlider_n_controlHeight,
                'n_sliderWidth': tpSlider_n_sliderWidth,
                'n_sliderHeight': tpSlider_n_sliderHeight,
                'n_pathLeft' : tpSlider_n_pathLeft,
                'n_pathTop' : tpSlider_n_pathTop,
                'n_pathLength' : tpSlider_n_pathLength,
                's_imgControl': null,
                's_imgSlider': imageDir + '/opacity_slider.gif',
                'n_zIndex': 1
                }
    var A_INIT = {
                's_form' : 0,
                's_name': 'futureCastOpacity',
                'n_minValue' : 0,
                'n_maxValue' : 100,
                'n_value' : 39,
                'n_step' : 1
                }
           
    new slider(A_INIT, A_TPL, FutureCastOpacity_Changed);

}
function FutureCastOpacity_Changed(value)
{

    document.getElementById('FutureCastOpacitySliderLabel').innerHTML =  value + "%";
    
    if (pageLoaded)
    {

        map.SetFutureCastAlpha(Math.abs(value - 100));

    }
    
}

function ShowFutureCastLegend(type)
{
var img = GetElement("imgFutureCastLegend");

var width = (((hostTypeBase == "5")||(hostTypeBase == "1")) ? 642 : 474);

img.src = futurecastServiceUrl + "&file=palette&type=" + type + "&width=" + width + "&height=13";
ShowThis("FutureCastLegend");
}

function HideFutureCastLegend()
{
HideThis("FutureCastLegend");
}
