// JavaScript Document
var zustand = 1;
var lastid = 0;
function slideUp(id){
	if(zustand == 0){
		Effect.Fade(id);
		zustand = 1;
		$('slider').className = "btn-slide-down";
	}
	else{
		Effect.BlindDown(id);
		zustand = 0;
		$('slider').className = "btn-slide-up";
	}
}

function alarm(test){
 window.alert("Ausgabe: " + test);
}

function detail(id){
	if(lastid==0){
		Effect.BlindDown(id);
	    lastid = id;
	}else if(lastid == id){
		Effect.BlindUp(id);
		lastid = 0;
	}else{
		Effect.BlindDown(id);
		Effect.BlindUp(lastid);
		lastid = id;
	}
}

function dropIn(id){
	if(lastid==0){
		Effect.Appear(id, { duration: 0.2, from: 0, to: 0.9 });
	    lastid = id;
	}else{
		Effect.Appear(id, { duration: 0.2, from: 0, to: 0.9 });
		Effect.Fade(lastid, { duration: 0.8 });
		lastid = id;
	}
}

// Companies
var dd1 = 0;
var dd2 = 0;
function drop_down(id1, id2){
	Effect.BlindDown(id1, { duration: 0.2, from: 0, to: 0.9 });
	Effect.BlindUp(id2, { duration: 0.2, from: 0, to: 0.9 });

	
	if(dd1 != 0 && dd2 != 0){
		drop_up(dd2, dd1);
	}
	dd1 = id1;
	dd2 = id2;
		
}

function drop_up(id1, id2){
	dd1 = 0;
	dd2 = 0;
	Effect.BlindDown(id1, { duration: 0.2, from: 0, to: 0.9 });
	Effect.BlindUp(id2, { duration: 0.2, from: 0, to: 0.9 });
}

function setStatus(type, val){
	if(type == 'state'){
		$('company_state').Value = val;
	}
}