function nMap(obj, config) {
	nDynamic(obj);
	obj.nName = 'nMap';

	var sizeFactor = 1;
	
	for (var i in config.coords) {
		
		sizeFactor = Math.round(Math.random() * 10);
		
		obj.point = document.createElement('img');
		obj.point.className = config.pointClassName;
		
		nMapPoint(obj.point, {
			left: config.coords[i].x,
			top: config.coords[i].y,
			min: sizeFactor + 10,
			max: sizeFactor * 4 + 20
		});
		
		obj.appendChild(obj.point);
	}
}


function nMapPoint(obj, config) {
	
	nDynamic(obj);
	obj.name = 'nMapPoint';

	config.max >>= 1;
	config.min >>= 1;
	
	obj.config = {
		factor: 0.01,
		min: 10,
		max: 30,
		left: 0,
		top: 0,
		image: (nConfig.isIE)? 'js/nDynamic/nMap/images/nMapLocationFrame8.png' : 'js/nDynamic/nMap/images/nMapLocationFrame7.png',
		random: function() {
			return Math.floor(Math.random() * 20000) + 5000;
		}
	}

	obj.configure(config);

	obj.css({
		position: 'absolute',
		left: obj.config.left + 'px',
		top: obj.config.top + 'px',
		zIndex: 1,
		width: (obj.config.min + 'px') || 0
	});

	if (obj.config.image) {
		obj.src = obj.config.image;
	}
	
	obj.pulseTimeout = null;

	obj.size = new nAction({
		obj: obj,
		factor: obj.config.factor,
		n: obj.config.min,
		start: obj.config.min,
		end: obj.config.max,
		onActivate:function() {
			this.n = this.start;
		},
		onLoop:function() {
			this.decelerate();
		},
		onUpdate:function() {
			this.obj.style.width = this.n * 2 + 'px';
			this.obj.style.height = this.n * 2 + 'px';
			this.obj.style.left = (this.obj.config.left - (this.n)) + 'px';
			this.obj.style.top = (this.obj.config.top - (this.n)) + 'px';
			
		},
		onDeactivate:function() {
			this.n = this.start;
			this.onUpdate();
			this.obj.opacity.deactivate();
		}
	});

	obj.opacity = new nAction({
		obj: obj,
		n: 0,
		start: 100,
		end: 0,
		onActivate:function() {
			this.n = this.start;
			this.detectDirection();
		},
		onLoop:function() {
			this.depended(this.obj.size);
//			this.n = (obj.config.min + 100) - (this.n);
		},
		onEndDetection:null,
		onDeactivate:function() {
			this.n = this.end;
			this.onUpdate();
			this.obj.randomPulse();
		}
	});

	if (!nConfig.isIE) {
		obj.opacity.onUpdate = function() {
			this.obj.style.opacity = this.n/100;
		}
	} else {
		obj.opacity.onUpdate = function() {
			this.obj.style.filter = 'alpha(opacity=' + this.n + ')';
		}
	}
	
	obj.opacity.onUpdate();
	
	obj.pulse = function() {
		obj.size.activate();
		obj.opacity.activate();
	}
	
	obj.randomPulse = function() {
		setTimeout(function() {
			obj.pulse();
		}, obj.config.random());
	}
	
	nConfig.addEvent(obj, 'mouseover', function() {
		obj.pulse();
	});
	
	setTimeout(function() {
		obj.pulse();
	}, Math.floor(Math.random() * 20000));
}