



//foreach fo IE

if (!Array.prototype.forEach)

{

    Array.prototype.forEach = function (closure)

    {

        var context = arguments[1] || null;

        for (var i = 0; i < this.length; i ++)

        {

            arguments[0].call(context, this[i], i, this);

        }

    }

}







$(document).ready(function(){

			

	var marki = ['personelpromo','jobman','jobselect'];

	marki.forEach(mouse_me);

	

	var partnerzy = ['saz','biuropromo_lider_rynku','biuropromo_rzetelna_firma','biuropromo_jakosc_roku','biuropromo_gepard_biznesu', 'biuropromo_gazele_giznesu'];

	partnerzy.forEach(white_me);

	

	var ludzie = ['personelpromo','jobman','jobselect'];

	ludzie.forEach(super_size_me);

	

	

	function mouse_me(el){

		$('#logo_'+el)

        .mouseover(function() { 

			$('#belka_'+el).attr("class","marka_over");

             var src = $(this).attr("src").replace("bw.gif", "color.gif");

            $(this).attr("src", src);

        })

        .mouseout(function() {

			$('#belka_'+el).attr("class","marka");

            var src = $(this).attr("src").replace("color.gif", "bw.gif");

            $(this).attr("src", src);

        });



	}

	

	

	function white_me(el){

		$('#'+el)

        .mouseover(function() { 

             var src = $(this).attr("src").replace('_color.gif','.gif');

            $(this).attr("src", src);

        })

        .mouseout(function() {

            var src = $(this).attr("src").replace(".gif","_color.gif");

            $(this).attr("src", src);

        });



	}

	

	

	function super_size_me(el){

		var new_width,old_width;

		

		if(el == 'personelpromo') {new_width = '263px'; old_width ='232px';}

		if(el == 'jobman') {new_width = '257px'; old_width = '238px';}

		if(el == 'jobselect') {new_width = '277px'; old_width = '257px';}

		

		$('#'+el)

        .mouseover(function() { 

        	$('#belka_'+el).attr("class","marka_over");

            var src = $('#logo_'+el).attr("src").replace("bw.gif", "color.gif");

            $('#logo_'+el).attr("src", src);

			

			 $(this).animate({ 

			 	queue:false,

				width: new_width,

				height: "250px"

			  }, "slow" );



        })

        .mouseout(function() {

           $('#belka_'+el).attr("class","marka");

            var src = $('#logo_'+el).attr("src").replace("color.gif", "bw.gif");

            $('#logo_'+el).attr("src", src);

			

			 $(this).animate({ 

			 	queue:false,

				width: old_width,

				height: "232px"

			  }, "slow" );

        });



	}

	

	

});














