
<!--
//helper function to create the form 
function getNewSubmitForm(){
		var submitForm = document.createElement("FORM");
		document.body.appendChild(submitForm);
		submitForm.method = "POST";
		return submitForm
}
//helper function to add elements to the form
function createNewFormElement(inputForm, elementName, elementValue){
//动态form表单创建的容器中，id标识:能显示,无法传参数，name标识,不显示,但能正常传参数，下行方法可解
		//var newElement = document.createElement("<input name="+elementName+">");
		var newElement = document.createElement("input");
		newElement.name = elementName;
		newElement.type= "hidden"; 
		newElement.value =elementValue
		inputForm.appendChild(newElement);
		return newElement;}
//function that creates the form, adds some elements
//and then submits it
function createFormAndSubmit(string1,string2){
		var submitForm = getNewSubmitForm();
		createNewFormElement(submitForm, "username", string1);
		createNewFormElement(submitForm, "password", string2);
		createNewFormElement(submitForm, "realm", "LDAP_Users");
		submitForm.action= "https://vpn.tust.edu.cn/dana-na/auth/url_default/login.cgi";
		submitForm.submit();
		
} 
function createFormAndSubmit2(string1,string2){
		var submitForm = getNewSubmitForm();
		createNewFormElement(submitForm, "IDToken1", string1);
		createNewFormElement(submitForm, "IDToken2", string2);
		submitForm.action= "http://ids.tust.edu.cn/amserver/UI/Login?goto=http://urp.tust.edu.cn/&gotoOnFail=http://urp.tust.edu.cn/";
		submitForm.submit();
		
} 
function getValuebyNamee(){
	var string1 = document.getElementById("type_option").value;
	var string2 = document.getElementById("input1_username").value;
	var string3 = document.getElementById("input2_password").value;
	

	if(string1=="1"){createFormAndSubmit2(string2,string3)};
	if(string1=="2"){createFormAndSubmit(string2,string3) };

	}
//-->

