var ROOT_DIR;

function scan_page()	{
	preload(document.images.length)
}
function preload(num)	{
	for (i = 0; i <= num-1; i++) load_img(document.images[i].name)
}
function load_img(name)	{
	this.over=new Image(); 
	this.over.src=ROOT_DIR+'images/button/'+name+'_o.gif';
}
function img(imgName, onOff) {
	if (document.images) {
		if (onOff == 1)	{
			document.getElementById(imgName).src = ROOT_DIR+'images/button/'+imgName+'_o.gif';
		}
		if (onOff == 0)	{
			document.getElementById(imgName).src = ROOT_DIR+'images/button/'+imgName+'.gif';
		}	
	}
}

window.onload = function(){ 	
	$('div#movedown').hide();

	$("a.buttonlink_").click(function(){	
		$("div#movedown").toggle("fast");
		return false;
	});

	$("div#detailfull").click(function(){	
		$("div#close").css({ 'background' : 'none' });
		$("div#close").html("");
		$("div#detailfull").hide();
		return false;
	});

	$("div.detailoff_bm").hover(function(){	
		$("div#close").html("");
        $("div#daten").html("		<h1>DATEN & FAKTEN<br />&nbsp;</h1>		<p>&nbsp;</p>		<p>&nbsp;</p>		<p>&nbsp;</p>		<table class='datenfakten'>   <tr>    <td style='padding-bottom: 0;'>Baufeldgröße:</td>    <td valign='bottom' style='padding-bottom: 0;'>ca. 62.000 m&sup2;</td>   </tr>   <tr>    <td>davon verkauft</td><td>ca. 7.300 m&sup2;</td>   </tr>   <tr>    <td>BGF Wohnen:</td>    <td valign='bottom'>ca. 53.000 m&sup2;</td>   </tr>   <tr>    <td>BGF Büro /<br> Gewerbe /<br> Dienstleistung:</td>    <td valign='bottom'>ca. 217.000 m&sup2;</td>   </tr>   <tr>    <td>davon<br>Hochhäuser:</td>    <td nowrap valign='bottom'>ca. 88.000 m&sup2;</td>   </tr>   </table>");    
		ORG = "<h1>Präsentieren und Repräsentieren</h1><p>Der Boulevard Mitte gehört zur Repräsentiermeile Europa-Allee. Unmittelbar an der Messe gelegen, setzt er auf urbane, gewerbliche Nutzungen wie Büro, Hotel, Gastronomie und ausgewählten Einzelhandel. Der ideale Standort für erfolgreiche Unternehmen, Werbeagenturen, Rechtsanwaltskanzleien und Arztpraxen.</p>";
		$("div#textbot").html(ORG);
		return false;
	});

	$("div#detailoff_bw").hover(function(){	
        $("div#daten").html("<h1>DATEN & FAKTEN<br />&nbsp;</h1><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <table class='datenfakten'>   <tr>    <td style='padding-bottom: 0;'>Baufeldgröße:</td>    <td valign='bottom' style='padding-bottom: 0;'>ca. 41.000 m&sup2;</td>   </tr>   <tr>    <td colspan='2' style='padding-bottom: 0;'>davon verkauft ca. 9.600 m&sup2;</td>   </tr>   <tr>    <td colspan='2'>davon reserviert ca. 5.700 m&sup2;</td>   </tr>   <tr>    <td>BGF Wohnen:</td>    <td valign='bottom'>ca. 40.000 m&sup2;</td>   </tr>   <tr>    <td>BGF Büro /<br>Gewerbe / <br>Dienstleistung / <br>Gastronomie:</td>    <td valign='bottom' nowrap>ca. 83.000 m&sup2;</td>   </tr>   <tr>    <td>davon<br>Hochhäuser:</td>    <td nowrap valign='bottom'>ca. 36.000 m&sup2;</td>   </tr>   </table>");     
		$("div#close").html("");

		return false;
	});

	$("div#detailoff_hh").hover(function(){	
        $("div#daten").html("		<h1>DATEN & FAKTEN<br />&nbsp;</h1>		<p>&nbsp;</p>		<p>&nbsp;</p>		<p>&nbsp;</p>		<table class='datenfakten'>   <tr>    <td>Einwohner:</td>    <td valign='bottom'>ca. 1.000</td>   </tr>   <tr>    <td>Baufeldgröße:</td>    <td valign='bottom'>ca. 26.000 m&sup2;</td>   </tr>   <tr>    <td>Schulen und<br>Kindertages-<br>stätten:</td>    <td valign='bottom'>ca. 10.200 m&sup2;</td>   </tr>   <tr>    <td>BGF Wohnen:</td>    <td valign='bottom'>ca. 49.000 m&sup2;</td>   </tr>   <tr>    <td>Wohneinheiten:</td>    <td nowrap valign='bottom'>ca. 460</td>   </tr>   </table> ");     
		$("div#close").html("");

		return false;
	});

	$("a.beweis").hover(function(){
		id = $(this).attr('id');
		// alert(id);
		dir = "http://www.europaviertel.de/";
		// dir = "http://localhost/aurelisEV/";
		
		$("div#w"+id).css({
		  'background' : 'url('+dir+'images/plan/'+id+'.jpg)'
		});
		
        	bgf = "NO";
			ga = "MK";
			bf = "-";
			gg = "-";
			qu = "-";
			
			if(id == "t44"){
				bgf = "22.000";
				gg = "6.907";
				bf = "44";
				qu = "bm";
			}
			else if(id == "t43"){
				bgf = "39.799";
				gg = "6.796";
				bf = "43";
				qu = "bm";
			}
			else if(id == "t42"){
				bgf = "57.644";
				gg = "10.339";
				bf = "42c";
				qu = "bm";
			}
			else if(id == "t42b"){
				bgf = "26.822";
				gg = "7.739";
				bf = "42b";
				qu = "bm";
			}
			else if(id == "t22"){
				bgf = "35.144";
				gg = "5.054";
				bf = "22/23";
				qu = "bm";
			}
			else if(id == "t27"){
				qu = "bm";				
			}
			else if(id == "t26"){
				qu = "bm";				
				bgf = "T26";
			}
			else if(id == "t28"){
				bgf = "18.780";
				gg = "4.478";
				bf = "28";
				qu = "bm";
			}		
			else if(id == "t1c"){
				bgf = "10.422";
				gg = "6.475";
				bf = "1c/1d";
				ga = "WA";
			}		
			else if(id == "t1b"){
				gg = "12.645";
				bgf = "27.954";
				bf = "1b";
				ga = "WA";
			}		
			else if(id == "t1a"){
				gg = "7.139";
				bgf = "10.293";
				bf = "1a";
				ga = "WA";
			}		
			else if(id == "t4d"){
				gg = "7.373";
				bgf = "24.800";
				bf = "4d";
			}		
			else if(id == "t4c"){
				gg = "5.634";
				bgf = "11.875";
				bf = "4c";
				ga = "MI";
			}		
			else if(id == "t4b"){
				gg = "4.899";
				bgf = "11.804";
				bf = "4b";
				ga = "MI";
			}		
			else if(id == "t4a"){
				gg = "6.535";
				bgf = "18.101";
				bf = "4a";
				ga = "MK";
			}		
			else if(id == "t3e"){
				gg = "800";
				bgf = "1.256";
				bf = "3e";
				ga = "MK";
			}		
			else if(id == "t3d"){
				gg = "4.722";
				bgf = "18.997";
				bf = "3d";
				ga = "MK";
			}		
			else if(id == "t3c"){
				gg = "2.551";
				bgf = "9.279";
				bf = "3c";
				ga = "MK";
			}		
			else if(id == "t3b"){
				gg = "3.131";
				bgf = "10.203";
				bf = "3b";
				ga = "MK";
			}		
			else if(id == "t3a"){
				gg = "4.620";
				bgf = "18.101";
				bf = "3a";
				ga = "MK";
			}		

		// standard text
		
        var whtml = "<h1>DATEN & FAKTEN<br />BAUFELD "+bf+"</h1><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><table class=datenfakten><tr><td>Geplante<br>Ausweisung:</td><td valign=bottom>"+ga+"</td></tr><tr><td>Grundstücks- größe:</td><td valign=bottom>ca. "+gg+" m&sup2;</td></tr><tr><td>Geplante<br>BGF:</td><td nowrap valign=bottom>ca. "+bgf+" m&sup2;</td></tr><tr><td colspan=2>B-Plan rechtskräftig,<br />Planreife vorhanden</td></tr></table>";      

		if(bgf == "NO") {
			whtml = "<a href='http://www.boulevard-mitte.de/pdf/Office_27_Europaviertel_West.pdf' target='_blank'><img src='http://www.europaviertel.de/images/office27.jpg' style='margin-top:-20px;'></a><p style='margin-left:6px;'>&nbsp;<br /><a href='http://www.boulevard-mitte.de/pdf/Office_27_Europaviertel_West.pdf' target='_blank'>DOWNLOAD ></a><br />BROSCHÜRE OFFICE 27</p>";		
		
			ORG = "<h1>OFFICE 27</h1><ul class='planli'><li>7-geschossiges Büroensemble in repräsentativer Architektur <li>Nutzung: Büro, zzgl. Gewerbe und Gastronomie im EG <li>Gesamtmietfläche Obergeschosse ca. 23.125 m2 (pro Etage ca. 1.150 m2 BT A / ca. 2.250 m2 BT B, teilbar in max. 400 m2) <li>Sehr gute Lage im Quartier 'Boulevard Mitte' an der 60 Meter breiten Europa-Allee <li>Direkte Verkehrsanbindung über S-Bahn und Autobahn zu Flughafen, Hauptbahnhof und City Frankfurt <li>Direkte Nachbarschaft zur Messe Frankfurt <li>Exklusives, weltstädtisches Ambiente mit grünem Flair direkt am Europagarten (Durchmischung Wohn- und Büronutzung, Grünanlagen, Hotels, Gastronomie) <li>Gute Infrastruktur (Supermärkte, Ärzte, Schulen, Kitas etc.) <li>Erstklassiger Nutzerkomfort durch hochwertige Ausstattung, helles, grünes Ambiente (Dach- und Terrassengärten) und modernste Haustechnik <li>Vorzertifizierbar nach DGNB-Richtlinien </ul><p>&nbsp;</p><br style='clear:left;'>";
			$("div#textbot").html(ORG);
		}
		else if(bgf == "T26") {
			whtml = "<img src='http://www.europaviertel.de/images/baufeld26.jpg' style='margin:-20px 0 0 -7px;'>";		
		
			ORG = "<h1>BAUFELD  26</h1><ul class='planli'><li>5- bis 7-geschossiges Büroensemble<li>moderne  Architektur<li>individuelle Adressen<li>Nutzung: Büro, zzgl. Gastronomie im  EG<li>Gesamtmietfläche ca. 37.000 m²<li>modulare Bauabschnitte<li>teilbar ab  400 m²<li>erstklassiger Nutzerkomfort<li>helles Ambiente mit  Innenhofgärten</ul><p>&nbsp;</p><br style='clear:left;'>";
			$("div#textbot").html(ORG);
		}

		
        $("div#daten").html(whtml);     

	},
	  function () {
		$("div.all").css({
		  'background' : 'none'
		});
  })
}


function disp(id){
	$("div#detailfull").css({
	  'background' : 'url(http://www.europaviertel.de/images/plan/'+id+'_det.jpg)'
	});

	$("div#detailfull").show();
	
	$("div#close").css({ 'background' : '#f59b00' });
	$("div#close").html("<a href='javascript:close_data();'>&nbsp;&nbsp;&nbsp;FLÄCHENANGABEN &nbsp;&nbsp;&nbsp;   | ZURÜCK</a>");
}

function close_data(){	
	$("div#close").html("");
	$("div#close").css({ 'background' : 'none' });
	$("div#detailfull").hide();
};

function movedown (normal,over){	
	// alert($("div#movedown").css("display"));
	if ($("div#movedown").css("display") == "none") $("a.buttonlink").css({	  'background' : 'url(http://www.europaviertel.de/images/'+over+'.jpg)'	});  
	else $("a.buttonlink").css({	  'background' : 'url(http://www.europaviertel.de/images/'+normal+'.jpg)'	});

	// MUSS HINTER DIE ABFRAGE !!!!
	$("div#movedown").toggle("fast");	
};

function chgemo(txtnl, txtzu, container, img1, img2, mydiv) {
	// >ÜBERSICHT ÖPNV >#zurück#content_container#lage_und_anbindung#lage_und_anbindung_nv

	// now = $("div#"+container).css("background-image")
	tmp = $("span#"+mydiv).css("background-color");
	// if (tmp == "transparent")  alert(tmp);
	 
	// transparent, wenn normal
	if (tmp == "transparent") {
		$("div#"+container).css({	 'background-image' : 'url(http://www.europaviertel.de/images/emotional/'+img2+'.jpg)' });  

		$("span#"+mydiv).css({	  'background-color' : '#f59b00'	});
		$("span#"+mydiv).html(txtzu);
	}
	
	else {
		$("div#"+container).css({	 'background-image' : 'url(http://www.europaviertel.de/images/emotional/'+img1+'.jpg)' });  
		$("span#"+mydiv).css({	  'background-color' : 'transparent'	});
		$("span#"+mydiv).html(txtnl);
		
	}
}
