$(document).ready(function() {
    $(this).run();
});

jQuery.fn.run = function() {

    var context = this;
    
    //$.ifixpng('/img/blank.gif');
    //$('*', this).ifixpng();
    
    $('.focus-blur', context).each(function() {
        $(this).attr('default', $(this).val());
        $(this).bind('focus',function() {
            if ($(this).val() == $(this).attr('default')) {
                $(this).val('');
            }
        });
        $(this).bind('blur',function() {
            if ($(this).val() == '') {
                $(this).val($(this).attr('default'));
            }
        });
    });
    
    $('.form-submit', context).click(function() {
        $(this).parents('form').submit();
        return false;
    });
    
    $("a[href$=.jpg],a[href$=.png],a[href$=.gif]").has('img').each(function() {
        if (!$(this).attr('title')) {
            $(this).attr('title', $(this).attr('href').split('/').pop());
        }
        $(this).fancybox({'titlePosition':'inside','overlayShow':true,'centerOnScroll':false,'autoScale':false});
    });
    
    return this;

};
