﻿var userAgent = navigator.userAgent.toLowerCase();
isIE = false;
if (userAgent.indexOf('msie') > 0) {
    isIE = true;
}

function appear(objectID) {
    // IE
    if (isIE) {
        $(objectID).fadeIn('slow', function () { });
    }
    // Normal browsers
    else {
        $(objectID).slideDown('slow', function () { });
    }
}

function disappear(objectID) {
    // IE
    if (isIE) {
        $(objectID).fadeOut('slow', function () { });
    }
    // Normal browsers
    else {
        $(objectID).slideUp('slow', function () { });
    }
}


function removeInfo() {
    disappear('#divFailed');
    $('input').removeClass('inputerror');    
}

// If ENTER is pressed, "submit" JSON
function onEnter(event) {
    if (window.event)
        key = window.event.keyCode;
    else
        key = event.which;

    if (key == 13) {
        submit();
    }
}