$(function(){
    $('#warning').remove(); /* REMOVE NON-JS USERS WARNING MESSAGE */
    $('#options li').each(function(){
        $(this).css({paddingTop:0,paddingBottom:0,paddingLeft:0})
        $('#options').css({listStyle: 'none', paddingLeft: 0});
        $(this).wrapInner('<div/>');
        $(this).children('div').children('h5').each(function(){
            var p = this.parentNode.parentNode;
            $(this).clone().prependTo(p);
        });
        $(this).children('div').children('h5').remove();
        $(this).children('div').wrapInner('<div/>')
        $(this).children('h5')
            .css({cursor:'pointer',paddingTop:'6px',paddingBottom:'6px',paddingLeft:'8px'})
            .hover(function(){
                $(this).css({background:'#ccc'});
            },function(){
                $(this).css({background:'#FFF'});
            });
        $(this).children('h5').next('div').hide();
        $(this).children('h5').click(function(){
            $(this).parent().addClass('activeOption')
            $(this).next('div').slideToggle(800,function(){
            });
            
        });
    })
    $('#likethis').click(function(){
       $(this).parent().seekAttention({
        
       });
       return false;
    });
    $('#likethis2').click(function(){
       $(this).parent().seekAttention({
            container: $('#wrap')
       });
       return false;
    });
    $('#button1').click(function(){
        $('#input1').seekAttention();
        return false;
    });

    $('#button11').click(function(){
        $('#input1').seekAttention();
        return false;
    });

    $('#button12').click(function(){
        $('#input1').seekAttention();
        return false;
    });

    $('#button13').click(function(){
        $('#input1').seekAttention();
        return false;
    });

    $('#button14').click(function(){
        $('#input1').seekAttention();
        return false;
    });

    $('#button15').click(function(){
        $('#input1').seekAttention();
        return false;
    });
    $('#button16').click(function(){
        $('#input1').seekAttention();
        return false;
    });
    $('#button17').click(function(){
        $('#input1').seekAttention();
        return false;
    });
    $('#button18').click(function(){
        $('#input1').seekAttention();
        return false;
    });
    $('#button19').click(function(){
        $('#input1').seekAttention();
        return false;
    });
    $('#button20').click(function(){
        $('#input1').seekAttention();
        return false;
    });
    $('#button21').click(function(){
        $('#input1').seekAttention();
        return false;
    });

    $('#button2').click(function(){
        $(this).parent().seekAttention({container:'#wrap'});
        return false;
    });
    
    
    
    $('#button3').click(function(){
        $('#para').seekAttention({
            paddingTop: 5,
            paddingBottom: 5,
            paddingLeft: 5,
            paddingRight: 5
        });
        return false;
    });
    
    
    
    $('#button4').click(function(){
        $('#my-important-link').seekAttention({
            paddingTop: 5,
            paddingBottom: 5,
            paddingLeft: 5,
            paddingRight: 5,
            opacity: 0.7
        });
        return false;
    });
    $('#button5').click(function(){
        $('#para2').seekAttention({
            pulse: false,
            paddingLeft: 10,
            paddingRight: 10
        });
        return false;
    });
    $('#button6').click(function(){
        var colorS = $('#selectcolor');
        var si = document.getElementById('selectcolor').selectedIndex;
        var color = $('#selectcolor').val() //document.getElementById('selectcolor').childNodes[si].value;
        $('#para3').seekAttention({
            color: color,
            paddingLeft: 10,
            paddingRight: 10
        });
        return false;
    });
    $('#button7').click(function(){
        $('#para4').seekAttention({
            paddingTop: 10,
            paddingBottom: 10,
            paddingLeft: 20,
            paddingRight: 20
        });
        return false;
    });
    $('#button8').click(function(){
        $('#para5').seekAttention({
            paddingLeft: 10,
            paddingRight: 10,
            pulseSpeed: 900
        });
        return false;
    });
    $('#button9').click(function(){
        $(this).next('img:eq(0)').seekAttention({
            container: $(this).parent()
        });
        return false;
    });
    $('#button10').click(function(){
        $('p.important:eq(0)').seekAttention({
            container: '#wrap',
            color: '#0c2340'
        });
        return false;
    });
});
        
$(document).ready(function() {
  function filterPath(string) {
  return string
    .replace(/^\//,'')
    .replace(/(index|default).[a-zA-Z]{3,4}$/,'')
    .replace(/\/$/,'');
  }
  
  var locationPath = filterPath(location.pathname);
  $('a[href*=#]').each(function() {
    var thisPath = filterPath(this.pathname) || locationPath;
    if (  locationPath == thisPath
    && (location.hostname == this.hostname || !this.hostname)
    && this.hash.replace(/#/,'') ) {
      var $target = $(this.hash), target = this.hash;
      if (target) {
        var targetOffset = $target.offset().top;
        $(this).click(function(event) {
          event.preventDefault();
          $('html, body').animate({scrollTop: targetOffset}, 400, function() {
            location.hash = target;
          });
        });
      }
    }
  });
});