var maxHeight = 215;
var m1 = null;

preloadImages('/V2/gfx/menu_services_hover.gif');
preloadImages('/V2/gfx/menu_community_hover.gif');
preloadImages('/V2/gfx/menu_suchen_hover.gif');

function closer(index) {
    this.popup = document.getElementById("spanMenuPlace" + index);
    this.whatToDo = 0;
    this.name = "m" + index;
}
closer.prototype.ShowHideMenu = function(whatHaveToDo){
	var timerShowSpan;
	var CurrentSize;
	
	var popup = this.popup;
	
	if ((whatHaveToDo>-1)&&(whatHaveToDo<3)) {
	    this.whatToDo = whatHaveToDo;
	}
	
	if (popup.style.height=="") {
			popup.style.height="10px";
	}
	
	CurrentSize = popup.style.height.slice(0,popup.style.height.length-2);
	CurrentSize--;
	
	if (this.whatToDo == 1){
		popup.style.visibility = "visible";
		if (CurrentSize<(maxHeight-10)) {
			timerShowSpan = setTimeout(this.name + ".ShowHideMenu()",20)
			popup.style.height=parseInt(CurrentSize+10) + "px";
		}
		else{
			this.whatToDo = 0;
			popup.style.height=parseInt(maxHeight) + "px";
		}
	}
	if (this.whatToDo == 2){
		if (CurrentSize>10) {
			timerShowSpan = setTimeout(this.name + ".ShowHideMenu()",20)
			popup.style.height=parseInt(CurrentSize-10) + "px";
		}
		else{
			this.whatToDo = 0;
			popup.style.height="1px";
			popup.style.visibility = "hidden";
		}
	}
}

function init_language() {
    m1 = new closer(1);
}

function preloadImages() {
  if (document.images) {
    var imgFiles = preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
    var i = document.preloadArray.length;
    with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
      preloadArray[i] = new Image;
      preloadArray[i++].src = imgFiles[j];
  } }
}
