jQuery.noConflict();
jQuery(document).ready(function($) { 
	$('ul.sf-menu').superfish({
		delay: 250,
		speed: 'fast',
		height: 810,
		autoArrows: false
	});

	if (!$('body.minor').length){
		$('#headers').cycle({
			pause:  1,
			speed:  1500,
			timeout:  6000
		});
	}

	if ($('#p-home').length){
		var fbOptions = {
			'zoomSpeedIn': 0,
			'zoomSpeedOut': 0,
			'frameWidth': 440,
			'frameHeight': 350,
			'overlayShow': true,
			'overlayOpacity': .6,
			'callbackOnStart': function(){ $('#headers').cycle('pause'); },
			'callbackOnClose': function(){ $('#headers').cycle('resume'); $('#fancy_content').empty(); }
		}

		$('#meet-link').fancybox(fbOptions);
		$('#walk-link').fancybox(fbOptions);
	}

	if ($('#swingme').length) { // && !isOSXFx()
		var so = new SWFObject('/assets/flash/swing_tag.swf', 'swingme', '100%', '100%', '8');
		so.addParam('loop', 'false');
		so.addParam('quality', 'high');
		so.addParam('wmode', 'transparent');
		so.write('swingme');
	}
	else $('#swingme').attr('id', 'swingno');

	$("a[@href^=http]").each(
		function(){
			if(this.href.indexOf(location.hostname) == -1) {
				$(this)
					.addClass('external')
					.attr('target', '_blank');
			}
		}
	)

	$("a.popup").click(function(){
		return !window.open(this.href, 'hsyt', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=1,width=640,height=420,left=660,top=425');
	});


});

function isOSXFx() {
  var userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox') != -1) {
    return true;
  }
}