function subscribeNewsletter(form,text){
  if (text.indexOf("+Updates")==-1) text+="+Updates";
  var url = "http://lnweb18.worldbank.org/ext/extrocontact.nsf/webcontactsubmission?Openform&^Default=" + text + "^MailAddress=" + form.email.value + "^";
  document.location = url;
  return false;
}

function PopupWindow(url,width,height,name,resizable){
		if (resizable==null) resizable = "no"
    if (name==null){
      name = new String(Math.round(Math.random()*10000000));
    }
    var left = (screen.width - width)/2;
    var top = (screen.height - height)/2 - 18;

    var win = window.open(url,name,"toolbar=no,location=no,directories=no,"+
      "status=no,menubar=no,scrollbars=no,resizable=" + resizable + ","+
      "copyhistory=no, width="+width+",height="+height+",left="+left+",top="+top);
}

function resizeMainDiv(elementName, xmargin, ymargin)
{
	var element = document.getElementById(elementName);
  if (!element) return;

	var width, height;

	// all except Explorer
	if (self.innerHeight)
	{
		width = self.innerWidth- 20;
		height = self.innerHeight - 20;
	}
	// Explorer 6 Strict Mode
	else if (document.documentElement && document.documentElement.clientHeight)
	{
		width = document.documentElement.clientWidth;
		height = document.documentElement.clientHeight;
	}
	// other Explorers
	else if (document.body)
	{
		width = document.body.clientWidth;
		height = document.body.clientHeight;
	}

	// resize div element
	element.style.width = width - xmargin;
	element.style.height = height - ymargin;
}
