$(document).ready(function() {
	
	/* open current menu */
	$('#pageNav li a').each(function(){
		if (window.location.href.indexOf($(this).attr("href")) > 0) {
			// for main selector
			$(this).parent().find('ul').addClass('selected');
			// for sub-item
			$(this).parent().parent().addClass('selected');
		}
	});
	$('#pageNav ul.selected').slideDown('slow');
	
	$('.news_overview h3').corner();
	
	// $('.border_inner').corner("round 16px").parent().css('padding', '1px').corner("round 18px")
	
});

$(window).load(function() {
	
	$("#photo_gallery img, #round_images img").each(function(){
		x = $(this).width();
		y = $(this).height();
		img = $(this).attr("src");
		object_class = $(this).attr('class');
		box_contents = '<div class="image_box ' + object_class + '" style="width: ' + x + 'px; height: ' + y + 'px; background-image: url(' + img + ');">&nbsp;</div>';
		$(this).replaceWith(box_contents);
		// alert (object_class);
	});
	
	$(".image_box").corner();
	
});

// google analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6033135-59']);
_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);
})();

