In javascript is it possible to create a function that checks an url to find the domain name. EG: if these sites:
www.site.co.uk
www.subdomain.site.co.uk
site.co.uk
subdomain.site.co.uk
were put into the function they would be returned as "site.co.uk".