var cPage=window.location.toString().replace(/.*\//,'');
var DIV;
cPage=cPage.replace(/\?.*/,'');

function Group(s)
{
	this.s=s;		/* Group Name (menu bar) */
	this.pid=0;
}

var Groups=new Array(
new Group('')
,new Group('System')
,new Group('WAN')
,new Group('LAN')
,new Group('NAT')
,new Group('Firewall')
,new Group('Routing')
);

var wizGroups=new Array(
new Group('')
,new Group('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1. Time Zone')
,new Group('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2. WAN Type')
,new Group('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3. WAN Settings')
,new Group('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4. DNS')
);

var mNum=0;
var focusPage;
function Page(g,s,p,t,d,h,f)
{
    this.g=g;			/* Group */
	this.s=s;			/* Text */
	this.p=p;			/* html file to link */
	this.t=t;			/* Banner */
	this.d=d;
	this.h=h;
	this.idx=mNum++;
	if (f)
	{
		this.f=f;
		if (f==1)
		{
			Groups[g].pid=this.idx;
		}
	}
	else
		this.f=0;	/* flag */
}

var index_desc =
	'The Broadband Router  device is ideal for home networking and small business users.  Most users \
	will be able to use the Broadband Router\'s default settings.  If you have different settings, the \
	Quick Setup will lead you step-by-step to configure the Broadband Router. \
	Its easy setup will allow you to enjoy risk-free Internet access within minutes.<br><br>';
var advanced_desc = 
	'The Broadband Router supports advanced functions like hacker attack detection, client \
	filtering, virtual servers, special application access, and a virtual DMZ host. <br> \
	<br>We recommend you keep the default settings.'
var	system_desc = 
	'This page includes all the basic configuration tools for the Broadband Router. \
	The options are in the menu screen to the left.';
var time_desc = 
	'Connecting to a Simple Network Time Protocol (SNTP) server allows the Broadband Router \
	to synchronize the system clock to the global Internet.  The synchronized clock \
	in the Broadband Router is used to record the security log and  client control filtering.';
var password_desc = 
	'Set a password to restrict management access to the Broadband Router. \
	If you want to manage the Broadband Router from a remote location (outside of the local network), you must \
	also specify the IP address of the remote PC.';
var upgrade_desc = 
	'Enter the path and name of the upgrade file \
	then click the APPLY button below. You will be prompted to confirm the upgrade.';
var configure_desc = 
	'Use the "Backup Settings" tool to save the Broadband Router\'s current configuration to a \
	file named "config.bin" on your PC. You can then use the "Restore Settings" tool to \
	restore the saved configuration of the Broadband Router.  Alternately, you can use the \
	"Restore to Factory Defaults" tool to force the Broadband Router to reset and \
	restore the original factory settings.';
var status_desc = 
	'You can use the Status screen to see the connection status \
	for the Broadband Router\'s WAN/LAN interfaces, firmware and hardware version numbers, \
	and the number of connected clients to your network.';
var wan_desc = 
	'How is the Broadband Router connected to your Internet Service Provider (ISP)?';
var dhcp_desc =
	'The Host Name is optional, but may be required by some Internet Service Providers. \
	The default MAC Address is set to the WAN\'s physical interface on the Broadband Router. \
	If required by your Internet Service Provider, use the "Clone MAC Address" button to \
	copy the MAC address of the Network Interface Card installed in your PC and replace \
	the WAN MAC address with this MAC address. \
	The BigPond login is optional, commonly used in Australia.  If your ISP need \
	you to do the BigPond login, please enable it and \
	fill the user name, password and the server name.';
var static_desc = 
	'If your Service Provider has assigned a fixed IP address, enter the assigned IP \
	Address, Subnet Mask and ISP Gateway Address provided.';
var pppoe_desc = 
	'Enter the PPPoE user name and password assigned by your Service Provider. \
	The Service Name is normally optional, by may be required by some service providers. \
	Enter a Maximum Idle Time (in minutes) to define a maximum period of time for which the Internet \
	connection is maintained during inactivity. \
	If the connection is inactive for longer than the defined Maximum Idle Time, then it will be dropped. \
	You can enable the Connect-on-demand option to automatically re-establish the connection as \
	soon as you attempt to access the Internet again.';
var pptp_desc = 
	'If your Internet Service Provider requires the use of PPTP, enter the information below.<br> \
	Note: PPTP for a WAN connection is most popular in Europe.';
var dns_desc =
	'A Domain Name system (DNS) server is like an index of IP addresses and Web addresses. \
	If you type a Web address into you browser, such as <u>www.yahoo.com</u>, \
	a DNS server will find that name in its index and find the matching IP address : 61.218.71.81. \
	<p> Most ISPs provide a DNS server for speed and convenience. \
	Since your Service Provider many connect to the Internet \
	with dynamic IP settings, it is likely that the DNS server IP addresses are also provided dynamically. \
	However, if there is a DNS server that you would rather use, \
	you need to specify the IP address below. </p>';
var lan_desc = 
	'The Broadband Router must have an IP address for the local network. You can also enable DHCP service \
	for dynamic IP address allocation to your clients, \
	or configure filtering functions based on specific clients or protocols.';
var lan_dhcp_desc = 'You can enable DHCP to dynamically allocate IP addresses to your client PCs.';
var dhcp_clients_desc = 
	'<p>The DHCP client list allows you to see which clients are connected to the Broadband Router via IP address, \
	host name, and MAC address.</p>';
var nat_desc = 
	'Network Address Translation (NAT) allows multiple users at your local site to access \
	the Internet through a single public IP address or multiple public IP addresses. \
	NAT can also prevent hacker attacks by mapping local addresses to public addresses \
	for key services such as the Web or FTP.';
var specialapp_desc =
	'Applications such as Internet gaming, video conferencing, \
	and Internet telephony require multiple connections. \
	The Special Application feature allows these applications to work properly.';
var virtualser_desc =
	'You can configure the Broadband Router as a virtual server \
	so that remote users accessing services such as the Web or FTP at your local site via \
	public IP addresses can be automatically redirected to local servers configured with private \
	IP addresses. \
	In other words, depending on the requested service (TCP/UDP port number), \
	the Broadband Router redirects the external service request to \
	the appropriate server (located at another internal IP address).';
var firewall_desc = 
	'The Broadband Router provides packet filtering rules by restricting \
	service ports, IP address or MAC address. However, for applications \
	that require unrestricted access to the Internet, you can configure \
	a specific client/server as a demilitarized zone (DMZ).';
var nowanping_desc =
	'When you "Block WAN Ping", you are causing the public WAN IP address on the Broadband Router to not \
	respond to ping commands. Pinging public WAN IP addresses is a common method used by hackers to \
	test whether your WAN IP address is valid and supports a network.';
var clientfilter_desc = 'You can block certain client PCs accessing the Internet based on time.';

var macfilter_desc = 'You can block certain client PCs accessing the Internet based on MAC addresses. <br>';
var dmz_desc =
	'If you have a local client PC that cannot run an Internet application \
	properly from behind the NAT firewall, you can open the \
	client up to unrestricted two-way Internet access by defining a virtual DMZ Host.';
var urlfilter_desc = 'Block URLs which contain keywords listed below.';
var route_desc = 
	'If there are multiple routers installed on your network, \
	it is necessary to configure the unit\'s routing functions.';
var route_static_desc =
	'The static routing function determines the path that data follows over your \
	network before and after it passes through your router. You can use static \
	routing to allow different IP domain users to access the Internet through this device.';    
var wizard_time_zone =    
	'You must set the Time Zone in order to synchronize the Broadband Router clock. \
	This clock is used to record the system log and control client filtering.';   
var wizard_wan_type = 
	'Specify the WAN connection type required by your Internet Service Provider. \
	Specify a Cable modem, Fixed-IP xDSL, or PPPoE xDSL.';
var wizard_static = 
	'Enter the IP address, subnet mask, and gateway provided to you by your Internet \
	Service Provider (ISP) in the appropriate fields.';
var wizard_pppoe = 
	'Enter the User Name and Password required by your ISP in the appropriate fields. If your ISP \
	has provided you with a Service Name, enter it in the Service Name field, otherwise, leave it blank.';
var wizard_pptp = 
	'Enter the Account Name, Account Password, Host Name, Service IP Address, Your IP Address, \
	Your Subnet Mask required by your ISP in the appropriate fields. If your ISP has provided you \
	with a connection ID, enter it in the Connection ID field, otherwise, leave it as zero.';

var Pages=new Array(
new Page(0,'Login','login.htm','Login','','',2)
,new Page(0,'LoginErr','loginerr.htm','Login','','',2)
,new Page(0,'Duplicate','duplicate.htm','Duplicate Administrator','','',2)
,new Page(0,'OK','do_cmd.htm','TW100-S4W1CA','','',2)
,new Page(0,'OK','upgrade_ok.htm','TW100-S4W1CA','','',2)
,new Page(0,'','index.htm','TW100-S4W1CA Setup',index_desc,'',2)
,new Page(0,'Advanced','frame_setup.htm','Advanced Setup',advanced_desc,'',1)
,new Page(1,'System','system_main.htm','System Settings',system_desc,'',1)
,new Page(1,'System Time','system_time.htm','System Time',time_desc,'time')
,new Page(1,'Administrator Settings', 'system_password.htm','Administrator Settings',password_desc,'password')
,new Page(1,'Firmware Upgrade','system_upgrade.htm','Firmware Upgrade',upgrade_desc,'')
,new Page(1,'Configuration Tools','system_configure.htm','Configuration Tools',configure_desc,'wtools')
,new Page(1,'Status','system_status.htm','Status',status_desc,'status')
,new Page(1,'System Log','system_log.htm','System Log','','log')
,new Page(1,'Reset','system_reset.htm','Reset Broadband Router','','reset')
,new Page(2,'WAN','wan_main.htm','WAN',wan_desc,'wan',1)
,new Page(2,'Dynamic IP','wan_dhcp.htm','Dynamic IP (Cable Modem)',dhcp_desc,'dhcp')
,new Page(2,'Static IP','wan_static.htm','Static IP (Fixed-IP XDSL)',static_desc,'fixed')
,new Page(2,'PPPoE','wan_pppoe.htm','PPPoE (Dial-Up xDSL)',pppoe_desc,'pppoe')
,new Page(2,'PPTP','wan_pptp.htm','PPTP',pptp_desc,'pptp')
,new Page(2,'DNS','wan_dns.htm','DNS',dns_desc,'dns')
,new Page(2,'Dynamic DNS','wan_dyndns.htm','Dynamic DNS','','dyndns')
,new Page(3,'LAN','lan_main.htm','LAN',lan_desc,'',1)
,new Page(3,'LAN Settings','lan_dhcp.htm','LAN Settings',lan_dhcp_desc,'lan')
,new Page(3,'DHCP Client List','lan_dhcp_clients.htm','DHCP Client List',dhcp_clients_desc,'lan_dhcp_list')
,new Page(4,'NAT','nat_main.htm','NAT Settings',nat_desc,'',1)
,new Page(4,'Special Application','nat_specialapp.htm','Special Application',specialapp_desc,'specapp')
,new Page(4,'Virtual Server','nat_virtualser.htm','Virtual Server',virtualser_desc,'virserver')
,new Page(5,'Firewall','firewall_main.htm','Firewall Settings',firewall_desc,'',1)
,new Page(5,'Block WAN Ping','firewall_disablewan.htm','Block WAN Ping',nowanping_desc,'discard_ping')
,new Page(5,'Client Filtering','firewall_clientfilter.htm','Client Filtering',clientfilter_desc,'filter')
,new Page(5,'MAC Control','firewall_mac.htm','MAC Control',macfilter_desc,'mac_control')
,new Page(5,'DMZ','firewall_dmz.htm','DMZ (Demilitarized Zone)',dmz_desc,'dmz')
,new Page(5,'URL Filter','firewall_url.htm','URL filter',urlfilter_desc,'urlfilter')
,new Page(6,'Routing','route_main.htm','Routing Settings',route_desc,'',1)
,new Page(6,'Static Routing', 'route_static.htm','Static Routing',route_static_desc,'route_static')
,new Page(7,'Wizard','wizard_T','1. Time Zone',wizard_time_zone,'time')
,new Page(8,'Wizard','wizard_M','2. WAN Type',wizard_wan_type,'wan')
,new Page(9,'Wizard','wizard_C1','3. WAN Settings','','dhcp')
,new Page(9,'Wizard','wizard_C2','3. WAN Settings',wizard_static,'fixed')
,new Page(9,'Wizard','wizard_C3','3. WAN Settings',wizard_pppoe,'pppoe')
,new Page(9,'Wizard','wizard_C4','3. WAN Settings',wizard_pptp,'pppoe')
,new Page(10,'Wizard','wizard_D','4. DNS',dns_desc,'dns')
,new Page(10,'Wizard','wizard_F','Setup Completed','','')
);

function GURL(x){location=x;}

function findPage()
{
	focusPage = Pages[0];
	
	for (var i=0;i<Pages.length;i++)
	{
		if(DIV)
		{
			if (Pages[i].p==DIV)
			{
				focusPage = Pages[i];
				break;
			}
		}
		else
		{
			if (Pages[i].p==cPage)
			{
				focusPage = Pages[i];
				break;
			}
		}
	}
		
	return focusPage;
}

function wizleftMenu()
{
	var m = '';
	m += '<td valign=top><img src=images/cat_quicksetup.gif border=0>';
	m += '<table border=0 align=center cellpadding=0 cellspacing=0>';
	
	/* Show menu */
	for (var i=1;i<wizGroups.length;i++)
	{
		m += '<tr>';
		m += '<td><img src=images/spacer.gif width=8 height=8></td>';
		m += '</tr>';
		m += '<tr>';
		m += '<tr>';
		m += '<td background=images/';
		if(focusPage.g >= i+6)
		{
			m += 'wizbut1.gif';
		}
		else
		{
			m += 'wizbut0.gif';
		}
		m += ' valign=middle align=left width=144 height=40>'
			+'<span class=btn_w>&nbsp;&nbsp;&nbsp;' + wizGroups[i].s + '</span></a></td>';
		m += '</tr>';
	}
	
	for (var j=0; j<3; j++)
		m += '<tr><td><img src=images/spacer.gif width=8 height=8></td></tr>';
	
	/* Show Home and Logout */
	m += '<tr><td>';
	m += '<table border=0 align=center cellpadding=0 cellspacing=0>';
	m += '<tr>';
	m += '<td></td>';
	m += '<td><input class=btn_o type=button value=Home onclick=GURL("index.html")></td>';
	m += '<td></td>';
	m += '</tr>';
	m += '<tr>';
	m += '<td></td>';
	m += '<td><img src=images/spacer.gif width=8 height=8></td>';
	m += '<td></td>';
	m += '</tr>';
	m += '<tr>';
	m += '<td></td>';
	m += '<td><input class=btn_o type=button value=Logout onclick=GURL("login.htm")></td>';
	m += '<td></td>';
	m += '</tr>';
	m += '</table>';
	m += '</td></tr>';
	
	m += '</table>';
	m += '<p>&nbsp;</p>';
	m += '</td>';
	
	return m;
}

function leftMenu()
{
var m = '';
	m += '<td valign=top><img src=images/cat_advancedsetup.gif border=0>';
	m += '<table border=0 align=center cellpadding=0 cellspacing=0>';
	
	/* Show menu */
	for (var i=1;i<Groups.length;i++)
	{
		m += '<tr>';
		m += '<td><img src=images/spacer.gif width=8 height=8></td>';
		m += '</tr>';
		m += '<tr>';
		m += '<tr>';
		m += '<td><input value="&nbsp;&nbsp;&nbsp;&nbsp;' + Groups[i].s + '"'
			+' onclick=GURL("' + Pages[Groups[i].pid].p + '")'
			+' class=btn_m' + (focusPage.g == i ? '1' : '0') + '>'
			+'</td>';
		m += '</tr>';
		
		if (focusPage.g == i)
		{
			m += '<tr>';
			m += '<td>';
			m += '<table width=100% border=0 cellpadding=0 cellspacing=0 class=submenubg>';
			m += '<tr>';
			m += '<td colspan=2><img src=images/but_top.gif width=144 height=3></td>';
			m += '</tr>';
			m += '<tr>';
			m += '<td colspan=2>';
			m += '<table width=100% border=0 cellpadding=2>';
			
			for (var j=0;j<Pages.length;j++)
			{
				if (Pages[j].g == i && Pages[j].f != 1)
				{
					m += '<tr>';
					m += '<td width=13% align=right valign=top><b><font color=#FFFFFF>&bull; </font></b></td>';
					m += '<td width=87% valign=top>'
						+ '<a href=' + Pages[j].p + ' class=submenus>'
						+ '<b>' + Pages[j].s + '</b></a></td>';
					m += '</tr>';
				}
			}
			
			m += '</table>';
			m += '</td>';
			m += '</tr>';
			m += '<tr>';
			m += '<td colspan=2><img src=images/but_bottom.gif width=144 height=3></td>';
			m += '</tr>';
			m += '</table>';
			m += '</td>';
			m += '</tr>';
		}
	}
	
	for (var j=0; j<3; j++)
		m += '<tr><td><img src=images/spacer.gif width=8 height=8></td></tr>';
	
	/* Show Home and Logout */
	m += '<tr><td>';
	m += '<table border=0 align=center cellpadding=0 cellspacing=0>';
	m += '<tr>';
	m += '<td></td>';
	m += '<td><input class=btn_o type=button value=Home onclick=GURL("index.html")></td>';
	m += '<td></td>';
	m += '</tr>';
	m += '<tr>';
	m += '<td></td>';
	m += '<td><img src=images/spacer.gif width=8 height=8></td>';
	m += '<td></td>';
	m += '</tr>';
	m += '<tr>';
	m += '<td></td>';
	m += '<td><input class=btn_o type=button value=Logout onclick=GURL("login.htm")></td>';
	m += '<td></td>';
	m += '</tr>';
	m += '</table>';
	m += '</td></tr>';
	
	m += '</table>';
	m += '<p>&nbsp;</p>';
	m += '</td>';
	
	return m;
}

function rightHead()
{
var m =	'';
	m += '<td width=78% valign=top>';
	m += '<table width=100% border=0 cellpadding=0 cellspacing=0>';
	m += '<tr>';
	m += '<td width=10><img src=images/c2_tl.gif width=10 height=10></td>';
	m += '<td background=images/bg2_t.gif><img src=images/spacer.gif width=10 height=10></td>';
	m += '<td width=10><img src=images/c2_tr.gif width=10 height=10></td>';
	m += '</tr>';
	m += '<tr>';
	m += '<td background=images/bg2_l.gif><img src=images/spacer.gif width=10 height=10></td>';
	
	/* Text area start */
	if (focusPage.f != 2)
		m += '<td height=400 valign=top bgcolor=#FFFFFF>';
	else
		m += '<td valign=top bgcolor=#FFFFFF>';
	
	/* Banner */
	m += '<table width=100% border=0 cellpadding=3 cellspacing=0>';
	m += '<tr>';
	m += '<td class=headerbg>' + focusPage.t + '</td>';
	
	if (focusPage.h != '')
	{
		m += '<td width=15% class=headerbg>'
			+'<input type=button value=Help'
			+' onClick=window.open("help.htm#' + focusPage.h + '","help","toolbar=0,status=0,menubar=0,scrollbars=1,resizable=1,width=530,height=400,left=150,top=150");'
			+' class=btn_o></td>';
	}
		
	m += '</tr>';
	m += '</table>';
	
	/* Online description */
	m += '<table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#FFFFFF">';
	m += '<tr>';
	m += '<td width=100% colspan="2">'
	m += focusPage.d;
	
	/* Start of form */
	return m;
}

function rightTail()
{
var m = '';
	
	/* End of form */
	m += '</td></tr></table>';
	
	m += '</td>';
	/* Text area end */
	
	m += '<td background=images/bg2_r.gif><img src=images/spacer.gif width=10 height=10></td>';
	m += '</tr>';
	m += '<tr>';
	m += '<td><img src=images/c2_bl.gif width=10 height=10></td>';
	m += '<td background=images/bg2_b.gif><img src=images/spacer.gif width=10 height=10></td>';
	m += '<td><img src=images/c2_br.gif width=10 height=10></td>';
	m += '</tr>';
	m += '</table>';
	m += '</td>';
	
	return m;
}

function pageHead()
{
var p = findPage();
var m = '';
	m += '<table width=750 border=0 cellpadding=0 cellspacing=0>';
	
	/* Top conner */
	m += '<tr>';
    m += '<td width=21><img src=images/c1_tl.gif width=21 height=21></td>';
    m += '<td width=708 background=images/bg1_t.gif><img src=images/top_1.gif width=390 height=21></td>';
    m += '<td width=21><img src=images/c1_tr.gif width=21 height=21></td>';
	m += '</tr>';
	
	/* Middle */
	m += '<tr>';
    m += '<td valign=top background=images/bg1_l.gif><img src=images/top_2.gif width=21 height=69></td>';
	
	/* logo */
	m += '<td background=images/bg.gif>';
	m += '<table width=100% border=0 cellpadding=0 cellspacing=0>';
	m += '<tr>';
	m += '<td width=13%><img src=images/logo.gif width=270 height=69></td>';
    m += '<td width=87% align=right><img src=images/description.gif></td>';
	m += '</tr>';
	m += '</table>';
	
	/* lef and right */
	m += '<table width=100% border=0 cellpadding=0 cellspacing=0>';
	m += '<tr>';
	
	if(DIV)
	{
		m += wizleftMenu();
		m += '<td width=2%><img src=images/spacer.gif width=15 height=15></td>';
	}
	else
	{
		if (p.f==0 || p.f==1)
		{
			m += leftMenu();
			m += '<td width=2%><img src=images/spacer.gif width=15 height=15></td>';
		}
	}
	
	m += rightHead();
	
	document.writeln(m);
}

function pageTail()
{
var m = rightTail();
	
	m += '</tr>';
	m += '</table>';
	/* End left and right */
	
	m += '</td>';
	m += '<td background=images/bg1_r.gif>&nbsp;</td>';
	m += '</tr>';
	
	/* Bottom */
	m += '<tr>';
	m += '<td><img src=images/c1_bl.gif width=21 height=20></td>';
	m += '<td align=right background=images/bg1_b.gif><img src=images/copyright.gif width=264 height=20></td>';
	m += '<td><img src=images/c1_br.gif width=21 height=20></td>';
	m += '</tr>';
	
	m += '</table>';
	
	document.writeln(m);
}

function show_hide(el,shownow)
{
	if (document.all)
		document.all(el).style.display = (shownow) ? "block" : "none";
	else if (document.getElementById)
		document.getElementById(el).style.display = (shownow) ? "block" : "none";
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var timeTable=[[0,"-12:00","Enewetak, Kwajalein"],
[1,"-11:00","Midway Island, Samoa"],
[2,"-10:00","Hawaii"],
[3,"-09:00","Alaska"],
[4,"-08:00","Pacific Time (US &amp; Canada);Tijuana"],
[5,"-07:00","Arizona"],
[6,"-07:00","Mountain Time (US &amp; Canada)"],
[7,"-06:00","Central Time (US &amp; Canada)"],
[8,"-06:00","Mexico City, Tegucigalpa"],
[9,"-06:00","Saskatchewan"],
[10,"-05:00","Bogota, Lima, Quito"],
[11,"-05:00","Eastern Time (US &amp; Canada)"],
[12,"-05:00","Indiana (East)"],
[13,"-04:00","Atlantic Time (Canada)"],
[14,"-04:00","Caracas, La Paz"],
[15,"-04:00","Caracas, La Paz"],
[16,"-03:00","Newfoundland"],
[17,"-03:00","Brasilia"],
[18,"-03:00","Buenos Aires, Georgetown"],
[19,"-02:00","Mid-Atlantic"],
[20,"-01:00","Azores, Cape Verde Is."],
[21,"-01:00","Casablanca, Monrovia"],
[22,"+00:00","Greenwich Mean Time: Dublin, Edinburgh"],
[23,"-01:00","Greenwich Mean Time: Lisbon, London"],
[24,"+01:00","Amsterdam, Berlin, Bern, Rome"],
[25,"+01:00","Stockholm, Vienna, Belgrade"],
[26,"+01:00","Bratislava, Budapest, Ljubljana"],
[27,"+01:00","Prague,Brussels, Copenhagen, Madrid"],
[28,"+01:00","Paris, Vilnius, Sarajevo, Skopje"],
[29,"+01:00","Sofija, Warsaw, Zagreb"],
[30,"+02:00","Athens, Istanbul, Minsk"],
[31,"+02:00","Bucharest"],
[32,"+02:00","Cairo"],
[33,"+02:00","Harare, Pretoria"],
[34,"+02:00","Helsinki, Riga, Tallinn"],
[35,"+02:00","Helsinki, Riga, Tallinn"],
[36,"+03:00","Baghdad, Kuwait, Nairobi, Riyadh"],
[37,"+03:00","Moscow, St. Petersburg"],
[38,"+03:00","Tehran"],
[39,"+04:00","Abu Dhabi, Muscat, Tbilisi, Kazan"],
[40,"+04:00","Volgograd, Kabul"],
[41,"+05:00","Islamabad, Karachi, Ekaterinburg"],
[42,"+06:00","Almaty, Dhaka"],
[43,"+07:00","Bangkok, Jakarta, Hanoi"],
[44,"+08:00","Beijing, Chongqing, Urumqi"],
[45,"+08:00","Hong Kong, Perth, Singapore, Taipei"],
[46,"+09:00","Toyko, Osaka, Sapporo, Yakutsk"],
[47,"+10:00","Brisbane"],
[48,"+10:00","Canberra, Melbourne, Sydney"],
[49,"+10:00","Guam, Port Moresby, Vladivostok"],
[50,"+10:00","Hobart"],
[51,"+11:00","Magadan, Solamon, New Caledonia"],
[52,"+12:00","Fiji, Kamchatka, Marshall Is."],
[53,"+12:00","Wellington, Auckland"]];

function genTimeOpt()
{
	var s='';
	for (i=0; i<timeTable.length; i++)
	{
		var t=timeTable[i];
		s+='<option value='+t[0]+'> (GMT'+t[1]+') '+t[2]+'</option>\n';
	}
	document.write(s);
}

function show_month_option()
{
	var str=new String("");
	var i;

	for(i=1;i<=12;i++)
	{
		str="";
		str+="<option value="+i+">"+month[i-1]+"</option>";
		document.write(str);
	}
}
function show_day_option()
{
	var str=new String("");
	var i;

	for(i=1;i<=31;i++)
	{
		str="";
		str+="<option value="+i+">"+ (i<10 ? "0" : "") +i+"</option>";
		document.write(str);
	}
}

function setCln(f,m)
{
	f.clnEn.value=1;
	decomMAC2(f.WMAC, m, 1);
	f.cln.value='Clone MAC Address';
}

function clrCln(f)
{
	f.clnEn.value=0;
	decomMAC2(f.WMAC, '', 1);
	f.cln.value='Duplicate MAC address from the customer end';
}

function clnMac(f)
{
	if  (f.clnEn.value=='1') clrCln(f); else setCln(f,cln_MAC);
}

function evalDnsFix(ds1,ds2)
{
	if ((ds1==''||ds1=='0.0.0.0')&&(ds2==''||ds2=='0.0.0.0')) return 0;
	return 1;
}

function isNumber(n)
{
    if (n.length==0) return false;
    for (var i=0;i < n.length;i++)
    {
        if (n.charAt(i) < '0' || n.charAt(i) > '9') return false;
    }
    return true;
}

function isBlank(s)
{
    var i=0;
    for (i=0; i < s.length;i++)
    {
        if (s.charCodeAt(i)!=32) break;
    }
    if (i==s.length) return true; 
   
    return false;
}
function chksc(n, msg)
{
	var ck=/[\;]/;
	if (ck.test(n))
	{
		alert(msg+" Include the invalid character: \;");
		return false;
	}
	return true;
}




