var varia = ""
IE = $.browser.msie
FF = $.browser.mozilla
w = $(window)
var current_size = 0
function spacer_ajuste(){
	if(current_size != w.height()){
		current_size = w.height()
	$c = $("body").children(":visible").not("#spacer")
	$spacer = $("#spacer")
	var tot_height = 0
	for(var i=0 ; i < $c.length ; i++ ){
		tot_height += $c.eq(i).height()
	}
	var sub  =w.height()-tot_height
	if(sub <= 0 ){
		sub=0
	}
	$spacer.css({height:sub+"px"})
	}
}


$(document).ready(function(){
$("a.close_video").click(function(){
	$.simpleDialog.close()
	$(this).hide()
	
})
	
var random =""	
if(IE){
	var t = new Date()
	random = "?t="+Math.random(t.getTime())
}

var flashvars = {};
var params = {wmode:"transparent"};
swfobject.embedSWF("/commun/home/home.swf"+random, "homeFlash", "100%", "600", "10.0.0", "/js/swfobject/expressInstall.swf", flashvars, params);



var  timer=setInterval("spacer_ajuste()", 300);


$("#footer li > a.interne").click(function(){
	varia = $(this).children("code").html()
	
	}).simpleDialog( { showCloseLabel:false,open:function(){ setVideo() },close: function () { $("a.close_video").hide()} } );


})
function setVideo(){
	var value = varia
	if(!IE){
	var h = 180
	var w = 320
	}else{
		var h = 5
		var w = 5
	}
	var flashvars = {flv:value};
	var params = {wmode:"transparent"};
	xt_click(this,'C','','HOME_video:'+value,'A')
	swfobject.embedSWF("/commun/FLVplayer/FLVplayer.swf", "v", w, h, "10.0.0", "/js/swfobject/expressInstall.swf", flashvars, params);
	$("#v").parent().height(h).width(w)
	
	
}
function setVideoSize(h,w){
	$e = $("#v").parent().parent().parent()
	
	$eH = $e.height()
	$eW = $e.width()
	$eTop = $e.offset().top
	$eLeft = $e.offset().left
	
	
	
	
	/*if(!FF){
		h+=50
		w+=70
	}*/	
	
		$e.width(w).height(h).css("top",($eTop-(h-$eH)/2)+"px").css("left",($eLeft-(w-$eW)/2)+"px")
		$("#v").height(h).width(w)
		.parent().height(h).width(w)
		.parent().height(h).width(w)
	
	$("a.close_video").css({
		top:($e.offset().top+6)+"px",
		left:($e.offset().left+w-14)+"px"
	}).show()
	
	}