$(document).ready( function() {
	var config= {
		over:out,
		timeout:10,
		out:inn
	};
	$(".header dt").hoverIntent(config);
	$("input[name=query]").example('szukany tekst');
	$("input[name=name]").example('imię/nick');
	$("input[name=mail]").example('adres email');
	$("input[name=recaptcha_response_field]").example('przepisz kod z obrazka');
	$("textarea[name=comment]").example('...');
	$("textarea[name=message]").example('treść wiadomości');
	$(".font-size a").click( function() {
		class_html=$(this).attr("class");
		size=class_html.split('-');
		size=size[1];
		$(".news-content,#news-content").css("font-size",size+"px");
		$.ajax({
			type:'POST',
			url:'/change_font/',
			data:"size="+size
		});
	});
	
	show_players(0);
	
});

function show_players(start)
{
	a = $("#strzelcy dt");
	if(start<0) start=0;
	if(start>a.length)
		start = a.length
	
	$("#strzelcy dt").hide();
	$("#strzelcy dt").slice(start,start+20).show();
}

$(document).ready( function() {
	$('.left-col a img[title],.submenu img[title], .left-col a[title], .znani-foto[title], .new-comments a[title]').qtip({
		content: {
			text:false
		},
		position: {
			target:'mouse',
			adjust: {
				screen:true
			}
		},
		show: {
			delay:0,
			effect: {
				length:0
			}
		},
		hide: {
			delay:100
		},
		style:'dark'
	});
});
$(document).ready( function() {
	$('.yt-hint a img[title]').qtip({
		content: {
			text:false
		},
		show: {
			delay:0,
			effect: {
				length:0
			}
		},
		position: {
			target:'mouse',
			adjust: {
				screen:true
			}
		},
		hide: {
			delay:100
		},
		style: {
			border: {
				width:1,
				radius:0,
				color:'#303030'
			},
			title: {
				background:'#404040',
				color:'#f3f3f3'
			},
			background:'url("/static/img/control_play.png") no-repeat scroll 5px 5px #505050',
			padding:'5px 26px',
			color:'#f3f3f3',
			classes: {
				tooltip:'qtip-yt'
			}
		}
	});
});
$(document).ready( function() {
	$('.gallery-hint a img[title]').qtip({
		content: {
			text:false
		},
		show: {
			delay:0,
			effect: {
				length:0
			}
		},
		position: {
			target:'mouse',
			adjust: {
				screen:true
			}
		},
		hide: {
			delay:100
		},
		style: {
			border: {
				width:1,
				radius:0,
				color:'#303030'
			},
			title: {
				background:'#404040',
				color:'#f3f3f3'
			},
			background:'url("/static/img/gallery_icon.png") no-repeat scroll 5px 5px #505050',
			padding:'5px 26px',
			color:'#f3f3f3',
			classes: {
				tooltip:'qtip-gall'
			}
		}
	});
});
function inn() {
	$('ul',this).hide();
	$("a",this).removeClass('current');
}

function validateForm() {
	var txt="";
	txt=$("#query_field").val();
	if(txt.length<3||txt=='szukany tekst') {
		alert("Wprowadź przynajmniej trzy znaki.")
		return false;
	}
	return true;
}

function out() {
	$("ul",this).show();
	$("a",this).addClass('current');
}

var RecaptchaOptions = {
	theme : 'custom',
	custom_theme_widget: 'recaptcha_widget'
};
