function GenerateCustomFckGallery(files_array)
{
		var result="";
		result+="<div class='bodyGallery-env'>";		
		
		for (var a=0;a<files_array.length;a++){
			result+="<a class='bodyGallery' href=\""+files_array[a].path+"\" rel=\"lightbox[gallery]\"><img alt=\"\" src=\""+files_array[a].thumb+"\" /></a>";
		}
		
		result+="<div class='cleaner'></div></div>";
		return result;
}

$(function() {
	$.fn.nyroModal.settings.processHandler = function(settings) {
		var from = settings.from;
		if (!settings.type && from && from.href) {
			/*alert(
				'type should be image: '+settings.type + '\n'
				+ "need to determine if image manually");*/
			var arr = from.href.split('?');
			//if carrying extra stuff
			if(arr.length>1){
				var newArr=arr[0].split('.');
				var newType=settings.type;
				//alert('extension is: ' + newArr[newArr.length-1]);
				switch(newArr[newArr.length-1].toUpperCase()){
					case 'IMG':
					case 'JPG':
					case 'JPEG':
					case 'PNG':
					case 'GIF':
					case 'ASPX':
						newType='image';
						break;
					default:
						newType=settings.type;
				}
				//alert("new type is " + newType);
				$.nyroModalSettings({
					type: newType
				});
			}
		}
	};
	
});

$(document).ready(function(){

	// lightbox
	$("a[rel=lightbox]").nyroModal({galleryCounts: false});

  	// otevreni odkazu do noveho okna	
	$("a.nw").attr("title", "Tento odkaz se otevře do nového okna");  
	$('a.nw').click( function() {
		window.open( $(this).attr('href') );
		return false;
	});  
	
	// chovani registracniho formulare
	$("#castka").focus();
	
	$("#potvrzeniAno").hide();
	
	$("#ucetAno").click(function(){
		$("#potvrzeniAno").fadeIn(500);
	});

	$("#ucetNe").click(function(){
		$("#potvrzeniAno").fadeOut(200);
	});
	
																												
});

