﻿
var lastvid_type = '';
var lastvid_file = '';
var lastvid_put = '';

function vcpVidWatchAgree() {
    tb_remove();
    vidwatchcan=true;
    vcpPlay(lastvid_type, lastvid_file, lastvid_put);
    ajaxgetdata('/site/content/termsagree.cnx?p=s', '', '','', 1);
}

function vcpPlay(fx_type, fx_file, fx_put) {  

    lastvid_type = fx_type;
    lastvid_file = fx_file;
    lastvid_put = fx_put;

    if (vidwatchcan==false) {
    
        tbappg('Agreement', 'vidwatch', '', '')
    
    } 
    
    if (vidwatchcan==true) {

        var vH = '391';
        var vW = '640';
        
        var vP = 'tc_005'    
        
        var vB = '#FFFFFF' 

        if (fx_type=='tc') {
            var vH = '391';
            var vW = '640';   
            var vP = 'tc_006'     
        }
        
        if (fx_type=='vc') {
            var vH = '271';
            var vW = '320';   
            var vP = 'ct_004'   
            vB = '#000000'   
        }   
        
        if (fx_type=='pf') {
            var vH = '301';
            var vW = '480';   
            var vP = 'pf_009'     
        }        
        

        var flashvars = {
          vcpvt: fx_type,
          vcpvs: fx_file
        };
        
        var params = {
            menu: 'false',
            allowFullScreen: 'true',
            allowScriptAccess: 'sameDomain',
            scale: 'showall',
            wmode: 'opaque'
        };        
        
        

        var playerVersion = swfobject2.getFlashPlayerVersion(); 
        var majorVersion = playerVersion.major;

        if (majorVersion < 6) {
            if (majorVersion == 0) {
                document.getElementById(fx_put).innerHTML = '<div style=\'padding: 20px;\'>Flash Player Not Installed. Click <a href=\'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\' target=\'_blank\' >here</a> to install Adobe Flash Player</div>'
            } else {
                document.getElementById(fx_put).innerHTML = '<div style=\'padding: 20px;\'>Adobe Flash Player version 9 or higher is required to watch this video. Please update your player.<br /><a href=\'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\' target=\'_blank\'>Update Now</a></div>';  
            }
        } else {
            swfobject2.embedSWF('/site/web/video/player/' + vP + '.swf', fx_put, vW, vH, '9.0.0', '/ctl/js/swfobject/expressInstall.swf', flashvars, params, '');       
        }



    
    }
    
    sotReset();
    
}



function vcpPlayNS(fx_type, fx_file, fx_put) {  



        var vH = '391';
        var vW = '640';
        
        var vP = 'tc_005'    
        
        var vB = '#FFFFFF' 

        if (fx_type=='tc') {
            var vH = '391';
            var vW = '640';   
            var vP = 'tc_006'     
        }
        
        if (fx_type=='vc') {
            var vH = '271';
            var vW = '320';   
            var vP = 'ct_004'   
            vB = '#000000'   
        }   
        
        if (fx_type=='pf') {
            var vH = '301';
            var vW = '480';   
            var vP = 'pf_009'     
        }        
        


        var flashvars = {
          vcpvt: fx_type,
          vcpvs: fx_file
        };
        
        var params = {
            menu: 'false',
            allowFullScreen: 'true',
            allowScriptAccess: 'sameDomain',
            scale: 'showall',
            wmode: 'opaque'
        };        
        
        

        var playerVersion = swfobject2.getFlashPlayerVersion(); 
        var majorVersion = playerVersion.major;

        if (majorVersion < 6) {
            if (majorVersion == 0) {
                document.getElementById(fx_put).innerHTML = '<div style=\'padding: 20px;\'>Flash Player Not Installed. Click <a href=\'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\' target=\'_blank\' >here</a> to install Adobe Flash Player</div>'
            } else {
                document.getElementById(fx_put).innerHTML = '<div style=\'padding: 20px;\'>Adobe Flash Player version 9 or higher is required to watch this video. Please update your player.<br /><a href=\'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\' target=\'_blank\'>Update Now</a></div>';  
            }
        } else {
            swfobject2.embedSWF('/site/web/video/player/' + vP + '.swf', fx_put, vW, vH, '9.0.0', '/ctl/js/swfobject/expressInstall.swf', flashvars, params, '');       
        }
        

        
        
        
        sotReset()
  
}

var vcp_Current_Video = 1;

var vcp_VideoVideos = new Array(5);
var vcp_VideoPics = new Array(5);


function vcpPlayTrainingIntro(fx_video) {
    
    //alert(document.getElementById('vidbox' + fx_video).style.backgroundImage);
    //alert('url:(/net/content/' + vcp_VideoPics[vcp_Current_Video] + ')');
    
    
    document.getElementById('vidbox' + fx_video).style.backgroundImage='url(/net/content/' + vcp_VideoPics[1] + ')';   
        
    //alert(fx_video);        
    //alert(vcp_VideoVideos[fx_video]);        
        
    vcpPlay('pf', vcp_VideoVideos[fx_video], 'mainvidPlayer')
    
    
    var vidwas = vcp_VideoVideos[fx_video];
    var picwas = vcp_VideoPics[fx_video];
    
    vcp_VideoVideos[fx_video] = vcp_VideoVideos[1]; 
    vcp_VideoPics[fx_video] = vcp_VideoPics[1]; 
    
    vcp_VideoVideos[1] = vidwas;
    vcp_VideoPics[1] = picwas;
    
    
             
    
    
    vcp_Current_Video = fx_video;
    
    sotReset();

}