/* Copyright 2007 - 2009 durch Navipedia GmbH */
/* Jede nicht-autorisierte Verwendung ist untersagt */
/* Datum und Zeit: 22.04.2010 10:07:00, Source-Dateien: */
/* ../common/js/navi_filter_ctrl_v0313.js */
/* ../common/js/navi_main_v0407.js */
/* ../common/js/navi_map_control_v0206.js */

var a_f_locked = false; 
var uuid_locked = false; 
function toggle_immotype_display(type)
{
document.getElementById("sel_gewerbetypen").selectedIndex = 0;
document.getElementById("sel_wohntypen").selectedIndex = 0; 
document.getElementById("sel_immotypen").selectedIndex = 0; 
immotype_selected("Alle");
switch(type) {
case 0: document.getElementById("txt_wohntypen").style.display = "none";  
document.getElementById("txt_gewerbetypen").style.display = "none";  
document.getElementById("txt_immotypen").style.display = "none";  
break;
case 1: document.getElementById("txt_wohntypen").style.display = "inline";  
document.getElementById("txt_gewerbetypen").style.display = "none";  
document.getElementById("txt_immotypen").style.display = "none";  
break;
case 2: document.getElementById("txt_wohntypen").style.display = "none";  
document.getElementById("txt_gewerbetypen").style.display = "inline";  
document.getElementById("txt_immotypen").style.display = "none";  
break;		
default: document.getElementById("txt_wohntypen").style.display = "none";  
document.getElementById("txt_gewerbetypen").style.display = "none";  
document.getElementById("txt_immotypen").style.display = "inline";  
// console.log('toggle_preis_display: Wert %d unbekannt\n', type); Script debugger, der nur mit Firefox funktioniert (d.h. nur temporaer einschalten!)
}
}
function toggle_marketingtype_display(type)
{	
if (!CONF_FILTER_CORRELATION) return; 
document.getElementById("sel_marketingtypen").selectedIndex = 0; 
marketingtype_selected("Alle");
switch(type) {
case 0: document.getElementById("txt_marketingtypen").style.display = "none";  
break;
case 1: document.getElementById("txt_marketingtypen").style.display = "inline";
break;
default: document.getElementById("txt_marketingtypen").style.display = "none";  
// console.log('toggle_marketingtype_display: Wert %d unbekannt\n', type); Script debugger, der nur mit Firefox funktioniert (d.h. nur temporaer einschalten!)
}
}
function toggle_preis_display(type)
{
document.getElementById("sel_mietpreis").selectedIndex = 0; 
document.getElementById("sel_kaufpreis").selectedIndex = 0; 
price_range_selected(0); 
switch(type) {
case 0: document.getElementById("txt_mietpreis").style.display = "none";  
document.getElementById("txt_kaufpreis").style.display = "none";  
break;
case 1: document.getElementById("txt_mietpreis").style.display = "inline";  
document.getElementById("txt_kaufpreis").style.display = "none";  
break;
case 2: document.getElementById("txt_mietpreis").style.display = "none";  
document.getElementById("txt_kaufpreis").style.display = "inline";  
break;		
default: document.getElementById("txt_mietpreis").style.display = "none";  
document.getElementById("txt_kaufpreis").style.display = "none";  
// console.log('toggle_preis_display: Wert %d unbekannt\n', type); Script debugger, der nur mit Firefox funktioniert (d.h. nur temporaer einschalten!)
}
}
function toggle_zimmer_display(type)
{	
}
function toggle_qm_display(type)
{	
document.getElementById("sel_qm").selectedIndex = 0; 
document.getElementById("wohn_sel_qm").selectedIndex = 0; 
document.getElementById("gewerbe_sel_qm").selectedIndex = 0;
qm_range_selected(0);
switch(type) {
case 0: document.getElementById("txt_qm").style.display = "none";  
document.getElementById("sel_qm").style.display = "none";
document.getElementById("wohn_sel_qm").style.display = "none";
document.getElementById("gewerbe_sel_qm").style.display = "none";
break;
case 1: document.getElementById("txt_qm").style.display = "inline";  
document.getElementById("wohn_sel_qm").style.display = "inline";
document.getElementById("gewerbe_sel_qm").style.display = "none";
document.getElementById("sel_qm").style.display = "none";
break;
case 2: document.getElementById("txt_qm").style.display = "inline";  
document.getElementById("gewerbe_sel_qm").style.display = "inline";
document.getElementById("wohn_sel_qm").style.display = "none";
document.getElementById("sel_qm").style.display = "none";
break;
case 3: document.getElementById("txt_qm").style.display = "inline";  
document.getElementById("sel_qm").style.display = "inline";
document.getElementById("gewerbe_sel_qm").style.display = "none";
document.getElementById("wohn_sel_qm").style.display = "none";
break;
default: document.getElementById("txt_qm").style.display = "none";  
document.getElementById("sel_qm").style.display = "none"; 
document.getElementById("gewerbe_sel_qm").style.display = "none";
document.getElementById("wohn_sel_qm").style.display = "none";
// console.log('toggle_qm_display: Wert %d unbekannt\n', type); Script debugger, der nur mit Firefox funktioniert (d.h. nur temporaer einschalten!)
}
}
function select_purpose (purpose)
{
var a_f_higher_level_locked=false;
if (a_f_locked == true) {a_f_higher_level_locked=true;} 
a_f_locked = true;
var marketing_type = "Alle";
switch(purpose) {
case "Wohnen":	document.getElementById("zweck").selectedIndex = 1; 
break;
case "WohnenM":	document.getElementById("zweck").selectedIndex = 1; 
purpose="Wohnen"; marketing_type = "Miete";
break;
case "WohnenK":	document.getElementById("zweck").selectedIndex = 1; 
purpose="Wohnen"; marketing_type = "Kauf";
break;
case "Gewerbe":	document.getElementById("zweck").selectedIndex = 2; 
break;
default:		document.getElementById("zweck").selectedIndex = 0;   
purpose="Alle";
}
purpose_selected (purpose);
if (marketing_type != "Alle") select_marketingtype (marketing_type);
if (a_f_higher_level_locked == false) {
a_f_locked = false; 
apply_filter();
}
}
function select_marketingtype (marketingtype)
{
switch(marketingtype) {
case "Kauf":	document.getElementById("sel_marketingtypen").selectedIndex = 2; 
break;
case "Miete":	document.getElementById("sel_marketingtypen").selectedIndex = 1; 
break;
default:		document.getElementById("sel_marketingtypen").selectedIndex = 0;   
purpose="Alle";
}
marketingtype_selected (marketingtype);
}
function select_immotype (type)
{
switch(type) {
case "Office":
curr_sel.purpose="Gewerbe";
document.getElementById("zweck").selectedIndex = 2; 
toggle_marketingtype_display(1);
toggle_qm_display (2);
toggle_immotype_display(2); 
document.getElementById("sel_gewerbetypen").selectedIndex = 1; 
break;
case "Industry":
curr_sel.purpose="Gewerbe";
document.getElementById("zweck").selectedIndex = 2; 
toggle_marketingtype_display(1);
toggle_qm_display (2);
toggle_immotype_display(2); 
document.getElementById("sel_gewerbetypen").selectedIndex = 2; 
break;
default: 	alert('select_immotype: Fehler');
}
immotype_selected (type);
}
function source_selected(source)
{
select_uuid(null);
curr_sel.objsource=source;
// console.log('source_selected %s', curr_sel.objsource); Script debugger, der nur mit Firefox funktioniert (d.h. nur temporaer einschalten!)
select_purpose ("Alle");
}
function purpose_selected(purpose)
{
var a_f_higher_level_locked=false;
if (a_f_locked == true) {a_f_higher_level_locked=true;} 
a_f_locked=true;
select_uuid(null);
curr_sel.purpose=purpose;
// console.log('purpose_selected %s', curr_sel.purpose); Script debugger, der nur mit Firefox funktioniert (d.h. nur temporaer einschalten!)
switch(purpose)
{
case "Alle":  	toggle_marketingtype_display(1);
toggle_qm_display (3);
toggle_immotype_display(3); break;
case "Wohnen":	toggle_marketingtype_display(1);
toggle_qm_display (1);
toggle_immotype_display(1); break;
case "Gewerbe": toggle_marketingtype_display(1);
toggle_qm_display (2);
toggle_immotype_display(2); 
//document.getElementById("zweck").style.backgroundColor="red";
break;
case "Geldanlage":
case "Ferien":
toggle_marketingtype_display(0);
toggle_qm_display (0);
toggle_immotype_display(0); break;
default:	toggle_marketingtype_display(1);
toggle_qm_display (0);
toggle_immotype_display(0);
}
if (a_f_higher_level_locked == false) {
a_f_locked = false; 
apply_filter();
}
}
function marketingtype_selected(marketingtype)
{
var a_f_higher_level_locked=false;
if (a_f_locked == true) {a_f_higher_level_locked=true;} 
a_f_locked=true;
select_uuid(null);
curr_sel.marketingtype=marketingtype;
switch(marketingtype)
{
case "Alle":  toggle_preis_display(0); break;
case "Miete": toggle_preis_display(1); break;
case "Kauf":  toggle_preis_display(2); break;
case "Pacht": toggle_preis_display(1); break;
default:  toggle_preis_display(0);
}
if (a_f_higher_level_locked == false) {
a_f_locked = false; 
apply_filter();
}
}
function immotype_selected(immotype) 
{
var a_f_higher_level_locked=false;
if (a_f_locked == true) {a_f_higher_level_locked=true;} 
a_f_locked=true;
select_uuid(null);
curr_sel.immotype=immotype;
switch(immotype)
{
case "Alle":
case "SiteLiving":
case "Office":
case "Gastronomy":
case "Industry":
case "Store":
case "Misc":
case "SiteTrade":
case "Investment":
case "MFH":
toggle_zimmer_display(0); break;
case "Appartment":
case "House":
case "WAZ":
toggle_zimmer_display(1); break;
default:  toggle_zimmer_display(0);
}
toggle_marketingtype_display(1);
if (a_f_higher_level_locked == false) {
a_f_locked = false; 
apply_filter();
}
}
function price_selected(price)
{
select_uuid(null);
curr_sel.price=price;
if (!a_f_locked) apply_filter();
}
function qm_selected(qm)
{
select_uuid(null);
curr_sel.qm=qm;
if (!a_f_locked) apply_filter();
}
function rooms_selected(rooms)
{
select_uuid(null);
curr_sel.rooms=rooms;
if (!a_f_locked) apply_filter();
}
function cat_selected(cat)
{
select_uuid(null);
curr_sel.category=cat;
if (!a_f_locked) apply_filter();
}
function group_selected(group)
{
select_uuid(null);
curr_sel.group_num=group;
if (!a_f_locked) apply_filter();
}
function months_selected(months)
{
select_uuid(null);
curr_sel.months_till_movein=months;
if (!a_f_locked) apply_filter();
}
var CONF_PLZ_MATRIX=new Array();
CONF_PLZ_MATRIX[0]=new Array(); 
CONF_PLZ_MATRIX[1]=new Array(); 
CONF_PLZ_MATRIX[2]=new Array(10117, 10555, 10557, 10585, 10587, 10589, 10623, 10625, 10627, 10629,  10707, 10709, 10711, 10719, 10785, 10787, 10789, 10963, 13597, 13627, 13629, 14050, 14052, 14053, 14055, 14057, 14059); 
CONF_PLZ_MATRIX[3]=new Array(10243, 10245, 10247, 10249, 10961, 10963, 10965, 10967, 10969, 10997, 10999); 
CONF_PLZ_MATRIX[4]=new Array(10315, 10317, 10318, 10319, 10365, 10367, 10369, 13051, 13053, 13055, 13057, 13059); 
CONF_PLZ_MATRIX[5]=new Array(12555, 12591, 12619, 12621, 12623, 12627, 12629, 12679, 12681, 12683, 12685, 12687, 12689); 
CONF_PLZ_MATRIX[6]=new Array(10115, 10119, 10178, 10179, 10551, 10553, 10559); 
CONF_PLZ_MATRIX[7]=new Array(10967, 12043, 12045, 12047, 12049, 12051, 12053, 12055, 12057, 12059, 12099, 12305, 12347, 12349, 12351, 12353, 12355, 12357, 12359); 
CONF_PLZ_MATRIX[8]=new Array(10247, 10249, 10405, 10407, 10409, 10435, 10437, 10439, 13051, 13086, 13088, 13089, 13125, 13127, 13129, 13156, 13157, 13158, 13159, 13187, 13189); 
CONF_PLZ_MATRIX[9]=new Array(13347, 13349, 13351, 13353, 13355, 13357, 13359, 13403, 13405, 13407, 13409, 13435, 13437, 13439, 13465, 13467, 13469, 13503, 13505, 13507, 13509, 13599); 
CONF_PLZ_MATRIX[10]=new Array(13581, 13583, 13585, 13587, 13589, 13591, 13593, 13595, 13597, 13599, 13627, 13629, 14052, 14089); 
CONF_PLZ_MATRIX[11]=new Array(12157, 12161, 12163, 12165, 12167, 12169, 12203, 12205, 12207, 12209, 12247, 12249, 12277, 12279, 14109, 14129, 14163, 14165, 14167, 14169, 14193, 14195, 14197, 14199); 
CONF_PLZ_MATRIX[12]=new Array(10777, 10779, 10781, 10783, 10787, 10789, 10823, 10825, 10827, 10829, 12099, 12101, 12103, 12105, 12107, 12109, 12157, 12159, 12161, 12163, 12169, 12249, 12277, 12279, 12305, 12307, 12309, 14197); 
CONF_PLZ_MATRIX[13]=new Array(12435, 12437, 12439, 12459, 12487, 12489, 12524, 12526, 12527, 12555, 12557, 12559, 12587, 12589, 12623); 
CONF_PLZ_MATRIX[14]=new Array(); 
CONF_PLZ_MATRIX[15]=new Array( 80331, 80333, 80335, 80469, 80538, 80539);
CONF_PLZ_MATRIX[16]=new Array( 81541, 81543, 81667, 81669, 81671, 81675, 81677);
CONF_PLZ_MATRIX[17]=new Array( 81243, 81245, 81249);
CONF_PLZ_MATRIX[18]=new Array( 81671, 81673, 81735, 81825);
CONF_PLZ_MATRIX[19]=new Array( 81675, 81677, 81679, 81925, 81927, 81929);
CONF_PLZ_MATRIX[20]=new Array( 80933, 80935, 80995);
CONF_PLZ_MATRIX[21]=new Array( 80689, 81375, 81377);
CONF_PLZ_MATRIX[22]=new Array( 80686, 80687, 80689);
CONF_PLZ_MATRIX[23]=new Array( 80335, 80336, 80337, 80469);
CONF_PLZ_MATRIX[24]=new Array( 80333, 80335, 80539, 80636, 80797, 80798, 80799, 80802);
CONF_PLZ_MATRIX[25]=new Array( 80807, 80809, 80937, 80939);
CONF_PLZ_MATRIX[26]=new Array( 80637, 80638, 80992, 80993, 80997);
CONF_PLZ_MATRIX[27]=new Array( 80634, 80636, 80637, 80638, 80639);
CONF_PLZ_MATRIX[28]=new Array( 81539, 81541, 81547, 81549);
CONF_PLZ_MATRIX[29]=new Array( 80687, 80689, 81241, 81243, 81245, 81247);
CONF_PLZ_MATRIX[30]=new Array( 81479);
CONF_PLZ_MATRIX[31]=new Array( 81539, 81549, 81669, 81671, 81735, 81737, 81739);
CONF_PLZ_MATRIX[32]=new Array( 80538, 80801, 80802, 80803, 80804, 80805, 80807, 80939);
CONF_PLZ_MATRIX[33]=new Array( 80796, 80797, 80798, 80799, 80801, 80803, 80804, 80809);
CONF_PLZ_MATRIX[34]=new Array(80335, 80339);
CONF_PLZ_MATRIX[35]=new Array(80336, 80337, 81369, 81371, 81373, 81379);
CONF_PLZ_MATRIX[36]=new Array(80686, 81369, 81373, 81377, 81379);
CONF_PLZ_MATRIX[37]=new Array(81379, 81475, 81476, 81477, 81479);
CONF_PLZ_MATRIX[38]=new Array(81735, 81825, 81827, 81829);
CONF_PLZ_MATRIX[39]=new Array(81543, 81545, 81547);
CONF_PLZ_MATRIX[40]=new Array( 80995, 80997, 80999, 81247, 81249);
CONF_PLZ_MATRIX[41]=new Array();
CONF_PLZ_MATRIX[42]=new Array();
CONF_PLZ_MATRIX[43]=new Array();
CONF_PLZ_MATRIX[44]=new Array();
CONF_PLZ_MATRIX[45]=new Array(21035,21037,22113);
CONF_PLZ_MATRIX[46]=new Array(20251,22297,22335,22337);
CONF_PLZ_MATRIX[47]=new Array(21029,21039);
CONF_PLZ_MATRIX[48]=new Array(21129);
CONF_PLZ_MATRIX[49]=new Array(20357,20359,22765,22767,22769);
CONF_PLZ_MATRIX[50]=new Array(20257,20357,22765,22769);
CONF_PLZ_MATRIX[51]=new Array(22525,22547,22549,22605,22607,22761,22769);
CONF_PLZ_MATRIX[52]=new Array(22297,22303,22305,22307,22309);
CONF_PLZ_MATRIX[53]=new Array(22081,22083,22085,22305);
CONF_PLZ_MATRIX[54]=new Array(21029,21031,21033,21035,21039);
CONF_PLZ_MATRIX[55]=new Array(22359,22395);
CONF_PLZ_MATRIX[56]=new Array(22111,22113);
CONF_PLZ_MATRIX[57]=new Array(22111,22113,22115,22117,22119);
CONF_PLZ_MATRIX[58]=new Array(21033,21035,22113);
CONF_PLZ_MATRIX[59]=new Array(22587,22589);
CONF_PLZ_MATRIX[60]=new Array(20535,20537);
CONF_PLZ_MATRIX[61]=new Array(22047,22159,22175,22177,22179,22309,22391,22393);
CONF_PLZ_MATRIX[62]=new Array(21129);
CONF_PLZ_MATRIX[63]=new Array(21029,21037,21039);
CONF_PLZ_MATRIX[64]=new Array(22049);
CONF_PLZ_MATRIX[65]=new Array(22397);
CONF_PLZ_MATRIX[66]=new Array(22457,22523,22525,22527,22547);
CONF_PLZ_MATRIX[67]=new Array(22087,22089);
CONF_PLZ_MATRIX[68]=new Array(20144,20253,20255,20257,20259,20357,22525,22527,22769);
CONF_PLZ_MATRIX[69]=new Array(21073,21075,21077);
CONF_PLZ_MATRIX[70]=new Array(20249,20251,22529);
CONF_PLZ_MATRIX[71]=new Array(22145,22159);
CONF_PLZ_MATRIX[72]=new Array(21129);
CONF_PLZ_MATRIX[73]=new Array(21129);
CONF_PLZ_MATRIX[74]=new Array(22335,22339,22415,22453);
CONF_PLZ_MATRIX[75]=new Array(22297,22335,22453,22529);
CONF_PLZ_MATRIX[76]=new Array(22605,22607,22609);
CONF_PLZ_MATRIX[77]=new Array(21079);
CONF_PLZ_MATRIX[78]=new Array(20095,20099,20457,20459);
CONF_PLZ_MATRIX[79]=new Array(20537);
CONF_PLZ_MATRIX[80]=new Array(20535,22087,22089);
CONF_PLZ_MATRIX[81]=new Array(20537);
CONF_PLZ_MATRIX[82]=new Array(20097,20537);
CONF_PLZ_MATRIX[83]=new Array(21073,21075,21079);
CONF_PLZ_MATRIX[84]=new Array(20144,20146,20148,20149,20249,20253);
CONF_PLZ_MATRIX[85]=new Array(21075,21079,21147,21149);
CONF_PLZ_MATRIX[86]=new Array(21073,21075,21079);
CONF_PLZ_MATRIX[87]=new Array(20144,20249,20251,20253);
CONF_PLZ_MATRIX[88]=new Array(20253,20255,22529);
CONF_PLZ_MATRIX[89]=new Array(22087,22089);
CONF_PLZ_MATRIX[90]=new Array(22111,22113,22119);
CONF_PLZ_MATRIX[91]=new Array(22339,22391,22399,22415,22417);
CONF_PLZ_MATRIX[92]=new Array(22589);
CONF_PLZ_MATRIX[93]=new Array(22043,22045);
CONF_PLZ_MATRIX[94]=new Array(21037);
CONF_PLZ_MATRIX[95]=new Array(20457,20539);
CONF_PLZ_MATRIX[96]=new Array(20095,20097,20457);
CONF_PLZ_MATRIX[97]=new Array(21077,21079);
CONF_PLZ_MATRIX[98]=new Array(22415,22417,22419);
CONF_PLZ_MATRIX[99]=new Array(22397,22399);
CONF_PLZ_MATRIX[100]=new Array(21031,21033,22113,22115);
CONF_PLZ_MATRIX[101]=new Array(20253,20255,22527,22529);
CONF_PLZ_MATRIX[102]=new Array(22525,22547,22549);
CONF_PLZ_MATRIX[103]=new Array(22041,22043,22089);
CONF_PLZ_MATRIX[104]=new Array(21077);
CONF_PLZ_MATRIX[105]=new Array(21079,21129);
CONF_PLZ_MATRIX[106]=new Array(22113);
CONF_PLZ_MATRIX[107]=new Array(21129);
CONF_PLZ_MATRIX[108]=new Array(21037,21039);
CONF_PLZ_MATRIX[109]=new Array(21147,21149);
CONF_PLZ_MATRIX[110]=new Array(21079);
CONF_PLZ_MATRIX[111]=new Array(20354,20355,20359,20457,20459);
CONF_PLZ_MATRIX[112]=new Array(22453,22455,22457,22459,22529);
CONF_PLZ_MATRIX[113]=new Array(22587,22607,22609);
CONF_PLZ_MATRIX[114]=new Array(21037);
CONF_PLZ_MATRIX[115]=new Array(22309,22335,22337,22391);
CONF_PLZ_MATRIX[116]=new Array(22547,22549,22587,22589,22609);
CONF_PLZ_MATRIX[117]=new Array(22605,22607,22609,22763);
CONF_PLZ_MATRIX[118]=new Array(22763,22765,22767);
CONF_PLZ_MATRIX[119]=new Array(22391,22393,22395,22399);
CONF_PLZ_MATRIX[120]=new Array(22143,22145,22147,22149,22359);
CONF_PLZ_MATRIX[121]=new Array(21037);
CONF_PLZ_MATRIX[122]=new Array(22559,22587);
CONF_PLZ_MATRIX[123]=new Array(20539);
CONF_PLZ_MATRIX[124]=new Array(20144,20146,20148,20149,20354,20357);
CONF_PLZ_MATRIX[125]=new Array(21077,21079);
CONF_PLZ_MATRIX[126]=new Array(20095,20097,20099);
CONF_PLZ_MATRIX[127]=new Array(20354,20355,20357,20359,20459,22767,22769);
CONF_PLZ_MATRIX[128]=new Array(22159,22391,22393,22395);
CONF_PLZ_MATRIX[129]=new Array(22455,22457,22459);
CONF_PLZ_MATRIX[130]=new Array(21077,21079);
CONF_PLZ_MATRIX[131]=new Array(21037);
CONF_PLZ_MATRIX[132]=new Array(22177,22309);
CONF_PLZ_MATRIX[133]=new Array(20457,21107);
CONF_PLZ_MATRIX[134]=new Array(20255,22525,22527,22529,22769);
CONF_PLZ_MATRIX[135]=new Array(22587,22589);
CONF_PLZ_MATRIX[136]=new Array(21037);
CONF_PLZ_MATRIX[137]=new Array(22041,22043,22045,22047,22149,22159);
CONF_PLZ_MATRIX[138]=new Array(22081,22085,22087);
CONF_PLZ_MATRIX[139]=new Array(20539,21109 );
CONF_PLZ_MATRIX[140]=new Array(22359);
CONF_PLZ_MATRIX[141]=new Array(21129);
CONF_PLZ_MATRIX[142]=new Array(22041,22047,22049,22089);
CONF_PLZ_MATRIX[143]=new Array(22391,22393);
CONF_PLZ_MATRIX[144]=new Array(20539,21107,21109);
CONF_PLZ_MATRIX[145]=new Array(21073,21077,21079);
CONF_PLZ_MATRIX[146]=new Array(20249,22297,22299,22301,22303,22305);
CONF_PLZ_MATRIX[147]=new Array(22395,22397);
CONF_PLZ_MATRIX[148]=new Array();
CONF_PLZ_MATRIX[149]=new Array(23552,23554,23556,23558,23560,23562,23564,23566,23568,23569,23570);
CONF_PLZ_MATRIX[150]=new Array(19001,19002,19003,19004,19005,19006,19007,19008,19009,19010,19011,19018,19022,19030,19031,19032,19033    *19043,19044,19045,19046,19047,19048,19049,19050,19053,19055,19057,19059,19061,19063,19091,19092,19100,19101);
CONF_PLZ_MATRIX[151]=new Array(18055, 18057, 18059, 18069, 18106, 18107, 18109, 18119, 18146, 18147);
CONF_PLZ_MATRIX[152]=new Array(50765, 50767, 50769);
CONF_PLZ_MATRIX[153]=new Array(50823, 50825, 50827, 50829);
CONF_PLZ_MATRIX[154]=new Array(50668, 50676, 50679, 50670, 50672, 50674, 50677);
CONF_PLZ_MATRIX[155]=new Array(51103, 51107, 51109);
CONF_PLZ_MATRIX[156]=new Array(50858, 50859, 50931, 50933, 50935, 50937, 50939);
CONF_PLZ_MATRIX[157]=new Array(51061, 51063, 51065, 51067, 51069);
CONF_PLZ_MATRIX[158]=new Array(50733, 50735, 50737, 50739);
CONF_PLZ_MATRIX[159]=new Array(51105, 51143, 51145, 51147, 51149);
CONF_PLZ_MATRIX[160]=new Array(50968, 50969, 50996, 50997, 50999);
CONF_PLZ_MATRIX[161]=new Array();
CONF_PLZ_MATRIX[162]=new Array();
CONF_PLZ_MATRIX[163]=new Array(82008);
CONF_PLZ_MATRIX[164]=new Array(82024);
CONF_PLZ_MATRIX[165]=new Array(30159, 30161, 30163, 30165, 30167, 30169, 30171, 30173, 30175, 30177, 30179, 30419, 30449, 30451, 30453, 30455, 30457, 30459, 30519, 30521, 30539, 30559, 30625, 30627, 30629, 30655, 30657, 30659, 30669);
CONF_PLZ_MATRIX[166]=new Array(
40210, 40211, 40212, 40213, 40215, 40217, 40219, 40221, 40223, 40225, 40227, 40229, 40231, 40233, 40235, 40237, 40239, 40468, 40470, 40472, 40474, 40476, 40477, 40479, 40489, 40545, 40547, 40549, 40589, 40591, 40593, 40595, 40597, 40599, 40625, 40627, 40629);
CONF_PLZ_MATRIX[167]=new Array(70771);
CONF_PLZ_MATRIX[168]=new Array(71034);
CONF_PLZ_MATRIX[169]=new Array(28195, 28203, 28205, 28207, 28209, 28211, 28213, 28215, 28217, 28219, 28237, 28239, 28307, 28309, 28325, 28327, 28329, 28355, 28357, 28359, 28717, 28719, 28755, 28757, 28759, 28777, 28779, 28197, 28199, 28201, 28259, 28277, 28279);
CONF_PLZ_MATRIX[170]=new Array(30159, 30161, 30163, 30165, 30167, 30169, 30171, 30173, 30175, 30177, 30179, 30419, 30449, 30451, 30453, 30455, 30457, 30459, 30519, 30521, 30539, 30559, 30625, 30627, 30629, 30655, 30657, 30659, 30669);
CONF_PLZ_MATRIX[171]=new Array(40210, 40211, 40212, 40213, 40215, 40217, 40219, 40221, 40223, 40225, 40227, 40229, 40231, 40233, 40235, 40237, 40239, 40468, 40470, 40472, 40474, 40476, 40477, 40479, 40489, 40545, 40547, 40549, 40589, 40591, 40593, 40595, 40597, 40599, 40625, 40627, 40629);
CONF_PLZ_MATRIX[172]=new Array(01067, 01069, 01097, 01099, 01109, 01127, 01129, 01139, 01157, 01159, 01169, 01187, 01189, 01217, 01219, 01237, 01239, 01257, 01259, 01277, 01279, 01307, 01309, 01324, 01326);
CONF_PLZ_MATRIX[173]=new Array(04103, 04105, 04107, 04109, 04129, 04155, 04157, 04159, 04177, 04179, 04205, 04207, 04209, 04229, 04249, 04275, 04277, 04279, 04289, 04299, 04299, 04315, 04317, 04318, 04319, 04329, 04347, 04349, 04357);
CONF_PLZ_MATRIX[174]=new Array(44135, 44137, 44139, 44141, 44143, 44145, 44147, 44149, 44225, 44227, 44229, 44263, 44265, 44267, 44269, 44287, 44289, 44309, 44319, 44328, 44329, 44339, 44357, 44359, 44369, 44379, 44388);
CONF_PLZ_MATRIX[175]=new Array(45127, 45128, 45130, 45131, 45133, 45134, 45136, 45138, 45139, 45141, 45143, 45144, 45145, 45147, 45149, 45219, 45239, 45257, 45259, 45276, 45277, 45279, 45289, 45307, 45309, 45326, 45327, 45329, 45355, 45356, 45357, 45359);
CONF_PLZ_MATRIX[176]=new Array(47051, 47053, 47055, 47057, 47058, 47059, 47119, 47137, 47138, 47139, 47166, 47167, 47169, 47178, 47179, 47198, 47199, 47226, 47228, 47229, 47239, 47249, 47259, 47269, 47279);
CONF_PLZ_MATRIX[177]=new Array(90402, 90403, 90408, 90409, 90411, 90419, 90425, 90427, 90429, 90431, 90439, 90441, 90443, 90449, 90451, 90453, 90455, 90459, 90461, 90469, 90471, 90473, 90475, 90478, 90480, 90482, 90489, 90491);
function select_district (district)
{
switch(district) {
case "0":	document.getElementById("sel_district").selectedIndex = 0; 
break;
default:	document.getElementById("sel_district").selectedIndex = 0;   
}
district_selected (district);
}
function district_selected(district)
{
var center= new VELatLong(CONF_LAT, CONF_LNG);
var plz_matrix_index=-1
var zoom=CONF_ZOOM;
select_uuid(null);
switch(district)
{
case "0": 
center= new VELatLong(CONF_LAT, CONF_LNG);
zoom=CONF_ZOOM;
plz_matrix_index=0;
break;
case "1": 
center= new VELatLong(49.023461463214126, 11.2225341796875);
zoom=7;
plz_matrix_index=42;
break;
case "2": 
center= new VELatLong(50.57626025689928, 9.404296875);
zoom=6;
plz_matrix_index=43;
break;
case "3": 
center= new VELatLong(51.12421275782688, 12.216796875);
zoom=4;
plz_matrix_index=44;
break;
case "999": 
center= new VELatLong(CONF_LAT, CONF_LNG);
zoom=CONF_ZOOM+1;
plz_matrix_index=1;
break;
case "1000": 
center= new VELatLong(51.05758110879136, 13.73565673828125);
zoom=10;
plz_matrix_index=172;
break;
case "4000": 
center= new VELatLong(51.34037111540686, 12.380733489990234);
zoom=10;
plz_matrix_index=173;
break;
case "10000": 
center= new VELatLong(52.516116401541495, 13.377399444580078);
zoom=13;
break;
case "13707": 
center= new VELatLong(52.61860493613562, 13.39057445526123);
zoom=11;
break;
case "10365": 
center= new VELatLong(52.517422163556766, 13.66649866104126);
zoom=11;
break;
case "10707": 
center= new VELatLong(52.4526095873022, 13.407869338989258);
zoom=11;
break;
case "10625": 
center= new VELatLong(52.532931647583325, 13.198356628417969);
zoom=11;
break;
case "10003": 
center= new VELatLong(52.51091908414787, 13.301739692687988);
zoom=12;
plz_matrix_index=2;
break;		
case "10007": 
center= new VELatLong(52.49809292272843, 13.395767211914062);
zoom=12;
plz_matrix_index=3;
break;
case "10010": 
center= new VELatLong(52.51287794429001, 13.496017456054688);
zoom=12;
plz_matrix_index=4;
break;
case "10011": 
center= new VELatLong(52.5341847000842, 13.580818176269531);
zoom=12;
plz_matrix_index=5;
break;
case "10005": 
center= new VELatLong(52.51731770402358, 13.39381456375122);
zoom=12;
plz_matrix_index=6;
break;
case "10009": 
center= new VELatLong(52.481865472249766, 13.433403968811035);
zoom=12;
plz_matrix_index=7;
break;
case "10008": 
center= new VELatLong(52.56925565435495, 13.402633666992188);
zoom=12;
plz_matrix_index=8;
break;
case "10004": 
center= new VELatLong(52.57526761188109, 13.34662914276123);
zoom=12;
plz_matrix_index=9;
break;
case "10002": 
center= new VELatLong(52.51851897366125, 13.276162147521973);
zoom=12;
plz_matrix_index=10;
break;
case "10001": 
center= new VELatLong(52.45402184600491, 13.318819999694824);
zoom=12;
plz_matrix_index=11;
break;
case "10006": //Tempelhof-Sch&ouml;neberg
center= new VELatLong(52.482780222078205, 13.371047973632812);
zoom=12;
plz_matrix_index=12;
break;
case "10012": //Treptow-K&ouml;penick
center= new VELatLong(52.452661893987695, 13.515758514404297);
zoom=12;
plz_matrix_index=13;
break;
case "14467": 
center= new VELatLong(52.38995393214217, 13.090081214904785);
zoom=12;
plz_matrix_index=14;
break;
case "20000": 
center= new VELatLong(53.55438256859328, 9.991401672014035);
zoom=9;
plz_matrix_index=148;
break;
case "20001": 
center= new VELatLong(53.61022911107819, 10.012344360002317);
zoom=11;
plz_matrix_index=46;
break;
case "20002": 
center= new VELatLong(53.546427608871134, 9.947479247348383);
zoom=12;
plz_matrix_index=49;
break;
case "20003": 
center= new VELatLong(53.57314219069711, 9.892181396135129);
zoom=12;
plz_matrix_index=51;
break;
case "20004": 
center= new VELatLong(53.598821217841525, 10.04221343959216);
zoom=11;
plz_matrix_index=52;
break;
case "20005": 
center= new VELatLong(53.579053825265056, 10.039970397774596);
zoom=11;
plz_matrix_index=53;
break;
case "20006": 
center= new VELatLong(53.486819875697485, 10.19398498465307);
zoom=12;
plz_matrix_index=54;
break;
case "20007": 
center= new VELatLong(53.57416149700881, 9.958786010392942);
zoom=12;
plz_matrix_index=68;
break;
case "20008": 
center= new VELatLong(53.6132842735673, 9.980758666642942);
zoom=12;
plz_matrix_index=75;
break;
case "20009": 
center= new VELatLong(53.55040527565132, 9.993278503243346);
zoom=13;
plz_matrix_index=78;
break;
case "20010": 
center= new VELatLong(53.55086421314643, 10.059019088657806);
zoom=12;
plz_matrix_index=79;
break;
case "20011": 
center= new VELatLong(53.56141840190047, 10.051815032784361);
zoom=12;
plz_matrix_index=80;
break;
case "20012": 
center= new VELatLong(53.54499963729939, 10.029750823887298);
zoom=12;
plz_matrix_index=82;
break;
case "20013": 
center= new VELatLong(53.5835379621847, 9.980403899971861);
zoom=12;
plz_matrix_index=87;
break;
case "20014": 
center= new VELatLong(53.54397962810946, 10.005821227678098);
zoom=12;
plz_matrix_index=96;
break;
case "20015": 
center= new VELatLong(53.55015030822565, 9.980392456054688);
zoom=12;
plz_matrix_index=111;
break;
case "20016": 
center= new VELatLong(53.5523429778852, 9.889778136857785);
zoom=12;
plz_matrix_index=117;
break;
case "20017": 
center= new VELatLong(53.55377070170346, 9.916557311662473);
zoom=12;
plz_matrix_index=118;
break;
case "20018": 
center= new VELatLong(53.60432183675507, 10.159629821428098);
zoom=12;
plz_matrix_index=120;
break;
case "20019": 
center= new VELatLong(53.534033250313314, 10.040737152012298);
zoom=12;
plz_matrix_index=123;
break;
case "20020": 
center= new VELatLong(53.55295486542028, 10.018524169572629);
zoom=12;
plz_matrix_index=126;
break;
case "20021": 
center= new VELatLong(53.5859836545598, 10.084098815568723);
zoom=12;
plz_matrix_index=142;
break;
case "20022": 
center= new VELatLong(53.61817207375609, 9.988998412736692);
zoom=10;
plz_matrix_index=148;
break;
case "20023": 
center= new VELatLong(53.55560627582936, 9.992431640275754);
zoom=10;
plz_matrix_index=148;
break;
case "20024": 
center= new VELatLong(53.46025520362287, 9.98524475027807);
zoom=10;
plz_matrix_index=83;
break;
case "20025": 
center= new VELatLong(53.549691362988334, 9.926170348771848);
zoom=10;
plz_matrix_index=148;
break;
case "20026": 
center= new VELatLong(53.51862450424817, 10.098114965949208);
zoom=13;
plz_matrix_index=57;
break;
case "20027": 
center= new VELatLong(53.8735827879826, 10.6842041015625);
zoom=9;
plz_matrix_index=149;
break;
case "20028": 
center= new VELatLong(53.63161060657857, 11.392822265625);
zoom=9;
plz_matrix_index=150;
break;
case "20029": 
center= new VELatLong(54.094838867777945, 12.122039794921875);
zoom=13;
plz_matrix_index=151;
break;
case "28100": 
center= new VELatLong(53.07876502482505, 8.799362182617188);
zoom=10;
plz_matrix_index=169;
break;
case "30000": 
center= new VELatLong(52.374917995645625, 9.735774993896484);
zoom=10;
plz_matrix_index=170;
break;
case "40000": 
center= new VELatLong(51.22795790079472, 6.78680419921875);
zoom=12;
plz_matrix_index=171;
break;
case "40001": 
center= new VELatLong(51.22795790079472, 6.78680419921875);
zoom=14;
plz_matrix_index=171;
break;
case "40002": 
center= new VELatLong(51.228889, 6.773611);
zoom=14;
plz_matrix_index=171;
break;
case "40010": 
center= new VELatLong(51.33264950245701, 6.7874908447265625);
zoom=14;
plz_matrix_index=171;
break;
case "40011": 
center= new VELatLong(51.161389, 6.873889);
zoom=14;
plz_matrix_index=171;
break;
case "40012": 
center= new VELatLong(51.208056, 6.776667);
zoom=14;
plz_matrix_index=171;
break;
case "40013": 
center= new VELatLong(51.222878, 6.771054);
zoom=14;
plz_matrix_index=171;
break;
case "40020": 
center= new VELatLong(51.24386491112567, 6.786975860595703);
zoom=14;
plz_matrix_index=171;
break;
case "40021": //D&uuml;sseltal
center= new VELatLong(51.236667, 6.809444);
zoom=14;
plz_matrix_index=171;
break;
case "40022": 
center= new VELatLong(51.200556, 6.838889);
zoom=14;
plz_matrix_index=171;
break;
case "40023": 
center= new VELatLong(51.187778, 6.772222);
zoom=14;
plz_matrix_index=171;
break;
case "40024": 
center= new VELatLong(51.228333, 6.814722);
zoom=14;
plz_matrix_index=171;
break;
case "40025": //Flingern S&uuml;d
center= new VELatLong(51.220833, 6.808889);
zoom=14;
plz_matrix_index=171;
break;
case "40030": 
center= new VELatLong(51.21188408675236, 6.788907051086426);
zoom=15;
plz_matrix_index=171;
break;
case "40031": 
center= new VELatLong(51.146389, 6.894444);
zoom=14;
plz_matrix_index=171;
break;
case "40032": 
center= new VELatLong(51.239444, 6.866111);
zoom=15;
plz_matrix_index=171;
break;
case "40033": 
center= new VELatLong(51.243354, 6.772385);
zoom=14;
plz_matrix_index=171;
break;
case "40034": 
center= new VELatLong(51.240833, 6.824722);
zoom=15;
plz_matrix_index=171;
break;
case "40035": 
center= new VELatLong(51.219167, 6.757778);
zoom=14;
plz_matrix_index=171;
break;
case "40036": 
center= new VELatLong(51.205, 6.744444);
zoom=14;
plz_matrix_index=171;
break;
case "40037": 
center= new VELatLong(51.179167, 6.873611);
zoom=14;
plz_matrix_index=171;
break;
case "40038": 
center= new VELatLong(51.228388, 6.715908);
zoom=14;
plz_matrix_index=171;
break;
case "40039": 
center= new VELatLong(51.132222, 6.906389);
zoom=14;
plz_matrix_index=171;
break;
case "40040": 
center= new VELatLong(51.172778, 6.809722);
zoom=14;
plz_matrix_index=171;
break;
case "40041": 
center= new VELatLong(51.17181, 6.831608);
zoom=15;
plz_matrix_index=171;
break;
case "40042": 
center= new VELatLong(51.256667, 6.910556);
zoom=14;
plz_matrix_index=171;
break;
case "40043": 
center= new VELatLong(51.165, 6.815);
zoom=14;
plz_matrix_index=171;
break;
case "40044": 
center= new VELatLong(51.3, 6.739167);
zoom=14;
plz_matrix_index=171;
break;
case "40045": 
center= new VELatLong(51.306389, 6.7625);
zoom=14;
plz_matrix_index=171;
break;
case "40046": 
center= new VELatLong(51.28207835410399, 6.798563003540039);
zoom=14;
plz_matrix_index=171;
break;
case "40047": 
center= new VELatLong(51.209167, 6.8275);
zoom=14;
plz_matrix_index=171;
break;
case "40050": 
center= new VELatLong(51.279957709836474, 6.740627288818359);
zoom=14;
plz_matrix_index=171;
break;
case "40051": //L&ouml;rick
center= new VELatLong(51.246389, 6.727778);
zoom=14;
plz_matrix_index=171;
break;
case "40052": 
center= new VELatLong(51.25622129123259, 6.866798400878906);
zoom=13;
plz_matrix_index=171;
break;
case "40053": //M&ouml;rsenbroich
center= new VELatLong(51.255147, 6.807919);
zoom=13;
plz_matrix_index=171;
break;
case "40054": 
center= new VELatLong(51.240104, 6.749983);
zoom=13;
plz_matrix_index=171;
break;
case "40055": 
center= new VELatLong(51.2161, 6.803631);
zoom=15;
plz_matrix_index=171;
break;
case "40060": 
center= new VELatLong(51.231075248234326, 6.747150421142578);
zoom=14;
plz_matrix_index=171;
break;
case "40061": 
center= new VELatLong(51.238035, 6.786847);
zoom=15;
plz_matrix_index=171;
break;
case "40070": 
center= new VELatLong(51.2625593628227, 6.820793151855469);
zoom=14;
plz_matrix_index=171;
break;
case "40071": 
center= new VELatLong(51.176491, 6.865854);
zoom=14;
plz_matrix_index=171;
break;
case "40072": 
center= new VELatLong(51.259928, 6.753416);
zoom=14;
plz_matrix_index=171;
break;
case "40073": 
center= new VELatLong(51.206111, 6.9);
zoom=14;
plz_matrix_index=171;
break;
case "40074": 
center= new VELatLong(51.208056, 6.776667);
zoom=15;
plz_matrix_index=171;
break;
case "40075": 
center= new VELatLong(51.273515, 6.790581);
zoom=14;
plz_matrix_index=171;
break;
case "40076": 
center= new VELatLong(51.145702, 6.867056);
zoom=14;
plz_matrix_index=171;
break;
case "40077": 
center= new VELatLong(51.21097, 6.859932);
zoom=14;
plz_matrix_index=171;
break;
case "40078": 
center= new VELatLong(51.188274, 6.763802);
zoom=14;
plz_matrix_index=171;
break;
case "40079": 
center= new VELatLong(51.181657, 6.816416);
zoom=14;
plz_matrix_index=171;
break;
case "40080": 
center= new VELatLong(51.318611, 6.743333);
zoom=14;
plz_matrix_index=171;
break;
case "40721": 
center= new VELatLong(51.168096164, 6.9338321685);
zoom=13;
plz_matrix_index=171;
break;
case "40878": 
center= new VELatLong(51.2972421332, 6.8494606018);
zoom=13;
plz_matrix_index=171;
break;
case "41001": //M&ouml;nchengladbach
center= new VELatLong(51.1938682967, 6.4415931701);
zoom=12;
plz_matrix_index=171;
break;
case "41460": 
center= new VELatLong(51.19784851, 6.6881847381);
zoom=13;
plz_matrix_index=171;
break;
case "47701": 
center= new VELatLong(51.331469697, 6.56055450439);
zoom=13;
plz_matrix_index=171;
break;
case "44000": 
center= new VELatLong(51.514458105500346, 7.466926574707031);
zoom=12;
plz_matrix_index=174;
break;		
case "45000": 
center= new VELatLong(51.45705543978292, 7.013096809387207);
zoom=12;
plz_matrix_index=175;
break;			
case "47000": 
center= new VELatLong(51.435310157824276, 6.762428283691406);
zoom=12;
plz_matrix_index=176;
break;	
case "50000": 
center= new VELatLong(50.94133955223965, 6.958465576171875);
zoom=12;
plz_matrix_index=161;
break;
case "50001": 
center= new VELatLong(51.0217728136133, 6.896495819091797);
zoom=13;
plz_matrix_index=152;
break;
case "50002": 
center= new VELatLong(50.94701794835952, 6.917695999145508);
zoom=14;
plz_matrix_index=153;
break;
case "50003": //K&ouml;ln-Innenstadt
center= new VELatLong(50.94133955223965, 6.958465576171875);
zoom=14;
plz_matrix_index=154;
break;
case "50004": 
center= new VELatLong(50.94509818727787, 7.043395042419434);
zoom=14;
plz_matrix_index=155;
break;
case "50005": 
center= new VELatLong(50.926356073979704, 6.909370422363281);
zoom=13;
plz_matrix_index=156;
break;
case "50006": //M&uuml;lheim
center= new VELatLong(50.981425000671194, 7.032537460327148);
zoom=14;
plz_matrix_index=157;
break;
case "50007": 
center= new VELatLong(50.96280565137738, 6.953830718994141);
zoom=14;
plz_matrix_index=158;
break;
case "50008": 
center= new VELatLong(50.88911990494846, 7.057342529296875);
zoom=13;
plz_matrix_index=159;
break;
case "50009": 
center= new VELatLong(50.89128561405367, 6.990180015563965);
zoom=13;
plz_matrix_index=160;
break;
case "60000": 
center= new VELatLong(50.11320318690767, 8.685550689697266);
zoom=12;
plz_matrix_index=162;
break;
case "60001": 
center= new VELatLong(50.11309310500418, 8.686065673828125);
zoom=15;
plz_matrix_index=162;
break;
case "60002": 
center= new VELatLong(50.10703821058209, 8.667097091674805);
zoom=15;
plz_matrix_index=162;
break;
case "60003": 
case "60004": 
case "60005": 
case "60006": 
case "60045": 
case "60007": 
case "60008": 
case "60009": 
case "60010": 
case "60011": 
case "60012": 
case "60013": 
case "60014": 
case "60015": 
case "60016": 
case "60017": 
case "60018": 
case "60019": 
case "60020": 
case "60021": 
case "60022": 
case "60023": 
case "60024": 
case "60025": 
case "60026": 
center= new VELatLong(50.08628062777049, 8.63748550415039);
zoom=14;
plz_matrix_index=162;
break;
case "60027": 
case "60028": 
case "60029": 
case "60030": 
case "60031": 
case "60032": 
case "60033": 
case "60034": 
case "60035": 
case "60036": 
case "60037": 
case "60038": 
case "60039": 
case "60040": 
case "60041": 
case "60042": 
case "60043": 
case "60044": 
center= new VELatLong(50.09531155673426, 8.49543571472168);
zoom=14;
plz_matrix_index=162;
break;
case "69999": 
center= new VELatLong(CONF_LAT, CONF_LNG);
zoom=10;
break;
case "70000": 
center= new VELatLong(CONF_LAT, CONF_LNG);
zoom=11;
break;
case "70007": 
center= new VELatLong(48.80416667,9.219722222);
zoom=15;
break;
case "70019": 
center= new VELatLong(48.71888889,9.205833333);
zoom=14;
break;
case "70011": 
center= new VELatLong(48.7775,9.124722222);
zoom=15;
break;
case "70010": 
center= new VELatLong(48.74583333,9.172222222);
zoom=14;
break;
case "70006": 
center= new VELatLong(48.80888889,9.155277778);
zoom=14;
break;
case "70018": 
center= new VELatLong(48.75694444,9.253611111);
zoom=14;
break;
case "70021": 
center= new VELatLong(48.72583333,9.145);
zoom=15;
break;
case "70024": 
center= new VELatLong(48.84472222,9.230277778);
zoom=14;
break;
case "70001": 
center= new VELatLong(48.7775,9.1825);
zoom=16;
break;
case "70015": 
center= new VELatLong(48.82222222,9.22);
zoom=14;
break;
case "70002": 
center= new VELatLong(48.79777778,9.172222222);
zoom=14;
break;
case "70017": 
center= new VELatLong(48.76722222,9.268055556);
zoom=14;
break;
case "70003": 
center= new VELatLong(48.78416667,9.206388889);
zoom=15;
break;
case "70020": 
center= new VELatLong(48.70083333,9.216111111);
zoom=14;
break;
case "70009": 
center= new VELatLong(48.74583333,9.213055556);
zoom=14;
break;
case "70023": 
center= new VELatLong(48.84722222,9.155555556);
zoom=13;
break;
case "70004": 
center= new VELatLong(48.75944444,9.172222222);
zoom=14;
break;
case "70016": 
center= new VELatLong(48.78194444,9.253888889);
zoom=14;
break;
case "70022": 
center= new VELatLong(48.73027778,9.1075);
zoom=15;
break;
case "70008": 
center= new VELatLong(48.77277778,9.240277778);
zoom=14;
break;
case "70012": 
center= new VELatLong(48.81361111,9.111111111);
zoom=14;
break;
case "70005": 
center= new VELatLong(48.77305556,9.151666667);
zoom=15;
break;
case "70013": 
center= new VELatLong(48.83138889,9.175833333);
zoom=14;
break;
case "70025": 
center= new VELatLong(48.705462895790546, 9.415283203125);
zoom=12;
break;
case "70026": 
center= new VELatLong(48.80007963827959, 9.499740600585938);
zoom=12;
break;	
case "70027": 
center= new VELatLong(48.942572762070746, 9.427299499511719);
zoom=12;
break;
case "70028": 
center= new VELatLong(48.894066800857466, 8.74237060546875);
zoom=12;
break;	
case "70029": 
center= new VELatLong(48.79759200667088, 9.011192321777344);
zoom=12;
break;
case "70030": 
center= new VELatLong(48.9601586301608, 9.132041931152344);
zoom=12;
break;	
case "70031": 
center= new VELatLong(48.899935141803255, 9.194183349609375);
zoom=12;
break;	
case "70032": 
center= new VELatLong(48.65604661485724, 9.216156005859375);
zoom=12;
break;
case "70771": 
center= new VELatLong(48.69232017824781, 9.167790412902832);
zoom=13;
plz_matrix_index=167;
break;
case "71034": 
center= new VELatLong(48.68285756351579, 8.998403549194336);
zoom=14;
plz_matrix_index=168;
break;
case "80000": 
center= new VELatLong(CONF_LAT, CONF_LNG);
zoom=CONF_ZOOM+1;
plz_matrix_index=41;
break;
case "80001": 
center= new VELatLong(48.14404066356506, 11.583881378173828);
zoom=13;
plz_matrix_index=15;
break;
case "80002": 
center= new VELatLong(48.13143940785125, 11.555643081665039);
zoom=13;
plz_matrix_index=23;
break;
case "80003": 
center= new VELatLong(48.1484217391235, 11.565384864807129);
zoom=13;
plz_matrix_index=24;
break;
case "80004": 
center= new VELatLong(48.16468285312064, 11.568002700805664);
zoom=13;
plz_matrix_index=33;
break;
case "80005": 
center= new VELatLong(48.12860369906855, 11.596026420593262);
zoom=13;
plz_matrix_index=16;
break;
case "80006": 
center= new VELatLong(48.11932210279354, 11.54839038848877);
zoom=13;
plz_matrix_index=35;
break;
case "80007": 
center= new VELatLong(48.12361934660122, 11.519851684570312);
zoom=13;
plz_matrix_index=36;
break;
case "80008": 
center= new VELatLong(48.13556379565277, 11.54015064239502);
zoom=13;
plz_matrix_index=34;
break;
case "80009": 
center= new VELatLong(48.15600899174947, 11.522555351257324);
zoom=13;
plz_matrix_index=37;
break;
case "80010": 
center= new VELatLong(48.181825874278246, 11.521267890930176);
zoom=13;
plz_matrix_index=26;
break;
case "80011": 
center= new VELatLong(48.195930939321656, 11.57160758972168);
zoom=13;
plz_matrix_index=25;
break;
case "80012": 
center= new VELatLong(48.18731958630774, 11.611647605895996);
zoom=13;
plz_matrix_index=32;
break;
case "80013": 
center= new VELatLong(48.15343231477297, 11.629500389099121);
zoom=13;
plz_matrix_index=19;
break;
case "80014": 
center= new VELatLong(48.12740062379426, 11.634435653686523);
zoom=13;
plz_matrix_index=18;
break;
case "80015": 
center= new VELatLong(48.121642659096814, 11.670999526977539);
zoom=13;
plz_matrix_index=38;
break;
case "80016": 
center= new VELatLong(48.11316209310676, 11.615123748779297);
zoom=13;
plz_matrix_index=31;
break;
case "80017": 
center= new VELatLong(48.100610579187254, 11.588988304138184);
zoom=13;
plz_matrix_index=28;
break;
case "80018": 
center= new VELatLong(48.090521296190715, 11.557016372680664);
zoom=13;
plz_matrix_index=39;
break;
case "80019": 
center= new VELatLong(48.08862933522144, 11.508479118347168);
zoom=13;
plz_matrix_index=37;
break;
case "80020": 
center= new VELatLong(48.11333401037152, 11.4896821975708);
zoom=13;
plz_matrix_index=21;
break;
case "80021": 
center= new VELatLong(48.14687551986356, 11.45573616027832);
zoom=13;
plz_matrix_index=29;
break;
case "80022": 
center= new VELatLong(48.16147684420182, 11.413979530334473);
zoom=13;
plz_matrix_index=17;
break;
case "80023": 
center= new VELatLong(48.18920791382544, 11.465563774108887);
zoom=13;
plz_matrix_index=40;
break;
case "80024": 
center= new VELatLong(48.21100447463161, 11.514058113098145);
zoom=13;
plz_matrix_index=20;
break;
case "80025": 
center= new VELatLong(48.135420593294654, 11.50294303894043);
zoom=13;
plz_matrix_index=22;
break;
case "80026": 
center= new VELatLong(48.061905121598315, 11.521224975585938);
zoom=13;
plz_matrix_index=30;
break;
case "80027": 
center= new VELatLong(48.060528391401874, 11.618986129760742);
zoom=13;
plz_matrix_index=163;
break;
case "80028": 
center= new VELatLong(48.0457835973869, 11.61503791809082);
zoom=13;
plz_matrix_index=164;
break;
case "90000": 
center= new VELatLong(49.452057117544314, 11.075849533081055);
zoom=10;
plz_matrix_index=177;
break;
default:  alert ("unbekannt");
center= new VELatLong(52.51731770402358, 13.39381456375122);
zoom=6;
}
if (CONF_SHOW_DISTRICT_PINS_ONLY) { curr_sel.plz_range = plz_matrix_index; }
map.SetMapStyle(VEMapStyle.Road);
map.SetCenterAndZoom(center, zoom);
}
function birdview_available (plz)
{
if ((plz >= 10115) && (plz <= 14199)) return true; 
if ((plz >= 20095) && (plz <= 22769)) return true; 
if ((plz >= 30159) && (plz <= 30669)) return true; 
if ((plz >= 40210) && (plz <= 41460)) return true; 
if ((plz >= 50169) && (plz <= 53842)) return true; 
if ((plz >= 60311) && (plz <= 65936)) return true; 
if ((plz >= 70173) && (plz <= 73734)) {if (plz==73630 || plz==73240 || plz==70794 || plz==71083 || plz==74321 || plz==73635 || plz==73547) return false; else return true;} 
if ((plz >= 80000) && (plz <= 82010)) return true; 
return false;
}
function reset_filter ()
{
var back_up = CONF_FILTER_CORRELATION;
CONF_FILTER_CORRELATION = true;
a_f_locked = true;
hide_cluster_popup();
select_district("0");
a_f_locked = false;
select_purpose ("Alle");
CONF_FILTER_CORRELATION = back_up;
}
function select_uuid (uuid)
{
var i=-1;
if (uuid==null) {
if (!uuid_locked) {
if (document.filter_form) { 
document.filter_form.sel_uuid.value = "";
}
curr_sel.uuid=null;
}
} else if ((i=uuid_exists(uuid))!=-1) {
if (document.filter_form) { 
document.filter_form.sel_uuid.value = uuid;
}
uuid_selected(uuid);
}
}
function uuid_selected(uuid)
{
var i=-1;
var a_f_higher_level_locked=false;
uuid_locked = true;
if (a_f_locked == true) a_f_higher_level_locked=true; 
else a_f_locked = true; 
if (uuid==null || uuid=="") { select_district("0"); uuid = null; i = 1;} 
else if ((i=uuid_exists(uuid))!=-1) {
curr_sel.plz_range = -1;
document.getElementById("sel_district").selectedIndex = 0; 
set_birdview(d_c(a[i].lat), d_c(a[i].long));
} 
if (i!=-1) {
curr_sel.uuid=uuid;
select_purpose ("Alle");
if (a_f_higher_level_locked == false) {
a_f_locked = false; 
apply_filter();
}
}
uuid_locked = false;
return false;
}

var MAXINT = 2147483647;
var MAXLIST = 4;
var NO_INDEX = -1;
var Lizenznummer=null;
var Lizenzkey=null;
var win_resize_blocked=false;
var map_initialized = false;
var map = null;
var num_n=0;
var num_k=0;
var a = new Array();
var curr_sel = new filter_obj();
var entry_center = null;
var last_zoom=CONF_ZOOM;
var last_style=CONF_FIRST_MAP_STYLE;
var last_center = null;
var last_clicked_object = NO_INDEX; 
var global_list_mode="map";
var global_list_start_index=0;
var global_list_grid_index = NO_INDEX;
var global_list_cluster_start_index=0;
var global_seldat = new Array(); 
var global_grid = new Array();
var global_last_selected_object=NO_INDEX; 
var	global_map_height=0;
var	global_map_width=0;
var global_map_size_changed=true;
var global_map_zoom=CONF_ZOOM;
var global_map_style=CONF_FIRST_MAP_STYLE;
var	global_new_map_style=null;
var global_grid_width_x=0;
var global_grid_width_y=0;
var global_change_grid_width=true;
var PIC_HGT=115;
var global_picture_padding=4;
var restore_size=CONF_MAP_SIZE; 
var poi_arr=new Array(); 
var selecting =false;
var selectBox=null;
var EndLatLon=null;
var StartLatLon=null;
function grid_obj()
{
this.num=0;
this.id=new Array(); 
this.lat=0;
this.long=0;
this.pin=null;
}
function filter_obj()
{
this.lat_min=0;
this.lat_max=0;
this.long_min=0;
this.long_max=0;
this.purpose=CONF_FIRST_PURPOSE;
this.marketingtype=CONF_FIRST_MARKETINGTYPE;
this.immotype=CONF_FIRST_IMMOTYPE;
this.price=9999999999;
this.ppqm=0;
this.ppqm_max=9999999999;
this.qm=0; 
this.qm_max=9999999999; 
this.rooms=0;
this.group_num=0;
this.objsource=CONF_FIRST_OBJSOURCE;
this.uuid=CONF_FIRST_OBJ_ID;
this.months_till_movein=-1;
this.plz_range=-1; 
}
function loc_data_obj()
{
this.objsource=null;
this.link=null;
this.mode="shrink";
this.grid_index=0;
this.status=null;
this.stadt=null;
this.plz=null;
this.strasse=null;
this.purpose=null;
this.marketingtype=null;
this.immotype=null;
this.price=0;
this.qm=1;
this.price_per_qm=0.0;
this.rooms=0;
this.lat=0;
this.long=0;
this.expose_link=null;
this.foto=null;
this.uuid=null;
this.anbieter_obj_id=null;
this.group_num=0;
this.miet_beginn=0;
this.category=0;
this.priceTG=0;
this.stadtteil=null;
this.pin=null;
this.marked="no"; 
this.sel_index=NO_INDEX; 
}
function store_obj_data(obj_data)
{
var i=0,k=0;
for (i=0;i<num_n;i++) {
k=num_k * i;
a[i]=new loc_data_obj();
a[i].objsource=obj_data[k];k++;
if (a[i].objsource == "a") {
a[i].objsource="is-active";
}
else if  (a[i].objsource == "i") {
a[i].objsource="is-inactive";
}
else if  (a[i].objsource == "p") {
a[i].objsource="permanent";
}
else if  (a[i].objsource == "pp") {
a[i].objsource="permanent-p";
}
a[i].expose_link=obj_data[k];k++;
a[i].sel_ind=obj_data[k];k++;
a[i].heading=obj_data[k];k++;
a[i].purpose=obj_data[k];k++;
a[i].marketingtype=obj_data[k];k++;
a[i].immotype=obj_data[k];k++;
a[i].courtage=obj_data[k];k++;
a[i].kaution=obj_data[k];k++;
a[i].miet_beginn=obj_data[k];k++;
a[i].stadt=obj_data[k];k++;
a[i].stadtteil=obj_data[k];k++;
a[i].plz=obj_data[k];k++;
a[i].strasse=obj_data[k];k++;
a[i].nummer=obj_data[k];k++;
a[i].qm=obj_data[k];k++;
a[i].qmtotal=obj_data[k];k++;
a[i].rooms=obj_data[k];k++;
a[i].price=obj_data[k];k++;
a[i].price_per_qm=obj_data[k];k++;
a[i].currency=obj_data[k];k++;
a[i].link=obj_data[k];k++;
a[i].foto=obj_data[k];k++;
a[i].lat=obj_data[k];k++;
a[i].long=obj_data[k];k++;
a[i].uuid=obj_data[k];k++;
a[i].group_num=obj_data[k];k++;
a[i].category=obj_data[k];k++;
a[i].priceTG=obj_data[k];k++;
a[i].anbieter_obj_id=obj_data[k];k++;
}
}
var request = false;
function set_statistik(exp_num) {	
if (window.XMLHttpRequest) {
request = new XMLHttpRequest(); 
} else if (window.ActiveXObject) {
try {
request = new ActiveXObject('Msxml2.XMLHTTP'); 
} catch (e) {
try {
request = new ActiveXObject('Microsoft.XMLHTTP'); 
} catch (e) {}
}
}
if (!request) {
alert("Kann keine XMLHTTP-Instanz erzeugen");
return false;
} else {
var url = "php/navi_set_statistik.php5";
request.open('post', url, true);
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
if (exp_num == 1) {
request.send('exp_num=' + exp_num + '&liz_num=' + Lizenznummer);
}
else {
request.send('exp_num=' + exp_num);
}
request.onreadystatechange = interpretRequest;
}
}
function interpretRequest() {
switch (request.readyState) {
case 4:
if (request.status != 200) {
} else {
var content = request.responseText;
var pos1=content.indexOf("Lizenzkey=");
if  (pos1 >= 0) {
pos1=pos1 + 10;
var pos2=pos1 + 6;
Lizenzkey=content.slice(pos1,pos2);
license_key_received();
}
else {
var pos1=content.indexOf("success");
if  (pos1 < 0) {
alert("error");
}
}
}
break;
default:
break;
}
}
function license_key_received() {
map_init_step_2();
customer_init();
}
function pre_load_object_images()
{
var i=0;
for (i=0;i<a.length;i++)
{
var pic = new Image();
pic.src = a[i].foto;
}
if (CONF_START_SCREEN) { pic.src = "./pic/pleasewait.png"; }
}
function new_grid_width (x) {
var n,k=0;
if (x == 0) {
return x;
}
if ((x >= 10) && (x < 100)) {
x=Math.floor(x) + 1;
}
else if  (x < 10) {
k=0;
while (x < 10) {
x=x*10;
k++;
}
x=Math.floor(x) + 1;
for (n=0;n<k;n++) {
x=x/10;
}		
}
else {
k=0;
while (x >= 100) {
x=x/10;
k++;
}
x=Math.floor(x) + 1;
for (n=0;n<k;n++) {
x=x*10;
}		
}
return x;
}
function d_c(c)
{
return (c / parseInt(Lizenzkey.slice(2,3))) - parseInt(Lizenzkey.slice(0,2));
}
function d_a(addr)
{
addr = base64_decode(addr);
var klartext = "";
for (var i=0; i<addr.length;i++) {
klartext += String.fromCharCode((addr.substr(i,1)+'').charCodeAt(0)   ^   (Lizenzkey.substr(i % Lizenzkey.length,1)+'').charCodeAt(0));
}
klartext = utf8_decode(klartext);
return klartext;
}
function utf8_decode ( str_data )
{
var tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0;
str_data += '';
while ( i < str_data.length ) {
c1 = str_data.charCodeAt(i);
if (c1 < 128) {
tmp_arr[ac++] = String.fromCharCode(c1);
i++;
} else if ((c1 > 191) && (c1 < 224)) {
c2 = str_data.charCodeAt(i+1);
tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
i += 2;
} else {
c2 = str_data.charCodeAt(i+1);
c3 = str_data.charCodeAt(i+2);
tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return tmp_arr.join('');
}
function base64_decode(data)
{
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = "", tmp_arr = [];
if (!data) {
return data;
}
data += '';
do {  
h1 = b64.indexOf(data.charAt(i++));
h2 = b64.indexOf(data.charAt(i++));
h3 = b64.indexOf(data.charAt(i++));
h4 = b64.indexOf(data.charAt(i++));
bits = h1<<18 | h2<<12 | h3<<6 | h4;
o1 = bits>>16 & 0xff;
o2 = bits>>8 & 0xff;
o3 = bits & 0xff;
if (h3 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1);
} else if (h4 == 64) {
tmp_arr[ac++] = String.fromCharCode(o1, o2);
} else {
tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
}
} while (i < data.length);
dec = tmp_arr.join('');
return dec;
}
function disp_zoom_level()
{
var curr_zoom=map.GetZoomLevel();
var curr_style=map.GetMapStyle();
if (curr_style == VEMapStyle.BirdseyeHybrid)
{
document.getElementById('level_info').innerHTML = "Zoom-Level " + (curr_zoom + 17) + " (Birdseye)";
}
else
{
document.getElementById('level_info').innerHTML = "Zoom-Level " + curr_zoom;
}
}
function get_zoom_level()
{
var curr_zoom=map.GetZoomLevel();
var curr_style=map.GetMapStyle();
if (curr_style == VEMapStyle.BirdseyeHybrid)
{
return (curr_zoom + 17);
}
else
{
return curr_zoom;
}
}
function set_last_view()
{
hide_cluster_popup();
map.SetMapStyle(last_style);
map.SetCenterAndZoom(last_center, last_zoom);
}
function set_entry_view()
{
hide_cluster_popup();
map.SetMapStyle(CONF_FIRST_MAP_STYLE);
map.SetCenterAndZoom(entry_center, CONF_ZOOM);
}
function set_birdview(lat, lng)
{
var change_zoom=true;
var change_style=true;
var change_pos=true;
var new_zoom=CONF_ZOOM_LUFTBILD;
var new_style=VEMapStyle.Hybrid;
var curr_center=map.GetCenter();
if (global_map_style == VEMapStyle.BirdseyeHybrid) {
global_new_map_style=null;
map.SetCenter(new VELatLong(lat,lng));
return;
}
if (global_map_style != VEMapStyle.BirdseyeHybrid) {
last_center=curr_center;
last_zoom=global_map_zoom;
last_style=global_map_style;
}
if ((!map.IsBirdseyeAvailable()) || (BIRDSEYE_LICENSED == false)) {
new_style=VEMapStyle.Hybrid;
} else {
new_style=VEMapStyle.BirdseyeHybrid;
}
if (global_map_style == new_style) {
change_style=false;
}
if (global_map_zoom > (CONF_ZOOM_LUFTBILD - 1)) {
change_zoom=false;
new_zoom=global_map_zoom;
}
if ((Math.abs(lat - curr_center.Latitude) < 0.00001) && (Math.abs(lng - curr_center.Longitude) < 0.00001)) {
change_pos=false;
}
global_new_map_style=null;
if ((change_pos == true) || (change_zoom == true)) {
if (change_style == true) {
global_new_map_style=new_style; 
}
map.SetCenterAndZoom(new VELatLong(lat,lng), new_zoom);
}
else {
if (change_style == true) {
map.SetMapStyle(new_style);
}
}
}
function center_map_to_object(lat, lng)
{
if (map.GetMapStyle() != VEMapStyle.BirdseyeHybrid)
{
last_center=map.GetCenter();
last_zoom=map.GetZoomLevel();
last_style=map.GetMapStyle();
}
lat=lat + (Math.random() /1000000);
lng=lng + (Math.random() /1000000);
map.SetCenter(new VELatLong(lat,lng));
}
function set_clusterview(grid_id)
{
var lat_min=90, lat_max=-90, long_min=180, long_max=-180;
var i=0, v=0, vlong=0, vlat=0;
var lat_tmp=0, long_tmp=0;
hide_cluster_popup();
if (map.GetMapStyle() != VEMapStyle.BirdseyeHybrid)
{
last_center=map.GetCenter();
last_zoom=map.GetZoomLevel();
last_style=map.GetMapStyle();
}
for (i=0;i < global_grid[grid_id].num;i++) {
lat_tmp=d_c(a[global_grid[grid_id].id[i]].lat);
long_tmp=d_c(a[global_grid[grid_id].id[i]].long);
if (lat_tmp < lat_min) {
lat_min = lat_tmp;
}
if (lat_tmp > lat_max) {
lat_max = lat_tmp;
}
if (long_tmp < long_min) {
long_min = long_tmp;
}
if (long_tmp > long_max) {
long_max = long_tmp;
}
}
var lat_center=(lat_max - lat_min)/2 + lat_min;
var long_center=(long_max - long_min)/2 + long_min;
if (long_max - long_min > 0) {
vlong=(curr_sel.long_max - curr_sel.long_min)/(long_max - long_min);
}
else {
vlong=999999999;
}
if (lat_max - lat_min > 0) {
vlat=(curr_sel.lat_max - curr_sel.lat_min)/(lat_max - lat_min);
}
else {
vlat=999999999;
}
(vlong > vlat) ? (v=vlat) : (v=vlong);
var new_zoom=Math.floor(Math.log(v)/Math.log(2)) + map.GetZoomLevel() - 1;
if (new_zoom > 17) {new_zoom=17;}
map.SetCenterAndZoom(new VELatLong(lat_center,long_center), new_zoom);
}
function months_till_date(miet_beginn)
{
var months=0;
if ((miet_beginn == null)|| (miet_beginn == "sofort"))
{
return 0; 
}
else
{
var jetzt_milli = new Date();
var miet_start=(miet_beginn).match(/\d+/g);
if (miet_start[2].length == 2)
{
miet_start[2]="20" + miet_start[2];
}
var miet_milli=Date.UTC(miet_start[2],miet_start[1],miet_start[0]);
months=Math.ceil((((miet_milli - jetzt_milli)/3600000/24) - 31)/30); 
if (months < 0){
months=0;}
}
return months;
}
function calculate_grid_num(x_or_y)
{
var n=0;
if (x_or_y == "x") {
n=Math.floor(global_map_width / CONF_GRID_MIN_SIZE);
if (n < CONF_GRID_MIN_NUM_X) {
n = CONF_GRID_MIN_NUM_X;
} else if  (n > CONF_GRID_MAX_NUM_X) {
n = CONF_GRID_MAX_NUM_X;
}
} else {
n=Math.floor(global_map_height / CONF_GRID_MIN_SIZE);
if (n < CONF_GRID_MIN_NUM_Y) {
n = CONF_GRID_MIN_NUM_Y;
} else if  (n > CONF_GRID_MAX_NUM_Y) {
n = CONF_GRID_MAX_NUM_Y;
}
}
return n;
}
function uuid_exists(uuid)
{
var i=0, m=a.length;
if ((uuid == null) || (uuid == "")) return -1;
for (i=0;i<m;i++) {
if (a[i].expose_link.indexOf(uuid) != -1) return i;
}
return -1;
}
function plz_is_in_range(plz_coded, array_pos)
{
if (array_pos < 0 || plz_coded == null) {  return true;}
var i=0, plz_int=parseInt(d_a(plz_coded)), m=CONF_PLZ_MATRIX[array_pos].length;
if (m==0) return true;
for (i=0;i<m;i++) { if (CONF_PLZ_MATRIX[array_pos][i] >= plz_int) return (plz_int == CONF_PLZ_MATRIX[array_pos][i]); }
return false;
}
function apply_filter()
{
var i=0, k=0, l=0, m=0, n=0;
var long_mid=0, lat_mid=0;
var seldat = new Array();
var grid_index=0;
var grid_start_x=11; 
var grid_start_y=48; 
if (global_change_grid_width == true) {
var grid_num_x=calculate_grid_num("x"); 
var grid_num_y=calculate_grid_num("y"); 
var grid_width_x=(curr_sel.long_max - curr_sel.long_min)/grid_num_x; 
var grid_width_y=(curr_sel.lat_max - curr_sel.lat_min)/grid_num_y; 
if (grid_width_y == 0) {grid_width_y=0.5;} 
global_grid_width_x=new_grid_width(grid_width_x); 
global_grid_width_y=new_grid_width(grid_width_y); 
global_change_grid_width=false;
}
var real_grid_num_x=Math.ceil((curr_sel.long_max - curr_sel.long_min)/global_grid_width_x) + 1;
var real_grid_num_y=Math.ceil((curr_sel.lat_max - curr_sel.lat_min)/global_grid_width_y) + 1;
var grid = new Array(real_grid_num_x*real_grid_num_y);
for (grid_index=0;grid_index<grid.length;grid_index++)
{
grid[grid_index] = new grid_obj();
}
var k_links=Math.floor((curr_sel.long_min - grid_start_x)/global_grid_width_x);
var k_unten=Math.floor((curr_sel.lat_min - grid_start_y)/global_grid_width_y);
m=a.length;
for (i=0;i<m;i++)
{
a[i].sel_index=NO_INDEX;
if ((a[i].price <= curr_sel.price) &&
(a[i].price_per_qm >= curr_sel.ppqm) &&
(a[i].price_per_qm <= curr_sel.ppqm_max) &&
(a[i].qm >= curr_sel.qm) &&
(a[i].qm <= curr_sel.qm_max) &&
(a[i].objsource == curr_sel.objsource) &&
((curr_sel.purpose == "Alle") || (a[i].purpose == curr_sel.purpose)) &&
((curr_sel.uuid == null) || (curr_sel.uuid == "") || (a[i].expose_link.indexOf(curr_sel.uuid) != -1)) &&
((curr_sel.marketingtype == "Alle") || (a[i].marketingtype == curr_sel.marketingtype)) &&
((curr_sel.immotype == "Alle") || (a[i].immotype == curr_sel.immotype)) &&
(a[i].rooms >= curr_sel.rooms) &&
((curr_sel.group_num == 0) || (a[i].group_num == curr_sel.group_num)) &&
((curr_sel.months_till_movein <0) || (curr_sel.months_till_movein >= months_till_date(a[i].miet_beginn))) &&
(plz_is_in_range(a[i].plz,curr_sel.plz_range)) &&
(d_c(a[i].lat) >= curr_sel.lat_min) &&
(d_c(a[i].lat) <= curr_sel.lat_max) &&
(d_c(a[i].long) >= curr_sel.long_min) &&
(d_c(a[i].long) <= curr_sel.long_max))
{ 
grid_index = Math.floor((d_c(a[i].long) - grid_start_x)/global_grid_width_x) -  k_links + 
real_grid_num_x * (256 + Math.floor((d_c(a[i].lat) - grid_start_y)/global_grid_width_y) - a[0].sel_ind -
k_unten - a[m-1].sel_ind);
if ((grid_index < 0) || (grid_index >= grid.length)) {grid_index = 0};
seldat[k] = i;
a[i].grid_index = grid_index;
a[i].sel_index = k;
grid[grid_index].num += 1;
n=grid[grid_index].num;
grid[grid_index].id[n-1] = i;
long_mid=0;
lat_mid=0;
for (l=0;l<n;l++)
{
long_mid += d_c(a[grid[grid_index].id[l]].long);
lat_mid += d_c(a[grid[grid_index].id[l]].lat);
}
long_mid=long_mid/n;
lat_mid=lat_mid/n;
grid[grid_index].long = long_mid;
grid[grid_index].lat = lat_mid;
k++;
} 
}
disp_zoom_level();
global_seldat=seldat;
global_grid=grid;
add_selected_pushpins(grid);
if ((global_last_selected_object !=NO_INDEX) &&  
(a[global_last_selected_object].sel_index > NO_INDEX)) { 
show_list_elements("map",a[global_last_selected_object].sel_index +1,NO_INDEX);  
set_focus(global_last_selected_object);
}
else {	
show_list_elements("map",1,NO_INDEX); 
}
}
function do_nothing(e)
{
return true;
}
function do_mouse(e)
{
if (e.elementID != null) {
var pin=map.GetShapeByID(e.elementID);
var layer = pin.GetShapeLayer();
var baselayer = map.GetShapeLayerByIndex(0);
if (layer.GetTitle() == baselayer.GetTitle()) { 
return true;
} else { 
return false;
}
}
}
function hide_popup(e)
{
hide_cluster_popup();
if ((global_last_selected_object !=NO_INDEX) &&  
(a[global_last_selected_object].sel_index > NO_INDEX)) { 
show_list_elements("map",a[global_last_selected_object].sel_index +1,NO_INDEX);  
set_focus(global_last_selected_object);
}
else {	
show_list_elements("map",1,NO_INDEX); 
}
return true;
}
function show_late_popup()
{
show_cluster_popup(a[last_clicked_object].grid_index);
show_list_elements('cluster',0,a[last_clicked_object].grid_index);
set_focus(last_clicked_object);
}
function pin_selected_in_map(e)
{
hide_cluster_popup();
if (e.elementID != null)
{
var pin=map.GetShapeByID(e.elementID);
var layer = pin.GetShapeLayer();
var baselayer = map.GetShapeLayerByIndex(0);
if (layer.GetTitle() != baselayer.GetTitle()) return false;
var descr=pin.GetTitle();
var n=descr.indexOf("grid_ident#");
var grid_index=parseInt(descr.slice(n+11,n+15)); 
var obj_index=global_grid[grid_index].id[0];
if (global_grid[grid_index].num ==1){ 
if (CONF_CENTER_ON_CLICK == true) {
center_map_to_object(d_c(a[obj_index].lat), d_c(a[obj_index].long));
}
show_list_elements("map", (a[obj_index].sel_index)+1,NO_INDEX); 
}
else { 
if (CONF_CENTER_ON_CLICK == true) {
last_clicked_object=obj_index;
center_map_to_object(global_grid[grid_index].lat, global_grid[grid_index].long);
return true;
}
else {
show_cluster_popup(grid_index);
show_list_elements('cluster',0,grid_index);
}
}	
set_focus(obj_index);
}
return true; 
}
function hide_cluster_popup()
{
last_clicked_object=NO_INDEX;
document.getElementById('clusterPopup').style.visibility = "hidden";
document.getElementById('arrows').style.visibility="hidden"; 
}
function checked_mod (i) { 
if (document.Clusterform.Art.checked == true) {
show_list_elements('cluster',0,i);
set_focus(global_last_selected_object);
} else { 
show_first_cluster_element(i);
}
if ((document.Clusterform.Art.checked == false) || (MAXLIST < global_grid[i].num)) {
document.getElementById('arrows').style.visibility="visible"; 
}
else {
document.getElementById('arrows').style.visibility="hidden"; 
}
}
function add_selected_pushpins(grid)
{
var shape_pushpin=null;
var icon=null;
var i=0, k=0, l=0, n=0;
var zoom=0;
var infobox = new String();
var baseLayer=null;
baseLayer = map.GetShapeLayerByIndex(0);
baseLayer.DeleteAllShapes();
zoom=get_zoom_level();
for (i=0;i<grid.length;i++)
{
if (grid[i].num > 0)
{
if (grid[i].num == 1) 
{
k=grid[i].id[0];
icon = determine_icon(a[k], zoom, 1);
shape_pushpin = new VEShape(VEShapeType.Pushpin, new VELatLong(d_c(a[k].lat), d_c(a[k].long)));
infobox = build_infobox(k);
}	  
else 
{
icon = determine_icon(grid[i].num, zoom, 0);
shape_pushpin = new VEShape(VEShapeType.Pushpin, new VELatLong(grid[i].lat, grid[i].long));
}
shape_pushpin.SetCustomIcon(icon);
shape_pushpin.SetTitle("<div style='margin:0px;'><span style='visibility:hidden'>grid_ident#" + i + "#</span>" +
"<a style='position:absolute; top:5px; right:30px; color:red;' href=\"#\" onclick=\"hide_popup(1)\">"+CONF_CLOSE_TEXT+"</a></div>");
//shape_pushpin.SetDescription(infobox);
map.AddShape(shape_pushpin);
if (grid[i].num == 1) 
{
a[k].pin=shape_pushpin.GetID();
}
else
{
grid[i].pin=shape_pushpin.GetID();
}
} 
} 
}
function show_first_cluster_element(i)
{
if (document.Clusterform.Art.checked == true) {
show_list_first_clicked();
}
else {
show_list_elements("map", a[global_grid[i].id[0]].sel_index + 1,NO_INDEX);
set_focus(global_grid[i].id[0]);
global_list_cluster_start_index=0;
}
}
function show_previous_cluster_element(i)
{
if (document.Clusterform.Art.checked == true) {
show_list_previous_clicked();
}
else {
global_list_cluster_start_index -= 1;
if (global_list_cluster_start_index < 0){
global_list_cluster_start_index=0;
}
show_list_elements("map", a[global_grid[i].id[global_list_cluster_start_index]].sel_index + 1,NO_INDEX);
set_focus(global_grid[i].id[global_list_cluster_start_index]);
}	
}
function show_next_cluster_element(i)
{
if (document.Clusterform.Art.checked == true) {
show_list_next_clicked();
}
else {
global_list_cluster_start_index += 1;
if (global_list_cluster_start_index > global_grid[i].num-1){
global_list_cluster_start_index=global_grid[i].num-1;
}
show_list_elements("map", a[global_grid[i].id[global_list_cluster_start_index]].sel_index + 1,NO_INDEX);
set_focus(global_grid[i].id[global_list_cluster_start_index]);
}
}
function show_last_cluster_element(i)
{
if (document.Clusterform.Art.checked == true) {
show_list_last_clicked();
}
else {
show_list_elements("map", a[global_grid[i].id[global_grid[i].num-1]].sel_index + 1,NO_INDEX);
global_list_cluster_start_index=global_grid[i].num-1;
set_focus(global_grid[i].id[global_grid[i].num-1]);
}
}
function show_list_first_clicked()
{
show_list_elements(global_list_mode,0,global_list_grid_index);
if ((global_last_selected_object !=NO_INDEX) &&  
(a[global_last_selected_object].sel_index > NO_INDEX)) { 
set_focus(global_last_selected_object);
}
}
function show_list_previous_clicked()
{
show_list_elements(global_list_mode,global_list_start_index-MAXLIST,global_list_grid_index);
if ((global_last_selected_object !=NO_INDEX) &&  
(a[global_last_selected_object].sel_index > NO_INDEX)) { 
set_focus(global_last_selected_object);
}
}
function show_list_next_clicked()
{
show_list_elements(global_list_mode,global_list_start_index+MAXLIST,global_list_grid_index);
if ((global_last_selected_object !=NO_INDEX) &&  
(a[global_last_selected_object].sel_index > NO_INDEX)) { 
set_focus(global_last_selected_object);
}
}
function show_list_last_clicked()
{
show_list_elements(global_list_mode,MAXINT,global_list_grid_index);
if ((global_last_selected_object !=NO_INDEX) &&  
(a[global_last_selected_object].sel_index > NO_INDEX)) { 
set_focus(global_last_selected_object);
}
}
function drop_focus (i)
{
var subnode=document.getElementById("referer-"+i);
if (subnode!=null) { 
subnode.style.visibility = 'hidden';
subnode.parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor="#ffffff"; 
} 
subnode=document.getElementById("image-" + i);
if (subnode!=null) { 
subnode.style.visibility = 'hidden';
} 
lowlight_pin(i);
if (global_grid[a[i].grid_index].num > 1) { 
drop_cluster_focus(a[i].grid_index);
}
}
function set_focus (i)
{
var subnode=document.getElementById("referer-" + i);
if (global_last_selected_object != NO_INDEX)
{
if (a[global_last_selected_object].sel_index > NO_INDEX) {
drop_focus(global_last_selected_object);
}
}
if (global_grid[a[i].grid_index].num > 1) { 
set_cluster_focus(a[i].grid_index);
}
if (subnode!=null) { 
subnode.style.visibility = 'visible';
subnode.parentNode.parentNode.parentNode.parentNode.parentNode.style.backgroundColor=CONF_COLOR; 
} 
subnode=document.getElementById("image-" + i);
if (subnode!=null) { 
subnode.style.visibility = 'visible';
} 
highlight_pin(i);
global_last_selected_object=i; 
}
function set_cluster_focus (grid_index)
{
var subnode=null;
var i,k=0;
for (i=0;i<global_grid[grid_index].num;i++)
{
k=global_grid[grid_index].id[i];
subnode=document.getElementById("image-" + k);
if (subnode!=null) { 
subnode.style.visibility = 'visible';
subnode.parentNode.parentNode.parentNode.style.backgroundColor=CONF_GROUP_COLOR; 
} 
}
}
function drop_cluster_focus (grid_index)
{
var subnode=null;
var i,k=0;
for (i=0;i<global_grid[grid_index].num;i++)
{
k=global_grid[grid_index].id[i];
subnode=document.getElementById("image-" + k);
if (subnode!=null) { 
subnode.style.visibility = 'hidden';
subnode.parentNode.parentNode.parentNode.style.backgroundColor="#ffffff"; 
}
}
}
function highlight_pin (i)
{
var pin=null;
var pin_new=null;
var grid_index=a[i].grid_index;
if (global_grid[grid_index].num == 1) { 
pin=map.GetShapeByID(a[i].pin);
pin_new = new VEShape(VEShapeType.Pushpin, new VELatLong(d_c(a[i].lat), d_c(a[i].long)));
}
else	{
pin=map.GetShapeByID(global_grid[grid_index].pin);
pin_new = new VEShape(VEShapeType.Pushpin, new VELatLong(global_grid[grid_index].lat, global_grid[grid_index].long));
}
if (pin != null) {
var new_title=pin.GetTitle();
map.DeleteShape(pin);
}		
var icon = determine_achtung_icon(global_grid[grid_index].num);
pin_new.SetCustomIcon(icon);
pin_new.SetTitle(new_title);
map.AddShape(pin_new);
if (global_grid[grid_index].num == 1) { 
a[i].pin=pin_new.GetID();
}
else {
global_grid[grid_index].pin=pin_new.GetID();
}
}
function lowlight_pin (i)
{
var zoom=get_zoom_level();
var icon=null;
var pin=null;
pin=map.GetShapeByID(a[i].pin);
if (pin == null) {
pin=map.GetShapeByID(global_grid[a[i].grid_index].pin);
icon = determine_icon(global_grid[a[i].grid_index].num, zoom, 0); 
}
else {
icon = determine_icon(a[i], zoom, 1); 
}
pin.SetCustomIcon(icon);
}
function getPixelsFromTop(obj){
var	objFromTop = obj.offsetTop;
var objParent=null;
while(obj.offsetParent!=null) {
objParent = obj.offsetParent;
objFromTop += objParent.offsetTop;
obj = objParent;
}
return objFromTop;
}
function getHeight(i){
var	contentTopDiv = document.getElementById("content_top"+i);
var	contentBotDiv = document.getElementById("content_bottom"+i);
var	contentTop = getPixelsFromTop(contentTopDiv);
var	contentBottom = getPixelsFromTop(contentBotDiv);
var	contentHeight = contentBottom - contentTop;
return contentHeight;
}
function show_list_elements(mode,start_index,grid_index)
{
var first_ind=0;
var last_ind=0;
var i=0, k=0;
var list_len=0;
var append=1;
var modus_text="";
var savelist="";
var total_len=0;
global_list_grid_index=grid_index;
global_list_mode=mode;
if (mode == "map")
{
list_len=global_seldat.length;
}
else 
{
list_len=global_grid[grid_index].num;
}
if (list_len == 0)
{
document.getElementById('listen_spalte').innerHTML = "";
write_list_info (0,0,0,mode);
return;
}
if (CONF_LIST_MODULO == true) { 
if (start_index == MAXINT) 
{
start_index=list_len - ((list_len- 1) % MAXLIST);
}
if (start_index > list_len) 
{
return;
}
first_ind = (start_index<1)? 1 : start_index;
first_ind = first_ind - ((first_ind -1) % MAXLIST);
}
else {
if (start_index > list_len - MAXLIST + 1) 
{
start_index=list_len - MAXLIST + 1;
}
first_ind = (start_index<1)? 1 : start_index;
}
global_list_start_index=first_ind;
last_ind = (first_ind+MAXLIST-1>list_len)? list_len : first_ind + MAXLIST-1;
document.getElementById('listen_spalte').innerHTML = "";  
for (i=first_ind-1;i<last_ind;i++)
{
savelist=document.getElementById("listen_spalte").innerHTML; 
if (mode == "map")
{
total_len+=write_list(global_seldat[i],append);
}
else
{  
k=global_grid[grid_index].id[i];
total_len+=write_list(k,append);
}
if (total_len > global_map_height) { 
document.getElementById("listen_spalte").innerHTML=savelist; 
MAXLIST=i+1-first_ind;  
write_list_info (first_ind,i,list_len,mode);
return;
}
} 
write_list_info (first_ind,i,list_len,mode);
}
function modify_list(n,mode)
{
var i=0;
if (n == MAXINT) {
if (global_list_mode == "map"){
for (i=0;i<global_seldat.length;i++)
{ 
a[global_seldat[i]].mode=mode;
}
}
else if (global_list_mode == "cluster"){
for (i=0;i<global_grid[global_list_grid_index].num;i++)
{ 
a[global_grid[global_list_grid_index].id[i]].mode=mode;
}
}
}
else
{
a[n].mode=mode;
}
show_list_elements(global_list_mode,global_list_start_index,global_list_grid_index);
}
function create_start_screen()
{
if (CONF_START_SCREEN) { document.getElementById('init_screen').src="./pic/pleasewait.png";}
}
function set_map_list_ratio()
{
if (CONF_MAP_SIZE == "60%") { return; } 
document.getElementById("listen_spalte").style.width=(100-CONF_MAP_SIZE_INT)+"%";
document.getElementById("mapArea").style.width=CONF_MAP_SIZE;
document.getElementById("mapArea").style.left=(100-CONF_MAP_SIZE_INT)+"%";
document.getElementById("map_header").style.width=CONF_MAP_SIZE;
document.getElementById("list_header").style.width=(100-CONF_MAP_SIZE_INT)+"%";
}
function trenner(number) {
number = Math.round(number); 
number = '' + number;
if (number.length > 3) {
var mod = number.length % 3;
var output = (mod > 0 ? (number.substring(0,mod)) : '');
for (i=0 ; i < Math.floor(number.length / 3); i++) {
if ((mod == 0) && (i == 0))
output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
else
output+= '.' + number.substring(mod + 3 * i, mod + 3 * i + 3);
}
return (output);
}
else return number;
}
function Vollbild() {
if (document.layers){
var breite=screen.width-10;
var hoehe=screen.height -20;}
else{
var breite=screen.width-2;
var hoehe=screen.height;}
self.resizeTo(breite,hoehe);
self.moveTo(0,0);
return
}
function calc_list_height()
{
if (global_map_height<300) { 
global_picture_padding = 1;
PIC_HGT = CONF_PIC_MIN_HEIGHT;
} else if (global_map_height<400) { 
global_picture_padding = 2;
PIC_HGT = Math.floor((global_map_height-16)/5);
} else if (global_map_height<500) { 
global_picture_padding = 3;
PIC_HGT = Math.floor((global_map_height-16)/4);
} else {
global_picture_padding = 4;
PIC_HGT = CONF_PIC_MAX_HEIGHT;
}
if (PIC_HGT < CONF_PIC_MIN_HEIGHT) PIC_HGT = CONF_PIC_MIN_HEIGHT;
if (PIC_HGT > CONF_PIC_MAX_HEIGHT) PIC_HGT = CONF_PIC_MAX_HEIGHT;
MAXLIST = Math.floor((global_map_height)/(PIC_HGT+4*global_picture_padding));
if (CONF_MAX_LIST_ENTRIES && MAXLIST > CONF_MAX_LIST_ENTRIES) MAXLIST = CONF_MAX_LIST_ENTRIES;
PIC_HGT = Math.floor((global_map_height-(4*global_picture_padding+1)*MAXLIST)/MAXLIST);
if (PIC_HGT < CONF_PIC_MIN_HEIGHT) PIC_HGT = CONF_PIC_MIN_HEIGHT;
if (PIC_HGT > CONF_PIC_MAX_HEIGHT) PIC_HGT = CONF_PIC_MAX_HEIGHT;
MAXLIST = Math.floor((global_map_height)/(PIC_HGT+4*global_picture_padding));
if (CONF_MAX_LIST_ENTRIES && MAXLIST > CONF_MAX_LIST_ENTRIES) MAXLIST = CONF_MAX_LIST_ENTRIES;
}
function execute_resize()
{
var mapWidth;
var mapHeight;
if ((map!=null) && (map_initialized == true)) {
var bdy = document.getElementsByTagName("body")[0];
mapWidth = bdy.offsetWidth - document.getElementById("listen_spalte").offsetWidth;
mapHeight = bdy.offsetHeight - document.getElementById("filter_selector").offsetHeight
- document.getElementById("level_info").offsetHeight-2 - document.getElementById("header").offsetHeight;
global_map_size_changed=false;
if ((Math.abs(global_map_height - mapHeight) > 5) || (Math.abs(global_map_width - mapWidth) > 5)) {
global_map_size_changed=true;
}
global_map_height=mapHeight;
global_map_width=mapWidth;
if (CONF_MAP_OVERLAY == false) { 
map.Resize(mapWidth, mapHeight);
} 
document.getElementById("exposeArea").style.height = mapHeight + CONF_EXPO_HEIGHT_OFFSET + "px";
document.getElementById("listen_spalte").style.height = mapHeight;
document.getElementById("navipedia").style.height = mapHeight; 
calc_list_height();
var docw = bdy.offsetWidth;
if (docw<CONF_DOC_WIDTH1) { 
bdy.style.fontSize=CONF_DOC_FONTSIZE1;
} else if (docw<CONF_DOC_WIDTH2) { 
bdy.style.fontSize=CONF_DOC_FONTSIZE2;
} else if (docw<CONF_DOC_WIDTH3) { 
bdy.style.fontSize=CONF_DOC_FONTSIZE3;
} else if (docw<CONF_DOC_WIDTH4) { 
bdy.style.fontSize=CONF_DOC_FONTSIZE4;
} else {
bdy.style.fontSize=CONF_DOC_FONTSIZE5;
}
if (global_map_style == VEMapStyle.BirdseyeHybrid) {
map.HideMiniMap();
if (global_map_height > 415) {
map.ShowMiniMap(0, (global_map_height - 200));
}
}
win_resize_blocked=false;
}
}
function win_resize()
{
execute_resize();
}
function create_list_navigation(target)
{
document.getElementById(target).innerHTML ="<img id=\"back\" alt=\"Navigation1\" src=\"./pic/zurueck.gif\" align=\"left\" style=\"margin:0 1px 1px 1px;\" usemap=\"#ListNavi1\"/>\
<map name=\"ListNavi1\">\
<area shape=\"rect\" coords=\"0,0,17,15\"\
href=\"#\" onclick=\"show_list_first_clicked()\" alt=\""+CONF_FIRST_TEXT+"\" title=\""+CONF_FIRST_TEXT+"\">\
<area shape=\"rect\" coords=\"18,0,35,15\"\
href=\"#\" onclick=\"show_list_previous_clicked()\" alt=\""+CONF_BACK_TEXT+"\" title=\""+CONF_BACK_TEXT+"\"></map>" +
((target=="list_navi")? "<div id='list_info'></div>" : "Ansammlung") +
"<img id=\"forward\" alt=\"Navigation2\" src=\"./pic/vor.gif\" align=\"right\" style=\"margin:0 1px 1px 1px;\" usemap=\"#ListNavi2\"/>\
<map name=\"ListNavi2\">\
<area shape=\"rect\" coords=\"0,0,17,15\"\
href=\"#\" onclick=\"show_list_next_clicked()\" alt=\""+CONF_NEXT_TEXT+"\" title=\""+CONF_NEXT_TEXT+"\">\
<area shape=\"rect\" coords=\"18,0,35,15\"\
href=\"#\" onclick=\"show_list_last_clicked()\" alt=\""+CONF_LAST_TEXT+"\" title=\""+CONF_LAST_TEXT+"\"></map>";
}
function write_list_info (first, last, total, mode)
{
if (total==0) {
document.getElementById('list_info').innerHTML = CONF_LIST_INFO_NO_OBJECTS; //document.getElementsByTagName("body")[0].offsetWidth;//
document.getElementById('forward').src="./pic/vorgreyed.gif";
document.getElementById('back').src="./pic/zurueckgreyed.gif";
}
else {
document.getElementById('list_info').innerHTML = CONF_LIST_INFO_OBJECTS + first + "-" + last + CONF_LIST_INFO_OF + total + ((mode=="map")?CONF_SINGLE_TEXT:CONF_CLUSTER_TEXT);
document.getElementById('forward').src = (last==total)? "./pic/vorgreyed.gif" : "./pic/vor.gif";
document.getElementById('back').src = (first==1)? "./pic/zurueckgreyed.gif" : "./pic/zurueck.gif";
}
}
function create_icon_legende(count) {
switch (count) {
case 4: 
document.getElementById('legende').innerHTML="<div class=\"txt\">"+CONF_CLUSTER_LEGENDE+"</div><img alt=\"\" src=\"./pic/cluster_leg.png\"/><div class=\"txt\">"+CONF_SINGLE1_LEGENDE+"</div><a href=\"javascript:select_purpose('"+CONF_SINGLE1_SELECT+"');\"><img alt=\"\" src=\"./pic/single1.png\"/></a><div class=\"txt\">"+CONF_SINGLE2_LEGENDE+"</div><a href=\"javascript:select_purpose('"+CONF_SINGLE2_SELECT+"');\"><img alt=\"\" src=\"./pic/single2.png\"/></a><div class=\"txt\">"+CONF_SINGLE3_LEGENDE+"</div><a href=\"javascript:select_purpose('"+CONF_SINGLE3_SELECT+"');\"><img alt=\"\" src=\"./pic/single3.png\"/></a>";
break;
case 3: 
document.getElementById('legende').innerHTML="<div class=\"txt\">"+CONF_CLUSTER_LEGENDE+"</div><img alt=\"\" src=\"./pic/cluster_leg.png\"/><div class=\"txt\">"+CONF_SINGLE1_LEGENDE+"</div><a href=\"javascript:select_purpose('"+CONF_SINGLE1_SELECT+"');\"><img alt=\"\" src=\"./pic/single1.png\"/></a><div class=\"txt\">"+CONF_SINGLE2_LEGENDE+"</div><a href=\"javascript:select_purpose('"+CONF_SINGLE2_SELECT+"');\"><img alt=\"\" src=\"./pic/single2.png\"/></a>";
break;
case 2: 
document.getElementById('legende').innerHTML="<div class=\"txt\">"+CONF_CLUSTER_LEGENDE+"</div><img alt=\"\" src=\"./pic/cluster_leg.png\"/><div class=\"txt\">"+CONF_SINGLE1_LEGENDE+"</div><img alt=\"\" src=\"./pic/single1.png\"/>";
break;
default:
break;
}
}
function determine_icon (ak, zoom, single) 
{
var base_icon="";
if (CONF_FIRST_OBJSOURCE=="permanent") {
base_icon = (!single) ? "pcluster" : ((ak.purpose == "Wohnen") ? "psingle2" : "psingle1");
} else {
base_icon = (!single) ? "cluster" : ((ak.purpose == "Wohnen") ? ((ak.marketingtype == "Miete") ? "single3" : "single2") : "single1");
}
var icon = "";
var icon_size = determine_icon_size(global_map_zoom);
var icon_settings = determine_icon_settings(icon_size);
var icon_top = icon_settings["top_shift"];
var icon_left = icon_settings["left_shift"];
var txt_size = icon_settings["text_size"];
var pad_size = icon_settings["pad_size"];
var num=1;
if (single == 0) {num=ak;}
if (navigator.userAgent.indexOf("MSIE 6") != -1) { 
icon = "<div id='np_icon' style='position:relative;top:" + icon_top + ";left:" + icon_left + "; z-index:99;'>" +
"<img src='./pic/" + base_icon + ".gif' width='" + icon_size + "' height='" + icon_size +
"' style='filter:Alpha(opacity=100, finishopacity=100, style=2)'>";
if (CONF_DISPLAY_NUMBER_IN_CLUSTER_ICON == true) {						 
icon += (num > 1) ? ("<div class='np_icon_num_obj' style='font-size:" + txt_size + ";padding:" + pad_size + ";'>" + num + "</div>") : "";
}
icon += "</div>";
}
else { 
icon = "<div id='np_icon' style='position:relative;top:" + icon_top + ";left:" + icon_left + ";background-color:transparent; z-index:99;'>" +
"<img src='./pic/" + base_icon + ".png' width='" + icon_size + "' height='" + icon_size + "'>";
if (CONF_DISPLAY_NUMBER_IN_CLUSTER_ICON == true) {						 
icon += (num > 1) ? ("<div class='np_icon_num_obj' style='font-size:" + txt_size + ";padding:" + pad_size + ";'>" + num + "</div>") : "";
}
icon += "</div>";
}
return icon;
}
function determine_achtung_icon (num) 
{
var icon = "";
var icon_size = determine_icon_size(global_map_zoom);
var icon_settings = determine_icon_settings(icon_size);
var icon_top = icon_settings["top_shift"];
var icon_left = icon_settings["left_shift"];
var txt_size = icon_settings["text_size"];
var pad_size = icon_settings["pad_size"];
if (navigator.userAgent.indexOf("MSIE 6") != -1) { 
icon = "<div id='np_icon' style='position:relative;top:" + icon_top + ";left:" + icon_left + "; z-index:99;'>" +
"<img src='./pic/Achtung.gif' width='" + icon_size + "' height='" + icon_size +
"' style='filter:Alpha(opacity=100, finishopacity=100, style=2)'>";
if (CONF_DISPLAY_NUMBER_IN_CLUSTER_ICON == true) {						 
icon += (num > 1) ? ("<div class='np_achtung_icon_num_obj' style='font-size:" + txt_size + ";padding:" + pad_size + ";'>" + num + "</div>") : "";
}
icon += "</div>";
}
else { 
icon = "<div id='np_icon' style='position:relative;top:" + icon_top + ";left:" + icon_left + ";background-color:transparent; z-index:99;'>" +
"<img src='./pic/Achtung.png' width='" + icon_size + "' height='" + icon_size + "'>";
if (CONF_DISPLAY_NUMBER_IN_CLUSTER_ICON == true) {						 
icon += (num > 1) ? ("<div class='np_achtung_icon_num_obj' style='font-size:" + txt_size + ";padding:" + pad_size + ";'>" + num + "</div>") : "";
}
icon += "</div>";
}
return icon;
}
function determine_icon_size(zoom) 
{
var icon_size=0;
switch (zoom) {
case 0: case 1: case 2:
icon_size=15;
break;
case 3: case 4: case 5:
icon_size=15;
break;
case 6: case 7: case 8:
icon_size=20;
break;
case 9: case 10: case 11:
icon_size=25;
break;
case 12: case 13: case 14:
icon_size=30;
break;
case 15: case 16: case 17:
icon_size=35;
break;
case 18: case 19:
icon_size=40;
break;
default:
alert("error");
break;
}
return (icon_size + "px");
}
function determine_icon_settings(size) 
{
var icon_top_shift=0;
var icon_left_shift=0;
var text_size=0;
var pad_size=0;
switch (size) {
case "40px": case "35px":
icon_top_shift=2;
icon_left_shift=-1;
text_size=20;
pad_size=3;
break;
case "30px":
icon_top_shift=2;
icon_left_shift=-1;
text_size=16;
pad_size=3;
break;
case "25px":
icon_top_shift=3;
icon_left_shift=1;
text_size=14;
pad_size=2;
break;
case "20px":
icon_top_shift=6;
icon_left_shift=4;
text_size=12;
pad_size=2;
break;
case "15px": 
icon_top_shift=6;
icon_left_shift=7;
text_size=12;
pad_size=1;
break;
case "10px":
icon_top_shift=2;
icon_left_shift=11;
text_size=12;
pad_size=1;
break;
default:
alert("error");
break;
}
icon_settings= new Object();
icon_settings["top_shift"]=icon_top_shift + "px";
icon_settings["left_shift"]=icon_left_shift + "px";
icon_settings["text_size"]=text_size + "px";
icon_settings["pad_size"]=pad_size + "px";
return (icon_settings);
}
function translate_immotype(intern) {
switch (intern) {
case "Appartment": return ("Wohnung");
case "House": return ("Haus");
case "SiteLiving": return ("Baugrundst&uuml;ck");
case "WAZ": return ("Wohnen auf Zeit");
case "Office": return ("B&uuml;ro/Praxis");
case "Gastronomy": return ("Gastronomie/Hotel");
case "Industry": return ("Halle/Produktion");
case "Store": return ("Einzelhandel");
case "Misc": return ("Spezialgewerbe");
case "SiteTrade": return ("Gewerbegrundst&uuml;ck");
case "Investment": return ("Anlageobjekt");
case "MFH": return ("Mehrfamilienhaus");
case "Site": return ("Grundst&uuml;ck");
case "AppartmentBuy": return ("Wohnung zum Kauf");
case "AppartmentRent": return ("Wohnung zum Mieten");
case "HouseRent": return ("Haus zum Mieten");
case "HouseBuy": return ("Haus zum Kaufen");
case "HouseType": return ("Haus Ausland");
case "GarageRent": return ("Mietgarage/ -Stellplatz");
case "GarageBuy": return ("Kaufgarage/ -Stellplatz");
case "FlatShareRoom": return ("Untermiete");
case "SiteTrade": return ("Gewerbegrundst&uuml;ck");
case "SiteLivingRent": return ("Wohnbaugrund zur Pacht");
case "SiteLivingBuy": return ("Baugrundst&uuml;ck zum Kauf");
case "AssistedLiving": return ("Betreutes Wohnen");
case "SeniorCare": return ("Altenpflege");
case "Sonstiges": return ("Sonstiges");
default: return (intern);
}
}
function getPixelsFromTop(obj){
var	objFromTop = obj.offsetTop;
var objParent=null;
while(obj.offsetParent!=null) {
objParent = obj.offsetParent;
objFromTop += objParent.offsetTop;
obj = objParent;
}
return objFromTop;
}
function getHeight(i){
var	contentTopDiv = document.getElementById("content_top"+i)
var	contentBotDiv = document.getElementById("content_bottom"+i)
var	contentTop = getPixelsFromTop(contentTopDiv);
var	contentBottom = getPixelsFromTop(contentBotDiv);
var	contentHeight = contentBottom - contentTop;
return contentHeight;
}
function create_expose_frame()
{
if (CONF_EXPO_TARGET=="_blank") return;
var eA=document.getElementById('exposeArea');
eA.innerHTML = "<iframe name=\"" + CONF_EXPO_TARGET + "\" id=\"" + CONF_EXPO_TARGET + "\" src=" +
CONF_EXPOSE_LOADING_FILE+" framespacing=\"0\" frameborder=\"0\"></iframe>";
if (CONF_EXPO_FULLSCREEN) eA.style.width="100%"; else eA.style.width=CONF_MAP_SIZE;
create_legende_expose();
}
function expose_popup(id) {
set_statistik(id);
if (CONF_EXPO_TARGET=="_blank") return;
if (!document.getElementById(CONF_EXPO_TARGET)) {
create_expose_frame();
}
document.getElementById("exposeHeader").style.visibility="visible";
document.getElementById("exposeArea").style.visibility="visible";
document.getElementById('filter_selector').style.visibility = "hidden";
document.getElementById('level_info').style.visibility = "hidden";
}
function expose_popdown() {
if (CONF_EXPO_TARGET=="_blank") return;
document.getElementById("exposeHeader").style.visibility="hidden";
document.getElementById("exposeArea").style.visibility="hidden";
document.getElementById('filter_selector').style.visibility = "visible";
document.getElementById('level_info').style.visibility="visible";
if (document.getElementById(CONF_EXPO_TARGET)) {
document.getElementById(CONF_EXPO_TARGET).src=CONF_EXPOSE_LOADING_FILE;
}
}
function expose_resize() {
if (CONF_EXPO_TARGET=="_blank") return;
var eA = document.getElementById("exposeArea");
eA.style.visibility = "visible";
if (eA.style.width=="100%") {
eA.style.width = restore_size;
} else {
eA.style.width = "100%";
}
}
function change_map_style() {
var new_style=global_new_map_style;
if ((!map.IsBirdseyeAvailable()) || (BIRDSEYE_LICENSED == false)) {
new_style=VEMapStyle.Hybrid;
} else {
new_style=VEMapStyle.BirdseyeHybrid;
}
global_new_map_style=null;
map.SetMapStyle(new_style);
}
function map_changed()
{
if ((map!=null) && (map_initialized == true) && (Lizenzkey !=null)) {
var map_style=map.GetMapStyle();
var map_zoom=get_zoom_level();
global_change_grid_width=false;
if ((map_style != global_map_style) || (map_zoom != global_map_zoom) || (global_map_size_changed == true)) {
global_change_grid_width=true;
}
global_map_style=map_style;
global_map_zoom=map_zoom;
global_map_size_changed=false;
if (map_style!=VEMapStyle.BirdseyeHybrid)
{
var lat_long_rect=map.GetMapView();
curr_sel.lat_min =lat_long_rect.BottomRightLatLong.Latitude;
curr_sel.lat_max =lat_long_rect.TopLeftLatLong.Latitude;
curr_sel.long_min=lat_long_rect.TopLeftLatLong.Longitude;
curr_sel.long_max=lat_long_rect.BottomRightLatLong.Longitude;
}
else
{
if (map.IsBirdseyeAvailable())
{
var be = map.GetBirdseyeScene();
var rect = be.GetBoundingRectangle();
var coord = 0;
curr_sel.lat_min =rect.BottomRightLatLong.Latitude;
curr_sel.lat_max =rect.TopLeftLatLong.Latitude;
curr_sel.long_min=rect.TopLeftLatLong.Longitude;
curr_sel.long_max=rect.BottomRightLatLong.Longitude;
if (curr_sel.lat_max < curr_sel.lat_min) {
coord = curr_sel.lat_min;
curr_sel.lat_min = curr_sel.lat_max;
curr_sel.lat_max = coord;
}
if (curr_sel.long_max < curr_sel.long_min) {
coord = curr_sel.long_min;
curr_sel.long_min = curr_sel.long_max;
curr_sel.long_max = coord;
}
}
}
apply_filter();
if (CONF_KONTAKT_FORMULAR == true) {
change_contact_params();
}
if (last_clicked_object > NO_INDEX) {
show_late_popup();
}
if (global_new_map_style != null) {
window.setTimeout("change_map_style()", 200);
}
}	
if (CONF_POI == true) {
if (global_map_zoom > (CONF_POI_MIN_ZOOM - 1)) {
document.getElementById('sel_poi').disabled=false;
document.getElementById('inp_poi').disabled=false;
} else {
delete_all_POI();
document.getElementById('sel_poi').disabled=true;
document.getElementById('inp_poi').disabled=true;
}
}
return true;
}
function MouseDownHandler(e) { 
if (!e.ctrlKey ) { 
return false;
} else {
selecting = true;
startX = e.mapX; 
startY = e.mapY; 
StartLatLon = map.PixelToLatLong(new VEPixel(startX, startY));
return true; 
}
}    
function MouseMoveHandler(e) { 
if (!selecting) {
return false;
} else {
if (selectBox) {map.DeleteShape(selectBox)};
currentX = e.mapX; 
currentY = e.mapY;
EndLatLon = map.PixelToLatLong(new VEPixel(currentX, currentY));
selectBox = new VEShape( 
VEShapeType.Polygon, 
[
StartLatLon,
new VELatLong(StartLatLon.Latitude, EndLatLon.Longitude),
EndLatLon,
new VELatLong(EndLatLon.Latitude, StartLatLon.Longitude) 
]); 
selectBox.HideIcon();
selectBox.SetLineWidth(2);
selectBox.SetLineColor(new VEColor(255,0,0, 1.0));
selectBox.SetFillColor(new VEColor(0, 0, 0, 0));
selectBox.Primitives[0].symbol.stroke_dashstyle = "DashDot";
map.AddShape(selectBox); 
} 
}    
function MouseUpHandler(e){ 
if (selecting) { 
window.setTimeout("set_selected_view()", 500);
selecting = false; 
} 
}        
function set_selected_view()
{
var v=0;
if (map.GetMapStyle() == VEMapStyle.BirdseyeHybrid) {return;}
hide_cluster_popup();
last_center=map.GetCenter();
last_zoom=map.GetZoomLevel();
last_style=map.GetMapStyle();
var lat_max=EndLatLon.Latitude;
var lat_min=StartLatLon.Latitude;
var long_max=StartLatLon.Longitude;
var long_min=EndLatLon.Longitude;
var lat_center=(lat_max - lat_min)/2 + lat_min;
var long_center=(long_max - long_min)/2 + long_min;
var vlong=Math.abs((curr_sel.long_max - curr_sel.long_min)/(long_max - long_min));
var vlat=Math.abs((curr_sel.lat_max - curr_sel.lat_min)/(lat_max - lat_min));
(vlong > vlat) ? (v=vlat) : (v=vlong);
var new_zoom=Math.floor(Math.log(v)/Math.log(2)) + map.GetZoomLevel();
if (new_zoom > 17) {new_zoom=17;}
map.SetCenterAndZoom(new VELatLong(lat_center,long_center), new_zoom);
}
function map_init_step_2()
{
entry_center= new VELatLong(CONF_LAT, CONF_LNG);
last_zoom=CONF_ZOOM;
last_center= new VELatLong(CONF_LAT, CONF_LNG);
last_style=CONF_FIRST_MAP_STYLE;
map = new VEMap('myMap');
var map_fixed=false;
if (CONF_MAP_OVERLAY == true) {
map_fixed=true;
}
map.LoadMap(entry_center, CONF_ZOOM, CONF_FIRST_MAP_STYLE, map_fixed,  VEMapMode.Mode2D, true);
map.HideDashboard();
if (CONF_MAP_OVERLAY == true) {
AddCustomLayer();
map.AttachEvent("onchangeview", do_nothing);
map.AttachEvent("onclick",pin_selected_in_map);
map.AttachEvent("onmouseover",do_nothing);
map.AttachEvent("onmouseout",do_nothing);
map.AttachEvent("ondoubleclick",do_nothing);
} else {
map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
map.AttachEvent("onchangeview", map_changed);
map.AttachEvent("onclick",pin_selected_in_map);
map.AttachEvent("onmouseover",do_mouse);
map.AttachEvent("onmouseout",do_mouse);
map.AttachEvent("ondoubleclick",do_nothing);
map.AttachEvent("onmousewheel",do_nothing);
map.AttachEvent("onmousedown", MouseDownHandler); 
map.AttachEvent("onmousemove", MouseMoveHandler); 
map.AttachEvent("onmouseup", MouseUpHandler); 
}
map_initialized = true;
win_resize();
naviMapControl(map);
document.getElementById('init_screen').style.visibility="hidden";
}
function map_init()
{
set_map_list_ratio();
store_loc_data();
set_statistik(1);
}
﻿
naviMapControl = function(map) {
var imgStyleView = "view";
var viewLastClickedObject = null;
var imgBirdView = "bird";
var birdsLastClickedObject = null;
var naviSliderControl = function() {		
var zoomInButton = document.getElementById("navi-slider-ZoomIn");
var zoomOutButton = document.getElementById("navi-slider-ZoomOut");
zoomInButton.pos_act="-1110px -30px";
zoomInButton.pos_inact="-1110px 0px";
zoomOutButton.pos_act="-1140px -30px";
zoomOutButton.pos_inact="-1140px 0px";
zoomInButton.style.backgroundPosition = zoomInButton.pos_inact;
zoomOutButton.style.backgroundPosition = zoomOutButton.pos_inact;
var sliderElement = document.getElementById("sliderthumb");
var ticks = 4;
function sliderInit() {
sliderControl = YAHOO.widget.Slider.getVertSlider("sliderbg", "sliderthumb", 3, 72, ticks);
sliderControl.subscribe("slideEnd", function(val) {
val = -(sliderControl.getValue() / ticks) + 19;
hide_cluster_popup();
map.SetZoomLevel(val);
});
setSlider(map.GetZoomLevel());
}
function setSlider(zoomLevel) {
var val = (zoomLevel -19) / -1 * ticks;
sliderControl.setValue(val);
}
sliderElement.onmouseover = function() {
callMouseOverCursor(this);
}
sliderElement.onmouseout = function() {
callMouseOutCursor(this);
}
assign_events(zoomInButton,2);
assign_events(zoomOutButton,2);
zoomInButton.onclick = function() {
hide_cluster_popup();
map.ZoomIn();
setSlider(map.GetZoomLevel());
}
zoomOutButton.onclick = function() {
hide_cluster_popup();
map.ZoomOut();
setSlider(map.GetZoomLevel());
}
map.AttachEvent("onendzoom",function() {
if (VEMapStyle.BirdseyeHybrid != map.GetMapStyle()) {
navi_slider.setSliderZoomLevel(map.GetZoomLevel());
}
});
sliderInit();
var html_el = document.getElementById("navi-sliderControl");
this.getHtmlElement = function() {
return html_el;
}
this.setSliderZoomLevel = function(zoomLevel) {
setSlider(zoomLevel);
}
}
var naviPanControl = function() {		
var resetButton = document.getElementById("navi_map_reset");
var moveTop = document.getElementById("navi_move_top");
var moveDown = document.getElementById("navi_move_bottom");
var moveLeft = document.getElementById("navi_move_left");
var moveRight = document.getElementById("navi_move_right");
resetButton.pos_act="-120px -30px";
resetButton.pos_inact="-120px 0px";
moveTop.pos_act="0px -30px";
moveTop.pos_inact="0px 0px";
moveDown.pos_act="-30px -30px";
moveDown.pos_inact="-30px 0px";
moveLeft.pos_act="-60px -30px";
moveLeft.pos_inact="-60px 0px";
moveRight.pos_act="-90px -30px";
moveRight.pos_inact="-90px 0px";
resetButton.style.backgroundPosition = resetButton.pos_inact;
moveTop.style.backgroundPosition = moveTop.pos_inact;
moveDown.style.backgroundPosition = moveDown.pos_inact;
moveLeft.style.backgroundPosition = moveLeft.pos_inact;
moveRight.style.backgroundPosition = moveRight.pos_inact;
assign_events(moveTop,2);
assign_events(moveDown,2);
assign_events(moveLeft,2);
assign_events(moveRight,2);
assign_events(resetButton,2);
moveTop.onclick = function() {
hide_cluster_popup();
map.Pan(0, -(Math.floor(global_map_height / 2)));
}
moveDown.onclick = function() {
hide_cluster_popup();
map.Pan(0, Math.floor(global_map_height / 2));
}	
moveLeft.onclick = function() {
hide_cluster_popup();
map.Pan(-(Math.floor(global_map_width / 2)), 0);
}	
moveRight.onclick = function() {
hide_cluster_popup();
map.Pan(Math.floor(global_map_width / 2), 0);
}
resetButton.onclick = function() {
set_last_view();
}
resetButton.ondblclick = function() {
set_entry_view();
}
var html_el = document.getElementById("navi-moveControl");
this.getHtmlElement = function() {
return html_el;
}
}
var naviBirdsviewControl = function() {		
var birdNorthControl = document.getElementById("navi_birdsViewNorth");
var birdEastControl = document.getElementById("navi_birdsViewEast");
var birdSouthControl = document.getElementById("navi_birdsViewSouth");
var birdWestControl = document.getElementById("navi_birdsViewWest");
var birdZoomControl = document.getElementById("navi_birdsViewZoom");
if (CONF_LANGUAGE == "dt") {
birdNorthControl.pos_act="-530px -30px";
birdNorthControl.pos_inact="-530px 0px";
birdEastControl.pos_act="-620px -30px";
birdEastControl.pos_inact="-620px 0px";
birdSouthControl.pos_act="-710px -30px";
birdSouthControl.pos_inact="-710px 0px";
birdWestControl.pos_act="-800px -30px";
birdWestControl.pos_inact="-800px 0px";
birdZoomControl.pos_act="-890px -30px";
birdZoomControl.pos_inact="-890px 0px";
birdZoomControl.pos2_act="-1000px -30px";
birdZoomControl.pos2_inact="-1000px 0px";
} else {
birdNorthControl.pos_act="-530px -120px";
birdNorthControl.pos_inact="-530px -90px";
birdEastControl.pos_act="-620px -120px";
birdEastControl.pos_inact="-620px -90px";
birdSouthControl.pos_act="-710px -120px";
birdSouthControl.pos_inact="-710px -90px";
birdWestControl.pos_act="-800px -120px";
birdWestControl.pos_inact="-800px -90px";
birdZoomControl.pos_act="-890px -120px";
birdZoomControl.pos_inact="-890px -90px";
birdZoomControl.pos2_act="-1000px -120px";
birdZoomControl.pos2_inact="-1000px -90px";
}
birdNorthControl.style.backgroundPosition = birdNorthControl.pos_inact;
birdEastControl.style.backgroundPosition = birdEastControl.pos_inact;
birdSouthControl.style.backgroundPosition = birdSouthControl.pos_inact;
birdWestControl.style.backgroundPosition = birdWestControl.pos_inact;
birdZoomControl.style.backgroundPosition = birdZoomControl.pos_inact;
birdSouthControl.actionPerform = function() {
map.SetBirdseyeOrientation(VEOrientation.North);
}				
birdEastControl.actionPerform = function() {
map.SetBirdseyeOrientation(VEOrientation.West);
}
birdNorthControl.actionPerform = function() {
map.SetBirdseyeOrientation(VEOrientation.South);
}
birdWestControl.actionPerform = function() {
map.SetBirdseyeOrientation(VEOrientation.East);
}
birdSouthControl.onclick = birdSouthControl.actionPerform;
birdEastControl.onclick = birdEastControl.actionPerform;
birdNorthControl.onclick = birdNorthControl.actionPerform;
birdWestControl.onclick = birdWestControl.actionPerform;
birdZoomControl.onmouseover = function() {
callMouseOverCursor(this);
}
birdZoomControl.onmouseout = function() {
callMouseOutCursor(this);
}
assign_events(birdSouthControl,2);
assign_events(birdEastControl,2);
assign_events(birdNorthControl,2);
assign_events(birdWestControl,2);
assign_events(birdZoomControl,4);
birdZoomControl.onclick = function() {
zoomBirdsView(true);
}
function zoomBirdsView(fromButton) {
if (VEMapStyle.BirdseyeHybrid == map.GetMapStyle()) {
if (map.GetZoomLevel() == 2) {
birdZoomControl.style.backgroundPosition = birdZoomControl.pos2_act;
if (fromButton) {
map.ZoomOut();
} else {
birdZoomControl.style.backgroundPosition = birdZoomControl.pos2_inact;
}
} else {
if (fromButton) {
birdZoomControl.style.backgroundPosition = birdZoomControl.pos_act;
map.ZoomIn();
} else {
birdZoomControl.style.backgroundPosition = birdZoomControl.pos_inact;
}
}
}
}
map.AttachEvent("onchangeview",handleOrientation);
function handleOrientation() {
if(VEMapStyle.BirdseyeHybrid == map.GetMapStyle()) {
var currentOrientation = map.GetBirdseyeScene().GetOrientation();
switch(currentOrientation) {
case VEOrientation.North:
set_checked_control(birdSouthControl,imgBirdView);
break;
case VEOrientation.South:
set_checked_control(birdNorthControl,imgBirdView);
break;
case VEOrientation.East:
set_checked_control(birdWestControl,imgBirdView);
break;
case VEOrientation.West:
set_checked_control(birdEastControl,imgBirdView);
break;
}
}		
}
map.AttachEvent("onendzoom",function() {
if (VEMapStyle.BirdseyeHybrid == map.GetMapStyle()) {
zoomBirdsView();
} else {
navi_slider.setSliderZoomLevel(map.GetZoomLevel());
}
});
var html_el = document.getElementById("navi-birdsViewControl");
this.getHtmlElement = function() {
return html_el;
}
}
var naviMapStyleControl = function() {
var viewRoad = document.getElementById("navi_road_view");
var viewAerial =document.getElementById("navi_aerial_view");
var viewHybrid =document.getElementById("navi_hybrid_view");
var viewBirdseye = document.getElementById("navi_birdseye_view");
if (CONF_LANGUAGE == "dt") {
viewRoad.pos_act="-150px -30px";
viewRoad.pos_inact="-150px 0px";
viewAerial.pos_act="-230px -30px";
viewAerial.pos_inact="-230px 0px";
viewHybrid.pos_act="-310px -30px";
viewHybrid.pos_inact="-310px 0px";
viewBirdseye.pos_act="-390px -30px";
viewBirdseye.pos_inact="-390px 0px";
viewBirdseye.pos_pass="-390px -60px";
} else {
viewRoad.pos_act="-150px -120px";
viewRoad.pos_inact="-150px -90px";
viewAerial.pos_act="-230px -120px";
viewAerial.pos_inact="-230px -90px";
viewHybrid.pos_act="-310px -120px";
viewHybrid.pos_inact="-310px -90px";
viewBirdseye.pos_act="-390px -120px";
viewBirdseye.pos_inact="-390px -90px";
viewBirdseye.pos_pass="-390px -150px";
}
viewRoad.style.backgroundPosition = viewRoad.pos_inact;
viewRoad.style.visibility = "visible";
viewAerial.style.backgroundPosition = viewAerial.pos_inact;
viewAerial.style.visibility = "visible";
viewHybrid.style.backgroundPosition = viewHybrid.pos_inact;
viewHybrid.style.visibility = "visible";
viewBirdseye.style.backgroundPosition = viewBirdseye.pos_inact;
viewBirdseye.style.visibility = "visible";
if (BIRDSEYE_LICENSED == false) {
hideBirdsViewAvailability();
viewBirdseye.style.display = "none";
}
var navi_birdseye = new naviBirdsviewControl();
var lastMapStyle = "";
viewRoad.actionPerform = function() {
map.SetMapStyle(VEMapStyle.Shaded);
}
viewAerial.actionPerform = function() {
map.SetMapStyle(VEMapStyle.Aerial);
}
viewHybrid.actionPerform = function() {
map.SetMapStyle(VEMapStyle.Hybrid);
}
viewBirdseye.actionPerform = function() {
if (BIRDSEYE_LICENSED == true) {
hide_cluster_popup();
map.SetMapStyle(VEMapStyle.BirdseyeHybrid);
}
}
viewRoad.onclick = viewRoad.actionPerform;
viewAerial.onclick = viewAerial.actionPerform;
viewHybrid.onclick = viewHybrid.actionPerform;
viewBirdseye.onclick = viewBirdseye.actionPerform;
assign_events(viewRoad,2);
assign_events(viewAerial,2);
assign_events(viewHybrid,2);
if (BIRDSEYE_LICENSED == true) {
map.AttachEvent("onobliqueenter",showBirdsViewAvailable);
map.AttachEvent("onobliqueleave",hideBirdsViewAvailability);
}
map.AttachEvent("onchangemapstyle",handleMapStyle);
this.initCtrl = function() {
if (map.GetMapStyle() == VEMapStyle.BirdseyeHybrid) {
removeControlFromMap(navi_slider);
addControlToMap(navi_birdseye);
} else {
removeControlFromMap(navi_birdseye);
addControlToMap(navi_slider);
}
handleMapStyle();
}
function handleMapStyle() {
var currentMapStyle = map.GetMapStyle();
if ((map.IsBirdseyeAvailable()) && (BIRDSEYE_LICENSED == true)) {
showBirdsViewAvailable();
} else {
hideBirdsViewAvailability();
}
switch (currentMapStyle) {
case VEMapStyle.Shaded:
set_checked_control(viewRoad,imgStyleView);
HideMiniMap(map);
break;
case VEMapStyle.Road:
set_checked_control(viewRoad,imgStyleView);
HideMiniMap(map);
break;
case VEMapStyle.Hybrid:
set_checked_control(viewHybrid,imgStyleView);
HideMiniMap(map);
break;
case VEMapStyle.Aerial:
set_checked_control(viewAerial,imgStyleView);
HideMiniMap(map);
break;
case VEMapStyle.BirdseyeHybrid:
set_checked_control(viewBirdseye,imgStyleView);
removeControlFromMap(navi_slider);
addControlToMap(navi_birdseye);
ShowMiniMap(map);
break;
}
if (lastMapStyle == VEMapStyle.BirdseyeHybrid) {
removeControlFromMap(navi_birdseye);
addControlToMap(navi_slider);
}
lastMapStyle = map.GetMapStyle();
}
function showBirdsViewAvailable() {
viewBirdseye.style.backgroundPosition = viewBirdseye.pos_inact;
assign_events(viewBirdseye,2);
viewBirdseye.onclick = viewBirdseye.actionPerform;
}
function hideBirdsViewAvailability() {
viewBirdseye.onmouseover = null;
viewBirdseye.onmouseout = null;
viewBirdseye.onclick = null;
viewBirdseye.style.backgroundPosition = viewBirdseye.pos_pass;
}
var html_el = document.getElementById("navi-viewControl");
this.getHtmlElement = function() {
return html_el;
}
this.hideBirdsView = function() {
document.getElementById("navi_birdseye_view").style.display = "none";
}
this.showBirdsView = function() {
document.getElementById("navi_birdseye_view").style.display = "block";
}
handleMapStyle();
}
function addControlToMap(control) {
control = control.getHtmlElement();
control.style.visibility = "visible";
}
function removeControlFromMap(control) {
control = control.getHtmlElement();
control.style.visibility = "hidden";
}
function set_checked_control(el, view) {
if (view == imgBirdView) {
if (!birdsLastClickedObject || (birdsLastClickedObject && birdsLastClickedObject != el)) {
birdsLastClickedObject = set_checked(el,birdsLastClickedObject);
}
} else {
if (!viewLastClickedObject || (viewLastClickedObject && viewLastClickedObject != el)) {
viewLastClickedObject = set_checked(el,viewLastClickedObject);
}
}
}
function set_checked(el, lastObject) {
if (el) {
el.style.backgroundPosition=el.pos_act;
el.onmouseout = null;
el.onmouseout = function() {
callMouseOutCursor(this);
}
if (lastObject) {
call_mouse_out(lastObject,lastObject.pos_inact);
assign_events(lastObject,2);
}
}
return el;
}
var navi_slider = new naviSliderControl();
addControlToMap(navi_slider);
var navi_pan = new naviPanControl();
addControlToMap(navi_pan);
var navi_mapstyle = new naviMapStyleControl();	
addControlToMap(navi_mapstyle);
this.reInitCtrl = function () {
navi_mapstyle = null;
navi_pan = null;
navi_pan = new naviPanControl();
addControlToMap(navi_pan);
navi_mapstyle = new naviMapStyleControl();		
addControlToMap(navi_mapstyle);
navi_slider.setSliderZoomLevel(map.GetZoomLevel());
navi_mapstyle.initCtrl();		
}
}
function assign_events(el,num) {
if (el) {
el.onmouseover = function() {
call_mouse_over(el,num);
}
el.onmouseout = function() {				
call_mouse_out(el,num);
}
}
}
function call_mouse_over(el,num) {
if ((num == 2) || ((el.style.backgroundPosition == el.pos_inact) || (el.style.backgroundPosition == el.pos_act))) {
var pos_act=el.pos_act;
} else {
var pos_act=el.pos2_act;
}
el.style.backgroundPosition = pos_act;
callMouseOverCursor(el);
}
function call_mouse_out(el,num) {
if ((num == 2) || ((el.style.backgroundPosition == el.pos_inact) || (el.style.backgroundPosition == el.pos_act))) {
var pos_inact=el.pos_inact;
} else {
var pos_inact=el.pos2_inact;
}
el.style.backgroundPosition = pos_inact;
callMouseOverCursor(el);
}
function callMouseOverCursor(el) {
el.style.cursor = "pointer";		
}
function callMouseOutCursor(el) {
el.style.cursor = "default";
}
function HideMiniMap(map) {
map.HideMiniMap();
}
function ShowMiniMap(map){
if (map.GetMapMode() == VEMapMode.Mode3D) {
map.SetMapMode(VEMapMode.Mode2D);
}
if (global_map_height > 415) {
map.ShowMiniMap(0, (global_map_height - 200));
}
}
