jQuery.noConflict();

function external_buildHeaderMenu() {
  jQuery('#navigation').html('<ul>  \
    <li><a href="http://www.theoakbridge.com/index.cfm" title="">Home</a></li> \
    <li><a href="http://www.theoakbridge.com/section15.cfm" title="">Why Us?</a> \
      <div style="width:231px !important;">  \
        <a href="http://www.theoakbridge.com/section16.cfm" title="">Compensation Structure</a>  \
        <a href="http://www.theoakbridge.com/section17.cfm" title="">Scheduled Reviews and Updates</a>  \
        <a href="http://www.theoakbridge.com/section20.cfm" title="">Portfolio &amp; Research</a>  \
      </div> \
    </li>  \
    <li><a href="http://www.theoakbridge.com/section2.cfm" title="">Investment Strategies &amp; Services</a> \
      <div style="width:265px !important">  \
        <a href="http://www.theoakbridge.com/section4.cfm" title="">Client Case Studies</a>  \
        <a href="http://www.theoakbridge.com/section5.cfm" title="">Achieving Retirement Goals</a>  \
        <a href="http://www.theoakbridge.com/section6.cfm" title="">Active Management</a>  \
        <a href="http://www.theoakbridge.com/section18.cfm" title="">Relationship Investing</a>  \
      </div> \
    </li>  \
    <li><a href="http://www.theoakbridge.com/section1.cfm" title="">Get a Custom Report</a></li> \
    <li><a href="http://www.theoakbridge.com/section8.cfm" title="">About Us</a>  \
      <div style="width:170px !important">    \
        <a href="http://www.theoakbridge.com/section9.cfm" title="">Contact Us</a>   \
        <a href="http://www.theoakbridge.com/section10.cfm" title="">Financial Partners</a>   \
        <a href="http://www.theoakbridge.com/section11.cfm" title="">Giving Back</a>  \
        <a href="http://www.theoakbridge.com/section7.cfm" title="">Bridging Generations</a> \
        <a href="http://www.theoakbridge.com/section12.cfm" title="">Upcoming Events</a>   \
        <a href="http://www.theoakbridge.com/section13.cfm" title="">Newsletter Archive</a> \
      </div> \
    </li> \
  </ul>');
}

function external_initHeaderMenu() {
  jQuery('#navigation li').each(function() {
    jQuery(this).css('width', this.clientWidth + 'px');
  });
  jQuery('#navigation li').hover(function() {
    jQuery(this).data('o', true);
    jQuery(this).children('div').css('display', 'block');
    jQuery(this).children('a').addClass('hover');
  }, function() {
    jQuery(this).data('o', false);
    var t = this;
    window.setTimeout(function () {
      if (!jQuery(t).data('o')) {
        jQuery(t).children('div').css('display', 'none');
        jQuery(t).children('a').removeClass('hover');
      }
    }, 30);
  });
}

function external_buildCalltoAction() {
  jQuery('#header').append('<div id="masthead-calltoaction">' + 
                            '<div id="masthead-title">Investing For <span>Your Future</span></div>' +
                            '<div style="text-transform: uppercase;" id="master-subtitle">When Your Investments Succeed<br />We Succeed!</div>' +
                            '<div id="masthead-button"><a href="http://www.theoakbridge.com/section1.cfm">RECEIVE A CUSTOM FINANCIAL ANALYSIS</a></div>' +
                            '</div>');
}

jQuery(document).ready(function($) {
	external_buildHeaderMenu();
  external_initHeaderMenu();
  external_buildCalltoAction();
  if (window['external_buildCustom'] != undefined) {
    external_buildCustom();
  }
});

