function Callout()
{
	this.callout = false;
	this.calloutContent = false;
	this.mapSize = applicationObject.mapObject.map.getSize();
	this.mapWidth = this.mapSize.width;
	this.mapHeight = this.mapSize.height;
	this.pixelPoint = new GPoint(0, 0);

	this.createCallout = function()
	{
		this.callout = document.createElement("div");
		this.callout.id = "callout";
		this.callout.className = "m1_tt_container";
		this.callout.style.position = "absolute";
		this.callout.style.zIndex = "100";
		this.callout.style.left = "-1000px";
		this.callout.style.top = "-1000px";
		this.callout.style.cursor = "pointer";
		this.callout.style.cursor = "hand";
		this.callout.innerHTML = '<div class="m1_tooltip_r"></div><div class="m1_tooltip_bg"><div id="callout_content"></div></div><div class="m1_tooltip"></div>';

		document.body.appendChild(this.callout);
		this.calloutContent = $('#callout_content').get(0);
	}

	this.showCallout = function(lat, lng, content, iconheight)
	{
		var centerPixel = applicationObject.mapObject.map.fromLatLngToContainerPixel(applicationObject.mapObject.map.getCenter());
		this.pixelPoint = applicationObject.mapObject.map.fromLatLngToContainerPixel(new GLatLng(lat, lng));
		
		if(this.pixelPoint)
		{
			var fromCenter = this.subGPoints(this.pixelPoint, centerPixel);

			var container_x = fromCenter.x + (this.mapWidth / 2);
			var container_y = fromCenter.y + (this.mapHeight / 2);

			var offsetLeft = $('#map').position().left;
			var offsetTop = $('#map').position().top;

			this.callout.style.left = ((offsetLeft + container_x) - 24) + "px";

			switch(iconheight)
			{
				case 10 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 65) + "px";
					break;
				case 20 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 65) + "px";
					break;			
				case 30 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 70) + "px";
					break;
				case 40 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 75) + "px";
					break;
				case 50 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 80) + "px";
					break;
				case 60 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 85) + "px";
					break;
				case 70 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 90) + "px";
					break;
				case 80 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 95) + "px";
					break;
				case 90 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 100) + "px";
					break;
				case 100 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 105) + "px";
					break;
				case 110 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 110) + "px";
					break;
				case 120 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 115) + "px";
					break;
				case 130 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 120) + "px";
					break;
				case 140 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 125) + "px";
					break;
				case 150 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 130) + "px";
					break;
				case 160 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 135) + "px";
					break;
				case 170 :
					this.callout.style.top = (((offsetTop + container_y) - iconheight) + 140) + "px";
					break;
			}
			if(applicationObject.action == 'home')
			{
				this.callout.style.top = (parseInt(this.callout.style.top) - 117) + "px";
			}
			this.calloutContent.innerHTML = content;

			var self = this;
			$("#callout").unbind("click");
			$("#callout").click(function(event)
			{
				//
			});
		}
	}
	
	this.hideCallout = function()
	{
		this.callout.style.left = "-1000px";
		this.callout.style.top = "-1000px";
	}

	this.subGPoints = function (a,b)
	{
		return new GPoint(a.x-b.x, a.y-b.y);
	}
}