/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    Mage
 * @package     js
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

jQuery(document).ready(function(){
	
	/* Warenkorb */
	jQuery('.basket_toggle').click(function(){
		jQuery('.basket_content').slideToggle(400);
		jQuery('.basket_toggle').toggleClass('active');
	});
	jQuery('.box_small_basket').click(function(){
		jQuery('.basket_content').slideToggle(400);
		jQuery('.basket_toggle').toggleClass('active');
	});
	
/* Startseiten Teaserboxen */
jQuery('#teaser-navigation li').hover(function(){
		jQuery(this).addClass('ro');
		jQuery(this).click(function(){
			var url = jQuery('a',this).attr('href');
			window.location.href = url;
			return false;
		});
	},function(){
		jQuery(this).removeClass('ro');
	});
	
	
	if( jQuery('.vertnav li ul').is(':visible')) {
		jQuery(this).prev('a').css( 'background-position','0 -65px');
	}
	else {
		jQuery(this).prev('a').css( 'background-position','0 0px');
	}

	
	/* Navigation auf der linken Seite */
	jQuery('.vertnav li a.lvl_1').click(function() {
		var clicked = this;
		if (jQuery(clicked).next('ul').is(':visible')){
			return;
		}else {
			jQuery('.vertnav li ul li ul').css('display','block');
			jQuery('.vertnav li a.lvl_1').css( 'background-position','0 0');
			jQuery('.vertnav li ul:visible').slideUp('400', function() {
				jQuery(clicked).css( 'background-position','0 -65px');
				jQuery(clicked).next('ul').slideDown('400');
			});
		}
	});	
	
});
