
  /**
        application's common javascript file
  */

  /**

    Mad Rabbit CMS - PHP Templated Website Content Management System
    (c) copyright july 2008 Raphaël SEBAN.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

  */


  function rfi_preload_images() {
    // safety controls
    if(typeof document.images == 'undefined') return false;
    // inits
    var _argv = rfi_preload_images.arguments;
    var _argc = _argv.length;
    // image cache inits
    if(!document.imgcache) document.imgcache = new Array();
    var _index = document.imgcache.length;
    // browse function arguments (params)
    for(var _i = 0 ; _i < _argc ; _i++) {
      // got something good in params?
      if(_argv[_i].indexOf('#') < 0) {
        // let's create a new image object
        document.imgcache[_index] = new Image;
        // let's load contents by URL
        document.imgcache[_index].src = String(_argv[_i]);
        // next object
        _index++;
      } // end if
    } // end loop
    // confirm op
    return true;
  } // end function


  function rfi_renum(text_, precision_, number_) {
    // safety controls
    if(!text_) return '';
    // inits
    var _numstr = String(number_);
    // completion loop
    while(_numstr.length < precision_) {
      // init completion w/signicant nils
      _numstr = '0' + _numstr;
    } // end loop
    // return results
    return text_.replace(/%d/, _numstr);
  } // end function



