
	/**
	 * right sizes for background image
	 */
	startImage = function() {
		var dimensions = $('bgStart').getDimensions();
		
		var imageWidth = 1230;
		var imageHeight = 948;
		var relation = 1.297;
		
		var screenWidth = dimensions.width;
		var screenHeight = dimensions.height;

		if (screenWidth < imageWidth && screenHeight < imageHeight) {

			if (screenWidth / screenHeight < relation) {
				$('bgStartImg').writeAttribute('width', screenHeight*relation);
				$('bgStartImg').writeAttribute('height', screenHeight);
			} else {
				$('bgStartImg').writeAttribute('width', screenWidth);
				$('bgStartImg').writeAttribute('height', screenWidth/relation);
			}
			
		} else {
			$('bgStartImg').writeAttribute('width', imageWidth);
			$('bgStartImg').writeAttribute('height', imageHeight);
		}
	}

	/**
	 * switch background image for the navigation items
	 * below the university map
	 */
	mapNav = function(current) {
		$$('div.mapNav a').each(function(element) {
			
			var className = element.getAttribute('class');
			var classNameNew = className.replace('active', '');
						
			element.writeAttribute('class', classNameNew);					
		});
		
		var className = current.getAttribute('class');
		var classNameNew = className.replace('active', '') + 'active';
		current.writeAttribute('class', classNameNew);
	}
	
	/**
	 * replace the university map after a new type selection 
	 * by click on a text link
	 */
	mapReplace = function(newImageName) {
		$('universityMap').writeAttribute('src', 'images/maps/' + newImageName + '.gif');
	}
	
	/**
	 * switch radio button image for each survey answer option
	 */
	surveyNav = function(current) {
		$$('ul.survey li').each(function(element) {
			element.writeAttribute('style', 'background-image:url(fileadmin/templates/images/buttons/surveyOff.gif)');					
		});		
		current.writeAttribute('style', 'background-image:url(fileadmin/templates/images/buttons/surveyOn.gif)');
	}
	
	/**
	 * teaser image rotation on overview page
	 */
	teaserRotate = function() {		
		if (t == 1) {
			$('portrait1').setStyle({zIndex: '30'});
			$('portrait2').setStyle({zIndex: '20'});
			$('portrait3').setStyle({zIndex: '10'});
			new Effect.Opacity('portrait1', { from: 0.4, to: 1.0, duration: 0.5 });
			new Effect.Opacity('portrait2', { from: 1.0, to: 0.4, duration: 0.5 });
			new Effect.Opacity('portrait3', { from: 1.0, to: 0.4, duration: 0.5 });

		}
		if (t == 2) {
			$('portrait1').setStyle({zIndex: '20'});
			$('portrait2').setStyle({zIndex: '30'});
			$('portrait3').setStyle({zIndex: '10'});
			new Effect.Opacity('portrait2', { from: 0.4, to: 1.0, duration: 0.5 });
			new Effect.Opacity('portrait1', { from: 1.0, to: 0.4, duration: 0.5 });
			new Effect.Opacity('portrait3', { from: 1.0, to: 0.4, duration: 0.5 });
		}
		if (t == 3) {
			$('portrait1').setStyle({zIndex: '10'});
			$('portrait2').setStyle({zIndex: '20'});
			$('portrait3').setStyle({zIndex: '30'});
			new Effect.Opacity('portrait3', { from: 0.4, to: 1.0, duration: 0.5 });
			new Effect.Opacity('portrait2', { from: 1.0, to: 0.4, duration: 0.5 });
			new Effect.Opacity('portrait1', { from: 1.0, to: 0.4, duration: 0.5 });
		}
		
		t = t+1;
		
		if (t > 3) {
			t = 1;
		}
	}
	
	/**
	 * toggle teasers on overview page
	 */
	var openPraxisContent = null;
	togglePraxis = function(current) {
		var idName = current.getAttribute('id');
		var idNameContent = idName.replace('Headline', 'Content');
					
		if (idNameContent != openPraxisContent) {
			if (openPraxisContent != null) {
				Effect.BlindUp(openPraxisContent, { duration: 0.3 });
				$(openPraxisContent.replace('Content','Headline')).setStyle({backgroundImage: 'url(fileadmin/templates/images/icons/down.gif)'});
			}
			Effect.BlindDown(idNameContent, { duration: 0.7 });
			$(idName).setStyle({backgroundImage: 'url(fileadmin/templates/images/icons/up.gif)'});
			openPraxisContent = idNameContent;
		}
	}
	
	var openSidebarContent = null;
	portraitSidebar = function(current) {
		if (current.identify() != openSidebarContent) {
			$$('div.portraitSidebarDetail').each(function(element) {
				if (element.getStyle('display') == 'block') {
					new Effect.BlindUp(element.identify());
					element.previous().setStyle({backgroundImage: 'url(fileadmin/templates/images/icons/down.gif)'});
				}					
			});	
			new Effect.BlindDown(current.next().identify());
			current.setStyle({backgroundImage: 'url(fileadmin/templates/images/icons/up.gif)'});
			openSidebarContent = current.identify();
		}
	}