$(function() {
  
	// hide all language sections //
	$('ul.subLangSelect').hide();
	
	$('ul.SubItemsList li').each(function(){
		
		if(! $.support.leadingWhitespace)
			$(this).css({'margin-bottom':'-2px'});
		
		$(this).toggle(function(e){
			
			// prevent click actions on anchor //
			e.preventDefault();
			
			// get clicked item //
			var $this = $(this);
			
			$this.children('ul').slideDown('125');
			
			if(! $.support.leadingWhitespace)
				$(this).css({'margin-bottom':'1px'});
			
			
		
		}, function(e){
			
			// prevent click actions on anchor //
			e.preventDefault();
			
			// get clicked item //
			var $this = $(this);
			
			$this.children('ul').slideUp('125');
			
			if(! $.support.leadingWhitespace)
				$(this).css({'margin-bottom':'-2px'});
			
		});
		
	
	});  
	
	$('ul.SubItemsList li a[href*=.pdf]').each(function(){
		$(this).click(function(){
			// get clicked item //
			// this is a link which targetting pdf file //
		    window.open( $(this).attr('href') );
            return false;
		});
	}); 
	$('ul.SubItemsList li a:not([href*=.pdf])').not('[href^=#]').each(function(){
		$(this).click(function(){
			// get clicked item //
			// this is a link which targetting viewer //
		    window.location=$(this).attr('href');
		    return false;
		});
	}); 
});
