// uprava nyroModal scriptu pri volani url obrazku pomoci queryStringu START // 

$(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
				});
			}
		}
	};
	
});