
// initialisierung
var act_left_popup = 'popup';
var act_right_border = ''
var activate_int = '1'

function change_mousepointer (id, cursorstyle) {
  document.getElementById(id).style.cursor=cursorstyle;
}

function display_overlays(id,count){	
	for (i=1;i<=count;i++){
		sub_id = id + '_' + i;		
		new Effect.Appear(sub_id, {duration: 1});	
	}
}

function display_left(show_id,master_id){	
				
	// alter rechter Rahmen zurücksetzen
	if (act_right_border != ''){
		document.getElementById(act_right_border).style.border = '1px solid #fff';
	}
	// neu rechts dicker Rahmen
	document.getElementById(master_id).style.border = '2px solid #fff';
	act_right_border = master_id;
	
	// neu links alt ausblenden + neuanzeigen
	if (show_id != act_left_popup){
		new Effect.Fade(act_left_popup,{Duration: 0});
	}	
	new Effect.Appear(show_id, {duration: 1});
	act_left_popup=show_id;	
		
}

function activate (master_int){
	if (master_int != activate_int){		
		// alten ausblenden
		if (document.getElementById('master'+activate_int)){
			document.getElementById('master'+activate_int).style.display = 'none';
		}
		document.getElementById('steuer'+activate_int).style.backgroundColor = 'transparent';	
		// alter rechter Rahmen zurücksetzen
		if (act_right_border != ''){
			document.getElementById(act_right_border).style.border = '1px solid #fff';
			act_right_border = ''
		}
		// standard popup linke Spalte herstellen
		if (act_left_popup != 'popup'){
			new Effect.Fade(act_left_popup,{Duration: 0});
			act_left_popup = 'popup';
			new Effect.Appear(act_left_popup, {duration: 1});
		}
		
		//neuen einblenden
		if (document.getElementById('master'+master_int)){
			document.getElementById('master'+master_int).style.display = 'block';
		}
		document.getElementById('steuer'+master_int).style.backgroundColor = 'red';			

		
	
		activate_int = master_int;
	} 			
}

function activate2 (master_int,count_overlays){
	if (master_int != activate_int){		
		window.scrollTo(0,document.getElementById('mood').offsetTop);
		// alten ausblenden
		if (document.getElementById('master'+activate_int)){
			//document.getElementById('master'+activate_int).style.display = 'none';
			new Effect.Fade(document.getElementById('master'+activate_int),{Duration: 0});
			//document.getElementById('zitat'+activate_int).style.display = 'none';
			new Effect.Fade(document.getElementById('zitat'+activate_int),{Duration: 0});
		}
		document.getElementById('steuer'+activate_int).className = '';	
		// alter rechter Rahmen zurücksetzen
		if (act_right_border != ''){
			document.getElementById(act_right_border).style.border = '1px solid #fff';
			act_right_border = ''
		}
		// standard popup linke Spalte herstellen
		if (act_left_popup != 'popup'){
			new Effect.Fade(act_left_popup,{Duration: 0});
			act_left_popup = 'popup';
			new Effect.Appear(act_left_popup, {duration: 1});
		}
		
		//neuen einblenden
		if (document.getElementById('master'+master_int)){
			//document.getElementById('master'+master_int).style.display = 'block';
			new Effect.Appear(document.getElementById('master'+master_int),{Duration: 0});
			//document.getElementById('zitat'+master_int).style.display = 'block';
			new Effect.Appear(document.getElementById('zitat'+master_int),{Duration: 0});
			// overlays einblenden
			//display_overlays('master'+master_int,count_overlays);
			func_call = "display_overlays('master"+master_int+"',"+count_overlays+")";			
			window.setTimeout(func_call, 1000);			
		}
		document.getElementById('steuer'+master_int).className = 'active';			
			
		activate_int = master_int;
	} 				
}

function open_prod_window (Adresse) {
  MeinFenster = window.open(Adresse, "Zweitfenster", "width=770,height=770,left=10,top=10,scrollbars=yes,resizable=yes");
  MeinFenster.focus();
}

var active_glossar_id = '';
function toggle_glossar(objectid){
	// aktiven Glossar-Punkt schliessen
	if (active_glossar_id != ''){
		Effect.Fade(active_glossar_id,{duration: 1, queue:'parallel'})	
	}
	if (active_glossar_id != objectid){		
		Effect.Appear(objectid,{queue:'parallel'})
		active_glossar_id = objectid;
	} else {
			active_glossar_id = '';
	}

}
