var aiwen = {

search: function(){
			var title = document.getElementById("search_title").value;
			if(title==""){
				alert("请输入你想查找的问题标题！");
				return false;
			}
			document.searchform.submit();
},
search1: function(){
		window.location.href="/zhidao/myquestion";
},
setWord: function(){
					var val = "";
					var val2 = "0";
					val = document.getElementById("content").value;
					if(val.length > 200) {
						document.getElementById("content").value = val.substring(0,200);
						val2 = "0";
					}else {			
					 val2 = 200 - val.length;
					}
					document.getElementById('wordLength').innerHTML=val2;
},
checkvaluett:	function(val){
		if(val==""||val.indexOf(".")>-1){
			alert("请登录后再进行操作！");
			window.location.href="/templates/login.html?comeurl=/zhidao/add-question";
		}else{
			window.location.href="/zhidao/add-question";
		}
},						
checkvalue:	function(){
		var cust_id = document.getElementById("cust_id").value;
		if(cust_id==""||cust_id.indexOf(".")>-1){
			alert("请登录后再进行操作！");
			window.location.href="/templates/login.html?comeurl=/zhidao/add-question";
			return false;
		}
		if(document.getElementById("title").value==""){
			alert("请输入问题标题！");
			return false;
		}
		if(document.getElementById("title").value.indexOf("<")>-1||document.getElementById("title").value.indexOf(">")>-1){
				alert("输入的信息包含非法字符 < 或 >,请检查！");
				return false;
			}
		if(document.getElementById("content").value.indexOf("<")>-1||document.getElementById("content").value.indexOf(">")>-1){
				alert("输入的信息包含非法字符 < 或 >,请检查！");
				return false;
			}
		document.questionform.submit();
},	
checkstate1: function(val){
		window.open("/zhidao/content-ok-"+val);
},			
checkvalue1:	function(){
	
		if(document.getElementById("answerer").value.indexOf("<")>-1||document.getElementById("answerer").value.indexOf(">")>-1){
				alert("输入的名称包含非法字符 < 或 >,请检查！");
				return false;
		}
		if(document.getElementById("content").value==""){
				alert("请输入回答内容！");
				return false;
		}
		if(document.getElementById("content").value.indexOf("<")>-1||document.getElementById("content").value.indexOf(">")>-1){
				alert("输入的信息包含非法字符 < 或 >,请检查！");
				return false;
		}
		document.questionform.submit();
},
checkstate:	function (val){
				window.open("/zhidao/content-tt-"+val);
}


}
