String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};$(document).ready(function(){var c=$("#sf");var a=$("#selectStr");var b=$("#s");var d=$("#subKW");$(".bbsList:even").css("margin-right","10px");b.keyup(function(){var e=b.val();$.post("/Mod/KeyWord.asp","s="+e,function(g){if(g!=""){$("#selectStr ul").html(g);var h=$("#selectStr ul li");var f=$("#selectStr ul li span[class='kw']");h.mousemove(function(){$(this).css({background:"#06C",color:"#FFF"})}).mouseout(function(){$(this).css({background:"#FFF",color:"#000"})});f.click(function(){b.val($(this).text());c.submit()});a.slideDown("normal")}},"text")}).click(function(){b.css("color","#000");if(b.val()=="请输入关键词"){b.val("")}}).blur(function(){a.slideUp("slow")});b.click(function(){a.hide()});d.click(function(){var e=b.val();e=e.trim();if(e=="请输入关键词"||e==""){alert("请输入搜索关键字!");b.val("请输入关键词");b.css("color","#999");b.focus();return false}c.submit()})});function selectAlert(d,f){var c=$("#msgDiv");var e=$("#msgTitle");var a=$("#msgTxt");var b=-200+document.documentElement.scrollTop+"px";c.css("margin-top",b);c.css("width",d);c.css("height",f);e.click(function(){c.fadeOut("slow")});a.html("<img src='/skin/loading.gif' />数据提交中...");c.fadeIn("slow")}function SubmitAjax(){selectAlert("300px","100px");$.post(convertURL("/Mod/advice.asp?type=send"),"Text="+$("#advice").val(),function(a){$("#msgTxt").html(a)},"text")}function convertURL(a){var b=(new Date()).valueOf();if(a.indexOf("?")>=0){a=a+"&t="+b}else{a=a+"?t="+b}return a};