function onLogon() { var xmlhttp; var ID,PWD; ID=document.getElementById("hash0").value; PWD=document.getElementById("hash1").value; xmlhttp=new XMLHttpRequest(); if ( ID !="") { xmlhttp.open("GET","webs.cgi?PAGE=ImageForm&random="+Math.random(),false, ID,PWD); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState ==4 ) { if (xmlhttp.status ==200) { //alert("OK"); parent.document.location="main.html"; } else if (xmlhttp.status == 401) { alert("Login Fail"); } } } xmlhttp.send(); } } document.getElementById("hash1").onkeyup=function(e) { if(e.keyCode === 13) document.getElementById("logon").onclick(); }; function init() { delete sessionStorage.nowSearch; xmlhttp=new XMLHttpRequest(); xmlhttp.open("GET","/rest/sysinfo"); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState ==4 ) { if (xmlhttp.status ==200) { var model_regex = /\"model\":\t\"[A-Za-z0-9]*\"/; var reg = /\"[A-Za-z0-9]*\"$/; var res = xmlhttp.responseText; var model_string = String(res.match(model_regex)); var model = String(model_string.match(reg)); var model_name = model.replace(/\"/g,""); document.title = document.title.replace("NetCam", model_name); } else if (xmlhttp.status == 401) { alert("Login Fail"); } } } xmlhttp.send(); }