function cMap()
{
	this.arMap = new Array();
	this.arLand = new Array();
	this.counter = 0;
	this.mapWidth = "160";
	this.mapHeight = "100";
	this.cssOpen = "menu_left_box_land_open";
	this.cssClose = "menu_left_box_land";
	
	//--- Länder dazu laden	
	this.load = function(caption,AGTLAND,swf,xml,width,height)
	{
		var length = this.arMap.length;
		this.arMap[length] = new Array();
		this.arMap[length]['caption'] = caption;
		this.arMap[length]['AGTLAND'] = AGTLAND;
		this.arMap[length]['swf'] = swf;
		this.arMap[length]['xml'] = xml;
		this.arMap[length]['width'] = width;
		this.arMap[length]['height'] = height;

		this.arLand[AGTLAND] = length;
	}

	//--- Internes Initialisieren
	this._init = function(e,arArray)
	{
		var AGTLAND = arArray[1];		
		if(AGTLAND.length > 0)
		{
			this.counter = this.arLand[AGTLAND];
		}		

		var DropDown = new CDropDown("","","");
		var open = "";
		for(var Nr in this.arMap)
		{					
			if(this.counter == Nr)
			{
				open = "open";
			}					
			DropDown.newDropDown("land_"+this.arMap[Nr]['AGTLAND'],"land_"+this.arMap[Nr]['AGTLAND']+"_bundeslaender","","",open,this.cssOpen,this.cssClose);
			open = "";
		}				
		DropDown.loadDropDown();			

		this._selectLand();				
	}
	
	//--- init Aufruf, Muss isOnload auf true stehen wenn es sich gerade im onload befindet, ansosnten wird das Event automatisch hinzugefügt
	this.init = function(AGTLAND,isOnLoad)
	{		
		if(isOnLoad)
		{
			this._init(false,new Array(false,AGTLAND));
		}else{
			addEvent(window,"load",this._init.scope(this,AGTLAND));
		}
	}
	
	//--- zeigt das vorherige Land
	this.prev = function()
	{
		this.counter -= 1;
		if(this.counter < 0)
		{
			this.counter = this.arMap.length - 1;
		}
		this._selectLand();
	}

	//--- zeigt das nächste Land
	this.next = function()
	{
		this.counter += 1;
		if(this.counter > this.arMap.length - 1)
		{
			this.counter = 0;
		}			
		this._selectLand();
	}
				
	//--- Initialisiert die FusionMap
	this._selectLand = function()
	{
		//--- Caption setzen
		document.getElementById('flashkarte_caption').innerHTML = this.arMap[this.counter]['caption'];

		var map;
		var t1 = "";
		var width 	= (this.arMap[this.counter]['width']) 	? this.arMap[this.counter]['width'] 	: this.mapWidth;
		var height 	= (this.arMap[this.counter]['height']) 	? this.arMap[this.counter]['height'] 	: this.mapHeight;
		
		map = new FusionMaps("../html/FusionMaps/Maps/" + this.arMap[this.counter]['swf'] + ".swf", "Map1Id", width, height, "0", "0");
		if( t1 == "" )
		{
			map.setDataURL("../html/FusionMaps/" + this.arMap[this.counter]['xml'] + ".xml");
		}else{
			map.setDataURL("../html/FusionMaps/" + this.arMap[this.counter]['xml'] + "_kunde.xml");
		}

		// map.setDataXML( sXML );
		map.render("mapdiv");
	}	
}
