window.onresize = function(){ vcenter('flash'); } 

$(document).ready(function(){

	$('#wrapper').css('display', 'block');
	
	var Firefox = detectFirefox();
	 
	var flashvars = {stl_chemin:root+'swf/images/', isFirefox:Firefox};
	var params = {allowscriptaccess:"sameDomain", wmode:"transparent"};
	swfobject.embedSWF("swf/home.swf", "flash", "810", "570", "8.0.0", false, flashvars, params);
	
	vcenter('flash');
});

function changeBg(file) {
	var url = root+'assets/images/'+file;
	$('#doc').css('backgroundImage', 'url('+url+')');
}

function h_browser() {
	var h;
	if (typeof(window.innerHeight) == 'number') h = window.innerHeight;
	else if (document.documentElement && document.documentElement.clientHeight) h = document.documentElement.clientHeight;
	else if (document.body) h = document.body.clientHeight;
	h = (isNaN(h)) ? "580" : h;
	return h;
}

function vcenter(div_id) {
	var heightBrowser = h_browser();
	var h_div = 570;
	var marge = (heightBrowser >= h_div) ? (Math.round((heightBrowser-h_div) * 0.5)) : 20;
	$('#'+div_id).animate({ marginTop:marge+'px' }, "slow");
}

function detectFirefox(){
 if (navigator.appName == 'Netscape') return true;
 else return false;
}
