function FindProxyForURL(url, host) {
    if
    (
       ( shExpMatch(host, "*.research.canon.com.au")
      && ! (host == "www.research.canon.com.au"
	 || host == "ftp.research.canon.com.au"
	 || shExpMatch(host,"*.cgn.research.canon.com.au")
	   )
       )
    || ! shExpMatch(host, "*.*")
    || host == "127.0.0.1"
    )
        return "DIRECT";
    else if
    (
     ! (shExpMatch(url, "http://*")
     || shExpMatch(url, "HTTP://*")
     || shExpMatch(url, "ftp://*")
     || shExpMatch(url, "FTP://*")
       )
     || shExpMatch(host, "*cgn.*canon*")
     || shExpMatch(host, "www.gatf.*canon*")
     || host == "202.2.169.18"
    )
		return "SOCKS socks:1080";
    else
        return "PROXY proxy:8081";
}