﻿/* 
* Name          : iSelected
* Version       : 1.0
* Author        : pivanov.com
* Author email  : me@pivanov.com
*
* Examples of use:
*
*	$(switchElement).iSelected({
*		className   : 'name'
*	});
*/

(function ($) {
    $.fn.iSelected = function (options) {

        var options = $.extend({}, $.fn.iSelected.defaults, options),
			className = options.className;

        var $this = $(this);

        var path = decodeURI(location.pathname + location.search);
        if (path)
            $this.find('a[href*="' + path + '"]').attr('class', className);
    };

    $.fn.iSelected.defaults = {
        className: 'selected'
    };
})(jQuery);
