$(document).ready(function () {
 	$(".nahodne .box").click(function() {
    window.location = $(this).find("p a:first").attr("href");
  });
  
  $("#facebox").html('<p style="padding-left:25px;"><iframe src="//www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FSIGMA-REALITY%2F131742943590178&amp;width=223&amp;height=330&amp;colorscheme=light&amp;show_faces=true&amp;border_color=#265759&amp;stream=false&amp;header=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:223px; height:330px;" allowTransparency="true"></iframe></p>');
  
  $("a[rel=galeria]").fancybox({
  	'transitionIn'  : 'fadeIn',
  	'transitionOut' : 'fadeOut',
  	'titlePosition' : 'over',
  	'titleFormat'   : function(title, currentArray, currentIndex, currentOpts) {
  		return '<span id="fancybox-title-over">' + (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
  	}
	});
		
});
	
$(document).ready(function() {
	
	/* see if anything is previously checked and reflect that in the view*/
	$(".checklist input:checked").parent().addClass("selected");
	
	/* handle the user selections */
	$(".checklist .checkbox-select").click(
		function(event) {
			event.preventDefault();
			$(this).parent().addClass("selected");
			$(this).parent().find(":checkbox").attr("checked","checked");
			
		}
	);
	
	$(".checklist .checkbox-deselect").click(
		function(event) {
			event.preventDefault();
			$(this).parent().removeClass("selected");
			$(this).parent().find(":checkbox").removeAttr("checked");
			
			
		}
	);
	
});

