﻿$(document).ready(function () {
    if ($(".p_menu ul li a#current").length > 0) {
        changeImg($(".p_menu ul li a#current").attr("img"));
    } else {
        changeImg($(".p_menu ul li a:first").attr("img"));
    }
    $(".p_menu ul li a").mouseover(function () {
        changeImg($(this).attr("img"));
    });
    $("a[rel=fb]").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'easingIn': 'easeOutBack',
        'easingOut': 'easeInBack'
    });
	if ($.browser.mozilla) $("#navcontainer").css("margin-left","43px");
});

function changeImg(file) {
    if (file != "") $("#work_image").attr("src", "images/Uploads/T_"+file);
}

function showtime(t) {
    if (typeof t !== "undefined") {
        var sec = parseInt(t % 60, 10);
        return parseInt(t / 60, 10) + ":" +
        (sec > 9 ? sec : "0" + sec);
    } else {
        return "0:00";
    }
}
