function getTrueOffset(el) {
    var IE_scroll_x = 0, IE_scroll_y = 0, of, ret;
    //if (navigator.appName == 'Microsoft Internet Explorer') {
    //IE_scroll_x = f_scrollLeft(); IE_scroll_y = f_scrollTop();
    //}
    of = el.getPosition();	
    return ret = { 
	x: of.x + IE_scroll_x,
	y: of.y + IE_scroll_y
    };
};

function DataIn(data) {
    var cd = [];
    for (var i = 0; i < data.length; i++) {
	cd[i] = [data[i][0], -data[i][1]];
    }
    return cd;
}

function DataOut(data) {
    var cd = [];
    for (var i = 0; i < data.length; i++) {
	cd[i] = [data[i][0], -data[i][1]];
    }
    return cd;
}

Interface = {
    pagemenu: 0,
    feature: 0, // current feature
    init_popup_menu: function() {
	pagemenu = new DDMenu ('ddmenu2', Site.map.div, {            //document can be the whole page, 
		//an element or a parent of elements 
		onOpen: function (e) {
		    this.enableItems(true);                          //enable all 
// 		    this.enableItems('menu_item_with_icon2',false);  //disable menu_item_with_icon2
		}, 
    
		onItemSelect: function (act_id, act_el, menu_bindon) {
		    log("onItemSelect", Site.menuclick_lonlat);
		    if (act_id == 'popup_route_a') {
			var lonLat = Site.menuclick_lonlat;
			var route = Site.route;
			route.add(lonLat, 0);
			route.set_roles();
			route.stops.redraw();
			Site.draw_route();
		    }
		    if (act_id == 'popup_route_b') {
			var lonLat = Site.menuclick_lonlat;
			var route = Site.route;
			route.add(lonLat);
			route.set_roles();
			route.stops.redraw();
			Site.draw_route();
		    }
		    if (act_id == "popup_route_removenode") {
			if (isobj(Interface.feature)) {
			    Site.route.stops.remove([this.feature]);
			    Site.route.stops.redraw();
			    Interface.feature = 0;
			}
		    }
		}
	    });
    }
}


//     of = getTrueOffset(this.curtb);
// x = event.page.x - of.x + this.tilebox.X;
// y = event.page.y - of.y + this.tilebox.Y;	    
// T = this.ScreenCoordsToGeoCoords(x, y);

