( 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();
		
		/* un-hide progressively enhanced elements */

		$( '.enhanced' ).css( "visibility", "visible" );

        $( '#mainNav li a' ).toggleHover();

		/* highlight the current page in top nav or bottom sub-nav */
		
		oh.marketingSite.utils.styleNav();
		
		/* set partner cookies */
		
		/* set partner cookies from querystring and existing cookie */

		oh.marketingSite.utils.setAllPartnerCookies();

		/* IE fixes - first-child, last-child */	

		$( 'ul.piped, dl.piped' )
			.firstAndLastChild()
		;
		
		/* PARTNER PAGE: display alerts before taking people off-site */
		
		//TODO - progressively enhance these so the disclaimer shows even if JS is disabled

		$( '.confirmAndGoToPage' ).confirmAndGoToPage();
		$( '.confirmAndGoToONN' ).confirmAndGoToONN();
        $('.confirmAndGoToONNPremium').confirmAndGoToONN('http://www.onn.tv/premium/');

        /* RATES PAGE: bind clicks */
		
		$( '#rates #tCharts' ).toggleHoverAndBindClick( '/why/' );
		$( '#rates #tFree' ).toggleHoverAndBindClick( '/landing/affiliate100' );
		
		/* WHY PAGE: bind clicks */
		
		$( '#why #tVirtual' ).toggleHoverAndBindClick( '/virtual/' );
		$( '#why #tPromo' ).toggleHoverAndBindClick( '/promotions/' );

		/* TOUR PAGE: bind clicks */
		
		$( '#tour #tVirtual' ).toggleHoverAndBindClick( '/virtual/' );
		$( '#tour #tFree' ).toggleHoverAndBindClick( '/landing/affiliate100' );


        /* PROMOTIONS PAGE : bind clicks */

		$( '#promotions #tVirtual' ).toggleHoverAndBindClick( '/virtual/' );
		$( '#promotions  #tSecure' ).toggleHoverAndBindClick( '/why/' );

        /* FAQ PAGE: show/hide */
		
		$( '#faq' ).toggleFAQ();
		
		/* Risk section: navigation dropdown */
		
		$( '#riskDropdown' ).riskNavigator();
		
	} );

} )( jQuery );

