// a library for misc javascript functions
// do not put functions in here if they are specific to a certain situation (like need to be used with drupal)


// calls a function on every element in an array
function apply_func(func, array){
    var result = new Array();
    for(var i=0; i < array.length; i++){
        result.push(func(array[i]));
    }
    return result;
}

// adds a colored string of text to a text field for help (great for search fields with hidden search buttons)
function showHelp(obj, helpStr, color){
    if(obj.value == ''){
        obj.style.color = color;
        obj.value = helpStr;
    }
}
function hideHelp(obj, helpStr, color){
    if(obj.value == helpStr){
        obj.value = '';
        obj.style.color = color;
    }
}

