$(document).ready(
	function() {
		
		
		// Open links with rel="external" in new window - like ye ole' target="_blank"
		$('a[rel="external"]').click(function() {window.open( $(this).attr('href') ); return false;});
		
		// Zebra-stripe data tables
		$("table.data tbody").each(function() {
			$(this).removeClass("odd even");
			$("tr:odd", this).addClass("odd");
			$("tr:even", this).addClass("even");
		});

		// Initialize Lightbox
		$(".lightbox").lightbox();
		
		 // //Micro Sites Flyout 
		$("ul.mainnav li.events a").click(function () { 
		  $("ul#flyout").slideToggle('fast');	
		  $("ul.mainnav li.events a").toggleClass("active");
		  return false;		
		});
		
		// Fade for the Map link 
		$('#map-link a').blend(600);

		//Homeflex page tabs
		$('#homeflex div.tabcontent').removeClass('hidden');
		$('#homeflex').tabs({
			fx: { opacity:'toggle', duration:100 }
		});
		$('#homeflex').tabs("rotate", 7000, true);
         
		// $('#caption').html( $( 'img', this).attr('alt')  );
		 
		//Bussines Finder view more 
		$('.viewlisting').click(function() {
		$('.complete', this).toggleClass('active');
		$(this).text($(this).text() == 'View Complete Listing' ? 'Hide Complete Listing' : 'View Complete Listing');
		$(this).next().slideToggle('fast');
		$(this).parent().toggleClass('interest');
		return false;
		})
		
		//slides homepage
		$('#slide').cycle({ 
			fx:     'scrollLeft', 
			speed:  'slow', 
			timeout: 9500,  
			pager:'#nav'
		});	
				
		//Show Nav
		$('#nav').addClass("active");
		
		
		//$(this).parents().css('background-color', 'red');
		//.addClass('active');
			
		// Home page tabs
		$('#explore ul li a').bind('mouseover', function(e) {
   			var offset = $(e.target).offset();
		$('#bracket').animate({'top': offset.top}, 600);
		return false;
		});

	}
);

