//--------------------------------------------------------------------------------
//
//    General JavaScript file for the Mobile-For 4411 video players.
//  
//    author:			Gerrit Bertier (gerrit@marlon.be)
//    copyright:		(c) 2010 - Marlon BVBA
//    since:			2010-03-19
//    last updated:		2010-03-19
//
//--------------------------------------------------------------------------------

//----------------------------------------
//  Web parking app functionality
//----------------------------------------
var videoplayer =
{
	/**
	 * General web app functionality.
	 */
	general :
	{
		/**
		 * Initialize the web application.
		 */
		init : function()
		{
			if ($('#video-garage').length > 0) 
			{
				// Embed the flash file
				videoplayer.flash.embedHowtoGarage();
			}
			
			if ($('#video-street').length > 0) 
			{
				// Embed the flash file
				videoplayer.flash.embedHowtoStreet();
			}
		}
	},
	
	/**
	 * Flash related functionality.
	 */
	flash :
	{
		/**
		 * Embed SWF file (how to use in garage).
		 */
		embedHowtoGarage : function()
		{
			var flashvars = {
				settings: '/custom/frontend/4411/0.0.1/swf/xml/video_settings.xml',
				video: "/custom/frontend/4411/0.0.1/swf/flv/howto_garage_encoded.mp4",
				controls: "over",
				thumb: "/custom/frontend/4411/0.0.1/swf/thumbs/thumb_video_garage.jpg",
				autoPlay: "false",
				volume: "80",
				debug: "false",
				videoSizeMode: "original"
			};
			var params = {
                wmode: 'opaque'
            };
			var attributes = {
				id: 'video-garage',
				name: 'video-garage'
			};
			swfobject.embedSWF('/custom/frontend/4411/0.0.1/swf/videoplayer.swf', 'video-garage', '440', '247', '9.0.0','/custom/frontend/4411/0.0.1/swf/expressInstall.swf', flashvars, params, attributes);
		},
		
		/**
		 * Embed SWF file (how to use on street)
		 */
		embedHowtoStreet: function()
		{
			var flashvars = 
			{
				settings: '/custom/frontend/4411/0.0.1/swf/xml/video_settings.xml',
				video: "/custom/frontend/4411/0.0.1/swf/flv/howto_street_encoded.mp4",
				controls: "over",
				thumb: "/custom/frontend/4411/0.0.1/swf/thumbs/thumb_video_street.jpg",
				autoPlay: "false",
				volume: "80",
				debug: "false",
				videoSizeMode: "original"
			};
			var params = 
			{
				wmode: 'opaque'
			};
			var attributes = 
			{
				id: 'video-street',
				name: 'video-street'
			};
			swfobject.embedSWF('/custom/frontend/4411/0.0.1/swf/videoplayer.swf', 'video-street', '440', '245', '9.0.0', '/custom/frontend/4411/0.0.1/swf/expressInstall.swf', flashvars, params, attributes);
		}
	}
}

//----------------------------------------
//  Fires when the DOM is ready.
//----------------------------------------
$(document).ready(function()
{
	// Initialize the web parking app
	videoplayer.general.init();
});
