
var saveTime=1000*30;
if (!Array.prototype.push) {
	Array.prototype.push = function () {
		var startLength = this.length;
		for (var i = 0; i < arguments.length; i++) {
			this[startLength + i] = arguments[i];
		}
		return this.length;
	};
}
function G() {
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++) {
		var element = arguments[i];
		if (typeof element == "string") {
			element = document.getElementById(element);
		}
		if (arguments.length == 1) {
			return element;
		}
		elements.push(element);
	}
	return elements;
}
Function.prototype.bind = function (object) {
	var __method = this;
	return function () {
		__method.apply(object, arguments);
	};
};
Function.prototype.bindAsEventListener = function (object) {
	var __method = this;
	return function (event) {
		__method.call(object, event || window.event);
	};
};
Object.extend = function (destination, source) {
	for (property in source) {
		destination[property] = source[property];
	}
	return destination;
};
if (!window.Event) {
	var Event = new Object();
}
Object.extend(Event, {observers:false, element:function (event) {
	return event.target || event.srcElement;
}, isLeftClick:function (event) {
	return (((event.which) && (event.which == 1)) || ((event.button) && (event.button == 1)));
}, pointerX:function (event) {
	return event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft));
}, pointerY:function (event) {
	return event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop));
}, stop:function (event) {
	if (event.preventDefault) {
		event.preventDefault();
		event.stopPropagation();
	} else {
		event.returnValue = false;
		event.cancelBubble = true;
	}
}, findElement:function (event, tagName) {
	var element = Event.element(event);
	while (element.parentNode && (!element.tagName || (element.tagName.toUpperCase() != tagName.toUpperCase()))) {
		element = element.parentNode;
	}
	return element;
}, _observeAndCache:function (element, name, observer, useCapture) {
	if (!this.observers) {
		this.observers = [];
	}
	if (element.addEventListener) {
		this.observers.push([element, name, observer, useCapture]);
		element.addEventListener(name, observer, useCapture);
	} else {
		if (element.attachEvent) {
			this.observers.push([element, name, observer, useCapture]);
			element.attachEvent("on" + name, observer);
		}
	}
}, unloadCache:function () {
	if (!Event.observers) {
		return;
	}
	for (var i = 0; i < Event.observers.length; i++) {
		Event.stopObserving.apply(this, Event.observers[i]);
		Event.observers[i][0] = null;
	}
	Event.observers = false;
}, observe:function (element, name, observer, useCapture) {
	var element = G(element);
	useCapture = useCapture || false;
	if (name == "keypress" && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
		name = "keydown";
	}
	this._observeAndCache(element, name, observer, useCapture);
}, stopObserving:function (element, name, observer, useCapture) {
	var element = G(element);
	useCapture = useCapture || false;
	if (name == "keypress" && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent)) {
		name = "keydown";
	}
	if (element.removeEventListener) {
		element.removeEventListener(name, observer, useCapture);
	} else {
		if (element.detachEvent) {
			element.detachEvent("on" + name, observer);
		}
	}
}});
Event.observe(window, "unload", Event.unloadCache, false);
var Class = function () {
	var _class = function () {
		this.initialize.apply(this, arguments);
	};
	for (i = 0; i < arguments.length; i++) {
		superClass = arguments[i];
		for (member in superClass.prototype) {
			_class.prototype[member] = superClass.prototype[member];
		}
	}
	_class.child = function () {
		return new Class(this);
	};
	_class.extend = function (f) {
		for (property in f) {
			_class.prototype[property] = f[property];
		}
	};
	return _class;
};
function space(flag) {
	if (flag == "begin") {
		var ele = document.getElementById("ft");
		if (typeof (ele) != "undefined" && ele != null) {
			ele.id = "ft_popup";
		}
		ele = document.getElementById("usrbar");
		if (typeof (ele) != "undefined" && ele != null) {
			ele.id = "usrbar_popup";
		}
	} else {
		if (flag == "end") {
			var ele = document.getElementById("ft_popup");
			if (typeof (ele) != "undefined" && ele != null) {
				ele.id = "ft";
			}
			ele = document.getElementById("usrbar_popup");
			if (typeof (ele) != "undefined" && ele != null) {
				ele.id = "usrbar";
			}
		}
	}
}
//定义弹出窗口
var Popup = new Class();
Popup.prototype = {
	iframeIdName:"ifr_popup", 
	initialize:function (config) {//初始化配置
		this.config = Object.extend({contentType:1, isHaveTitle:true, scrollType:"no", isBackgroundCanClick:false, isSupportDraging:true, isShowShadow:true, isReloadOnClose:true, width:400, height:300}, config || {});
		this.info = {shadowWidth:4, title:"", contentUrl:"", contentHtml:"", callBack:null, parameter:null, confirmCon:"", alertCon:"", someHiddenTag:"select,object,embed", someDisabledBtn:"", someHiddenEle:"", overlay:0, coverOpacity:60};
		this.color = {cColor:"#EEEEEE", bColor:"#FFFFFF", tColor:"#A5ACB2", wColor:"#FFFFFF"};
		this.titleImage = path+"/images/title_bg.gif";
		this.dropClass = null;
		this.someToHidden = [];
		this.someToDisabled = [];
		if (!this.config.isHaveTitle) {//如果无标题就不支持，拖拽
			this.config.isSupportDraging = false;
		}
		this.iniBuild();//初始化编译，重新生成对话框dom对象（先删后加）
	},setContent:function (arrt, val) {//设置内容
		if (val != "") {
			switch (arrt) {
			  case "width":
				this.config.width = val;
				break;
			  case "height":
				this.config.height = val;
				break;
			  case "title":
				this.info.title = val;
				break;
			  case "contentUrl":
				this.info.contentUrl = val;
				break;
			  case "contentHtml":
				this.info.contentHtml = val;
				break;
			  case "callBack":
				this.info.callBack = val;
				break;
			  case "parameter":
				this.info.parameter = val;
				break;
			  case "confirmCon":
				this.info.confirmCon = val;
				break;
			  case "alertCon":
				this.info.alertCon = val;
				break;
			  case "someHiddenTag":
				this.info.someHiddenTag = val;
				break;
			  case "someHiddenEle":
				this.info.someHiddenEle = val;
				break;
			  case "someDisabledBtn":
				this.info.someDisabledBtn = val;
				break;
			  case "overlay":
				this.info.overlay = val;
			}
		}
	},iniBuild:function () {//初始化编译，重新生成对话框dom对象（先删后加）
		G("dialogCase") ? G("dialogCase").parentNode.removeChild(G("dialogCase")) : function () {
		};
		var oDiv = document.createElement("span");
		oDiv.id = "dialogCase";
		document.body.appendChild(oDiv);
	},build:function () {
		//控制z
		var baseZIndex = 10001 + this.info.overlay * 10;
		var showZIndex = baseZIndex + 2;
		this.iframeIdName = "ifr_popup" + this.info.overlay;
		//图片路径
		//var path = "../images/";
		//关闭按钮
		var close = "<input type=\"image\" id=\"dialogBoxClose\" src=\"" + path + "/images/dialogclose.gif\" border=\"0\"  align=\"absmiddle\" title=\"\u5173\u95ed2\"/>";
		//遮盖程度
		var cB = "filter: alpha(opacity=" + this.info.coverOpacity + ");opacity:" + this.info.coverOpacity / 100 + ";";
		//遮盖层
		var cover = "<div id=\"dialogBoxBG\" style=\"position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:" + baseZIndex + ";" + cB + "background-color:" + this.color.cColor + ";display:none;\"></div>";	
		//主要显示内容
		var mainBox = "<div id=\"dialogBox\" style=\"border:1px solid " + this.color.tColor + ";display:none;z-index:" + showZIndex + ";position:relative;width:" + this.config.width + "px;\">"
		+"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"" + this.color.bColor + "\">";	
		if (this.config.isHaveTitle) {//判断需要不需要标题
			mainBox += "<tr height=\"24\" style=\"background:url(" + this.titleImage + ") repeat-x;color:#000\"><td>"
						+"<table style=\"-moz-user-select:none;height:24px;\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ><tr>" 
						+ "<td width=\"6\" height=\"24\"></td><td id=\"dialogBoxTitle\" style=\"color:#000;font-size:14px;font-weight:bold;\">" 
						+ this.info.title + "&nbsp;</td>" 
						+ "<td id=\"dialogClose\" width=\"20\" align=\"right\" valign=\"middle\">" + close + "</td><td width=\"6\"></td></tr></table></td></tr>";
		} else {
			mainBox += "<tr height=\"10\"><td align=\"right\">" + close + "</td></tr>";
		}
		mainBox += "<tr style=\"height:" + this.config.height + "px\" valign=\"top\"><td id=\"dialogBody\" style=\"position:relative;\"></td></tr></table></div>" 
			+ "<div id=\"dialogBoxShadow\" style=\"display:none;z-index:" + baseZIndex + ";\"></div>";
		//由是否需要标题决定显示
		//document.getElementById('popcnt').value=mainBox;
		if (!this.config.isBackgroundCanClick) {
			//document.getElementById('popcnt').value=cover + mainBox;
			G("dialogCase").innerHTML = cover + mainBox;
			G("dialogBoxBG").style.height = document.body.scrollHeight;
		} else {
			G("dialogCase").innerHTML = mainBox;
		}
		//alert(mainBox);
		Event.observe(G("dialogBoxClose"), "click", this.reset.bindAsEventListener(this), false);
		//构造拖拽类
		if (this.config.isSupportDraging) {
			dropClass = new Dragdrop(this.config.width, this.config.height, this.info.shadowWidth, this.config.isSupportDraging, this.config.contentType);
			G("dialogBoxTitle").style.cursor = "move";
		}
		this.lastBuild();
	}, lastBuild:function () {
		var confirm = "<div style=\"width:100%;height:100%;text-align:center;\"><div style=\"margin:20px 20px 0 20px;font-size:14px;line-height:16px;color:#000000;\">"
			 + this.info.confirmCon + "</div>"
			 +"<div style=\"margin:20px;\"><input id=\"dialogOk\" type=\"button\" value=\"  \u786e\u5b9a  \"/>&nbsp;<input id=\"dialogCancel\" type=\"button\" value=\"  \u53d6\u6d88  \"/></div></div>";
		var alert = "<div style=\"width:100%;height:100%;text-align:center;\"><div style=\"margin:20px 20px 0 20px;font-size:14px;line-height:16px;color:#000000;\">" + this.info.alertCon 
			+ "</div><div style=\"margin:20px;\"><input id=\"dialogYES\" type=\"button\" value=\"  \u786e\u5b9a  \"/></div></div>";
		var baseZIndex = 10001 + this.info.overlay * 10;
		var coverIfZIndex = baseZIndex + 4;
		if (this.config.contentType == 1) {//iframe提交，结果提示型的
			var openIframe = "<iframe width='100%' style='height:" + this.config.height + "px' name='" + this.iframeIdName + "' id='" + this.iframeIdName + "' src='" + this.info.contentUrl + "' frameborder='0' scrolling='" + this.config.scrollType + "'></iframe>";
			//在拖到对话框时对内容部分的遮盖div
			var coverIframe = "<div id='iframeBG' style='position:absolute;top:0px;left:0px;width:1px;height:1px;z-index:" + coverIfZIndex + ";filter: alpha(opacity=90);opacity:0.90;background-color:#ffffff;'><div>";
			G("dialogBody").innerHTML = openIframe + coverIframe;
		} else {
			if (this.config.contentType == 2) {//提示型的
				G("dialogBody").innerHTML = this.info.contentHtml;
			} else {
				if (this.config.contentType == 3) {//ok,cancel型的
					G("dialogBody").innerHTML = confirm;
					Event.observe(G("dialogOk"), "click", this.forCallback.bindAsEventListener(this), false);
					Event.observe(G("dialogCancel"), "click", this.close.bindAsEventListener(this), false);
				} else {
					if (this.config.contentType == 4) {//ok型的
						G("dialogBody").innerHTML = alert;
						Event.observe(G("dialogYES"), "click", this.close.bindAsEventListener(this), false);
					}
				}
			}
		}
	}, reBuild:function () {
		if (G("dialogBoxTitle")!=null)
			G("dialogBoxTitle").innerHTML = this.info.title;
		G("dialogBody").height = G("dialogBody").clientHeight;
		this.lastBuild();
	}, show:function () {
		//处理隐藏
		this.hiddenSome();
		//控制对话框居中
		this.middle();
		//显示阴影层
		if (this.config.isShowShadow) {
			this.shadow();
		}
	}, forCallback:function () {
		return this.info.callBack(this.info.parameter);
	}, shadow:function () {//显示阴影层
		var oShadow = G("dialogBoxShadow");
		var oDialog = G("dialogBox");
		oShadow["style"]["position"] = "absolute";
		oShadow["style"]["background"] = "#000";
		oShadow["style"]["display"] = "";
		oShadow["style"]["opacity"] = "0.2";
		oShadow["style"]["filter"] = "alpha(opacity=20)";
		oShadow["style"]["top"] = oDialog.offsetTop + this.info.shadowWidth;
		oShadow["style"]["left"] = oDialog.offsetLeft + this.info.shadowWidth;
		oShadow["style"]["width"] = oDialog.offsetWidth;
		oShadow["style"]["height"] = oDialog.offsetHeight;
	}, middle:function () {//控制对话框居中
		if (!this.config.isBackgroundCanClick) {//不能点就显示“遮盖层”
			G("dialogBoxBG").style.display = "";
		}
		var oDialog = G("dialogBox");
		oDialog["style"]["position"] = "absolute";
		oDialog["style"]["display"] = "";
		var sClientWidth = document.body.clientWidth;
		var sClientHeight = document.body.clientHeight;
		var sScrollTop = document.body.scrollTop;
		var sleft = (document.body.clientWidth / 2) - (oDialog.offsetWidth / 2);
		var iTop = -80 + (sClientHeight / 2 + sScrollTop) - (oDialog.offsetHeight / 2);
		var sTop = iTop > 0 ? iTop : (sClientHeight / 2 + sScrollTop) - (oDialog.offsetHeight / 2);
		if (sTop < 1) {
			sTop = "20";
		}
		if (sleft < 1) {
			sleft = "20";
		}
		oDialog["style"]["left"] = sleft;
		oDialog["style"]["top"] = sTop;
	}, reset:function () {//点击reset，先调用close
		if (this.config.isReloadOnClose) {
			top.location.reload();
		}
		this.close();
	}, close:function () {//点击reset，先调用close
		G("dialogBox").style.display = "none";
		if (!this.config.isBackgroundCanClick) {
			G("dialogBoxBG").style.display = "none";
		}
		if (this.config.isShowShadow) {
			G("dialogBoxShadow").style.display = "none";
		}
		G("dialogBody").innerHTML = "";
		this.showSome();
	}, hiddenSome:function () {
		var tag = this.info.someHiddenTag.split(",");
		if (tag.length == 1 && tag[0] == "") {
			tag.length = 0;
		}
		for (var i = 0; i < tag.length; i++) {
			this.hiddenTag(tag[i]);
		}
		var ids = this.info.someHiddenEle.split(",");
		if (ids.length == 1 && ids[0] == "") {
			ids.length = 0;
		}
		for (var i = 0; i < ids.length; i++) {
			this.hiddenEle(ids[i]);
		}
		var ids = this.info.someDisabledBtn.split(",");
		if (ids.length == 1 && ids[0] == "") {
			ids.length = 0;
		}
		for (var i = 0; i < ids.length; i++) {
			this.disabledBtn(ids[i]);
		}
		space("begin");
	}, disabledBtn:function (id) {
		var ele = document.getElementById(id);
		if (typeof (ele) != "undefined" && ele != null && ele.disabled == false) {
			ele.disabled = true;
			this.someToDisabled.push(ele);
		}
	}, hiddenTag:function (tagName) {
		var ele = document.getElementsByTagName(tagName);
		if (ele != null) {
			for (var i = 0; i < ele.length; i++) {
				if (ele[i].style.display != "none" && ele[i].style.visibility != "hidden") {
					ele[i].style.visibility = "hidden";
					this.someToHidden.push(ele[i]);
				}
			}
		}
	}, hiddenEle:function (id) {
		var ele = document.getElementById(id);
		if (typeof (ele) != "undefined" && ele != null) {
			ele.style.visibility = "hidden";
			this.someToHidden.push(ele);
		}
	}, showSome:function () {
		for (var i = 0; i < this.someToHidden.length; i++) {
			this.someToHidden[i].style.visibility = "visible";
		}
		for (var i = 0; i < this.someToDisabled.length; i++) {
			this.someToDisabled[i].disabled = false;
		}
		space("end");
	}
};
var Dragdrop = new Class();
Dragdrop.prototype = {
initialize:function (width, height, shadowWidth, showShadow, contentType) {
	this.dragData = null;
	this.dragDataIn = null;
	this.backData = null;
	this.width = width;
	this.height = height;
	this.shadowWidth = shadowWidth;
	this.showShadow = showShadow;
	this.contentType = contentType;
	this.IsDraging = false;
	this.oObj = G("dialogBox");
	Event.observe(G("dialogBoxTitle"), "mousedown", this.moveStart.bindAsEventListener(this), false);
}, moveStart:function (event) {
	this.IsDraging = true;
	//显示拖到遮盖层div
	if (this.contentType == 1) {
		G("iframeBG").style.display = "";
		G("iframeBG").style.width = this.width;
		G("iframeBG").style.height = this.height;
	}
	Event.observe(document, "mousemove", this.mousemove.bindAsEventListener(this), false);
	Event.observe(document, "mouseup", this.mouseup.bindAsEventListener(this), false);
	//控制拖拉工程中不要选中文字
	Event.observe(document, "selectstart", this.returnFalse, false);
	this.dragData = {x:Event.pointerX(event), y:Event.pointerY(event)};
	this.backData = {x:parseInt(this.oObj.style.left), y:parseInt(this.oObj.style.top)};
}, mousemove:function (event) {
	if (!this.IsDraging) {
		return;
	}
	var iLeft = Event.pointerX(event) - this.dragData["x"] + parseInt(this.oObj.style.left);
	var iTop = Event.pointerY(event) - this.dragData["y"] + parseInt(this.oObj.style.top);
	if (this.dragData["y"] < parseInt(this.oObj.style.top)) {
		iTop = iTop - 12;
	} else {
		if (this.dragData["y"] > parseInt(this.oObj.style.top) + 25) {
			iTop = iTop + 12;
		}
	}
	this.oObj.style.left = iLeft;
	this.oObj.style.top = iTop;
	if (this.showShadow) {
		G("dialogBoxShadow").style.left = iLeft + this.shadowWidth;
		G("dialogBoxShadow").style.top = iTop + this.shadowWidth;
	}
	this.dragData = {x:Event.pointerX(event), y:Event.pointerY(event)};
	document.body.style.cursor = "move";
}, mouseup:function (event) {
	if (!this.IsDraging) {
		return;
	}
	if (this.contentType == 1) {
		G("iframeBG").style.display = "none";
	}
	document.onmousemove = null;
	document.onmouseup = null;
	var mousX = Event.pointerX(event) - (document.documentElement.scrollLeft || document.body.scrollLeft);
	var mousY = Event.pointerY(event) - (document.documentElement.scrollTop || document.body.scrollTop);
	if (mousX < 1 || mousY < 1 || mousX > document.body.clientWidth || mousY > document.body.clientHeight) {
		this.oObj.style.left = this.backData["x"];
		this.oObj.style.top = this.backData["y"];
		if (this.showShadow) {
			G("dialogBoxShadow").style.left = this.backData.x + this.shadowWidth;
			G("dialogBoxShadow").style.top = this.backData.y + this.shadowWidth;
		}
	}
	this.IsDraging = false;
	document.body.style.cursor = "";
	Event.stopObserving(document, "selectstart", this.returnFalse, false);
}, returnFalse:function () {
	return false;
}};
var g_pop=null;
function relogin(url){
	if (typeof (g_pop) == "undefined"||g_pop==null){
		g_pop=new Popup({ contentType:1, isReloadOnClose:false, width:300, height:180 });
	}else{
		g_pop.config.contentType=1;
		g_pop.config.isReloadOnClose=false;
		g_pop.config.width=300;
		g_pop.config.height=180;
	}
	g_pop.setContent("title","重新登录");
	g_pop.setContent("contentUrl",url);
	g_pop.build();
	g_pop.show();
	return false;
}


function openPop(title,width,height,url,isReloadOnClose){
	//alert(url);
	if (typeof(isReloadOnClose)=='undefined'||isReloadOnClose==false ){
		g_pop = new Popup({ contentType:1, isReloadOnClose:false, width:width, height:height });
	}else{
		g_pop = new Popup({ contentType:1, isReloadOnClose:isReloadOnClose, width:width, height:height });
	}
	//alert(1);
	g_pop.setContent("title",title);
	url=((url.indexOf('?')==-1)?url+"?hm=2":url+"&hm=2");
	//alert(url);
	g_pop.setContent("contentUrl",url);
	g_pop.build();
	g_pop.show();
	return false;
}

function openPopC(comfirmTitle,title,width,height,url){
	if (confirm(comfirmTitle)){
		openPop(title,width,height,url)
	}
   return false;
}
function closePop(){
	if (typeof (callBack) != "undefined"&&callBack!=null){
		callBack();
	}
	if (typeof (g_pop) != "undefined"&&g_pop!=null){
		g_pop.close();
	}
	return false;
}
function submitForm(f,title) {
	if ( typeof( FCKeditorAPI ) != 'undefined' ){
      f.content.value=FCKeditorAPI.GetInstance('content').GetXHTML();
    }
   if (!validForm(f)){
   		return false;
   }else{
   		openPop(title,380,70,'');
		f.target=g_pop.iframeIdName;
		return true;
   }
   return false;
}





function ShowModule(pojoId){
	var s = document.getElementById('commendModule').innerHTML;
	document.getElementById('pojoId').value=pojoId;	
	document.getElementById('moduleId').value=document.getElementById('ModuleSelect').value;
	document.getElementById('commendId').value=document.getElementById('CommendSelect').value;
	g_pop = new Popup({ contentType:2, isReloadOnClose:false, width:340, height:100 });
	g_pop.setContent("title","推荐到模块");
	g_pop.build();
	g_pop.show();
	G("dialogBody").innerHTML=s;
	document.getElementById('commendModule').innerHTML=s;
	return false;
}
					
function commendModule(path){

		document.getElementById('commendModule').style.display='none';
		var moduleId = document.getElementById('moduleId').value;
		var commendId = document.getElementById('commendId').value;
		//alert(path+'/back/modulecommend.do?hm=2&cm=2&mid='+moduleId+'&oid='+document.getElementById('pojoId').value);
		try{
	    dojo.io.bind({
		url: path+'/back/modulecommend.do?hm=2&cm=2&mid='+moduleId+'&cid='+commendId+'&oid='+document.getElementById('pojoId').value,
		mimetype: "text/html", 
		method:"post",
		load : commendModuleResut,
		error: function(type, error) { }, 
		encoding: "utf-8",
		preventCache: true
	});	
	}catch(e) {  }
	
}

function commendModuleResut(type,data ,evt){
	if( type=='error') {
	}else{
		if(data.indexOf('该内容已经被推荐')!=-1){
			alert('该内容已经被推荐');
		}else{
			alert('推荐成功');
		}
		
		g_pop.close();
	}
}

function commendUserStyle(id,isexpert){
	try{
	    dojo.io.bind({
		url: path+'/back/usermanage.do?hm=2&cm=7&isexpert='+isexpert+'&id='+id,
		mimetype: "text/html", 
		method:"post",
		load : function(type,data ,evt){
		 alert("操作成功!");
		 setTimeout('parent.callBack();parent.closePop();',700);
		},
		error: function(type, error) { }, 
		encoding: "utf-8",
		preventCache: true
	});	
	}catch(e) {  }
}


function TagDeleById(url){
	try{
		    if(confirm('确实要删除吗?')){
		    dojo.io.bind({
			url: url,
			mimetype: "text/html", 
			method:"post",
			load : function(type,data ,evt){
			 alert("删除成功!");
			 setTimeout('parent.callBack();parent.closePop();',700);
			},
			error: function(type, error) {  }, 
			encoding: "utf-8",
			preventCache: true
			});	
		}
	}catch(e) {  }
}


/** 自动保存文章信息 **/
function BlogAutoSave(url,title,tagStr,content,sysCateId,cateId,remarkableFlag ,openFlag){
	try{
		    dojo.io.bind({
			url: url,
			mimetype: "text/html", 
			method:"post",
			load : function(type,data ,evt){
			 
			},
			
		  content:{
	        title  : title ,
	        tagStr : tagStr,
	        content : content,
	        sysCateId : sysCateId,
	        cateId : cateId,
	        remarkableFlag : remarkableFlag ,
	        openFlag : openFlag 
	        
		   },
		   
			error: function(type, error) { }, 
			encoding: "utf-8",
			preventCache: true
			});	
	}catch(e) {  }
}


/** 自动保存文章信息 **/
function User_Message(url){
	try{    dojo.io.bind({
			url: url,
			mimetype: "text/html", 
			method:"post",
			load : function(type,data ,evt){
			 	document.getElementById('user_message').innerHTML=data;
			},		   
			error: function(type, error) { }, 
			encoding: "utf-8",
			preventCache: true
			});	
	}catch(e) {  }
}

/** 置顶功能 , 和取消置顶  bool == false 为 取消置顶 , true 为 置顶功能 **/
function BblogArtTop(path,id,bool){
		try{
		    dojo.io.bind({
			url: path+ '/user/arttop.jsp',
			mimetype: "text/html", 
			method:"post",
			 load : function(type,data ,evt){
			 	top.location.href=top.location.href;
			},
		    content:{
	         id  : id ,
	         bool : bool 
		    },
		   
			error: function(type, error) {  }, 
			encoding: "utf-8",
			preventCache: true
			});	
	}catch(e) {   }
	return false;
}



/** 个人热标签 **/
function HotTagByUserId(path,userid){
		try{
		    dojo.io.bind({
			url: path+ '/user/tag_ajax.jsp',
			mimetype: "text/html", 
			method:"post",
			 load : function(type,data ,evt){
			 	document.getElementById('tagtdid').innerHTML=data;
			},
		    content:{
	         userid  : userid 
		    },
		   
			error: function(type, error) {  }, 
			encoding: "utf-8",
			preventCache: true
			});	
	}catch(e) {   }
	return false;
}


/** 系统热标签 **/
function HotTagBySystemId(path,systemid){
		try{
		    dojo.io.bind({
			url: path+ '/user/system_tag_ajax.jsp',
			mimetype: "text/html", 
			method:"post",
			 load : function(type,data ,evt){
			 	document.getElementById('systemtagid').innerHTML=data;
			},
		    content:{
	         systemid  : systemid 
		    },
		   
			error: function(type, error) {  }, 
			encoding: "utf-8",
			preventCache: true
			});	
	}catch(e) {   }
	return false;
}

var city_searchForm='';
/** 高级搜索 **/
function searchForm(){
	if(city_searchForm==''){
		city_searchForm = document.getElementById('searchForm').innerHTML;
	}
	g_pop = new Popup({ contentType:2, isReloadOnClose:false, width:300, height:150 });
	g_pop.setContent("title","高级搜索");
	g_pop.build();
	g_pop.show();
	G("dialogBody").innerHTML=city_searchForm;
	return false;
}


/** 城市 **/
function cityChange(path,Pid,spanId,seleceId,bool,value){
		try{
		    dojo.io.bind({
			url: path+ '/user/city_ajax.jsp',
			mimetype: "text/html", 
			method:"post",
			 load : function(type,data ,evt){
			 	if(bool){
			 		document.getElementById(spanId).innerHTML=data;
			 		if( typeof (value) != "undefined"  && value!=null &&  value!='' && value!='null'){
			 		 document.getElementById(seleceId).value=value;
			 		}
			 	}else if(!bool){
			 		var s = document.getElementById('searchForm').innerHTML;
			 		document.getElementById('searchForm').innerHTML="";
			 		document.getElementById(spanId).innerHTML=data;
			 		document.getElementById('searchForm').innerHTML=s;
			 	}
			 	
			},
		    content:{
	         Pid  : Pid ,
	         seleceId : seleceId
		    },
		   
			error: function(type, error) {   }, 
			encoding: "utf-8",
			preventCache: true
			});	
	}catch(e) {  }
	
}

/** 替换字符串 **/
function  StringReplace(s){
  try{
    return  s.replace(/&gt;/g,">").replace(/&lt;/g," <").replace(/&amp;/g,"&"); 
  }catch(e) { return""; }
}

function ResumeError() {
return true;
}
window.onerror = ResumeError;

