function EgovinfoClickUtil() {
	var _this = this;
	var intervalObj = null;
	var clickurl = "/system/resource/egovinfo/getegovinfoclick.jsp";
	// 获取一个信息的点击次数
	_this.getEgovinfoClick = function(uuid, htmlobj) {
		if (window.jQuery) {
			clearInterval(intervalObj);
			jQuery.post(clickurl, {
						"uuid" : uuid,
						"actionmethod" : "getClick"
					}, function(data) {
						if (jQuery("#" + htmlobj)) {
							jQuery("#" + htmlobj).html(data.click);
						}
					}, "json");
		} else {
			_this.loadJquey();
			intervalObj = setInterval(function() {
						_this.getEgovinfoClick(uuid, htmlobj)
					}, 1000);
		}
	}
	_this.getEgovinfosClick = function(uuids, viewid) {
		if (window.jQuery) {
			clearInterval(intervalObj);
			jQuery.post(clickurl, {
						"uuids" : uuids,
						"actionmethod" : "getClicks"
					}, function(data) {
						for (var i = 0;data!=null&& i < data.length; i++) {
							if (jQuery("#" + data[i].uuid + viewid)) {
								jQuery("#" + data[i].uuid + viewid).html(data[i].click);
							}
						}
					}, "json");
		} else {
			_this.loadJquey();
			intervalObj = setInterval(function() {
						_this.getEgovinfoClick(uuid, htmlobj)
					}, 1000);
		}
	}
	// 一个公开信息增加一次点击次数
	_this.addEgovinfoClick = function(uuid) {
		if (window.jQuery) {
			clearInterval(intervalObj);
			jQuery.post(clickurl, {
						"uuid" : uuid,
						"actionmethod" : "addClick"
					}, function(data) {
					}, "json");
		} else {
			_this.loadJquey();
			intervalObj = setInterval(function() {
						_this.setEgovinfoClick(uuid)
					}, 1000);
		}
	}
	// 更新点击次数并且获取更新以后的
	_this.updateEgovinfoClick = function(uuid, htmlobj) {
		if (window.jQuery) {
			clearInterval(intervalObj);
			jQuery.post(clickurl, {
						"uuid" : uuid,
						"actionmethod" : "updateClick"
					}, function(data) {
						if (data && data.click) {
							if (jQuery("#" + htmlobj)) {
								jQuery("#" + htmlobj).html(data.click);
							}
						}
					}, "json");
		} else {
			_this.loadJquey();
			intervalObj = setInterval(function() {
						_this.updateEgovinfoClick(uuid, htmlobj)
					}, 1000);
		}
	}
	_this.loadJquey = function() {
		var head = document.getElementsByTagName('head');
		var jqueryScript = document.createElement('script');
		jqueryScript.src = "/system/resource/js/jquery/jquery-latest.min.js";
		jqueryScript.type = 'text/javascript';
		head[0].appendChild(jqueryScript);
	}
};