How to do "strtolower", "str_replace" and "preg_replace" in javascript?
===

How can I do this in javascript?

    $name = $xml->name;
    $file_name = strtolower($name);
    $file_name = str_replace(array('-','  ',' ','å','ä','ö'), array('',' ','-','a','a','o'), $file_name);
    $file_name = preg_replace("/[^a-z0-9-]+/i", "", $file_name);