﻿/*!
* jQuery Clickable v1.0b
* http://pixeltango.com
*
* Copyright 2010, PixelTango
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Date: Fri Aug 20 08:10:07 2010 +0100
*/
jQuery.fn.clickable = function (f, b) {
    b = jQuery.extend({ hoverClass: "hover", changeCursor: true }, b); return this.each(function () {
        var a = $(this), c = f != null ? a.find(f) : a.find("a:first"); if (c != null) {
            var d = c.attr("href"), g = function (e) { a.addClass(b.hoverClass); e.type != "focus" && c.focus().css("outline", "none"); window.status = d; b.changeCursor && a.css("cursor", "pointer") }, h = function (e) { a.removeClass(b.hoverClass); e.type != "blur" && c.blur().css("outline", "inherit"); window.status = ""; b.changeCursor && a.css("cursor", "auto") };
            a.click(function () { if (c.attr("target") == "_blank") window.open(d, "_blank"); else window.location.href = d }).hover(g, h); c.focus(g).blur(h)
        } 
    })
};
