// JavaScript Document
function getobj(itemid){
	return document.getElementById(itemid)
}

function autoswitch (itemid){
	if (getobj(itemid).style.display != "")getobj(itemid).style.display = "";
	else getobj(itemid).style.display = "none";
}

function changClass(Front,id,count,de_class,indexclass,show){
	for(i=1;i<=count;i++){
		getobj(Front + i).className = de_class;
		if (show != false){
			getobj(Front + "S_" + i).style.display = "none";
		}
	}
	
	getobj(Front + id).className = indexclass;
	if (show != false){
		getobj(Front + "S_" + id).style.display = "";
	}
}

function onechangClass(itemid,indexclass){
		getobj(itemid).className = indexclass;
}


function changview (Front,id,count){
	for(i=1;i<=count;i++){
		getobj(Front + i).style.display = "none";
	}
	
	getobj(Front + id).style.display = "";
}

function allchangClass(form,itemid,de_class,indexclass){
	var form = getobj(form);
	var item_arr = form.getElementsByTagName('li');
    for (var i=0;i<item_arr.length;i++){
		var e = item_arr[i];
		if (e.title == 'sidebar_items')
			e.className = de_class;
	}
	getobj(itemid).className = indexclass;
}
