var resizeTimer = false;

function mcd_get_window_size() {
	//return {width : $(window).width(), height : $(window).height()};
	return {width : 900, height : $(window).innerHeight()};
}

$(document).ready(function(){
	$('#contenu table tr:even', this).addClass('pair');
	mcd_resize_flash();
});


$(window).bind('resize', function () {
	//set timer for ie
	if (resizeTimer) clearTimeout(resizeTimer);
	resizeTimer = setTimeout(mcd_resize_flash, 100);
});

// get screen ratio
function mcd_get_screen_ratio() { 
	var ratio = $(window).width() / $(window).innerHeight();
	//console.log("ze_ratio : " + ratio);
	return ratio; 
}

function mcd_resize_flash() {
	if (resizeTimer) clearTimeout(resizeTimer);
	resizeTimer = false;
	
	if($(window) != null) {
		//console.log("resize window");
		var myFlash = $('#flash_main');
		//alert(mcd_get_screen_ratio());
		
		if(myFlash != null) {
			if(mcd_get_screen_ratio() > 1.53) {
				//console.log("laptop mode");
				$(myFlash).width(($(window).innerHeight()*1.508) + 'px');
				$(myFlash).height('100%');
			}
			else {
				//console.log("normal");
				$(myFlash).width('100%');
				$(myFlash).height('100%');
			}
		}
	}
}

