/**
 * VideoPilot360 Jquery v3.9
 *
 * Code has been modified to be used by Pre-paid Legal Services, Inc
 * VideoPilot360 is product of Tricolor Media Group, Inc
 * http://www.videopilot360.com || http://www.tricolormediagroup.com
 *
 */

$(document).ready(function(){

	/*
  var BaseURL = "http://cp.blastoffnetwork.com/images/prepaid/ppl_300";
  */
	var BaseURL = "";
	
	var flashPlayerURL = BaseURL + "flash/VideoPilot360.BlastOff.PPL.swf";
	
	var videosURL=new Array();
	videosURL['open_service_1']=BaseURL + "videos/PPL_Intro.flv";
	videosURL['open_service_2']=BaseURL + "videos/PPL_IDTheft.flv";
	videosURL['open_service_3']=BaseURL + "videos/PPL_Business.flv";

	
	// prepend clear div element to body
	$('body').prepend( '<div class="clear" id="VideoPilot360ContainerClear" name="VideoPilot360ContainerClear" style="display:none"></div>' );

	// create div element - VideoPilot360
	var VideoPilot360Div = $(document.createElement("div"))
		.attr("id", "VideoPilot360Container")
		.attr("name", "VideoPilot360Container");

	// prepend div element to body
	$('body').prepend( VideoPilot360Div );

	// set div css
	$('#VideoPilot360Container').css('display', 'none' );
	$('#VideoPilot360Container').css('width', '197px' );
	$('#VideoPilot360Container').css('height', '350px' );
	$('#VideoPilot360Container').css('position', 'relative' );
	
	var BobyClass = $("body").attr("class");
	//alert(BobyClass);
	if(BobyClass != "browserIE browserIE8"){
		$('#VideoPilot360Container').css('float', 'left' );
	}
	
	$('#VideoPilot360Container').css('top', '500px' );
	$('#VideoPilot360Container').css('left', '605px' );
	$('#VideoPilot360Container').css('z-index', '999999' );


	_loadVideoPilot360( videosURL['open_service_1']  );


	function  _loadVideoPilot360( videoID ) {

		$('#VideoPilot360ContainerClear').show();
		$('#VideoPilot360Container').empty();
		$('#VideoPilot360Container').show();
		
		$('body').css('margin-top', '-353px' );
		
		$('#VideoPilot360Container').flash({   

			swf: flashPlayerURL,
			height: 350,
			width: 197,
			params: {   
					
					wmode: 'transparent',
					AllowScriptAccess: 'always',
					scale: 'noscale',
					quality: 'high',
					loop: 'false'

			},
			flashvars: {

					cacheBust: (new Date()).getTime(),   
					flvVideo: videoID,   
					bufferPercentage: '0',
					soundVolume: '100',
					displayContactLayerButton: 'true',
					contactLayerButtonPageUrl: 'false',
					contactLayerButtonPageTarget: 'false',
					contactLayerButtonPageType: 'none',
					contactLayerButtonPageFunction: 'false',
					preloaderFontColor: '18191D',
					preloaderGraphicColor: '313131',
					VP360ButtonColor: 'B7B8BD'

			}   
			 
		});

	}

	$(".open_options_btn").click(function(){
		
		_loadVideoPilot360( videosURL[ $(this).attr('id') ] );

	});

});

function extUnloadVideoPilot360() {

		// empty div		
		$('body').css('margin-top', '0px' );
		$('#VideoPilot360ContainerClear').hide();
		$('#VideoPilot360Container').hide();

}
