﻿$(document).ready(function(){
	$('.fixpng').ifixpng();

	$(window).bind('resize', function(){
		resizeit();
	});
	resizeit();
		
	$(".palvelu td:first-child, .palvelu th:first-child").addClass("first");

	function resizeit(){

		var window_width = $(window).width();
		if (window_width < 950) {
		$('#wrap').css('width', '950px');
		}else {
		$('#wrap').css('width', '100%');
		}
		var wrap_height = $("#wrap").height();	
		var lastwrap = $("#footerwrap").prev();		
		var lastwrap_height = lastwrap.offset().top + lastwrap.height();
		var footerwrap_height = $("#footerwrap").height() + 2;
		var footer_old = $("#footer").height();
		var footer_height = wrap_height - lastwrap_height - footerwrap_height;
		var footer_total = footer_old + footer_height;

		if(footer_total > 100) footer_total = 100;

		$('#footer').css('height', ''+footer_total+'px');
	}
	
		
	if ($(".frontPage #splasherimg").length > 0 ) {
		$('.frontPage #splasherimg').flash({
			src: '/assets/flash/splasherimg.swf',
			wmode: 'opaque',
			width: 950,
			height: 200
		});
	}

});
