﻿///<reference path="jquery-1.3.2.min-vsdoc.js" />
$().ready(function() {
    FixUrlTextBox();
    RandomBg();
    Buttons();
    CheckBrowser();
});

function FixUrlTextBox() {
    if ($('#tburl').val() == '')
        $('#tburl').val('Vinkr your url!');

    $('#tburl').focus(function() {
        if ($(this).val() == 'Vinkr your url!')
            $(this).val('');
    });

    $('#tburl').blur(function() {
        if ($(this).val() == '')
            $(this).val('Vinkr your url!');
    });
}

function BeginVinkralize() {
    $.blockUI({ message: '<h1>Vinkring your url...</h1>' });
}

function VinkrCreated() {
    $.unblockUI();
}

function RandomBg() {
    var colors = new Array('#09f', '#ff0066', '#006db5', '#00b53c', '#901753', '#07bce3', '#e307d6', '#ff9c00');
    var rndNum = Math.floor(Math.random() * colors.length);
    $("body").css("background-color", colors[rndNum]);
}

function Buttons() {
    $('a[rel="icon"] img').fadeTo('fast', 0.33);
    $('a[rel="icon"] img').hover(function() { $(this).fadeTo('slow', 1); });
    $('a[rel="icon"] img').mouseout(function() { $(this).fadeTo('slow', 0.33); });
}

function CheckBrowser() {
    if ($.browser.msie && $.browser.version > 7)
        $('.accelerator').show();
    else
        $('.accelerator').hide();
}