function remove_divs()
 {
  body_tag = document.getElementsByTagName("body").item(0);
  if (document.getElementById('wait_div_')) body_tag.removeChild(document.getElementById('wait_div_'));
  if (document.getElementById('div_opacity')) body_tag.removeChild(document.getElementById('div_opacity'));
  if (document.getElementById('google_div_')) body_tag.removeChild(document.getElementById('google_div_'));
 }


function create_please_wait_div()
 {
  if (!document.all) maxWidth = window.innerWidth-20;
			    else maxWidth = document.body.scrollWidth;

  wait_div = document.createElement("div");
  body_tag = document.getElementsByTagName("body").item(0);
  body_tag.appendChild(wait_div);
  wait_div.id = 'wait_div_';
  wait_div.style.position = 'absolute';
  wait_div.style.left = (maxWidth - 200)/2;
  wait_div.style.top = (document.body.clientHeight)/2 - 170 + document.body.scrollTop;
  wait_div.style.backgroundColor = 'white';
  wait_div.innerHTML = "<table border='1'><tr><td><table><tr><td><h4>Please wait a moment...</h4></td></tr></table>";
 }


function create_opacity_div()
 {
  if (document.getElementById('div_opacity')) return false;
  if (!document.all) maxWidth = window.innerWidth-20;
			    else maxWidth = document.body.scrollWidth;
  if (!document.all) maxHeight = document.body.offsetHeight;
			    else maxHeight = document.body.scrollHeight;

  if (maxWidth<800) maxWidth = 800;

  body_tag = document.getElementsByTagName("body").item(0);
  op_div = document.createElement("div");
  body_tag.appendChild(op_div);
  op_div.id = 'div_opacity';
  op_div.style.position = 'absolute';
  op_div.style.left = 0;
  op_div.style.top = 0;
  op_div.style.width = maxWidth;
  op_div.style.height = maxHeight;
  op_div.className = 'opacity_style';

  create_please_wait_div();
 }


function create_google_map_div(txt)
 {
  if (!document.all) maxWidth = window.innerWidth-20;
			    else maxWidth = document.body.scrollWidth;
/*  if (!document.all) maxHeight = document.body.offsetHeight;
			    else maxHeight = document.body.scrollHeight;*/

  google_div = document.createElement("div");
  body_tag = document.getElementsByTagName("body").item(0);
  body_tag.removeChild(document.getElementById('wait_div_'));
  body_tag.appendChild(google_div);
  google_div.id = 'google_div_';
  google_div.style.position = 'absolute';
  google_div.style.left = (maxWidth - 390)/2;
  google_div.style.top = (document.body.clientHeight)/2 - 170 + document.body.scrollTop;
  google_div.style.backgroundColor = 'white';
  google_div.innerHTML = "<div id='div_wait' style='position: absolute; left: 140px; top: 327px;'>Loading the map, please wait...</div><table border='1'><tr><td><table><tr><td colspan='2' width='390'><font color=red>The location you have chosen exists more than once. To submit your form, please choose the place you are referring to from the map below:</font></td></tr><tr><td colspan='2'><iframe src='http://www.travelgrove.com/community/users/"+ username_js +"/choose_from_map/" + txt + "' width='390' height='260' frameborder='0'></iframe></td></tr><td><img style='cursor: pointer' src='http://www.travelgrove.com/community/images/global/back.gif' onclick='make_back()'></td></tr></table></td></tr></table>";
 }


function make_back()
 {
  document.getElementsByTagName("body").item(0).removeChild(document.getElementById('div_opacity'));
  document.getElementsByTagName("body").item(0).removeChild(document.getElementById('google_div_'));
 }
