    String.prototype.trim = function()
    {
       return this.replace(/(^\s+)|\s+$/g,"");
    }

    
//------------getitems(页面大小，当前页面，学段，年级，科目，课堂类型，搜索的关键字）
    function getitems(pagesize,pageindex,term,garde,km,type,txt)
    {
		$('yilist').innerHTML="<span style='color:#cccccc'><div align='center'><br><br><img src='http://pic.78ic.com/images/v3/0504317.gif'><br><br>正在检索，请稍等......<br><br></div></span>";
        var postbody="term="+term+"&km="+km+"&type="+type+"&garde="+garde+"&txt="+txt+"&pageindex="+pageindex+"&pagesize="+pagesize+"&random="+Math.random();
	    var myajax=new Ajax.Request
	     (
		      "/common/v3_searchstudy.aspx",
		      {
			      method:'post',
			      postBody: postbody,
			      onComplete:function showResponse(response)
			      {
			        //alert(response.responseText);
				      $('yilist').innerHTML=response.responseText;
					  
					  if ($('yilist').innerHTML=="没有找到相关信息")
					  {
						  if (txt=="关键字：专题名称")
						  {
							  txt="";
							  }
						  nosearch2(type,txt,term,garde,km);
						}
						else
						{
							$('select123').style.display="none";
							}
			      }
    			  
		      }
	     )
    }
	
	function nosearch2(type,searchtxt,term,garde,km)
	{
		var tmp;
	  if (type=="1")
	  {
		  tmp="名师大讲堂";
		  }
		  else if (type=="2")
		  {
			  tmp="小班辅导";
		   }
			else if (type=="3")
			{
				tmp="在线一对一";
			}
			else
			{
				tmp="实时答疑室";
			}
			var t="";
			if (searchtxt.length>18)
			{ t=searchtxt.substring(0,18)+"..."; }
			else
			{ t=searchtxt; }
		$('yilist').innerHTML="<div id=\"searchnone\" >"+
      "<ul><img src=\"http://pic.78ic.com/images/all/hhhbl_ico1.gif\"/></ul>"+
      "<ul>"+
        "<li class=\"orange12b\">抱歉：没有找到关于 “<span class=\"blank12\"><strong>"+tmp+"-"+term+"-"+garde+"-"+km+" <span title='"+searchtxt+"' style='cursor:hand;'>"+t+"</span></strong></span>” 的课程!</li>"+
        "<li class=\"blue12b\">&middot;<a href=\"http://my.78ic.com/student/require.aspx\" target='_blank'>发布课程信息</a><span class=\"huise12\">让老师找到我</span></li>"+
        "<li class=\"blue12b\">&middot;<a href=\"http://my.78ic.com/teacher/publiccourse.aspx\" target='_blank'>发布讲课信息</a><span class=\"huise12\">补充相关课程</span></li>"+
      "</ul>"+
  "</div>";
  		
  		select123course(tmp);
	}
	
//------------getitems(页面大小，当前页面，搜索的关键字,类型）
    function getitems_head(pagesize,pageindex,searchtxt,type,v3_type)
    {
		$('yilist').innerHTML="<span style='color:#cccccc'><div align='center'><br><br><img src='http://pic.78ic.com/images/v3/0504317.gif'><br><br>正在检索，请稍等......<br><br></div></span>";
        var postbody="pagesize="+pagesize+"&pageindex="+pageindex+"&searchtxt="+searchtxt+"&type="+type+"&random="+Math.random();
	    var myajax=new Ajax.Request
	     (
		      "/common/v3_searchstudy.aspx",
		      {
			      method:'post',
			      postBody: postbody,
			      onComplete:function showResponse(response)
			      {
			            //alert(response.responseText);
				      $('yilist').innerHTML=response.responseText;
				      if ($('yilist').innerHTML=="没有找到相关信息")
					  {
						nosearch(v3_type,searchtxt);
					  }
					  else
					  {
						  $('select123').style.display="none";
					  }
			      }
    			  
		      }
	     )
    }
	
	function nosearch(type,searchtxt)
	{
		var t="";
			if (searchtxt.length>18)
			{ t=searchtxt.substring(0,18)+"..."; }
			else
			{ t=searchtxt; }
		$('yilist').innerHTML="<div id=\"searchnone\" >"+
      "<ul><img src=\"http://pic.78ic.com/images/all/hhhbl_ico1.gif\"/></ul>"+
      "<ul>"+
        "<li class=\"orange12b\">抱歉：没有找到关于 “<span class=\"blank12\"><strong>"+type+"-<span style='cursor:hand;' title='"+searchtxt+"'>"+t+"</span></strong></span>” 的课程!</li>"+
        "<li class=\"blue12b\">&middot;<a href=\"http://my.78ic.com/student/require.aspx\" target='_blank'>发布课程信息</a><span class=\"huise12\">让老师找到我</span></li>"+
        "<li class=\"blue12b\">&middot;<a href=\"http://my.78ic.com/teacher/publiccourse.aspx\" target='_blank'>发布讲课信息</a><span class=\"huise12\">补充相关课程</span></li>"+
      "</ul>"+
  "</div>";
  		select123course(type);
	}
	
	function select123course(type)
	{
		$('select123').style.display="";
		var postbody="typemore="+type+"&random="+Math.random();
	    var myajax=new Ajax.Request
	     (
		      "/common/v3_searchstudy.aspx",
		      {
			      method:'post',
			      postBody: postbody,
			      onComplete:function showResponse(response)
			      {
			            //alert(response.responseText);
				      $('select123').innerHTML=response.responseText;
			      }
    			  
		      }
	     )	
	}
	
	function v3_dosearch()
        {
            var type=$F('searchselect');
			//alert($('searchselect').options[$('searchselect').selectindex]);
			//alert(document.getElementById("searchselect").options[document.getElementById("searchselect").selectedIndex].text);
            var searchtxt=$F('textfield').trim();
            if (searchtxt!="")
            {
				if (searchtxt.indexOf('请输入您所要搜索')>-1)
				{
					alert("请输入相应的搜索信息");
				}
				else
				{
                	window.open('http://www.78ic.com/searchstudy.aspx?txt='+searchtxt+'&type='+type);
				}
            }
            else
            {
                alert("请输入相应的搜索信息");
            }
        }
		
<!------------------------------------------------------------------->
function ClearValue()
		{
		   document.getElementById("textfield").value = "";
		}
		function SelectValue()
		{
		     document.getElementById("textfield").focus();
		}
		function ChangeText()
		{
		    var str=document.getElementById("searchselect").value;
		    if(str=="Yzox")
		    {
		        document.getElementById("textfield").value ="请输入您所要搜索小学的课程名称";
		    }
		    if(str=="Yzoy")
		    {
		        document.getElementById("textfield").value ="请输入您所要搜索初中的课程名称";
		    }
		    if(str=="Yzoz")
		    {
		        document.getElementById("textfield").value ="请输入您所要搜索高中的课程名称";
		    }
		    if(str=="dDox")
		    {
		        document.getElementById("textfield").value ="请输入您所要搜索名师大讲堂的课程名称";
		    }
		    if(str=="dDoy")
		    {
		        document.getElementById("textfield").value ="请输入您所要搜索小班辅导的课程名称";
		    }
		    if(str=="dDoz")
		    {
		        document.getElementById("textfield").value ="请输入您所要搜索在线一对一的课程名称";
		    }
		    if(str=="dDo0")
		    {
		        document.getElementById("textfield").value ="请输入您所要搜索实时答疑室的课程名称";
		    }
		}