jQuery(document).ready(function() {
	fvideobg();
});


jQuery(document).resize(function() {
	fvideobg();
	

});

function fvideobg(){
	var screenW = '';
	var docW = '';
	var docH = '';
	
	screenW = screen.availWidth;
	/*alert("screenW"+screenW);*/
	
	docW = jQuery(window).width();
	/*alert("largeur"+docW);*/
	
	docH = jQuery(window).height();
	docH2 = docH - 100;
	
	if(docW<=screenW){
		docW = screenW;
	}
	
	jQuery("#videobg").css("clip","rect(0px, "+docW+"px, "+docH+"px, 0px)");
	
	jQuery("#videobg img").attr("width",docW);
	
	
	
	/*if(jQuery(".magikBG").length == 0){*/
		var theHTML = '';
		var Largeur = '100%';
		var Hauteur = '100%';
		var Filevideo = "fileadmin/templates/video_bg/videos/nuages_9"
			
			
		theHTML += '<object type="application/x-shockwave-flash" data="'+Filevideo+'.swf"  width="'+Largeur+'" height="'+Hauteur+'" id="nuages_9" align="middle">';
	theHTML += '<param name="allowScriptAccess" value="sameDomain" />';
	theHTML += '<param name="movie" value="'+Filevideo+'.swf" />';
	theHTML += '<param name="flashVars" value="nuages_9.flv" />';
	theHTML += '<param name="quality" value="high" />';
	theHTML += '<param name="bgcolor" value="#FFFFFF" />';
	theHTML += '<param name="wmode" value="transparent" />';
	theHTML += '</object>';
		
		/*alert("html"+theHTML);*/
		
		jQuery("#videobg").html(theHTML);
		jQuery("#videobg").attr("width",docW,"px");	
		jQuery("#videobg").attr("height",docH,"px");	
		jQuery("#pageWrap").attr("height",docH2,"px");
		
}




