var obj_marquee = {

	obj_data : {},

	init : function(obj_params) {

		var elm_target = document.getElementById(obj_params.str_id);
		var str_id     = elm_target.id;

		this.d = new Date();

		this.obj_data[str_id] = {

			bit_pause     : false,
			elm_scroll    : elm_target,
			int_start     : obj_params.int_height,
			int_stop      : -elm_target.offsetHeight,
			//int_increment : obj_params.int_increment,
			int_index     : obj_params.int_height,
			//int_index     : elm_target.offsetHeight
			var_speed	  : obj_params.var_speed,
			var_prevMS	  : this.d.getTime()
			
		};
//alert(elm_target.offsetHeight);
		//this.obj_data[str_id].int_index = this.obj_data[str_id].int_start;
		elm_target.style.position = 'absolute';
		elm_target.style.top      = this.obj_data[str_id].int_index + 'px';

		elm_target.onmouseover = function(obj_event) {
			obj_marquee.stop(str_id);
		}

		elm_target.onmouseout = function(obj_event) {
			obj_marquee.start(str_id);
		}

		setInterval('obj_marquee.execScroll("' + str_id + '");', obj_params.int_interval);

	},

	execScroll : function(str_id) {
		this.d = new Date();
		var ms = this.d.getTime();
		var delta = ms - this.obj_data[str_id].var_prevMS;
		var int_increment = (delta/25) * this.obj_data[str_id].var_speed;
		this.obj_data[str_id].var_prevMS = ms;

		if (!this.obj_data[str_id].bit_pause) {

			this.obj_data[str_id].int_index -= int_increment;

			if (this.obj_data[str_id].int_index < this.obj_data[str_id].int_stop) {
				this.obj_data[str_id].int_index = this.obj_data[str_id].int_start;
			}

			this.obj_data[str_id].elm_scroll.style.top = this.obj_data[str_id].int_index + 'px';

		}

	},

	stop : function(str_id) {

		obj_marquee.obj_data[str_id].bit_pause = true;

	},

	start : function(str_id) {

		obj_marquee.obj_data[str_id].bit_pause = false;

	}

}
