$(document).ready(function(){ 
	$('#accordian li a.item').each(function(){
		$(this).click(function(event){
			parentli = $(this).parent();
			if(!parentli.hasClass('selected')){				
				$('#accordian li').each(function(event){
					$(this).children('div').slideUp('slow');
					$(this).removeClass('selected');
				});				
				parentli.addClass('selected');
				parentli.children('div').slideDown('slow');
			}else{
				parentli.removeClass('selected');
				parentli.children('div').slideUp('slow');
			}
		});
	});	
		
	$('#cReset').click(function(event){
			$('.rdpform').children('div.formfield-container').each(function(event){
			$(this).children('textarea').each(function(event){
				if($(this).attr('type') != 'hidden'){
					$(this).attr('value', '');
				}			
			});
			$(this).children('select').each(function(event){
				if($(this).attr('type') != 'hidden'){
					$(this).attr('value', '');
				}			
			});
			$(this).children('input').each(function(event){
				if($(this).attr('type') != 'hidden'){
					$(this).attr('value', '');
				}
			});
		});	
	});
	
	$('.right .rdnavigationmenucontrol .lvl1 a').each(function(){
		$(this).click(function(event){
			parentli = $(this).parent();
			if(!parentli.hasClass('selected') && parentli.hasClass('lvl1')){				
				$('.right .rdnavigationmenucontrol .selected').each(function(event){
					$(this).children('ul').slideUp('slow');
					$(this).removeClass('selected');
				});				
				parentli.addClass('selected');
				parentli.children('ul').slideDown('slow');
			}else{
				parentli.removeClass('selected');
				parentli.children('ul').slideUp('slow');
			}
		});
	}); 
	
	$('#menu-LEFT .lvl2.selected').each(function(){
		parentul = $(this).parent();
		parentli = parentul.parent();
		parentli.addClass('selected');
		parentul.show();
	}); 
	
	
});
