var servermap ="http://localhost/streetview.ch";
var gen = null;
var map = null;

var streetMarker = null;

function initPage()
{
	
	
    // set default language
	var lang = document.getElementById("selectLang").options[document.getElementById("selectLang").selectedIndex].id;
    setLanguage(lang);
	//alert("after load language");
    
    // set up main control object
	
    gen = new Gen();
    gen.m_initMap();
    gen.m_initMapData();    
    gen.m_initDisplay();

    checkBookMark();
	
}

function closePage()
{
    GUnload();
}


// main street view video engine object
function Gen()
{
	
    // this.m_defaultCentre = new GLatLng(46.203121, 6.143074); // Geneva
    var y = 46.732331;
    var x = 8.058471;
    this.m_defaultCentre = new GLatLng(y,x);
    this.m_defaultZoom = 2;
    
    // this.m_minRouteZoom = 10;
    this.m_midRouteZoom = 14;

    this.m_filterText = "";
    this.m_placeFilterText = "";
    
    this.m_currentRoute = null;
    this.m_currentSegment = null;   // current segment within the route
    this.m_routeTime = -1;          // current time within route
    
    this.m_autoCentre = false;
    this.m_dragging = false;
    
    this.m_gridList = [];
    
    this.m_routeList = [];
    this.m_placeList = [];
    // this.m_regionList = [];
    this.m_cityList = [];
    this.m_categoryList = [];
    
    this.m_gridOn = true; 
    this.m_overlaysOn = true;
    
    this.m_visibleRoutes = [];  // list of currently displayed routes on the map
    
    this.m_placeCategory = "city";    // currently visible category - garage or canton city
    
    this.m_selectedPlace = null;
    
}


