/*
Copyright 2004, U.S. Robotics Corporation
All Rights Reserved.

THIS SOFTWARE IS OFFERED "AS IS", AND U.S. Robotics GRANTS NO WARRANTIES OF ANY
KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. U.S. Robotics
SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
*/
function MenuItem(strFilename, strTitle, strDescription)
{	this.strFilename = strFilename;
	this.strTitle = strTitle;
	this.strDescription = strDescription;
}
var menuMain = new Array(new MenuItem("status.htm",	"Status",	"View information about the router"),
			new MenuItem("log.htm",		"Log",		"View the router's activity log"),
			new MenuItem("wan.htm",		"Internet",	"Configure the router's connection to the Internet"),
			new MenuItem("security.htm",	"Security",	"Configure the router's security settings"),
			new MenuItem("firewall.htm",	"Firewall",	"Configure the router's firewall settings"),
			new MenuItem("wireless.htm",	"Wireless",	"Configure the router's wireless settings"),
			new MenuItem("lan.htm",		"LAN",		"Configure the router's LAN settings"),
			new MenuItem("device.htm",	"Device",	"Manage the router")
			);
function WeekdayName(ix)
{	switch (ix)
	{	case 0:	return "Sunday";	break;
		case 1:	return "Monday";	break;
		case 2:	return "Tuesday";	break;
		case 3:	return "Wednesday";	break;
		case 4:	return "Thursday";	break;
		case 5:	return "Friday";	break;
		case 6:	return "Saturday";	break;
		default: return "<unknown>";	break;
	}
}
function manageWANoptions()
{      		var radios = document.idForm.optModem;
		setVisibility('idCablePrompts', radios[0].checked);
		setVisibility('idADSLprompts', radios[1].checked);
		if (document.idForm.chkHaveStaticIP != null)
			setVisibility('idStaticIPfields', document.idForm.chkHaveStaticIP.checked);
}
function check_firewall()
{	if (!document.idForm.chkFirewall.checked)
		document.idForm.fw_disable.value="1";
}
function setup_wanproto(s)
{	var radios = document.idForm.optModem;
	if (s == 1)
	{	var value = document.idForm.wan_pppoe_idletime.value;
		document.idForm.wan_pppoe_idletime.value = value * 60;
	}
	if (radios[0].checked) {
		document.idForm.wan_proto.value = "dhcp";
		if (document.idForm.chkHaveStaticIP.checked)
			document.idForm.wan_proto.value = "static";
		else {
			document.idForm.wan_ipaddr.value = "0.0.0.0";
			document.idForm.wan_netmask.value = "0.0.0.0";
			document.idForm.wan_gateway.value = "0.0.0.0";
			document.idForm.wan_dns.value = "";
			document.idForm.wan_wins.value = "";
		}
	}
	if (radios[1].checked) {
		document.idForm.wan_proto.value = "pppoe";
		document.idForm.wan_ipaddr.value = "0.0.0.0";
		document.idForm.wan_netmask.value = "0.0.0.0";
		document.idForm.wan_gateway.value = "0.0.0.0";
		document.idForm.wan_dns.value = "";
		document.idForm.wan_wins.value = "";
		if (document.idForm.chkCxn != null) {
			if (document.idForm.chkCxn.checked)
				document.idForm.connection.value = "demand";
		}
	}
	if (document.idForm.chkUsePPTP != null)
	{	if (document.idForm.chkUsePPTP.checked)
			document.idForm.wan_pptp_activated.value = "1";
		if (document.idForm.chkRemoteAccess != null) {
			if (!document.idForm.chkRemoteAccess.checked)
			document.idForm.http_wanport.value = "";
		}
	}
}
