//<script type="text/javascript">

/**
 * Wait until the script has loaded. Note that we
 * can't rely on a jQuery event for this, if we're
 * only just loading jQuery ourselves, but jQuery will
 * be available by the time the function is called.
 */

window.SLI_MBOS = {};
 
sli_mbos_load = function($) {
  /**
   * Set up options and call recommend()
   * to display product recommendations
   * (if any are available).
   */
  window.SLI_MBOS.recommend($.extend({},
    // Give the default values the lowest priority.
    // The defaults themselves are set in mbos.js,
    // but available options are listed below with
    // their default values.
    window.SLI_MBOS.defaults,

    // Clients can set some SLI_MBOS_OPTIONS
    // to express preferences...
    typeof(window.SLI_MBOS_OPTIONS) == 'undefined' ? {} : window.SLI_MBOS_OPTIONS,

    // ...but we have the last word.
    // Set any engineer-specific options here:
    // clients will be unable to override these options.
    // Watch out for missing/misplaced commas!
    {
      // URL of the search service
      searchURI: window.location.protocol + '//search.americanbridal.com/search',

      // Template set to use
      templateSet: 'mbos',

      // Inline the CSS for fewer requests to the server.
      css: '.sli_mbos_results{position:relative;background:#eee;border-bottom:1px solid #999;zoom:1}.sli_mbos_results:after{content:\".\";display:block;height:0;clear:both;visibility:hidden}.sli_mbos_result{float:left;width:160px;text-align:middle}.sli_mbos_results h2{font-weight:normal;font-size:100%;padding:20px 10px 10px}.sli_mbos_results a.close{text-decoration:none;font-size:85%;color:#999}.sli_mbos_results a.close:hover{text-decoration:underline}.sli_mbos_results{position:relative;background:#eee;border-bottom:1px solid #999;zoom:1}.sli_mbos_results:after{content:\".\";display:block;height:0;clear:both;visibility:hidden}.sli_mbos_result{float:left;width:160px;text-align:middle}.sli_mbos_results h2{font-weight:normal;font-size:100%;padding:20px 10px 10px}.sli_mbos_results a.close{text-decoration:none;font-size:85%;color:#999}.sli_mbos_results a.close:hover{text-decoration:underline}.sli_mbos_results{top:-5px;margin:0 0 10px -6px;border-bottom:1px solid #c6c8e6;padding:0 20px;font-size:12px}.sli_mbos_results h2{font-size:15px;padding:20px 15px 10px}.sli_mbos_result{width:130px;margin:0 15px;text-align:center;text-decoration:none;padding:0 0 10px;color:inherit}.sli_mbos_result img{display:block;margin:0 auto 5px}.sli_mbos_result h3{font-size:13px;font-weight:normal;line-height:1em;min-height:3em}.sli_mbos_result h3:hover{text-decoration:underline}.sli_mbos_result strong{display:block;color:red;font-size:15px}',

      // Client ID (for Spark/Beacon)
      clientID: 524,

      // Site ID (for Spark/Beacon)
      siteID: 1

      // Number of results to show
      // nResults: 4,

      // Location in page to inject search results
      // into: '#sli_mbos_results'

      // HTML to show above results
      // header: '<h2>Looking for <strong>{QUERY}</query>? Try these results!</h2>',

      // HTML to show below results
      // footer: ''
    }
  ));
}

// There's no point in any of this if we don't have a referrer,
// unless we're being asked to check the configuration.
if (document.referrer || window.location.hash.indexOf('#FROM=') == 0 || window.location.search.indexOf('mbos=check') > -1) {
  // Load jQuery if it isn't already loaded
  if (typeof(jQuery) == 'undefined') {
    document.write('<s' + 'cript type="text/javascript" src="' + window.location.protocol + '//assets.resultspage.com/js/jquery-1.5.2.min.js"></s' + 'cript>');
    document.write('<s' + 'cript type="text/javascript" defer="defer">jQuery.noConflict();</s' + 'cript>')
  }

  if (typeof(SliSpark) == 'undefined') {
    document.write('<s' + 'cript type="text/javascript" src="' + window.location.protocol + '//b.sli-spark.com/sli-spark.js"></s' + 'cript>');
  }

  // Load the correct version of the MBOS script
  document.write('<s' + 'cript type="text/javascript" src="' + window.location.protocol + '//assets.resultspage.com/js/mbos/mbos-1.4-29.js" id="sli_mbos_loader"></s' + 'cript>');
  document.write('<s' + 'cript type="text/javascript" defer="defer">window.sli_mbos_load(jQuery);</s' + 'cript>');

}

//</script>
