var time_after_load = 0;
$(document).ready(function() {
    setInterval("time_after_load++;", 1000);
    $('.mailtome').attr('href', 'ma' + 'il' + 'to' + ':as' + 'm@' + 'as' + 'm.' + 'lt');
    $('a.mailtome:first').html('as' + 'm@' + 'as' + 'm.' + 'lt');
    $('.callme').html('+37' + '0 ' + '67' + '4 ' + '74' + ' 1' + '31');
    $('#card').mouseover(
        function() {
            //$('#clickformore').show('slow');
            $('.clickformoreblack').switchClass('clickformoreblack', 'clickformorered', 500);
            setTimeout('$(\'.clickformorered\').switchClass(\'clickformorered\', \'clickformoreblack\',  500)', 600);
        }
    );
    // countdown
/*    var dateNow = new Date();
    var dateUntil = new Date(2012, 1, 27, 11, 0, 0, 0);
    var dateDiff = dateUntil.getTime() - dateNow.getTime();
    dateDiffS = Math.round(dateDiff / 1000); // NASTY - it's global
    
    if (dateDiffS > 0) {
        waitForBigBadaboom();
    } else {
        bigBadaboom();
    }
    var countdown = setInterval(function(){
        if (dateDiffS > 0) {
	    waitForBigBadaboom();
	} else {
	    bigBadaboom();
            clearInterval(countdown);
	}
    }, 1000);*/ // fuck it, I don't need it anymore
});
$(window).resize(function() {
});
function bigBadaboom() {
    $('#bigbadaboom').html('big BIG bada boom!');
}
function waitForBigBadaboom() {
    $('#countdown_seconds').html(dateDiffS--);
}
function more() {
    $('#content').switchClass('content_out', 'content_in', 700);
    $('#details').switchClass('details_out', 'details_in', 700);
    var tracker = _gat._getTrackerByName();
    tracker._trackEvent('main', "more", "after " + time_after_load + " secs", time_after_load);
    tracker._trackPageview('/more');
}

function less() {
    $('#content').switchClass('content_in', 'content_out', 700);
    $('#details').switchClass('details_in', 'details_out', 700);
    var tracker = _gat._getTrackerByName();
    tracker._trackEvent('main', "less", "after " + time_after_load + " secs", time_after_load);
    tracker._trackPageview('/less');
}

function cv() {
    var tracker = _gat._getTrackerByName();
    tracker._trackEvent('main', "cv", "after " + time_after_load + " secs", time_after_load);
    tracker._trackPageview('/cv');
}

function clickAction(actionName, doTrackPageview) {
    if (actionName == undefined) {
        return;
    }
    if (doTrackPageview == undefined) {
        doTrackPageview = false;
    }
    var tracker = _gat._getTrackerByName();
    tracker._trackEvent('main', actionName, 'after ' + time_after_load + ' secs', time_after_load);
    if (doTrackPageview == true) {
        tracker._trackPageview('/' + actionName);
    }
}

