function addAllowList(){
	if(document.DeleteAllowList.number.value >= 10)
	{
		alert("No more allow list to enter");
        return;
	}
	if (checkIPaddr(document.AddAllowList.start))
		return;
	if (checkIPaddr(document.AddAllowList.end))
		return;
    document.AddAllowList.submit();
}
function deleteAllowList(){
    document.DeleteAllowList.submit();
}

function addDenyList(){
	if(document.DeleteDenyList.number.value >= 10)
	{
		alert("No more deny list to enter");
        return;
	}
	if (checkIPaddr(document.AddDenyList.start))
		return;
	if (checkIPaddr(document.AddDenyList.end))
		return;
    document.AddDenyList.submit();
}

function deleteDenyList(){
    document.DeleteDenyList.submit();
}

function modAnEntry(anEntry, start, end){
	if (start.length != 0) {
		anEntry[0] = true;
		anEntry[1] = start + " ~ " + end;
	}
}

var aAllowList = new Array(10); 
var aDenyList = new Array(10); 
for (i = 0; i < 10; i ++){
	aAllowList[i] = new Array(false, "", i);
	aDenyList[i] = new Array(false, "", i);
}

modAnEntry(aAllowList[0], ipfilter_allowstart_0,  ipfilter_allowend_0);
modAnEntry(aAllowList[1], ipfilter_allowstart_1,  ipfilter_allowend_1);
modAnEntry(aAllowList[2], ipfilter_allowstart_2,  ipfilter_allowend_2);
modAnEntry(aAllowList[3], ipfilter_allowstart_3,  ipfilter_allowend_3);
modAnEntry(aAllowList[4], ipfilter_allowstart_4,  ipfilter_allowend_4);
modAnEntry(aAllowList[5], ipfilter_allowstart_5,  ipfilter_allowend_5);
modAnEntry(aAllowList[6], ipfilter_allowstart_6,  ipfilter_allowend_6);
modAnEntry(aAllowList[7], ipfilter_allowstart_7,  ipfilter_allowend_7);
modAnEntry(aAllowList[8], ipfilter_allowstart_8,  ipfilter_allowend_8);
modAnEntry(aAllowList[9], ipfilter_allowstart_9,  ipfilter_allowend_9);

modAnEntry(aDenyList[0], ipfilter_denystart_0,  ipfilter_denyend_0);
modAnEntry(aDenyList[1], ipfilter_denystart_1,  ipfilter_denyend_1);
modAnEntry(aDenyList[2], ipfilter_denystart_2,  ipfilter_denyend_2);
modAnEntry(aDenyList[3], ipfilter_denystart_3,  ipfilter_denyend_3);
modAnEntry(aDenyList[4], ipfilter_denystart_4,  ipfilter_denyend_4);
modAnEntry(aDenyList[5], ipfilter_denystart_5,  ipfilter_denyend_5);
modAnEntry(aDenyList[6], ipfilter_denystart_6,  ipfilter_denyend_6);
modAnEntry(aDenyList[7], ipfilter_denystart_7,  ipfilter_denyend_7);
modAnEntry(aDenyList[8], ipfilter_denystart_8,  ipfilter_denyend_8);
modAnEntry(aDenyList[9], ipfilter_denystart_9,  ipfilter_denyend_9);

