/* LGI Map 2009 */
//map_lang = 0;


sMapJsPath = 'fileadmin/start_map/';
sMapImagePath = 'fileadmin/start_map/img/';
aMapLang = new Array('de', 'en');
aMapImg = new Array();
aMapImg['MapEU'] = 'lgi-map.png';
aMapCountry = new Array();
aMapCountry['de'] = new Array();
aMapCountry['en'] = new Array();

aMapLocation = new Array();aMapLocation['de'] = new Array();aMapLocation['en'] = new Array();var country = new Array();

countryMap = new Array();
countryMap['de'] = new Array(
							 {'Deutschland':'de'}
							 ,{'Bulgarien':'bg'}
							 ,{'Frankreich':'fr'}
							 ,{'Italien':'it'}
							 ,{'Österreich':'at'}
							 ,{'Polen':'pl'}
							 ,{'Portugal':'pt'}
							 ,{'Schweden':'se'}
							,{'Spanien':'es'}
							,{'Tschechien':'cz'}
							,{'Türkei':'tr'}
							,{'UK':'uk'}
							,{'Ungarn':'hu'}
							 );


countryMap['en'] = new Array(
							 {'Germany':'de'}
							 ,{'Bulgaria':'bg'}
							 ,{'France':'fr'}
							 ,{'Italy':'it'}
							 ,{'Austria':'at'}
							 ,{'Poland':'pl'}
							 ,{'Portugal':'pt'}
							 ,{'Sweden':'se'}
							 ,{'Spain':'es'}
						     ,{'Czech Republic':'cz'}
							 ,{'Turkey':'tr'}
						     ,{'UK':'uk'}
						     ,{'Hungary':'hu'}
							 );

function cName(){
	for(cname in country){
		for(cMap in countryMap[aMapLang[map_lang]]){
			if(countryMap[aMapLang[map_lang]][cMap][country[cname]]){
				aMapLocation[aMapLang[map_lang]][cname] = countryMap[aMapLang[map_lang]][cMap][country[cname]]+';'+aMapLocation[aMapLang[map_lang]][cname];
				aMapCountry[aMapLang[map_lang]][countryMap[aMapLang[map_lang]][cMap][country[cname]]] = country[cname];
			}
		}
	}
}




function MapRenderLocations(aLoc, sHtmlContainerId, sLocImage, iLocImageHeight){
	sHtmlCode = '<div style="position:relative;top:0px;left:0px;margin-bottom:-288px;"><img src="'+sMapImagePath+aMapImg[sHtmlContainerId]+'" width="443" height="288" /></div>';
	sHtmlCode += '<div style="position:relative;top:0px;left:0px;margin-bottom:-288px;"><img src="'+sMapImagePath+'blind.gif" name="MapOverImg" id="MapOverImg" width="443" height="288" /></div>';

	for(iLocId in aLoc){
	
		aLocData = aLoc[iLocId].split(';');
		
		sHtmlCode += '<div style="position:relative;left:'+aLocData[1]+'px;top:'+aLocData[2]+'px;margin-bottom:-'+iLocImageHeight+'px;width:'+iLocImageHeight+'px;"><img src="'+sMapImagePath+sLocImage+'" /></div>';
	}
	
	sHtmlCode += '<div style="position:relative;top:0px;left:0px;margin-bottom:-288px;"><img src="'+sMapImagePath+'blind.gif" width="443" height="288" usemap="#StartMap"/></div>';
	sHtmlCode += '<map name="StartMap" id="StartMap">';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['de']+'" href="javascript:ShwoCountry(\'de\');" onMouseOver="OverCountry(\'de\')" onMouseOut="OutCountry()" shape="poly" coords="167,75,180,76,189,81,189,85,196,84,201,80,218,84,223,119,201,126,215,144,207,149,209,156,189,158,162,155,166,141,148,135,148,107,155,107,158,90,170,89" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['bg']+'" href="javascript:ShwoCountry(\'bg\');" onMouseOver="OverCountry(\'bg\')" onMouseOut="OutCountry()" shape="poly" coords="351,201,336,194,323,199,308,200,296,194,294,215,300,223,327,227,329,222,347,219,344,210" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['fr']+'" href="javascript:ShwoCountry(\'fr\');" onMouseOver="OverCountry(\'fr\')" onMouseOut="OutCountry()" shape="poly" coords="114,117,92,136,76,131,77,143,65,141,51,145,54,155,73,167,79,182,75,203,120,215,127,203,155,207,161,200,152,194,154,175,145,172,154,157,161,154,164,141,142,135" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['it']+'" href="javascript:ShwoCountry(\'it\');" onMouseOver="OverCountry(\'it\')" onMouseOut="OutCountry()" shape="poly" coords="212,172,202,191,215,199,225,218,236,218,260,240,227,280,198,267,164,253,163,230,176,228,190,217,180,195,170,191,162,200,153,194,156,174,188,165,201,162,203,170" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['at']+'" href="javascript:ShwoCountry(\'at\');" onMouseOver="OverCountry(\'at\')" onMouseOut="OutCountry()" shape="poly" coords="187,158,187,164,201,162,203,168,212,171,215,178,228,179,237,168,239,154,243,151,243,142,226,139,222,145,216,144,207,150,209,155" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['pl']+'" href="javascript:ShwoCountry(\'pl\');" onMouseOver="OverCountry(\'pl\')" onMouseOut="OutCountry()" shape="poly" coords="218,85,224,119,256,134,291,139,304,124,295,104,299,100,292,82,264,80,256,82,251,74" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['pt']+'" href="javascript:ShwoCountry(\'pt\');" onMouseOver="OverCountry(\'pt\')" onMouseOut="OutCountry()" shape="poly" coords="8,219,0,252,3,262,3,276,18,274,31,221" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['se']+'" href="javascript:ShwoCountry(\'se\');" onMouseOver="OverCountry(\'se\')" onMouseOut="OutCountry()" shape="poly" coords="188,33,204,58,204,71,218,71,236,62,254,22,240,3,200,3,201,24" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['es']+'" href="javascript:ShwoCountry(\'es\');" onMouseOver="OverCountry(\'es\')" onMouseOut="OutCountry()" shape="poly" coords="73,204,18,197,5,204,7,219,32,222,19,273,29,284,41,284,81,269,130,243,120,216" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['cz']+'" href="javascript:ShwoCountry(\'cz\');" onMouseOver="OverCountry(\'cz\')" onMouseOut="OutCountry()" shape="poly" coords="254,134,224,119,201,126,214,145,222,145,226,139,244,143" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['tr']+'" href="javascript:ShwoCountry(\'tr\');" onMouseOver="OverCountry(\'tr\')" onMouseOut="OutCountry()" shape="poly" coords="347,219,332,222,329,234,329,247,342,276,364,284,403,284,441,277,441,228,412,217,386,222,365,228" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['hu']+'" href="javascript:ShwoCountry(\'hu\');" onMouseOver="OverCountry(\'hu\')" onMouseOut="OutCountry()" shape="poly" coords="273,150,250,155,244,152,239,154,237,167,249,176,275,172,289,160,295,151,283,145,273,145" />';
	sHtmlCode += '<area title="'+aMapCountry[aMapLang[map_lang]]['uk']+'" href="javascript:ShwoCountry(\'uk\');" onMouseOver="OverCountry(\'uk\')" onMouseOut="OutCountry()" shape="poly" coords="33,56,29,85,44,87,52,95,44,131,108,118,110,97,102,97,81,57,86,46,80,28,42,38" />';
	sHtmlCode += '</map>';
	
	document.getElementById(sHtmlContainerId).innerHTML = sHtmlCode;
}

function MapRenderCountryLocations(aLoc, sTld, sLocImage, iLocImageHeight){
	sHtmlCode = '<div style="position:relative;left:0px;top:0px;margin-bottom:-288px;"><img width="443" height="288" src="'+sMapImagePath+'map_'+sTld+'.png"/></div>';
	
	for(iLocId in aLoc){
		aLocData = aLoc[iLocId].split(';');
	
		if(aLocData[0] != sTld){
			continue;
		}
		sHtmlCode += '<div style="position:relative;left:'+aLocData[3]+'px;top:'+aLocData[4]+'px;width:'+iLocImageHeight+'px;margin-bottom:-'+iLocImageHeight+'px;">';
		sHtmlCode += '<a href="javascript:ShowLocationAdr(\''+iLocId+'\', \''+sTld+'\');" onMouseOver="ShowCityName(\''+aLocData[5]+'\');" onMouseOut="HideCityName();"><img src="'+sMapImagePath+sLocImage+'" /></a>';
		sHtmlCode += '</div>';
	}
	sHtmlCode += '<div style="position:relative;left:315px;top:20px;margin-bottom:-27px;"><a href="javascript:MapClose();"><img src="'+sMapImagePath+'close.png"/></a></div>';
	sHtmlCode += '<div style="position:relative;left:0px;top:230px;text-align:center;width:443px;height:18px;text-transform: uppercase;font-size:14px;overflow:hidden"><b>'+aMapCountry[aMapLang[map_lang]][sTld]+'</b></div>';
	sHtmlCode += '<div id="MapCityName" style="position:relative;left:0px;top:230px;height:18px;text-align:center;width:443px;overflow:hidden">&nbsp;</div>';
	sHtmlCode += '<div id="MapLocationAdr" style="position:relative;left:0px;top:0px;width:443px;font-size:11px;margin-top:-37px;"></div>';
	
	
	document.getElementById('MapCountry').innerHTML = sHtmlCode;
}

function ShwoCountry(sTld){
	MapRenderCountryLocations(aMapLocation[aMapLang[map_lang]], sTld, 'loc_n.png', 5);
}

function OverCountry(sTld){
	document.getElementById('MapOverImg').src = sMapImagePath+'map_over_'+sTld+'.gif';
}

function OutCountry(sTld){
	document.getElementById('MapOverImg').src = sMapImagePath+'blind.gif';
}

function ShowCityName(sCity){
	document.getElementById('MapCityName').innerHTML = sCity;
}

function HideCityName(){
	document.getElementById('MapCityName').innerHTML = '&nbsp;';
}

function ShowLocationAdr(iLocID, sTld){
	sHtml = '<div style="position:relative;left:0px;top:0px;background-image:url('+sMapImagePath+'loc_hg.png);height:288px;">';
	
	sHtml += '<div style="padding:40px 0 0 110px;width:234px;">';
	sLocationHtml = document.getElementById('map_'+iLocID).innerHTML;
	if(sTld != 'de'){
		sLocationHtml = sLocationHtml.replace(aMapCountry[aMapLang[map_lang]][sTld]+', ', '')
	}
	sHtml += '<div style="font-size:14px;float:left;">'+aMapCountry[aMapLang[map_lang]][sTld]+'</div>';
	sHtml += '<div style="float:right;"><a href="javascript:CloseLocationAdr();"><img src="'+sMapImagePath+'close_adr.png" /></a></div><div style="float:left;width:234px;">'+sLocationHtml+'</div></div>';
	sHtml += '</div>';
	document.getElementById('MapLocationAdr').innerHTML = sHtml;
}

function CloseLocationAdr(){
	document.getElementById('MapLocationAdr').innerHTML = '';
}

function MapClose(){
	document.getElementById('MapCountry').innerHTML = '';
}
