$(document).ready( function() {

    var hndFileId;
    var foundItem;
    var loc = window.location.href;
    
    $('.a0 dt').each( function() {
        hndFileId = $(this).find('input[name$=hndFileId]').val();
        
        if (loc.indexOf(hndFileId) != -1) {
            $(this).addClass('opened').next('dd').show();
            foundItem = true;
        }    
    });
    
    if (!foundItem) {
        $('.a0 dt:nth-child(1)').addClass('opened').next('dd').show();
    }
	
//	$('.a0 dt').click( function() {
//		
//		var closed = false;
//		
//		if(!$(this).next('dd').is(':visible')) 
//			closed = true;
//		
//		$(this).parent().find('dt').removeClass('opened');
//		
//		$(this).parent().find('dd').hide('slow')
//			.find('ul.sub').hide();
//		
//		if(closed) 
//			$(this).addClass('opened').next('dd').show('slow');
//		
//	} );
	
	$('a.open-dashboard-settings').click( function() {
		$('.dashboard-settings-container .box-layer').slideDown();
	} );
	
	$('.dashboard-settings-container .box-layer a.cancel').click( function() {
		$('.dashboard-settings-container .box-layer').slideUp();
	} );
	
} );