$(document).ready(function(){	
	$("#slider").easySlider({
		auto: true,
		speed: 500,
		pause: 7000,
		prevId: 'homePageSliderPrev',
		prevText: '&#160;',
		nextId: 'homePageSliderNext',	
		nextText: '&#160;',
		continuous: true 
	});
	
	
	/**************************
		MENU - POCITANI SIRKY
	*/
	var widthLI
	var widthSum = 0
	
	countLI = $('#headermenu li').length
	$('#headermenu li').css('padding', '0px 0px 0px 0px')
	$('#headermenu li').each(function(i, val) {
		widthLI = $(this).width()
		widthSum += Math.abs(widthLI)
	})
	differenceWidth = $('#headermenu').width() - widthSum	
	paddingSize = (differenceWidth / countLI)
	paddingSizeItem = '0px ' + Math.floor(paddingSize) + 'px 0px 0px'
	$('#headermenu li').css('padding', paddingSizeItem)
	$('#headermenu li.last').css('padding', '0px 0px 0px 0px')
	
	
/* FUNKCE PRO VOLANI HRY */

	$("#sendFriend").click(function () {
		$("#sendGamesFriend").fadeIn();
	});
	
	$("#addGames").click(function () {
		$("#addGamesToPage").fadeIn();
	});
	
	
	
	$("#closeSendFriend").click(function () {
		$("#sendGamesFriend").fadeOut();
	});
	
	$("#closeAddGames").click(function () {
		$("#addGamesToPage").fadeOut();
	});
	
	
});	

$(document).ready(function(){
	$("a[rel^='photo']").prettyPhoto({
		animationSpeed: 'fast', /* fast/slow/normal */
		padding: 0, /* padding for each side of the picture */
		opacity: 0.8, /* Value betwee 0 and 1 */
		showTitle: true, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: ' ze ' /* The separator for the gallery counter 1 "of" 2 */
	});
});

function InputFillDefaultText(language) {
	if (language == 'cs') {
		if(document.getElementById('sSearchText')) document.getElementById('sSearchText').value='Vyhledávání';
	} else {
		if(document.getElementById('sSearchText')) document.getElementById('sSearchText').value='Suche';
	}
}

function InputClearText(input, string) {
	if(input.value==string) input.value='';
}

function AddFavorite(linkObj,addUrl,addTitle){
	if (document.all && !window.opera) {
		window.external.AddFavorite(addUrl,addTitle);
		return false;
	} else if (window.opera && window.print) {
		linkObj.title = addTitle;
		return true;
	} else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function')) {
		if (window.confirm('Přidat oblíbenou stránku jako nový panel?')) 
		{
			window.sidebar.addPanel(addTitle,addUrl,'');
			return false;
		}
	}
	window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
	return false;
} 
