function XSSMessageKit() {
	var self = this, cb = null, pipe = [], interval = null;
	function recv() {
		if(pipe.length) {
			var item = pipe.pop();
			(navigator.userAgent.indexOf('Safari')<0?document.getElementById(item[0]).contentWindow:frames[item[0]]).location.hash = 'msg'+(new Date()).getTime()+'|'+item[1];
		}
		if(arguments.callee.last == location.hash) return;
		var s = arguments.callee.last = location.hash;
		var c = s.indexOf('|');
		if(c >= 0) self.cb(s.substr(c+1));
	}
	this.send = function(name,msg) {
		pipe.unshift([name,msg]);
	};
	this.stop = function() {
		if(interval) clearInterval(interval);
		interval = null;
		return self;
	};
	this.start = function(cb) {
		self.stop();
		self.cb = cb;
		interval = setInterval(recv,200);
		return self;
	};
	return true;
}
