﻿/* UserPages/StaticPages/Public/Video.aspx */

    $(document).ready(function(){
        // TABS ON THE RIGHT SIDE
        // ----------------------------------------------
        // advertiser
        $("#tab_advertiser .advertiser").click(function(){
            $("#tab_shipper").css('display', 'none');
            $("#tab_advertiser").css('display', 'block');
            $("#advertiser").show();
            $("#shipper").hide();
        });
        $("#tab_shipper .advertiser").click(function(){
            $("#tab_shipper").css('display', 'none');
            $("#tab_advertiser").css('display', 'block');
            $("#advertiser").show();
            $("#shipper").hide();
        });
        
        // shipper
        $("#tab_advertiser .shipper").click(function(){
            $("#tab_shipper").css('display', 'block');
            $("#tab_advertiser").css('display', 'none');
            $("#shipper").show();
            $("#advertiser").hide();
        });
        $("#tab_shipper .shipper").click(function(){
            $("#tab_shipper").css('display', 'block');
            $("#tab_advertiser").css('display', 'none');
            $("#shipper").hide();
            $("#advertiser").hide();
        });
        // END TABS
        // ----------------------------------------------
        
        // SLIDING TABS INSIDE RIGHT SIDEBAR
        // ----------------------------------------------
        $(".tab").each(function(){
            $(this).click(function(){
                var display = $(this).next().css('display');
                
                if (display == 'block')
                    $(this).next().slideUp();
                
                if (display == 'none')
                    $(this).next().slideDown();
            });
        });
        // END INSIDE TABS
        // ----------------------------------------------
    });


    // FLASH PLAYER
    // ----------------------------------------------
    function switch_to(type)
    {
        switch (type)
        {
            case "shipper":
                $("#tab_shipper").css('display', 'block');
                $("#tab_advertiser").css('display', 'none');
                $("#advertiser").hide();
                $("#shipper").show();
            break;
            case "advertiser":
                $("#tab_shipper").css('display', 'none');
                $("#tab_advertiser").css('display', 'block');
                $("#advertiser").show();
                $("#shipper").hide();
            break;
        }
    }
    
    function thisMovie(movieName) 
    {
	    var isIE = navigator.appName.indexOf("Microsoft") != -1;
	    //return (isIE) ? window[movieName] : document[movieName];
	    return document[movieName];
    }     

    vid = {
        link: null
    }

    $(document).ready(function(){
        var url = String(document.location).split('#');
        
        if (url[1] != '')
            vid.link = url[1];
    });

    // load first movie
    function loadFirstFlv()
    { 
        if (vid.link == null) 
            vid.link = 'Inventory/NewProduct.flv';
        loadFlv('../../Media/VideoTutorials/'+vid.link, "Adding New Products", "play"); 
    }

    // load movie
    function loadFlv(file, title, startState)
    {
	    thisMovie("flvPlayer").setFLV(file, title, startState);
    }

    // voided when movie complete
    function setFlvComplete() {	    
    }
    // END FLASH PLAYER
    // ----------------------------------------------