﻿// ######## movie file, must be a .flv -TMAX

var varMovie = "test.flv";

// ######## end movie file -TMAX

function deletePlayer(theWrapper, thePlaceholder, thePlayerId) 
    { 
        swfobject.removeSWF(thePlayerId);
        var tmp=document.getElementById(theWrapper);
        if (tmp) { tmp.innerHTML = "<div id=" + thePlaceholder + "></div>"; }
        
    }


    function createPlayer(theWrapper, thePlaceholder, thePlayerId, theFile) 
    { 
        
        if (swfobject.hasFlashPlayerVersion("9")) {

        
            //deletePlayer(theWrapper, thePlaceholder, thePlayerId);

            var flashvars = {
            flvURL:theFile,
            ControlPanelColor:0xffffff,
            buttonColor:0x000000,
            ControlPanelPosition:0,
            showControlPanel:2,
            ShowtimeColor:0xffffff,
            bAutoPlay:0,
            bAutoRepeat:0,
            BufferTime:5,
            tmeColor:0xffffff,
            loaColor:0x666666,
            GroundColor:0x000000,
            conNum:1,
            bShowtime:1,
            startvolume:100

            }

            var params = {
            allowfullscreen:"true", 
            allowscriptaccess:"always",
            movie:"player.swf" 
            }

            var attributes = {
            id:thePlayerId, 
            name:thePlayerId
            }

            swfobject.embedSWF("player.swf", thePlaceholder, "420", "325", "9", true, flashvars, params, attributes);
        }
        else
        {
            var tmp=document.getElementById(theWrapper);
            if (tmp) { tmp.innerHTML = "<div id=" + thePlaceholder + "><span class='home_abouttxt'>To view the tour, please install/upgrade to<br>flash player version 9 or higher.</span><br><br><a href='http://get.adobe.com/flashplayer/' target='_blank'><img src='images/flash.png' border='0' alt='Get Latest Flash Player!'></a></div>"; }
        }
    }
    
     function ShowMyModalPopup(vidId) 
    { 
        createPlayer('wrapper', 'placeholder', 'gmplayer', vidId);

        var modal = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender2'); 
        modal.show(); 
    }
    
     function HideModalPopup() 
    { 

        deletePlayer('wrapper', 'placeholder', 'gmplayer');
        //createPlayer('wrapper', 'placeholder', 'gmplayer', 'close.flv');
        var modal = $find('ctl00_ContentPlaceHolder1_ModalPopupExtender2'); 
        modal.hide();
    }