/**
 * @author rgranadino
 */
var eyemagineBlog = {
    init: function() {
        if ($('blog-category-select')) {
            Event.observe($('blog-category-select'),'change',this.categoryChangeHandler,false);
        }
    },
    categoryChangeHandler: function(e) {
        if (!this.value) {
            return true;
        }
        var asplode = document.location.pathname.split('/');
        var path = document.location.protocol + '//' + document.location.hostname+'/'+asplode[1]+'/cat/'+this.value;
        if (path != document.location) {//only redirect if necessary
            document.location = path;
        }
    }
};

Event.observe(window,'load',eyemagineBlog.init.bindAsEventListener(eyemagineBlog),false);
