var ARR_WINDOWS = new Array(); //{"storywrap":0, "mapwrap":0, "multimediawrap":0, "linkswrap":0});
ARR_WINDOWS["storywrap"] = 0;
ARR_WINDOWS["mapwrap"] = 0;
ARR_WINDOWS["multimediawrap"] = 0;
ARR_WINDOWS["linkswrap"] = 0;
ARR_WINDOWS["intro"] = 0;


/*
function showWindow(str){



	var p;



	for(id in ARR_WINDOWS){
	
		p=document.getElementById(id);
			
		if(id == str && ARR_WINDOWS[id] == 0){

			$(p).slideDown("slow" );
			ARR_WINDOWS[id]=1;
		}else if(id != str && ARR_WINDOWS[id] == 1){

			$(p).slideUp("slow");			
			ARR_WINDOWS[id]=0;
		}

	
	}
	
}	
*/
function showWindow(str){
	var p;
	var isF= false;
	for(id in ARR_WINDOWS){
	
		p=document.getElementById(id);
			
		if(id != str && ARR_WINDOWS[id] == 1){
			isF = true;
			$(p).slideUp("slow", function(){  
			
			
				document.getElementById("container").style.height = "1000px";
				$(document.getElementById(str)).slideDown("slow", function(){
			
				if(document.getElementById(str).offsetHeight > 600){
					document.getElementById("container").style.height = (document.getElementById(str).offsetHeight + 700) +"px";
				}
			}); ARR_WINDOWS[str]=1;  
			
			});			
			ARR_WINDOWS[id]=0;
		}

	
	}
	
	if(!isF){
			
				document.getElementById("container").style.height = "1000px";
			$(document.getElementById(str)).slideDown("slow", function(){
			
				if(document.getElementById(str).offsetHeight > 600){
					document.getElementById("container").style.height = (document.getElementById(str).offsetHeight + 700) +"px";
				}
			}); ARR_WINDOWS[str]=1;  
	
	}
	
}	

