Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function status_clock() {
- theTime = window.setTimeout("runClock()", 1000);
- var today = new Date();
- var display= today.toLocaleString();
- status = display;
- }
- function go_page(main, sub) {
- switch (main) {
- case "system":
- switch (sub) {
- case "info":
- document.location.href = "./system_info.cgi";
- break;
- case "user":
- document.location.href = "./system_user.cgi";
- break;
- case "default":
- document.location.href = "./system_default.cgi";
- break;
- case "reboot":
- document.location.href = "./system_reboot.cgi";
- break;
- }
- break;
- case "device":
- switch (sub) {
- case "camera":
- document.location.href = "./device_camera.cgi";
- break;
- case "audio":
- document.location.href = "./device_audio.cgi";
- break;
- case "sensor":
- document.location.href = "./device_sensor.cgi";
- break;
- case "moalarm":
- document.location.href = "./device_moalarm.cgi";
- break;
- case "exalarm":
- document.location.href = "./device_exalarm.cgi";
- break;
- }
- break;
- case "record":
- switch (sub) {
- case "camera":
- document.location.href = "./record_camera.cgi";
- break;
- case "schedule":
- document.location.href = "./record_schedule.cgi";
- break;
- }
- break;
- case "network":
- switch (sub) {
- case "network":
- document.location.href = "./network_network.cgi";
- break;
- case "ddns":
- document.location.href = "./network_ddns.cgi";
- break;
- case "notification":
- document.location.href = "./network_notification.cgi";
- break;
- }
- break;
- case "quick":
- switch (sub) {
- case "setup":
- document.location.href = "./quick_setup.cgi";
- break;
- }
- break;
- case "wconf":
- document.location.href = "./system_info.cgi";
- break;
- case "live":
- document.location.href = "./web_monitoring.cgi";
- break;
- case "vod":
- document.location.href = "./web_playback.cgi";
- break;
- case "logout":
- document.location.href = "./logout_proc.cgi";
- break;
- }
- }
- function trim(value) {
- return value.replace(/(^\s*)|(\s*$)/g, "");
- }
- function isvalid_ip(ipvalue) {
- var ippattern = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
- var iparray = ipvalue.match(ippattern);
- var result = "";
- if (ipvalue == "0.0.0.0")
- return false;
- else if (ipvalue == "255.255.255.255")
- return false;
- if (iparray == null) {
- return false;
- } else {
- for (i = 0; i < 4; i++) {
- thissegment = iparray[i];
- if (thissegment > 255)
- return false;
- else if ((i == 0) && (thissegment > 255))
- return false;
- }
- }
- return true;
- }
- function isvalid_date(y, m, d) {
- var er = 0;
- var daa = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
- if ((y%1000 != 0) && (y%4 == 0)) daa[1] = 29;
- if ((d>daa[m-1]) || (d<1)) er = 1;
- if ((m<1) || (m>12)) er = 1;
- if ((m%1 != 0) || (y%1 != 0) || (d%1 != 0)) er = 1;
- if (er == 1)
- return false;
- return true;
- }
- function isvalid_data(input) {
- if (input == null || input.replace(/ /gi,"") == "") {
- return false;
- }
- return true;
- }
- function isvalid_num(input) {
- return (/^[0-9]+$/).test(input.remove(arguments[0])) ? true : false;
- }
- function isvalid_email(input) {
- return (/\w+([-+.]\w+)*@\w+([-.]\w+)*\.[a-zA-Z]{2,4}$/).test(input);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement