$.fn.activeNav = function(activeClass, strict) {
    strict = (typeof strict == 'undefined') ? true : strict;
    activeClass = activeClass || "active";
    var condition;
    return this.each(function() {
        if(strict) {
            condition = (this.href == window.location.href || this.href.split('?')[0] == window.location.href.split('?')[0]) ? true : false;
        }
        else {
            condition = (this.href == window.location.href) ? true : false;
        }
        if(condition) {
            $(this).addClass(activeClass);
        }
    })
}
$.fn.switcher = function(targets, callback) {
    callback = callback || function(){};
    var group = this;
    $(targets).each(function() {
        if(typeof this.nodeName != "undefined" && this.nodeName == "IMG") {
            $("<img>").attr("src", this.src);
        }
        else if(typeof this.nodeName != "undefined") {
            $(this).find("img").each(function() {
                $("<img>").attr("src", this.src);
            })
        }
    })
    return this.each(function() {
        $(this).click(function() {
            var id = this.href.split("#")[1];
            if(typeof id == "undefined") return false;
            $(targets).hide().filter("." + id).css("display", "");
            group.removeClass("active");
            for(var i = 0; i < group.length; i ++) {
                if(group[i].href == this.href) group.eq(i).addClass("active");
            }
            callback.call(this, group);
            return false;
        })
    })
}

Rot13={map:null,convert:function(a){Rot13.init();var s="";for(i=0;i<a.length;i++){var b=a.charAt(i);s+=((b>='A'&&b<='Z')||(b>='a'&&b<='z')?Rot13.map[b]:b);}
return s;},init:function(){if(Rot13.map!=null)
return;var map=new Array();var s="abcdefghijklmnopqrstuvwxyz";for(i=0;i<s.length;i++)
map[s.charAt(i)]=s.charAt((i+13)%26);for(i=0;i<s.length;i++)
map[s.charAt(i).toUpperCase()]=s.charAt((i+13)%26).toUpperCase();Rot13.map=map;},write:function(a){document.write(Rot13.convert(a));}}


