var $ = jQuery.noConflict();
jQuery(document).ready(function($) {

	$.swapImage(".swapImage", true, true, "mouseenter", "mouseleave");
	
	$("div.bookmarks a.comments-link").click(function (e) {
		e.preventDefault();
		$(this).parents('.hentry').find('div.comment_toggle').toggle();
	});  
	
	$(".hentry input#author").attr('value', 'Name');
	$(".hentry input#email").attr('value', 'Email');
	
	$("a[rel^='prettyPhoto[photos]']").prettyPhoto({
					animation_speed: 'fast', /* fast/slow/normal */
					slideshow: 5000, /* false OR interval time in ms */
					autoplay_slideshow: false, /* true/false */
					opacity: 0.80, /* Value between 0 and 1 */
					show_title: true, /* true/false */
					allow_resize: true, /* Resize the photos bigger than viewport. true/false */
					default_width: 500,
					default_height: 344,
					theme: 'dark_square', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
					social_tools: false /* html or false to disable */
				});

	//search form
	$(".search_form .text").focus( function() {
		$(this).val('');
	}); 
	
	$("#s").focusin( function(){
		$(this).parent('fieldset').addClass('active');
	});  
	
	$("#s").focusout( function(){
		if($(this).val()==''){
			$("#s").parent('fieldset').removeClass('active');
			$("#s").val(''); //remove SEARCH and leave'' if you want to use image	
		}
	});
	
	$('.active #searchsubmit').live( 'mouseenter', function() {
		$(this).parent().addClass("hover");
	}); 
	
	$('#searchsubmit').mouseleave( function() {
		$(this).parent().removeClass("hover");
	}); 
	
	$('.kiss_links').easyListSplitter({ colNumber: 2 });
	
	$('ul.bikes').easyListSplitter({ colNumber: 3 });
	
	$("#inquiry_btn").fancybox({
			'titlePosition'		: 'inside',
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'showNavArrows'		: false,
			'titleShow'			: false
		});


	if (!(($(".custom-sidebar-block").length) == 0)) $(".custom-sidebar-block").tabs({ fx: { opacity: 'toggle' } });
});

Cufon.replace('h1.page_title, h2.page_title, .hentry h1, .hentry h2, .bike_media h3, ul.social p a, .kiss_links h3, #respond h3, #comments h3, #inquiry h3, #shopp ul.products li .name a', {
	hover: true,
	ignore: { 
    	span: true 
  	} 
});

Cufon.replace('.widget h3.widget_title', {
	textShadow: '#1d1813 0px 1px 1px',
	hover: true
});

Cufon.replace('#shopp #shopp_sidebar h3.widget_title, .product_details .product_description h4', {
	textShadow: 'none',
	hover: true
});

Cufon.replace('ul#top-bar-items li a, #header ul li a, .widget .news_list .date span', {
	textShadow: '#efe9d7 0px 1px 1px',
	hover: true
});


Cufon.replace('#bike_sale h3.widget_title span', {
	textShadow: '#955a2e 0px -1px 0px'
});

Cufon.replace('#footer h3.widget_title', {
	textShadow: '#a18f80 0px 1px 1px',
	hover: true
});

Cufon.replace('#intro .intro_main h1', {
	textShadow: '#373737 0px 1px 1px'
});


Cufon.replace('a.btn_b span', {
	textShadow: '#666666 0px -1px 0px',
	hover: true
});


//Footer Cufon
Cufon.replace('ul#footer-nav-items li a', {
	hover: true
});
