New to the Java world but need help.

I have a proxy.pac writing for my office. It has at the beginning the various site or networks to ignore. If none of these apply it checks to see which network the computer is on. There is two networks XXX.XXX.0.0 or XXX.YYY.0.0. Which proxy to use is determined by the network the computer is on. The first network is working fine when it is true. The second network is not working correctly. Listed below is my code. Could some one look to see if it is correctly written and give me some suggestions? Thanks.


function FindProxyForURL(url, host) {
if (
(isInNet(host,"XXX.XXX.XXX.0","255.255.255.128")) ||
(isInNet(host,"XXX.XXX.XXX.0","255.255.255.192")) ||
(isInNet(host,"XXX.XXX.0.0","255.255.0.0")) ||
(isInNet(host,"XXX.XXX.0.0","255.255.0.0")) ||
(dnsDomainIs(host, ".nrcims.on.ca")) ||
(dnsDomainIs(host, "XXX.XXX.XXX.167")) ||
(dnsDomainIs(host, "127.71.241.240")) ||
(dnsDomainIs(host, ".fasttrack.mcys.gov.on.ca")) ||
(dnsDomainIs(host, ".pli.gsa.gov.on.ca")) ||
(dnsDomainIs(host, "library.skillport.com")) ||
(dnsDomainIs(host, "main.zerotothree.org")) ||
(dnsDomainIs(host, ".oacas.org")) ||
(dnsDomainIs(host, ".adoptontario.ca")) ||
(dnsDomainIs(host, "link.brightcove.com")) ||
(dnsDomainIs(host, "said.coyotecorp.com")) ||
(dnsDomainIs(host, "etrustdownloads.ca.com"))

)
return "DIRECT";
else
if (isInNet(myIpAddress(), "XXX.XXX.0.0", "255.255.0.0"))
return "PROXY XXX.XXX.0.25:8080";
ELSE
if (isInNet(myIpAddress(), "XXX.YYY.0.0", "255.255.0.0"))
return "PROXY XXX.yyy.0.25:8080";
ELSE
return "DIRECT";
}