function makePager(pages){
    $('#pager').show();
    $('.page').not(':first').hide();

    var page  = 1;

    function actualizePager()
    {
	if (page == 1){
	    $('.prev').css('visibility', 'hidden');
	} else {
	    $('.prev').css('visibility', 'visible');
	}
	if (page == pages){
	    $('.next').css('visibility','hidden');
	} else {
	    $('.next').css('visibility', 'visible');
	}
	$('#pager a').removeClass('active');
	$('#pager a').eq(page-1).addClass('active');
    }
    actualizePager();

    $('#pager').find("a").bind({
	click: function(event){
	    page = parseInt( $(this).text() );
	    actualizePager();

	    $('.page').hide();
	    $('.page').eq(page-1).show();

	    event.preventDefault();
	}
    })
    $('.prev').click(function(){
	$(this).parent().find('a').eq(page-2).click();
    })
    $('.next').click(function(){
	$(this).parent().find('a').eq(page).click();
    })

    
}

$(window).bind('load', function(){

    jQuery(function($) {
	//$("img[@src$=png]").pngfix();
	});

    Cufon.replace("h1,h2,h3, .partner-item .sub", {
	hover: true,
	fontFamily: 'normal'
    });

    var xHeight = 0;
    $('.page').each(function(){
	if ( $(this).height() > xHeight ) xHeight = $(this).height();
    })

    $('.page').height( xHeight );


})

$(document).ready(function(){
    $('#m333f4moduleform_2 textarea').example('Sem napíšte váš názor');

    $('.pager a, #pager a').click(function(){
	$('html, body').animate({
	    scrollTop: '470'
	}, 'slow')
    })


    $('.bottom-hr').prev().find('img').bind({
	mouseover: function(){
	    var srcText = $(this).attr('src');
	    var oldFileName = srcText.substring(0, srcText.length-4);
	    var newFileName = oldFileName + '-color.png';
	    $(this).attr('src', newFileName);
	},

	mouseout: function(){
	    var srcText = $(this).attr('src');
	    var oldFileName = srcText.substring(0, srcText.length-10);
	    var newFileName = oldFileName + '.png';
	    $(this).attr('src', newFileName);
	}
    })

})
