$(document).ready(function() {


  $('#dropdown-products ul ul li a').click(function() {
    $(this).next('ul').toggle();
	$(this).toggleClass('active');
    //return false;
  });

  $('#dropdown-features ul ul li a').click(function() {
    $(this).next('ul').toggle();
	$(this).toggleClass('active');
    return false;
  });
  



  if ($('#home').length>0) { 
    
    $('#slideshow').cycle({
		fx: 'fade',
		timeout: 4000, 
        cleartype: true, 
		cleartypeNoBg: true
		
	});
	
	


  }// end if home(homepage)
 
  // lightbox for photos in gallery
   //$("ul.list-photos a,a.view-image").fancybox();
    $("ul.list-photos a.image").fancybox();
    //$("ul.list-videos a.watch").fancybox();
	$("ul.list-videos a.watch").click(function() {
	$.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
		   	'wmode'			: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});

	return false;
});


/*   
  // lightbox for photos in gallery
  $("a.watch").click(function() {
	$.fancybox({
			'padding'		: 5,
			'autoScale'		: true,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		   : 450,
			'height'		: 300,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			   	 'wmode'		: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});
	return false;
   });
*/
   
 

	// ----------------  CUFON  --------------------------//
 
    /* Common */
	Cufon.replace('#winnercircle');
	Cufon.replace('ul#main-nav a span',{hover: true});
	Cufon.replace('div#dropdown-products h3');
	Cufon.replace('ul#breadcrumbs a',{hover: true});
	Cufon.replace('#banner');
	Cufon.replace('#content h2');
	
	
	/* Home */
	Cufon.replace('#headlines');
	Cufon.replace('#modules',{hover: true});
	
	/* Products */
	Cufon.replace('.product-info h3');
	Cufon.replace('div.list-productoptions ul>li',{hover: true});
	
	/* Category */
	Cufon.replace('ul#list-categories li',{hover: true});
	
	/* Team */
	Cufon.replace('p.cat-title',{hover: true});
	
	/* Footer or Bottom */
	Cufon.replace('#dial h2');
	Cufon.replace('ul#list-steps');
	Cufon.replace('#footer h4');
	Cufon.replace('.list-sitemap a',{hover: true});
	Cufon.replace('#footer .contact a',{hover: true});
	Cufon.replace('#list-rides a',{hover: true});
	


});



