zoo/funcs.js
// replace all occurences of s1 to s2 in st

replace all occurences of s1 to s2 in st
replace all occurences of s1 to s2 in st
function replaceAllStr (st, s1, s2)
{
 if (s1!==s2)
   for (var i=1; i>=0;)
     {
     i = st.indexOf(s1);
     if (i>=0)
       st = st.replace(s1,s2);
     }
 return st;
}
function replaceAllStr ( st , s1 , s2 ) { if ( s1 !== s2 ) for ( var i = 1 ; i >= 0 ; ) { i = st . indexOf ( s1 ) ; if ( i >= 0 ) st = st . replace ( s1 , s2 ) ; } return st ; }
replace all occurences of s1 to s2 in st
replace all occurences of s1 to s2 in st