function FindProxyForURL(url, host) { var pmbbm1="PROXY.UNP.AC.ZA"; var dbnproxy = "DBNPROXY1.UKZN.AC.ZA:8080; PROXY DBNPROXY2.UKZN.AC.ZA:8080"; var dbnproxy1 = "PROXY DBNPROXY1.UKZN.AC.ZA:8080"; var dbnproxy2 = "PROXY DBNPROXY2.UKZN.AC.ZA:8080"; var myip=myIpAddress(); var ipbits=myip.split("."); var myseg=parseInt(ipbits[3]); if(myseg==Math.floor(myseg/2)*2) { var dbnproxy = "PROXY DBNPROXY1.UKZN.AC.ZA:8080; PROXY DBNPROXY2.UKZN.AC.ZA:8080"; } else { var dbnproxy = "PROXY DBNPROXY2.UKZN.AC.ZA:8080; PROXY DBNPROXY1.UKZN.AC.ZA:8080"; } if (shExpMatch(host, "*.und.ac.za")) return "DIRECT"; else if (shExpMatch(host, "*.nu.ac.za")) return "DIRECT"; else if (shExpMatch(host, "*.ukzn.ac.za")) return "DIRECT"; else if (shExpMatch(host, "*.udw.ac.za")) return "DIRECT"; else if (shExpMatch(host, "*.unp.ac.za")) return "DIRECT"; else if (shExpMatch(host, "143.128.*")) return "DIRECT"; else if (shExpMatch(host, "146.230.*")) return "DIRECT"; else if (shExpMatch(host, "127.*")) return "DIRECT"; else if (shExpMatch(host, "localhost")) return "DIRECT"; else if (shExpMatch(host, "*.cao.ac.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "196.21.235.6")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.hwwilsonweb.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.columbia.edu")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.hwwilson.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.jstor.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.csa.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.globalbooksinprint.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "blues.sabinet.co.za")) return "PROXY 143.128.64.29:8080"; else if (shExpMatch(host, "*.sabinet.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.sciencedirect.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.epnet.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.f-secure.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.ebscohost.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.ebsco.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.surveymonkey.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.isiknowledge.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.journals.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.cabdirect.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.wikipedia.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.wikimedia.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.national.archives.gov.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "217.154.110.98")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "217.154.120.6")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.aps.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.aip.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.swetswise.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.oed.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "proquest.umi.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.ams.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.sanas.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.arxiv.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.emeraldinsight.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.oxfordjournals.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.scopus.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.emis.de")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.zone-h.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.tenet.ac.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "portal.acm.org/dl.cfm")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "prod1.centra.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.goldseek.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.gold-eagle.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.agis.agric.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.nrf.ac.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.home.mdconsult.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.drupal.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.refworks.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.nih.gov")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.esri.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.manuscriptcentral.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.netlibrary.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.wired.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.aldaily.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.newleftreview.net")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.spun.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.ovid.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.tdnet.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.nedbank.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.nedsecure.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.absa.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.fnb.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.standardbank.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.standard.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, ".elsevier.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.geoscience.org.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.blogger.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.mydropbox.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.libqual.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.oracle.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.acs.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "tux.expertise.co.za:81")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.cas.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.microsoft.com ")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.windowsupdate.com ")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.iucr.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.wiley.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.gartner.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.comsoc.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.iol.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.mg.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.witness.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.thetimes.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.medicalvideos.us")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.java.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.sarsefiling.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.samj.org.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "196.33.159.102")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.zotero.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.fstrf.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.rss-info.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "weather.yahooapis.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "rss.accuweather.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "services.qsrinternational.com")) return "PROXY 143.128.64.29:8080"; else if (shExpMatch(host, "www4.clustrmaps.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.melisa.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.lscf.ucsb.edu")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.cnn.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.wga.hu")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.exlibrisgroup.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*moodle.org")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.journals.uchicago.edu")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.agu.org")) return "PROXY 146.230.128.29:8080"; else if (shExpMatch(host, "www.liebertonline.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "swcdn.apple.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.turnitin.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.bartleby.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.accessmedicine.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.merck.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.etorque.co.za")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.psiberworks.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "lm.spss.com")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.dimdim.com")) return "DIRECT"; else if (shExpMatch(host, "www.google.com") && (url.substring(0, 5) == "http:")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "www.google.co.za") && (url.substring(0, 5) == "http:")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "scholar.google.com") && (url.substring(0, 5) == "http:")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "scholar.google.co.za") && (url.substring(0, 5) == "http:")) return "PROXY 146.230.128.27:8080"; else if (shExpMatch(host, "*.mcgbfa.com")) return dbnproxy; else if (isInNet(myIpAddress(), "143.128.0.0", "255.255.0.0")) return "PROXY "+pmbbm1+":8080"; else return dbnproxy ; }