/*
 * nm_display_fullbackground
 * 
 * Bindet eine Flash-Datei ein als Hintergrundbild. Benötigt Flash.
 *
 * http://www.next-motion.de
 * Version: 1.0.0 (10/08/2009)
 * Copyright (c) 2009 next.motion / Pierre Geyer
 * Requires: jQuery v1.3+
*/

	jQuery.fn.nm_display_fullsizebackground = function (options) {
		
		//Go through each object in the selector and create a ratings control.
		return this.each(function() {
  		
			// Merge settings
			var opts = $.extend({}, $.fn.nm_display_fullsizebackground.defaults, options);						
			
			// Save  the jQuery object for later use.
			$this   = $(this);
			
			// Get the Global Flash
		  jQuery.fn.nm_display_fullsizebackground.initFlash(opts);

		});		
	};

	jQuery.fn.nm_display_fullsizebackground.initFlash = function (opts){
		$('<div id="'+opts.container_id+'"><div id="'+opts.flash_id+'"><h1>Bitte Flash installieren.</h1><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p></div></div>').prependTo("body"); 
		$('#'+opts.container_id+',#'+opts.flash_id).css(
				{
					height:'100%',
					left:0, 
					margin:0,
					overflow:'hidden',
					padding:0,
					position:'absolute',
					'text-align':'center',
					top:0,
					width:'100%',
					'z-index':1
				}
			);
		swfobject.embedSWF(
				opts.flash, 
				opts.flash_id, 
				"100%", "100%", 
				"9.0.0", 
				opts.flash_install,
				{'backgroundimage': opts.image }, 
				{'scale': 'noScale', 'salign': 'topLeft', 'wmode': 'transparent'}
				);
	}
	
	jQuery.fn.nm_display_fullsizebackground.defaults = {
		image:					null,
		flash:					"/swf/nm_display_fullsizebackground.swf",
		flash_install:  "/swf/expressInstall.swf",
		container_id:		"background-flash",
		flash_id:				"background-flash-object"
	}
	


