var SelRowBC

function GetSchedule(f, r, i){
    if (r[i]=="0")
        f.schd[0].checked = true       
    else
        f.schd[1].checked = true       
      
    f.hour1.selectedIndex = r[i+1]
    f.min1.selectedIndex = r[i+2]
    f.am1.selectedIndex = r[i+3]
    f.hour2.selectedIndex = r[i+4]
    f.min2.selectedIndex = r[i+5]
    f.am2.selectedIndex = r[i+6]
    f.day1.selectedIndex = r[i+7]
    f.day2.selectedIndex = r[i+8]
    
}

function GetProto(f, p, n){
    var i
    if (p=="6")
        i=0
    else if (p=="17")
        i=1
    else
        i=2
	eval("f."+n+".selectedIndex="+i)
}

function SelectRow(tn,row){
    if (SelRow != row){
        var bar = document.getElementById(tn)
        if (SelRow >= 0)
            bar.rows[SelRow].style.backgroundColor = SelRowBC
        if (row >= 0){
            SelRowBC = bar.rows[row].style.backgroundColor
            bar.rows[row].style.backgroundColor = "#FFFF00"
        }
        SelRow = row;
    }
    
}

function NewRow(f,tn){
	f.editRow.value = "-1"
/* SelectRow(tn,-1) change by ken */	
	SelectRow(tn,0)

}

function LastRow(fn,tn){
	var f = document.getElementById(fn)
	var i = parseInt(f.editRow.value)
	if (i>=-1) {
/* SelectRow(tn,i+1) change by ken */		
	    SelectRow(tn,i+1)
	}	
}

function EnableRow(f, e){
	if (e == "1")
		f.enable[0].checked = true
	else
		f.enable[1].checked = true

}

/* new */
function ShowWizard(name){
	window.open(name,"Wizard","width=450,height=320")
}

function ExitWizard(){
    if (confirm("Quit setup wizard and discard settings ?"))
        window.close()
}

/* new */
function ExitMore(){
        window.close()
}

function ChgPage(i){
    var p
	if (i==0) p="h_wan_dhcp.html"
	if (i==1) p="h_wan_fix.html" 
	if (i==2) p="h_wan_poe.html" 
	/* new */
	if (i==3) p="h_wan_pptp.html"
	if (i==4) p="h_wan_bigpond.html"
	if (i==5)
	{
		if (others == "bigpond")
			p="h_wan_bigpond.html"
		else
			p="h_wan_pptp.html"
	}
	window.location.href=p
} 

function ChgFilter(i){
    var p
	if (i==0) p="adv_filters.html"
	if (i==1) p="adv_filters_mac.html"
	if (i==2) p="adv_filters_url.html"
	if (i==3) p="adv_filters_domain.html"
	window.location.href=p
}

function DelRow(f,r)
{
    EditRow(r)
    if (confirm("Are your sure you want to delete this entry?")){
        f.delrow.value="1"
        popupwin()
    }
}




function popupwin () {
window.open("continue.html","url","scrolling=no,width=780,height=300,navigation=no")

}

function selWL(F){
	popupwin();
}

function WirelessChg(w){
	
    var p
	if (w==0) p="h_wireless.html"
	if (w==1) p="h_wireless1.html"
	if (w==2) p="h_wireless2.html"
	if (w==3) p="h_wireless3.html"
	window.location.href=p
}
