$(document).ready(function() {
	
	/* Wyszukiwarka główna */
	$(".search input[name='search']").focus(function(){ if ( $(this).val() == "Wpisz szukaną frazę" ); $(this).val(''); });
	$(".search input[name='search']").blur(function(){ 
		if ( $(this).val() == "" ) $(this).val('Wpisz szukaną frazę'); 		
	});

	/* Drukowanie artykułu */	
	$(function(){
		/* Hook up the print link. */
		$( "a.printme" ).attr( "href", "javascript:void(0)" ).click(
		function(){
			/* Print the DIV. */
			$( ".printable" ).print();	 
			/* Cancel click event. */
			return( false );
		});
	});
	
	/* Alt dla Images */
	$(".main img").each(function() {
		if ( $(this).attr('alt') != "" )
		{
			var did = $(this).attr('src');
			var img_width = $(this).attr('width');
			
			$(this).wrap("<div id='"+$(this).attr('src')+"' style='width:"+img_width+"px;' class='foo'></div>");			
			$("div[id='"+did+"']").append($(this).attr('alt'));	
		}
	});	
	
})