﻿function showPop(y, m, d) {
    var sc = document.getElementsByTagName("script")[0];
    window.showModalDialog("CalenderList.aspx?y=" + y + "&m=" + m + "&d="+d, "dialogWidth=200px;dialogHeight=100px;dialogLeft:10px;dialogTop:430px;"); 
}

function getNewSubmitForm() {
    var submitForm = document.createElement("FORM");
    document.body.appendChild(submitForm);
    submitForm.method = "get";
    submitForm.target = "_self";
    return submitForm;
}

function createNewFormElement(inputForm, elementName, elementValue) {
    var newElement = document.createElement("<input name='" + elementName + "' type='hidden'>");
    inputForm.appendChild(newElement);
    newElement.value = elementValue;
    return newElement;
}

function gosearch() {
    var submitForm = getNewSubmitForm();
    createNewFormElement(submitForm, "q", document.getElementById("query").value == "需求信息" ? "" : document.getElementById("query").value);
    createNewFormElement(submitForm, "sitesearch", "http://jobs.hubu.edu.cn/");
    createNewFormElement(submitForm, "hl", "zh-CN");
    createNewFormElement(submitForm, "ie", "UTF-8");
    submitForm.action = "http://www.google.cn/search";
    submitForm.method = "get";
    submitForm.submit();
}

function login1() {
        var submitForm = getNewSubmitForm();
    createNewFormElement(submitForm, "username", document.getElementById("textfield2").value);
    createNewFormElement(submitForm, "password", document.getElementById("textfield4").value);
    createNewFormElement(submitForm, "user_type", document.getElementById("user_type").value);
    var query =window.location;
    submitForm.action = "http://job.hubu.edu.cn/login.aspx?action=login&url=" + query;
    submitForm.method = "post";
  submitForm.submit();
}

function login2() {
      var submitForm = getNewSubmitForm();
    createNewFormElement(submitForm, "username", document.getElementById("text1").value);
    createNewFormElement(submitForm, "password", document.getElementById("Password1").value);
    var query = window.location;
    submitForm.action = "http://job.hubu.edu.cn/login.aspx?action=login&url=" + query;
    submitForm.method = "post";
      submitForm.submit();
}



function searchPosition() {
var submitForm = getNewSubmitForm();
createNewFormElement(submitForm, "city", document.getElementById("city").value == "输入城市" ? "" : document.getElementById("city").value);
createNewFormElement(submitForm, "position", document.getElementById("position").value == "输入公司或职位" ? "" : document.getElementById("position").value);
 createNewFormElement(submitForm, "position_ID", document.getElementById("DropDownList2").value);
 submitForm.action = "http://job.hubu.edu.cn/student/PositionList.aspx?f=r";
 submitForm.method = "post";
  submitForm.submit();
}
