( function( $ ) {
	
	$( function() {
		
		/* GLOBAL */
		/* progressively enhance links for all pages that will not work without JavaScript (except
        /contact_us/, which also includes important info re: address, phone, etc.) */

        // TODO - decouple style classes from behavior classes for login, help and referAFriend
		$( '.openAnAccount' ).openAnAccount();
		$( '#secureLogin, .secureLogin' ).secureLogin();
		$( '.liveHelp' ).liveHelp();
		$( '.referAFriend' ).referAFriend();
		//$( '#faq' ).toggleFAQ();
		
        $( '#mainNav li a' ).toggleHover();

		// highlight the current page in top nav or bottom sub-nav
		oh.marketingSite.utils.styleNav();
		oh.marketingSite.utils.playTourVideo();
		
		$( '.enhanced' ).css( "visibility", "visible" ); // un-hide progressively enhanced elements
		$( '#riskDropdown' ).riskNavigator();			 // Risk section: navigation dropdown
		$( 'ul.piped, dl.piped' ).firstAndLastChild(); 	 // IE fixes - first-child, last-child
		$( '.confirmAndGoToPage' ).confirmAndGoToPage(); // TODO - progressively enhance these so the disclaimer shows even if JS is disabled

	  	/* RATES FAQ PAGE: bind clicks */
		$( "#pricingLandingPage #optionRates.fees, #pricingLandingPage #stockRates.fees, #pricingLandingPage #spreadRates.fees")
			.toggleHoverAndBindClick( '/rates/')
			.toggleSiblingHover('#goToRates a')
		;
			
		/******
		  NEW
		*******/
		$('.turnIntoLink').turnIntoLink();
	});

	/* Instantiates Blackbird in Dev only */
if( oh.isDevSite() ){

oh.namespace("oh.core");
	oh.core.blackbird = blackbird( {
		shimSrc: "/asset/html/blank.html"
	} );
}
		
} )( jQuery );


