function drawCircle(center, radius, nodes, liColor, liWidth, liOpa, fillColor, fillOpa) {
	//calculating km/degree
	var latConv = center.distanceFrom(new GLatLng(center.lat()+0.1, center.lng()))/100;
	var lngConv = center.distanceFrom(new GLatLng(center.lat(), center.lng()+0.1))/100;

	//Loop 
	var points = [];
	var step = parseInt(360/nodes)||10;
	for(var i=0; i<=360; i+=step)
	{
	var pint = new GLatLng(center.lat() + (radius/latConv * Math.cos(i * Math.PI/180)), center.lng() + 
	(radius/lngConv * Math.sin(i * Math.PI/180)));
	points.push(pint);
	//bounds.extend(pint); //this is for fit function
	}
	fillColor = fillColor||liColor||"#0055ff";
	liWidth = liWidth||2;
	var poly = new GPolygon(points,liColor,liWidth,liOpa,fillColor,fillOpa);
	map.addOverlay(poly);
}

function findPosX(obj) {

    var mapOffsetLeft = getPosition(document.getElementById("map_canvas")).x;

    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;

    curleft = curleft-mapOffsetLeft;
    return curleft;
}

function findPosY(obj) {

    var mapOffsetTop = getPosition(document.getElementById("map_canvas")).y-50;

    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;

    curtop = curtop-mapOffsetTop;
    return curtop;
}

function getPosition(element) {
  var elem = element;
  var tagname = "";
  var x = 0;
  var y = 0;

  while (elem != null && (typeof(elem) == "object") && (typeof(elem.tagName) != "undefined")) {

    y+=elem.offsetTop;
    x+=elem.offsetLeft;
    tagname=elem.tagName.toUpperCase();

    if (tagname=="BODY")
      elem=0;

    if (typeof(elem)=="object")
      if (typeof(elem.offsetParent)=="object")
        elem=elem.offsetParent;
    
  }

  position = new Object();
  position.x = x;
  position.y = y;
  return position;
}






