﻿/**
 *  Artist Search Functions
 */


/**
 *  Clears the input field
 */
function clearField() {
    $('searchString').value = "";
}

/**
 *  Check of the keypress is "enter"
 */
function checkEnter(e) {
    var characterCode;
    if(e && e.which) { //if which property of event object is supported (NN4)
        e = e;
        characterCode = e.which; //character code is contained in NN4's which property
    } else {
        e = event;
        characterCode = e.keyCode; //character code is contained in IE's keyCode property
    }
    if(characterCode == 13) {
        return true;
    } else {
        return false;
    }
}

/**
 *  Submit the form with the right Query String
 */
function submitForm() {
    document.forms["searchForm"].action = "/search/search.aspx?aid=" + $("searchString").value.toUpperCase();
    document.forms["searchForm"].submit();
}
        
