/*function $(ele) {
    if (typeof (ele) == 'string') {
        ele = document.getElementById(ele)
        if (!ele) {
            return null;
        }
    }
    return ele;
}*/
function zOpenD() {
    var diag = new Dialog("Diag1");
    diag.Width = 900;
    diag.Height = 400;
    diag.Title = "弹出窗口示例";
    diag.URL = "http://baidu.com";
    diag.ShowMessageRow = true;
    diag.MessageTitle = "弹出窗口示例";
    diag.Message = "在这儿你可以对这个窗口的内容或功能作一些说明";
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}
function zOpen() {
    var diag = new Dialog("Diag2");
    diag.Width = 900;
    diag.Height = 400;
    diag.Title = "弹出窗口示例";
    diag.URL = "http://demo.zving.com/";
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}
function zAlert() {
    Dialog.alert("你点击了一个按钮");
}
function zConfirm() {
    Dialog.confirm('警告：您确认要XXOO吗？', function() { Dialog.alert("yeah，周末到了，正是好时候"); });
}
function sometext(ele, n) {
    var strArr = ["可", "以", "清", "心", "也"];
    var writeStr = ""
    for (i = 0; i < n; i++) {
        index = parseInt(Math.random() * 5);
        for (j = 0; j < 5; j++) {
            str = index + j > 4 ? index + j - 5 : index + j;
            writeStr += strArr[str];
        }
    }
    $(ele).innerHTML = writeStr;
}
 
 
var current_index = null; 

/*弹出修改学院信息的窗口页面*/
function OpenEditCollegeInfo(index, title, collegeNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改学院信息" : title;
    diag.URL = "/CollegeInfo/collegeInfoUpdate.php?collegeNumber=" + encodeURI(collegeNumber);
    diag.Message = "<span style='color:red'>请修改学院信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看学院信息详情的窗口页面*/
function OpenViewCollegeInfo(index, title, collegeNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询学院信息" : title;
    diag.URL = "/CollegeInfo/collegeInfoView.php?collegeNumber=" + encodeURI(collegeNumber);
    diag.Message = "<span style='color:red'>查看学院信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改专业信息的窗口页面*/
function OpenEditSpecialFieldInfo(index, title, specialFieldNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改专业信息" : title;
    diag.URL = "/SpecialFieldInfo/specialFieldInfoUpdate.php?specialFieldNumber=" + encodeURI(specialFieldNumber);
    diag.Message = "<span style='color:red'>请修改专业信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看专业信息详情的窗口页面*/
function OpenViewSpecialFieldInfo(index, title, specialFieldNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询专业信息" : title;
    diag.URL = "/SpecialFieldInfo/specialFieldInfoView.php?specialFieldNumber=" + encodeURI(specialFieldNumber);
    diag.Message = "<span style='color:red'>查看专业信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改班级信息的窗口页面*/
function OpenEditClassInfo(index, title, classNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改班级信息" : title;
    diag.URL = "/ClassInfo/classInfoUpdate.php?classNumber=" + encodeURI(classNumber);
    diag.Message = "<span style='color:red'>请修改班级信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看班级信息详情的窗口页面*/
function OpenViewClassInfo(index, title, classNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询班级信息" : title;
    diag.URL = "/ClassInfo/classInfoView.php?classNumber=" + encodeURI(classNumber);
    diag.Message = "<span style='color:red'>查看班级信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改学生信息的窗口页面*/
function OpenEditStudent(index, title, studentNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改学生信息" : title;
    diag.URL = "/Student/studentUpdate.php?studentNumber=" + encodeURI(studentNumber);
    diag.Message = "<span style='color:red'>请修改学生信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看学生信息详情的窗口页面*/
function OpenViewStudent(index, title, studentNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询学生信息" : title;
    diag.URL = "/Student/studentView.php?studentNumber=" + encodeURI(studentNumber);
    diag.Message = "<span style='color:red'>查看学生信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改教师信息的窗口页面*/
function OpenEditTeacher(index, title, teacherNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改教师信息" : title;
    diag.URL = "/Teacher/teacherUpdate.php?teacherNumber=" + encodeURI(teacherNumber);
    diag.Message = "<span style='color:red'>请修改教师信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看教师信息详情的窗口页面*/
function OpenViewTeacher(index, title, teacherNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询教师信息" : title;
    diag.URL = "/Teacher/teacherView.php?teacherNumber=" + encodeURI(teacherNumber);
    diag.Message = "<span style='color:red'>查看教师信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改课程信息的窗口页面*/
function OpenEditCourseInfo(index, title, courseNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改课程信息" : title;
    diag.URL = "/CourseInfo/courseInfoUpdate.php?courseNumber=" + encodeURI(courseNumber);
    diag.Message = "<span style='color:red'>请修改课程信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看课程信息详情的窗口页面*/
function OpenViewCourseInfo(index, title, courseNumber) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询课程信息" : title;
    diag.URL = "/CourseInfo/courseInfoView.php?courseNumber=" + encodeURI(courseNumber);
    diag.Message = "<span style='color:red'>查看课程信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改选课信息的窗口页面*/
function OpenEditStudentSelectCourseInfo(index, title, selectId) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改选课信息" : title;
    diag.URL = "/StudentSelectCourseInfo/studentSelectCourseInfoUpdate.php?selectId=" + encodeURI(selectId);
    diag.Message = "<span style='color:red'>请修改选课信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看选课信息详情的窗口页面*/
function OpenViewStudentSelectCourseInfo(index, title, selectId) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询选课信息" : title;
    diag.URL = "/StudentSelectCourseInfo/studentSelectCourseInfoView.php?selectId=" + encodeURI(selectId);
    diag.Message = "<span style='color:red'>查看选课信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改成绩信息的窗口页面*/
function OpenEditScoreInfo(index, title, scoreId) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改成绩信息" : title;
    diag.URL = "/ScoreInfo/scoreInfoUpdate.php?scoreId=" + encodeURI(scoreId);
    diag.Message = "<span style='color:red'>请修改成绩信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看成绩信息详情的窗口页面*/
function OpenViewScoreInfo(index, title, scoreId) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询成绩信息" : title;
    diag.URL = "/ScoreInfo/scoreInfoView.php?scoreId=" + encodeURI(scoreId);
    diag.Message = "<span style='color:red'>查看成绩信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出修改新闻信息的窗口页面*/
function OpenEditNews(index, title, newsId) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "修改新闻信息" : title;
    diag.URL = "/News/newsUpdate.php?newsId=" + encodeURI(newsId);
    diag.Message = "<span style='color:red'>请修改新闻信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}

/*弹出查看新闻信息详情的窗口页面*/
function OpenViewNews(index, title, newsId) { 
    current_index = index;
    var diag = new Dialog("Diag1");
    diag.Width = 600;
    diag.Height = 350;
    diag.Title = title == null ? "查询新闻信息" : title;
    diag.URL = "/News/newsView.php?newsId=" + encodeURI(newsId);
    diag.Message = "<span style='color:red'>查看新闻信息</span>";
    diag.ShowMessageRow = true;
    diag.MessageTitle = title;
    diag.OKEvent = zAlert; //点击确定后调用的方法
    diag.show();
}





