<!--

//** Open a popup window for print view
	function print_open (url) {
      if(url != '')
        open(url, '_blank', 'width=530,resizable=yes,scrollbars=yes');
    }

/**
 * Rotate Items (magicinfo.js)
 * Copyright (c) 2009 Jack Szwergold. All rights reserved.
 *
 * w: http://www.runwork.com
 * e: me@runwork.com
 *
 * Created: 2009-03-29
 * Version: 2009-03-30
 *
 */

  var Rotate = Class.create();

  Rotate.prototype = {

    initialize: function(items, background, element, speed, effect_speed, json_items) {
      this.items = typeof(items) != 'undefined' ? items : '';
      this.background = typeof(background) != 'undefined' ? background : '';
      this.element = typeof(element) != 'undefined' ? element : '';
      this.speed = typeof(speed) != 'undefined' ? speed : 0;
      this.effect_speed = typeof(effect_speed) != 'undefined' ? effect_speed : 0;
      if (typeof(json_items) != 'undefined') {
        this.json_items = Object.toJSON(json_items).evalJSON();
        var parent = this;
        new PeriodicalExecuter( function() { parent.single(); }, speed);
      }
    },

    destroy: function() {
    },

    single: function () {
	  var first = this.items.down(this.element, 0);
	  var next = this.json_items.shift();
	  this.json_items.push(next);
	  var parent = this;
	  if ((typeof(this.effect_speed) == 'undefined') || this.effect_speed <= 0 ) {
	    this.items.update(next);
	  }
	  else {
	    new Effect.Fade(first, { duration: this.effect_speed, from: 100, to: 0, delay: 0, afterFinish:
	      function () {
	        parent.items.update(next);
	        $(parent.background).update(parent.json_items[0]);
	      }
	    });
	  }
    }

  }

// -->
