/*
Allclick
Author: Michele De Angelis
version 1.0

requires:
    jquery.js

** rende il box cliccabile e manda allo stesso indirizzo del link interno al box stesso **
*/

(function($) {
    $.allclick = {
        defaults: {
            box: '',
            href: ''
        }
    };
    
    $.fn.extend({
        allclick: function(config)
        {
            var config = $.extend({}, $.allclick.defaults, config);
            config.box = this;
            config.href = this.children('a').attr('href');
            
            makeBoxClick(config);
            
            return this;
        }
    });
    
    function makeBoxClick(config) 
    {
        var box = config.box;
        var href = config.href;
        
        box.css('cursor','pointer');
        box.bind('click',function()
        {
            window.location.href = href;
        })
    }
    
})(jQuery);
