﻿var rndmSchm = new Array(
			"home",
			"portfolio",
			"experiments",
			"chronicles",
			"interaction"
		);

function randomValue(rndmSchm) {
    return rndmSchm[Math.round(Math.random() * (rndmSchm.length - 1))];
}

$.fn.addRandomClass = function (rndmSchm) {
    return this.attr("class", "s-" + randomValue(rndmSchm));
};

$(function () {
    if ($('body').hasClass("s-home")) {
        $('#frame').addRandomClass(rndmSchm);
        tipper($('#frame').attr("class"));
    }

    var el = $('#followers');
    var orgText = '';

    $.ajax({
        url: 'http://api.twitter.com/1/users/show.json',
        data: { screen_name: 'precisioncoding' },
        dataType: 'jsonp',
        success: function (data) {
            var cnt = data.followers_count;
            el.attr('title', el.attr('title').replace('the', cnt));
        },
        error: function () {
            el.attr('title', "Seem to have outwitted the twits");
        }
    });

    $('#topNav li:first').css("margin-left", "0");
    $('#topNav li:last').css("margin-right", "0");

});

var gOverride = {
    urlBase: 'http://gridder.andreehansson.se/releases/latest/',
    gColor: '#EEEEEE',
    gColumns: 12,
    gOpacity: 0.35,
    gWidth: 10,
    pColor: '#C0C0C0',
    pHeight: 16,
    pOffset: 0,
    pOpacity: 0.55,
    center: true,
    gEnabled: true,
    pEnabled: true,
    setupEnabled: true,
    fixFlash: true,
    size: 960
};
