$(document).ready(function(){
	// Slider
	$(".top .slides").easySlider({
		 auto: true
		,continuous: true 
		,pause: 5000
		,prevText: ''
		,nextText: ''
	});
	// Corners
	if ( $.browser.msie ) {
		DD_roundies.addRule('.top', '10px');
		DD_roundies.addRule('.top .botonera', '10px');
	} else {
		$('.top').corner();
		$('.top .botonera').corner();
		$('.top .slides').corner();
	}
	// Accordeon
	$('ul.menu ul').hide();
	$.each($('ul.menu'), function(){
		$('#' + this.id + '.expandfirst ul:first').show();
	});
	$.each($('ul.menu ul'), function(){
		if ( $(this).hasClass('expanded') ) {
			$(this).show();
		}
	});
	$('ul.menu li a').click(function() {
		var checkElement = $(this).next();
		var parent = $(this).parent().parent();
	
		if($(parent).hasClass('noaccordion')) {
			$(this).next().slideToggle('normal');
			return false;
		}
		if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
			if($(parent).hasClass('collapsible')) {
				$(parent).find('ul:visible').slideUp('normal');
			}
			return false;
		}
		if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
			$(parent).find('ul:visible').slideUp('normal');
			checkElement.slideDown('normal');
			return false;
		}
	});
});
