function hide_chel(){
		$('.main_chel_hidden_sub').each(function(){
			$(this).find('div').css({'display':'none'});
			$(this).find('.main_chel_title').css({'borderWidth':'0px 0px 1px 0px', 'marginBottom':'10px'});
			$(this).removeClass('chel_h');
		})
}

$(document).ready(function(){

	$(document).click(function(e){
		var targ=  $(e.target);
		if (($(targ).hasClass('main_chel_content')== false)  
		&& ($(targ).hasClass('main_chel_sub')== false) 
		&& ($(targ).hasClass('main_chel_content')== false) 
		&& ($(targ).hasClass('main_chel_title')== false) 
		&& ($(targ).hasClass('main_chel_hidden_sub')== false) 
		){
			hide_chel();
		}
	})
	
	$('.main_chel_title').click(function(){
		var hid=$(this).parent();
		if ($(hid).find('div').css('display')=='block'){
			hide_chel();
			return;
		} else {
			hide_chel();
		}
		$(this).css({'borderWidth':'0px', 'marginBottom':'11px'})
		$(hid).find('div').css({'display':'block'});
		$(hid).addClass('chel_h');
		//if (! $.browser.msie) 
		$(hid).css({'opacity':'0.9'});
		//$(hid).parent().find(".dropShadow").show();
		//var z = parseInt($(hid).css('zIndex'));
		//$(hid).parent().find(".dropShadow").css({'zIndex':z-1})
	})
	/*if ($.browser.safari!=true && $.browser.opera!=true){
		if ($.browser.msie!=true){
			$('.main_chel_hidden_sub').dropShadow({top: -1, left: -1, blur: 4, color: '#ededed'});
		} else {
			$('.main_chel_hidden_sub').dropShadow({top: 0, left: 0, blur: 3, color: '#625656'});
		}
		$(".dropShadow").hide();
		var new_z=300;
		$('.main_chel_hidden_sub').each(function(){
			$(this).css({'zIndex':new_z});
			new_z-=100;
		})
		$('.main_chel_hidden_sub').removeClass('chel_h');
		$('.main_chel_hidden_sub').find('div').css({'display':'none'});
	}*/
	$('.main_chel_hidden_sub').find('div').css({'display':'none'});
	$('.main_chel_hidden_sub').removeClass('chel_h');
	/*$('.main_chel_hidden_sub').mouseout(function(e){
		var targ= e.toElement || e.relatedTarget;
		if (! is_parent(targ, this)){
			$(this).find('div').css({'display':'none'});
			$(this).find('.main_chel_title').css({'borderWidth':'0px 0px 1px 0px', 'marginBottom':'10px'});
			$(this).removeClass('chel_h');
			if (! $.browser.msie) $(this).css({'opacity':'1'});
			//$(this).parent().find(".dropShadow").hide();
			//$(this).parent().find(".dropShadow").css({'zIndex': '0'})
		}
	})*/
})




