﻿//去掉空格
function Trim(str){
	return str.replace(/(^[\s]*)|([\s]*$)/g, "");
}

//去掉空格
function lTrim (str){
	return str.replace(/(^[\s]*)/g, "");
}

//去掉空格
function rTrim (str){
	return str.replace(/([\s]*$)/g, "");
}

//主页菜单切换JS
function switchmodTag(modtag,modcontent,modk) {
    for(i=1; i <15; i++) {
        if (i==modk) {
            document.getElementById(modtag+i).className="menuOn";
            document.getElementById(modcontent+i).className="slidingList";
        }
        else {
            document.getElementById(modtag+i).className="menuNo";
            document.getElementById(modcontent+i).className="slidingList_none";
        }
    }
}

//课程选择
function LessonSelect(LessonID){
    $("#txtLesson").val(LessonID);
    //alert($("#txtLesson").val());
    $("#form1").submit();
}
function SortSelect(){
    $("#form1").submit();
    //window.location.hash="hotast";
}

function switchmodTag(modtag,modcontent,modk) {
    for(i=1; i <15; i++) {
      if (i==modk) {
        document.getElementById(modtag+i).className="menuOn";document.getElementById(modcontent+i).className="slidingList";}
      else {
        document.getElementById(modtag+i).className="menuNo";document.getElementById(modcontent+i).className="slidingList_none";}
    }
}

//课程搜索
function Search(obj)
{
    if(Trim(obj) != "")
    {
        window.location="/LessonSearch.aspx?OtherKey=" + encodeURI(obj);
    }
    else
    {
        alert("请输入查询条件！");
    }
}
function SearchTo(obj)
{
    if(Trim(obj) != "")
    {
        window.open('/LessonSearch.aspx?OtherKey='+encodeURI(obj));
    }
    else
    {
        alert("请输入查询条件！");
    }
}




