/*
	Autor: Grzegorz Jaworek
	E-mail: grzegorz.jaworek@gmail.com
	www: http://gjaworek.pl 
	Tel.: +48 519 133 159
*/

jQuery(document).ready(function(){
	var footHeight = jQuery('#footer').height();
	var footPadding = parseInt(jQuery('#footer').css('padding-top'))+parseInt(jQuery('#footer').css('padding-bottom'));
	var currHeight = jQuery('#top').height()+jQuery('#content').height()+footPadding;
	var newOffset = jQuery('body').height()-currHeight-footHeight;
	if (newOffset > 0) {
		jQuery('#footer').height(footHeight+newOffset);
		jQuery('#footer').css('margin-bottom',(-1)*newOffset);
	}
	jQuery('#reasons').cycle({ 
		fx:     'scrollHorz', 
		speed:  400, 
		timeout: 0, 
		next:   '.next', 
		prev:   '.prev'
	});
	jQuery('#offer').css('width', 400);
	jQuery('#offer').before('<ul id="offer-nav">').cycle({ 
		fx:     'scrollVert', 
		speed:  800, 
		timeout: 0, 
		pager:  '#offer-nav', 
		pagerAnchorBuilder: function(idx, slide) { 
			return '<li><a href="#" title="">'+jQuery(slide).children('h4').html()+'</a></li>'; 
		}
	});
	jQuery('#offer h4').remove();
	jQuery('.map-link').hide();
	jQuery('.map .more, .contact .more, .map .next').hover( 
		function () {jQuery(this).children('.map-link').show();
		}, 
		function () {jQuery(this).children('.map-link').hide();
		}
	);
	try {
		Cufon.replace('h3, h4', { fontFamily: 'euromode'});
		Cufon.replace('.content h3, .content h4, th', { fontFamily: 'verdana'});
		Cufon.replace('.sidemenu a', { fontFamily: 'verdana', textShadow: ' 1px 1px #00629e', hover: true});
		Cufon.replace('.menu a', { fontFamily: 'trebuchet'});
	} catch(err) {}
});
