
/* Fetch and add latest tweet to twitter widgets */
$(document).ready(function () {
    if ($("p#twitterWidget")) {
        //$.getJSON("http://twitter.com/statuses/user_timeline/CPFrontrunner.json?callback=?", function (data) {
        $.getJSON("http://api.twitter.com/1/statuses/user_timeline.json?screen_name=CPFrontrunner&count=1&callback=?", function (data) {
            $("p#twitterWidget").html(data[0].text);
            var h = "http://twitter.com/CPFrontrunner/status/" + data[0].id_str;
            var a = $("<a/>").attr("href", h);
            $("p#twitterWidget").wrap(a);

            var b = 5;
            b = b + $("p#twitterWidget").height();
            $("p#twitterWidget").parent().height(b);
        });
    }

  $("a[rel^='prettyPhoto']").prettyPhoto({deeplinking:false} );
   
});


$.fn.clearOnFocus = function () {
        return this.focus(function () {
            var v = $(this).val();
            $(this).val(v == this.defaultValue ? '' : v);
        }).blur(function () {
            var v = $(this).val();
            $(this).val(v.match(/^\s+$|^$/) ? this.defaultValue : v);
        });
    };
