list = doc.getElementsByTagName("a");
len = list.getLength();
for(int i = 0; i < len; i++)
{
HTMLAnchorElement elem = (HTMLAnchorElement)list.item(i);
String href = elem.getHref();
if (!href.startsWith("http:"))
elem.setHref("http://www.google.com" + href);
}
list = doc.getElementsByTagName("img");
len = list.getLength();
for(int i = 0; i < len; i++)
{
HTMLImageElement elem = (HTMLImageElement)list.item(i);
String src = elem.getSrc();
if (!src.startsWith("http:"))
elem.setSrc("http://www.google.com" + src);
}
}