/*
ShareControl for map
*/
function ShareControl()
{
	
}

ShareControl.prototype = new GControl();

ShareControl.prototype.initialize = function(map)
{
	var container = document.createElement("div");
	container.style.height = '70px';
	container.style.width = '285px';
	container.style.paddingLeft = '5px';
	container.style.border = '1px solid #FF9900';
	container.style.backgroundColor = '#FFEAC0';
	container.style.fontFamily = 'Georgia,Century,Times,serif';
	//container.style.setProperty('-moz-user-select', 'text', null);
	container.setAttribute('id', 'share_control_container');

/*  close link */

	var close = document.createElement("div");
	close.style.background = 'transparent url(/images/close.png) no-repeat scroll 17pt 50%';
	close.appendChild(document.createTextNode('_'));
	close.style.color = '#FFEAC0';
	close.style.fontWeight = 'bold';
	close.style.paddingLeft = '15px';
	close.style.fontSize = '11px';
	close.style.textAlign = 'left';
	close.style.width = '23px';
	close.setAttribute('id', 'close_button');
	GEvent.addDomListener(close, "click", function()
		{
			HideShareMapArea();
		}
	);
	close.style.cursor = "pointer";
	container.appendChild(close);

/* text DIV */ 

	var textDiv = document.createElement('div');
	textDiv.style.height = '25px';
	textDiv.style.width = '225px';
	textDiv.style.color = '#000';
	textDiv.style.marginTop = '10px';
	textDiv.style.fontFamily = 'Georgia,Century,Times,serif';
	textDiv.setAttribute('id', 'textDiv');
	textDiv.appendChild(document.createTextNode('Paste link in email or IM'));
	container.appendChild(textDiv);

/* INPUT field */

	var input = document.createElement('input');
	var map_url = GetMapUrl();
	
	input.setAttribute('value', map_url);
	input.setAttribute('id', 'share_control_input');
	input.style.border = '1px solid #a5acb2';
	input.style.height = '19px';
	input.style.paddingTop = '2px';
	container.appendChild(input);
	
	map.getContainer().appendChild(container);
	return container;
}

ShareControl.prototype.getDefaultPosition = function()
{
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(0, 0));
}