jQuery.noConflict();
jQuery(document).ready(function() {
	init();
});

function init() {
	// open external links in new window (checking domain first)
	jQuery("a[href^='http']:not([href*='hotyoga-abq.com'])").each(function() {
		jQuery(this).attr("target", "_blank");
	});
	
	jQuery("a[href*='/featured/pay-for-classes-gift-cards']").attr("href", "http://clients.mindbodyonline.com/ws.asp?studioid=11466&stype=41");
	
	jQuery("#suckerfishnav li:last-child ").css("margin-right","0");
	jQuery('a[title*="powered by HealCode"]').css('display','none');
	// Expand Panel
	jQuery("#open").click(function(){
		jQuery("div#panel").slideDown("slow");
	});	
	// Collapse Panel
	jQuery("#close").click(function(){
		jQuery("div#panel").slideUp("slow");	
	});		
	// Switch buttons from "Log In | Register" to "Close Panel" on click
	jQuery("#toggle a").click(function () {
		jQuery("#toggle a").toggle();
	});	
	
	jQuery('#community #slides').jcarousel({
		auto: 4,
		scroll: 4,
		wrap: 'circular',
		buttonPrevHTML: null,
		buttonNextHTML: null,
		initCallback: mycarousel_initCallback
	});	
}

function mycarousel_initCallback(carousel) {
	// Disable autoscrolling if the user clicks the prev or next button.
	carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
	});
	carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
	});
	
	// Pause autoscrolling if the user moves with the cursor over the clip.
	carousel.clip.hover(function() {
		carousel.stopAuto();
	}, function() {
		carousel.startAuto();
	});
};

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-403844-18']);
_gaq.push(['_setDomainName', '.hotyoga-abq.com']);
_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);
})();
