// Helvetica Condensed THIN
Cufon.replace(
	'.home_title, .page-head h3, .page-head-alt h3, ',
	{  hover: true,
		fontFamily:'HelveticaNeue LT 37 ThinCn'});
// Helvetica CONDENSED
Cufon.replace(
	'#nav',
	{	hover: true,
		fontFamily:'HelveticaNeue LT 57 Cn'
});
Cufon.replace(
	'.product-options h3,.product-name, .prezzo, .catalog-product-view .col1 h2, .catalog-listing h5, .data-table thead tr th, td.attributes-col h4.title a, .form-button-alt, .form-button, .shopping-cart-totals tfoot td, h4, .dettaglio_title, .product-specs h2, .side-col h3, .one-page-checkout h3, ul.viste, .curious-title, .bugatti ul.testi, .related-title, .promo h3, .shipment-methods dt, .sconto, .price, .cms-page-view h2.helve',
	{	hover: true,
		fontFamily:'Helvetica700'
});



var $j = jQuery.noConflict();
var timer;  

// execute your scripts when the DOM is ready. this is a good habit 
$j(document).ready(function() {
							
// popup spedizioni home page */
	setTimeout(function() {
			$j('#popup').fadeIn('slow');
	}, 1000);
	$j('#popup .close, #popup .close2').click(function(){
		$j('#popup').fadeOut('slow');
	});
//end popup spedizioni
				
$j('.custom-option-29, .custom-option-34, .custom-option-51').append('<div class="tooltip">Vestibilit&agrave; REGULAR:<br/>Per chi ama una vestibilit&agrave; comoda dalle linee morbide e tradizionali.<br/><br/>Vestibilit&agrave; SLIM:<br/>Per chi ama una vestibilit&agrave; pi&ugrave; asciutta ed un  look pi&ugrave; contemporaneo ed aggiornato</div>');
		
	$j('.custom-option-29 .tooltip, .custom-option-34 .tooltip, .custom-option-51 .tooltip').hide();
	
	$j('.custom-option-29, .custom-option-34, .custom-option-51').hover(function(){
				$j('.tooltip').show();
	});
	$j('.custom-option-29, .custom-option-34, .custom-option-51').mouseleave(function(){
				$j('.tooltip').hide();	
	});
	
	
	
		
	/* gallery */
	
	// Loop over each hottie.
	$j( ".product-options ul.options-list label" ).each(
	
		// For each hottie, run this code. The "indIndex" is the
		// loop iteration index on the current element.
		function( intIndex ){
	  var labelColor = $j(this).text()
	 $j(this).addClass('opt'+labelColor);
	});

	$j( ".product-valstarino-be-one-and-only .nav-be-one-and-only" ).addClass('active');

	
	// $j('.nav-be-original').attr("href", "http://www.valstarino.it/be-original/men/valstarino-original.html");
	$j('.product-valstarino-camoscio-estivo-donna a.men').attr("href", "http://www.valstarino.it/valstarino-camoscio-estivo-uomo.html");
    $j('.product-valstarino-camoscio-estivo-donna a.women').attr("href", "#");
	$j('.product-valstarino-camoscio-estivo-uomo a.women').attr("href", "http://www.valstarino.it/valstarino-camoscio-estivo-donna.html");
    $j('.product-valstarino-camoscio-estivo-uomo a.men').attr("href", "#");
	

	$j('.dettagli a').click(function(){
	  $j('.dettagli a').removeClass('active');		
	  $j(this).addClass('active');	
	  $j('#largeImg').show();
		
	  $j('#largeImg img').attr({ src: '#', alt: '#', title: '#' });
		 
	  var largePath = $j(this).attr('href');
	  var largeAlt = $j(this).attr('rev');
	  var largeName = $j(this).attr('rel');
	
	 //setTimeout(function() {
		$j('#largeImg img').hide();
	  $j('#largeImg img').show().attr({ src: largePath, alt: largeAlt, title: largeName });
	  //}, 700); 
	  
	  $j('.dettaglio_title').html(largeAlt);
	  $j('.dettaglio_desc').html(largeName); return false;
	});
	

	
	
	



	$j('.dettagli a span').hide();
	
			
	// On document ready hide all images first
    //$j('#imageShowcase img').hide();
    $j('#productImgDefault').show();
	
		

	//$j('body').append('<div class="overlaypsd"></div><div class="btn_overlay"><a class="psd_show">Show PSD!</a> | <a class="psd_50">50%</a> | <a class="psd_25">25%</a> | <a class="psd_hide">HIDE PSD</a></div>');	
	$j('.overlaypsd').hide();
	$j('.btn_overlay .psd_show').click(function(){
	$j('.overlaypsd').fadeTo(200, 1);
	});
	$j('.btn_overlay .psd_50').click(function(){
	$j('.overlaypsd').fadeTo(200, 0.5);
	});
	$j('.btn_overlay .psd_25').click(function(){
	$j('.overlaypsd').fadeTo(200, 0.25);
	});
	$j('.btn_overlay .psd_hide').click(function(){
	$j('.overlaypsd').hide('slow');
	});

	//  $j('.btn_overlay, .overlaypsd').draggable();
	 $j('.btn_overlay').click(function(){
			$j(this).slideDown()
	});

	/* box promo cliccabile */
	$j('.promo').click(function(){
		  window.location=$j(this).find('a').attr('href'); return false;
	});
   
   $j('.dettagli a, .home_visual').hide();

	setTimeout(function() {
	$j('.home_visual').fadeIn(2000);
	}, 500);


	setTimeout(function() {
			$j('.dettaglio1').fadeIn('fast');
	}, 500);
	setTimeout(function() {
			$j('.dettaglio1').fadeIn('fast');
	}, 500);
	setTimeout(function() {
			$j('.dettaglio2').fadeIn('fast');
	}, 700);
	setTimeout(function() {
			$j('.dettaglio3').fadeIn('fast');
	}, 900);
	setTimeout(function() {
			$j('.dettaglio4').fadeIn('fast');
	}, 1100);
	setTimeout(function() {
			$j('.dettaglio5').fadeIn('fast');
	}, 1300);

	// $j('.home_visual').css({opacity: 0, left: -900}).animate({opacity: 1, left: 0}, 300, 'linear');     



	// Lampeggianti Dettagli
	timer = setTimeout(Cloud, 0);
	function Cloud() {
		$j('.dettagli a').css({opacity: 1}).
			animate({opacity: 0.5}, 500).
			animate({opacity: 1}, 500, function() {
			timer = setTimeout(Cloud,1300);
		});
	 } 

	// btn home hover che si muovono 
	$j('.home_menu li').hover(function(){
		$j(this).animate({left: '-10'}, 'fast');
		//$j('h1#logo').animate({left: '500'}, 'fast');
			},function(){
		$j(this).animate({left: '0'}, 'slow');
		//$j('h1#logo').animate({left: '0'}, 'slow');
	 });

	// lista prodotti
	$j('.listing-type-list .listing-item img').hover(function(){
		$j(this).animate({top: '0'}, 'fast');
		//$j('h1#logo').animate({left: '500'}, 'fast');
			},function(){
		$j(this).animate({top: '10'}, 'slow');
		//$j('h1#logo').animate({left: '0'}, 'slow');
	 });







////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////// GALLERY  ORIGINAL //////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////

$j('.btn_zoomout').hide();

$j('.btn_zoom').click(function() {
	$j('#imageShowcase img.active').animate({ height: '800',  width: '800', left: '-200px', top: '-200px'}, 'slow');
	$j('#imageShowcase').draggable({disabled: false }).css('cursor', 'move');
	$j('.catalog-product-view .col2 ').addClass('active');
	$j(this).hide();
	$j('.btn_zoomout').show();
	$j('p.product-image-zoom').addClass('active');
	
});

$j('.btn_zoomout').click(function() {
	//var disabled = $j('.zoom_giubotto.active').draggable( "option", "disabled" );
	$j('#imageShowcase img.active').animate({ height: '400', width: '400', left: '0', top: '0' }, 'fast');
	//$j('.product-image-zoom').animate({left: '0', top: '0' }, 'fast');
	$j('#imageShowcase').draggable("option", "disabled", true, "opacity", 1).css('cursor', 'pointer').css({opacity:1}).animate({ height: '400', width: '400', left: '0', top: '0' }, 'fast');
	$j('.catalog-product-view .col2 ').removeClass('active');
	$j(this).hide();
	$j('.btn_zoom').show();
	$j('p.product-image-zoom').removeClass('active',1000);
});


$j('.switch_view li.prodotto_fronte a').click(function(){		
	$j('#productImgFronte,.vista-fronte').fadeIn('slow').addClass("active");
	$j('#productImgInsertiFronte').show();
	$j('#productImgInterno,#productImgRetro, .vista-retro, .vista-interno, #productImgInsertiRetro, #productImgInterno, #productImgInsertiInterno').hide().removeClass('active');	
});
	
$j('.switch_view li.prodotto_retro a').click(function(){
	$j('#productImgRetro, .vista-retro').fadeIn('slow').addClass('active');
	$j('#productImgInsertiRetro').show();
	$j('#productImgFronte, #productImgInterno, .vista-fronte, .vista-interno, #productImgInsertiFronte, #productImgInsertiInterno').hide().removeClass('active');
	
});
$j('.switch_view li.prodotto_interno a').click(function(){
	$j('#productImgInterno, .vista-interno').fadeIn('slow').addClass('active');
	$j('#productImgInsertiInterno').show();
	$j('#productImgRetro, #productImgFronte,.vista-fronte, .vista-retro, #productImgInsertiFronte, #productImgInsertiRetro').hide().removeClass('active');
});




// Loop over each hottie.









// SPLASH PAGE
			
	$j('#splash_giubotto').hide();
	
	$j('.language-switcher a').hover(function(){
  		$j(this).fadeIn(100).fadeOut(100).fadeIn(100);
	});
	
	

  $j('.dettagli_btn').click(function(){
  $j('.dettagli_prodotto').animate({
    opacity: 1,
    marginLeft: '-1px'
  },'slow');
});



  $j('.btn_close').click(function() {
		$j('.dettagli_prodotto').animate({
			opacity: 1,
			marginLeft: '425px',
			duration: 200,
			easing: 'easeOutBounce'
		  });
		
		});

	//setTimeout(function() {
        $j('#splash_giubotto').fadeIn(200);
    //}, 1000);
	
	//	function runIt() {
	//	$j('#splash_giubotto').animate({top: '-40'}, 'slow').animate({top: '-30'}, 'slow');
	//	   }
	//	runIt();


});
