function goToByScroll(id) {
    jQuery('html,body').animate({
        scrollTop: jQuery("#top").offset().top
    }, 'slow');
}

jQuery(document).ready(function () {
	jQuery('.option-image').corner("5px");
	jQuery('.error-msg').corner("5px");
	jQuery('.success-msg').corner("5px");
	jQuery('.note-msg').corner("5px");
	jQuery('.notice-msg').corner("5px");
	jQuery('#product-choose-variant').corner("5px");
	/*jQuery('.kundecenter-main li').hoverIntent(function() {
		jQuery(this).find('.kundecenter-bubble').fadeIn();
	}, function() {
		jQuery(this).find('.kundecenter-bubble').fadeOut();
		
		});*/
	jQuery('input').ezMark();
	jQuery(".view-ratings").hide();

	jQuery('.ratings .rating-links a').hover(function() {
      jQuery('.view-ratings').show();
}, function() {
      jQuery('.view-ratings').hide();
});	
		
	//Default Action
	jQuery(".home-page-products .products-grid:first-child li.last").hover(function() {
		jQuery(".tab-right-corner").addClass("tab-right-corner-hover");
	}, function() {
		jQuery(".tab-right-corner").removeClass("tab-right-corner-hover");
	});
	
	jQuery(".tab_content").hide(); //Hide all content
	jQuery("ul.tabs li:first a").addClass("active").show(); //Activate first tab
	jQuery(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	jQuery("ul.tabs li").click(function() {
		jQuery("ul.tabs li a").removeClass("active"); //Remove any "active" class
		jQuery(this).find('a').addClass("active"); //Add "active" class to selected tab
		jQuery(".tab_content").hide(); //Hide all tab content
		var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	
    /*jQuery('.home-nav ul li.older').click(function () {
        jQuery(this).find('ul').toggle('blind', {}, 1300);


    });*/

    cufonReplaceAll();

   
	jQuery('.scroll-pane').jScrollPane({
        verticalDragMinHeight: 32,
        verticalDragMaxHeight: 32,
        horizontalDragMinWidth: 10,
        horizontalDragMaxWidth: 10
    });
	jQuery('.header-cart').hide();
});

function cufonReplaceAll() {

	Cufon.set('fontFamily', 'Vitesse Sans Medium');
	Cufon.replace('ul.top-links li > a, .block-wishlist .actions a', {
		hover: true,
		textShadow: '-1px -1px #333'
	});
	
    Cufon.set('fontFamily', 'Vitesse Sans Book');
    Cufon.replace('.footer .icons li a, .radio-item div, .checkbox-item div, .link-cart, .tilbage a', {
        hover: true
    });

    Cufon.set('fontFamily', 'Vitesse Sans Medium');
    Cufon.replace('.block .block-title strong span, .view-mode label, .block-layered-nav dt, .product-slider .slider-price, .product-name h1, .product-collateral h2, button.button span span, .products-list .special-price .price, .products-list .old-price .price,  .product-review .product-name, .review-product-list a.nobr, .view-ratings, .support-dropdown .repeat a, .kundecenter-main li a span, .box-account .box-head h2, .fieldset .legend, .buttons-set .f-left, .account-login .content h2, .video-products h2, .postContent a, .postTitle h3, ul.vilkar li a, .block-layered-nav .block-subtitle, .block-layered-nav .actions a, .block-layered-nav .currently liz, .related-title, .cart .discount h2, p.onestepcheckout-numbers', {
        hover: true
    });

    Cufon.set('fontFamily', 'Vitesse Sans Bold');
    Cufon.replace('.category-title h1, .page-title h1, .page-title h2, h1.onestepcheckout-title', {
        hover: true
    });
	
	Cufon.set('fontFamily', 'Vitesse Sans Light');
    Cufon.replace('h2.video-title, .video-date, .postTitle h2, .cms-page-view .std h2', {
        hover: true
    });

};
