$(document).ready(function(){
	/* Fix unknown height issue  */
	var roundedHeight = Math.round($("#container").height()/57);
	$("#container").height(roundedHeight*57.2);

	// Initiate Galleries
	var options = {
            caption:    false,
            navigation: 'permanent',
            direction:  'right',
			zindex: 10000
        }
    
    $('#ppy1, #ppy2, #ppy3').popeye(options);

	$(".popMeUp").click(function(){
		var href = $(this).attr("href");
		var title = $(this).attr("title");
		var rel = $(this).attr("rel");
		var rev = $(this).attr("rev");
		
		if (rel == "youtube")
			href = "youtube.php?video=" + rev; 

		var newWindow = window.open(href, title, 'width=640,height=510,resizable=no,scrollbars=no,toolbar=no,location=no,menubar=no,status=no,copyhistory=no');

		return false;
	});

});


// Google analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16810587-1']);
_gaq.push(['_trackPageview']);

(function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
