var maxIds= 20;
var occindex = 0.0;
var currdivObj;
var active1;
var active2;
var active3;
var active4;
var activeElements = new Array(4);
function init_accordion(){
	hide_accordion_elements(null);
	/*
	if (document.getElementById('acc1_div1')) document.getElementById('acc1_div1').style.display='block';
	if (document.getElementById('acc2_div1')) document.getElementById('acc2_div1').style.display='block';
	if (document.getElementById('acc3_div1')) document.getElementById('acc3_div1').style.display='block';
	activeElements = new Array("acc1_div1", "acc2_div1", "acc3_div1");
	*/
}

function toggle_accordion(divObj, hObj){
	currdivObj = divObj;
	isIE = false;
	if (navigator.appName.indexOf("Microsoft") >= 0){
		isIE = true;
	}
	if (divObj.style.display=='none'){
		divObj.style.display='block';
		if (!isIE){
			divObj.style.opacity = 0;
			occindex=0.0;
			divObj.style.filter = "alpha(opacity=0)";
			currdivObj = divObj;
			acc_showSlowly();
		}
		hObj.className='accordion_toggle_active';
		if (divObj.id.indexOf("acc1_div") >=0) activeElements[0] = divObj.id;
		if (divObj.id.indexOf("acc2_div") >=0) activeElements[1] = divObj.id;
		if (divObj.id.indexOf("acc3_div") >=0) activeElements[2] = divObj.id;
		if (divObj.id.indexOf("acc4_div") >=0) activeElements[3] = divObj.id;
		
	}else{
		divObj.style.display='none';
		if (!isIE){
			occindex=1.0;
			//acc_hideSlowly();
			
			//alert (currdivObj);
		}
		hObj.className='accordion_toggle';
	}
	hide_accordion_elements(divObj.id);
}

function hide_accordion_elements(id){
	for (j=1; j <=activeElements.length; j++){
		for (i=1; i <= maxIds; i++){
			ao = document.getElementById('acc'+j+'_div'+i);
			ho = document.getElementById('acc'+j+'_h'+i);
			if (ao && activeElements[(j-1)] != ao.id){
				ao.style.display = 'none';
				ho.className='accordion_toggle';
			}
		}
	}
	
}

function acc_showSlowly(){
	 if (occindex <= 1.0){
		occindex+= 0.1;
		currdivObj.style.opacity = occindex;
		currdivObj.style.filter = "alpha(opacity="+(occindex*10)+")";
		aktiv = window.setTimeout("acc_showSlowly()",45);
	}	 
}
function acc_hideSlowly(){
	 if (occindex > 0.0){
		occindex = occindex-0.1;
		currdivObj.style.opacity = 1.0;
		currdivObj.style.filter = "alpha(opacity="+(occindex*10)+")";
		aktiv = window.setTimeout("acc_hideSlowly()",45);
	 }else{
		 currdivObj.style.display = "none";
	 }	 
}

