areas = new Array("ausbildung","rehab","wohnen","industrie","gewerbe","innen","stadtbau","kultur","ueberuns","leistungen","partner","links");

calls = new Array();
calls['ausbildung']	 = new Array('left','top');
calls['rehab']		 = new Array('right','top');
calls['wohnen']		 = new Array('left','top');
calls['industrie']	 = new Array('right','top');
calls['gewerbe']	 = new Array('left','bottom');
calls['innen']		 = new Array('right','bottom');
calls['stadtbau']	 = new Array('left','bottom');
calls['kultur']		 = new Array('right','bottom');
calls['ueberuns']	 = new Array('left','top');
calls['leistungen']	 = new Array('right','top');
calls['partner']	 = new Array('left','bottom');
calls['links']		 = new Array('right','bottom');

colors = new Array();
colors['ausbildung'] = new Array('#ac2623','#8c8c8c');
colors['rehab']		 = new Array('#9e5d01','#808080');
colors['wohnen']	 = new Array('#006a7a','#858585');
colors['industrie']	 = new Array('#00484f','808080');
colors['gewerbe']	 = new Array('#664b78','#737373');
colors['innen']		 = new Array('#c1b40d','#858585');
colors['stadtbau']	 = new Array('#f6a20b','#9b9b9b');
//colors['kultur']	 = new Array('#a0d2ed','#858585'); ALTES BLAU
colors['kultur']	 = new Array('#499bc7','#858585');
colors['ueberuns']	 = new Array('#9e5d01','#8c8c8c');
colors['leistungen'] = new Array('#006a7a','#737373');
colors['partner']	 = new Array('#f6a20b','#737373');
//colors['links']	 	 = new Array('#a0d2ed','#797979'); ALTES BLAU
colors['links']	 	 = new Array('#499bc7','#797979');

var naviview='';
var otherside='';
var categoryopen='';
function initcat(what,side,thisdirection,language) {
	if(categoryopen==what) {
		closeall();
		categoryopen=''
	} else {
		jQuery.each(areas, function() {
			if(this==what) {
				$('#'+what).css('background-color',colors[what][0]);
				if(what=='ueberuns' || what=='leistungen' || what=='partner' || what=='links') {
					$('#'+this).css('backgroundImage','url(../../images/btn_'+this+'.gif)'); 
				} else {
					$('#'+this).css('backgroundImage','url(../images/btn_'+this+'.gif)'); 
				}
			} else {
				$('#'+this).css('background-color',colors[this][1]);
				if(what=='ueberuns' || what=='leistungen' || what=='partner' || what=='links') {
					$('#'+this).css('backgroundImage','url(../../images/btn_'+this+'_passiv.gif)'); 
				} else {
					$('#'+this).css('backgroundImage','url(../images/btn_'+this+'_passiv.gif)'); 
				}
			}
		});	
		
		if(side=='left') { otherside='right'; } else { otherside='left'; }
		if(naviview) { 
			window.setTimeout("up()",0);
			window.setTimeout("down('"+what+"','"+side+"','"+thisdirection+"','"+language+"')",400);
		} else {
			window.setTimeout("down('"+what+"','"+side+"','"+thisdirection+"','"+language+"')",0);
		}
		categoryopen=what;
	}
}

function up() {
	$("#left_top").hide("fast");
	$("#right_top").hide("fast");
	$("#left_bottom").hide("fast");
	$("#right_bottom").hide("fast");
	
	window.setTimeout("clearids()",200);
	naviview='';
}

function clearids() {
	$("#left_top").html("&nbsp;");
	$("#right_top").html("&nbsp;");
	$("#left_bottom").html("&nbsp;");
	$("#right_bottom").html("&nbsp;");
	$('#top').css('background-color','#808080'); 
	$('#bottom').css('background-color','#808080');
	$('#left_top_td').css('background-color','#808080'); 
	$('#left_bottom_td').css('background-color','#808080');
	$('#right_top_td').css('background-color','#808080'); 
	$('#right_bottom_td').css('background-color','#808080');
}

function down(what,side,thisdirection,language) {
	//alert(what+'--'+side+'--'+direction);
		
	if(side=='left') { otherside='right'; } else { otherside='left'; }
	if(thisdirection=='top') { otherdirection='bottom'; } else { otherdirection='top'; }
	
	$('#'+thisdirection).css('background-color','#ffffff'); 
	$('#'+otherdirection).css('background-color','#808080');
	
	elementside=side+'_'+thisdirection;
	elementotherside=otherside+'_'+thisdirection;	
	otherelementside=side+'_'+otherdirection;
	otherelementotherside=otherside+'_'+otherdirection;
	
	$("#"+elementotherside).html("&nbsp;");
	$("#"+elementotherside).show("fast");
	//alert(what+'--'+side+'--'+elementside+'--'+language);
	
	if(what=='ueberuns' || what=='leistungen' || what=='partner' || what=='links') {
	$("#"+elementside).load("../../ueberuns_kategorie.php?language="+language+"&cat="+what+"&side="+side+"&thisdirection="+thisdirection);
	} else {
	$("#"+elementside).load("../home_kategorie.php?language="+language+"&cat="+what+"&side="+side+"&thisdirection="+thisdirection+'&neubau='+selector['neubau']+'&sanierung='+selector['sanierung']+'&umbau='+selector['umbau']+'&modular='+selector['modular']+'&planung='+selector['planung']);
	}
	$("#"+elementside).ajaxComplete(function(request, settings){
  		$("#"+elementside).show("fast");
 	});
	naviview=what;
}

function closeall() {
	window.setTimeout("up()",0);
	jQuery.each(areas, function() {
		$('#'+this).css('background-color',colors[this][1]);
		if(this=='ueberuns' || this=='leistungen' || this=='partner' || this=='links') {
			$('#'+this).css('backgroundImage','url(../../images/btn_'+this+'.gif)');
		} else {
			$('#'+this).css('backgroundImage','url(../images/btn_'+this+'.gif)');
		}
	});
}

function closeall_ueberuns() {
	window.setTimeout("up()",0);
	jQuery.each(areas, function() {
		$('#'+this).css('background-color',colors[this][1]);
		$('#'+this).css('backgroundImage','url(../../images/btn_'+this+'.gif)');
	});
}


function buttonover(what) {
	if(naviview && naviview!=what) {
		if(what=='ueberuns' || what=='leistungen' || what=='partner' || what=='links') {
			$('#'+what).css('backgroundImage','url(../../images/btn_'+what+'.gif)');
		} else {
			$('#'+what).css('backgroundImage','url(../images/btn_'+what+'.gif)'); 
		}
	}
}

function buttonout(what) {
	if(naviview && naviview!=what) {
		if(what=='ueberuns' || what=='leistungen' || what=='partner' || what=='links') {
			$('#'+what).css('backgroundImage','url(../../images/btn_'+what+'_passiv.gif)'); 
		} else {
			$('#'+what).css('backgroundImage','url(../images/btn_'+what+'_passiv.gif)'); 
		}
	}
}


var datenelement='daten';

function contentchange(what) {
	datenid='project_'+what+'_daten';
	beschreibungid='project_'+what+'_beschreibung';
	datenlinkid='project_'+what+'_datenlink';
	beschreibunglinkid='project_'+what+'_beschreibunglink';
	if(datenelement=='daten') {
		window.setTimeout("hidedaten('"+datenid+"')",0);
		window.setTimeout("showdaten('"+beschreibungid+"')",500);
		$('#'+beschreibunglinkid).css('display','none');
		$('#'+datenlinkid).css('display','');
		datenelement='beschreibung';
	} else {
		window.setTimeout("hidedaten('"+beschreibungid+"')",0);
		window.setTimeout("showdaten('"+datenid+"')",500);
		$('#'+datenlinkid).css('display','none');
		$('#'+beschreibunglinkid).css('display','');
		datenelement='daten';
	}
}

function showdaten(what) {
	$("#"+what).show("slow");
}

function hidedaten(what) {
	$("#"+what).hide("slow");
}

function printView() {
	
}

var actualsize=0;
function changeSize() {
	if(actualsize==0) {
		$('#navigation').css('font-size','14px');
		$('#hinweis').css('font-size','14px');
		actualsize=1;
	} else {
		$('#navigation').css('font-size','12px');
		$('#hinweis').css('font-size','12px');
		actualsize=0;
	}
}

function bookmark(title,url) {
	if (window.sidebar) { // Firefox		
		window.sidebar.addPanel('PLP - '+title, url,"");	
	} else if( window.external ) { // IE		
		window.external.AddFavorite( url, 'PLP - '+title); 
	}	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
          elem.setAttribute('href',url);
          elem.setAttribute('title','PLP - '+title);
          elem.setAttribute('rel','sidebar');
          elem.click();
	} else {
		alert ('Bitte benutzen Sie die folgende Tastenkombination um diese \nSeite zu Ihren Lesezeichen hinzuzufügen:\n\nFür PC:\n STRG und D\n\nFür Apple Macintosh:\n CMD bzw. Apfeltaste und D');
	}
}

