﻿function show(object, val) {
    document.getElementById(object).style.display = val;
}
function tabColor(object, val) {
    document.getElementById(object).style.background = val;
}
function fixPNG(selector) {
    var c = new Array();
    $(selector + ' img').each(function (j) {
        c[j] = new Image();
        c[j].src = this.src;

        if ($.browser.msie && this.src.substr(this.src.length - 4).toLowerCase() === '.png') {
            this.style.filter = "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)" + this.src + "')";
        }
    });

}

$(document).ready(function () {
    fixPNG(".fix-png");

    $(".in-field").inFieldLabels();

    $.fn.colorbox.settings.opacity = 0.5;
    $('a.register-link').colorbox({ iframe: true, innerWidth: 350, innerHeight: 375 });
    $("#colorbox-open").colorbox({ open: true, inline: true, width: "600px", href: "#colorbox-open" });
    $(".colorbox-inline").colorbox({ inline: true });
    $(".colorbox-iframe").colorbox({ iframe: true, innerWidth: 640, innerHeight: 390 });
    $(".colorbox-iframe-wide").colorbox({ iframe: true, innerWidth: 960, innerHeight: 400 });

    $('ul#rotator').innerfade({
        speed: 1700,
        timeout: 4000,
        type: 'sequence',
        containerheight: '394px'
    });

    $(".submit-on-enter").keyup(function (event) {
        if (event.keyCode == 13) {
            $(".submit-on-enter").next(".submit-on-enter-button").click();
        }
    });
});
