function checkQuestion(this_form) { this_form.source.value = "ysearch_ks_bar_ask"; this_form.title.value=this_form.p.value; /* if (this_form.title.value.length < 6 || this_form.title.value.length > 30){ alert("请把题目长度控制在6-30字之间,谢谢。"); return false ; this_form.link.value="ask"; this_form.action="/question/"; this_form.submit(); return false; } */ this_form.action="http://ks.cn.yahoo.com/question/index"; this_form.submit(); return true; } function checkSearch(this_form) { var p = this_form.p.value.replace(/[\'\"]+/g, " "); p = p.replace(/^[  ]+|[  ]+$/g, ""); p = p.replace(/[  ]+/g, " "); this_form.p.value = p; if(this_form.p.value=="" || this_form.p.value=="请输入查询词"){ this_form.p.value="请输入查询词"; this_form.p.focus(); if(this_form.p.setSelectionRange) { this_form.p.setSelectionRange(0,this_form.p.value.length); } else { this_form.p.select(); } return false; } this_form.action="/search/search_result"; return true; } function checkAdvanceSearch(ref) { ref.href = "/search/search_advance?source=ysearch_ks_hp_bar_asearch"; keyword = document.forms["multi_submit"].elements["p"].value; if(typeof encodeURIComponent == 'function') { keyword = encodeURIComponent(keyword); } else { keyword = ""; } if(keyword != "") { ref.href += "&title=" + keyword; } /* if (this_form.title.value.length < 6 || this_form.title.value.length > 30){ alert("请把题目长度控制在6-30字之间,谢谢。"); return false ; this_form.link.value="ask"; this_form.action="/question/"; this_form.submit(); return false; } */ return true; } function openwin(mypage,myname,w,h,infocus) { settings="width=" + w + ",height=" + h + ",top=0,left=0,scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no"; win=window.open(mypage,myname,settings); win.focus(); } function pass_keyword(ref, val) { var home_page = new Array( "http://search.cn.yahoo.com/", "http://focus.search.yahoo.cn/index.html", "http://ks.cn.yahoo.com/", "http://music.yahoo.com.cn/", "http://image.yahoo.com.cn/", "http://bendi.yahoo.cn", "http://gouwu.cn.yahoo.com/?source=y_ks"); var res_page = new Array( "http://www.yahoo.com.cn/search?ei=utf-8&fr=fp-tab-web-ycn&meta=vl%3Dlang_zh-CN%26vl%3Dlang_zh-TW&pid=ysearch&p=", "http://cn.news.yahoo.com/search.html?ei=utf-8&p=", "http://ks.cn.yahoo.com/search/search_result2?ei=utf-8&p=", "http://music.yahoo.com.cn/search.html?ei=utf-8&p=", "http://image.yahoo.com.cn/search?ei=utf-8&p=", "http://bendi.yahoo.cn/search/searchstore.html?ei=utf-8&option.key=", "http://gouwu.cn.yahoo.com/search?source=y_ks&p=", "http://combo.yahoo.com.cn/search?ei=utf-8&p="); if(navigator.userAgent.toLowerCase().indexOf("msie")>0 && navigator.userAgent.toLowerCase().indexOf("5.0")>0){ ref.href = home_page[val]; return; } keyword = document.forms["multi_submit"].elements["p"].value; if(typeof encodeURIComponent == 'function'){ keyword = encodeURIComponent(keyword); }else{ keyword = escape(keyword); } if(keyword == "") { ref.href = home_page[val]; } else { ref.href = res_page[val] + keyword; } return 1; } function showTips(x) { document.getElementById('tips'+x).style.display="block" } function hideTips(x) { document.getElementById('tips'+x).style.display="none" }