function addFlashHeader(){
	$('#header_flash').flash({
		src: '/swf/header.swf',
		width: 900,
		height: 178,
		wmode: 'opaque',
		flashvars : url_destination
	});
}

function addFlashFooter(){
	$('#footer_flash').flash({
		src: '/swf/footer.swf',
		width: 900,
		height: 165,
		wmode: 'opaque',
		flashvars : url_destination
	});
}


$(document).ready(function(){
	// We are in the home page
	if ( $("#flash").length > 0 ) 
	{
		// Flash banner
		$('#flash').flash({
			src: '/swf/home_mega_supple.swf',
			width: 900,
			height: 655,
			wmode: 'opaque',
			flashvars : url_destination
		});
		
	}
	else
	{
		// otherwise add generic header and foooter
		addFlashHeader();
		addFlashFooter();
		
		if ( $("#offer_flash").length > 0 ) {
			$('#offer_flash').flash({
				src: '/swf/offer.swf',
				width: 900,
				height: 450,
				wmode: 'opaque',
				flashvars : url_destination
			});
		}
	}
	
	if($('#pageBox').height()<$(window).height()) {
		$('#pageBox').height($(window).height());
	}
	
});

