function MiU() {}
MiU.prototype = {
	locationInfo:{},sLocation:'',sKeywords:'',sCategories:'',sAuthors:'',sSearchWord:'',rd:'rd=',beacon:'/oo/n.gif?',
	go: function() {
		this.setLocationInfo();
		if (!(document.referrer == null || document.referrer == '')) {
			this.setReferInfo();
		}
		for(var key in this.locationInfo) {
			this.sLocation += key + '=' + encodeURIComponent(this.locationInfo[key]) + '&';
		}
		var img = new Image();
		this.rd += Math.random();
		img.src = this.beacon + this.sLocation + this.rd;
		this.rd = '&' + this.rd;
		this.rd += '&media=' + encodeURIComponent(this.locationInfo['media']);
		this.rd += '&id=' + encodeURIComponent(this.locationInfo['id']);
		if(this.sKeywords != ''){
			var imgK = new Image();
			imgK.src = this.beacon + 'keywords=' + encodeURIComponent(this.sKeywords) + this.rd;
		}
		if(this.sCategories != ''){
			var imgC = new Image();
			imgC.src = this.beacon + 'categories=' + encodeURIComponent(this.sCategories) + this.rd;
		}
		if(this.sAuthors != ''){
			var imgA = new Image();
			imgA.src = this.beacon + 'authors=' + encodeURIComponent(this.sAuthors) + this.rd;
		}
		if(this.sSearchWord != ''){
			var imgS = new Image();
			imgS.src = this.beacon + 'searchword=' + encodeURIComponent(this.sSearchWord) + this.rd;
		}
	},
	setLocationInfo: function() {
		this.locationInfo['host'] = document.location.hostname;
		this.locationInfo['path'] = document.location.pathname;
		if (!(document.location.search.substr(1) == null || document.location.search.substr(1) == '')){this.locationInfo['query'] = document.location.search.substr(1);}
	},
	setReferInfo: function() {
		var protocol = document.referrer.substr(0, (document.referrer.indexOf('://') + 3));
		var refer = document.referrer.substr(protocol.length, document.referrer.length);
		var refers = refer.split('/');
		var referHost = refers[0];
		this.locationInfo['rhost'] = referHost;
		this.locationInfo['rpath'] = refer.substr(this.locationInfo['rhost'].length, refer.length);
		if(refer.indexOf('?') != -1){
			var work = refer.split('?');
			rquery = work[1];
			params = rquery.split('&');
			for(var i = 0; i<params.length; i++){
				var pair = params[i];
				param = pair.split('=');
				if(param[0] == 'q' || param[0] == 'as_q' || param[0] == 'p' || param[0] == 'MT') sSearchWord = param[1].replace('+',' ');
			}
		}
	}
}
