//----------------------------//
// Custom JS Include File     //
// Author: Jason Barnes       //
// Modified: 7/18/2011        //
//                            //
//----------------------------//

//Cufon
Cufon.replace('#pp-links ul li a, #menu ul li a', {fontFamily: 'Liberation' , textTransform: 'uppercase', hover:{color: '#FFFFFF'}});
Cufon.replace('.access li.welcome, .mycart a span, .mini-mycart a, span.proceed, .page-title h1,#slide .placeholder .panel .promo span', {fontFamily: 'Liberation' , fontWeight:700});
Cufon.replace('.pp-hot-title, .newsletter-title a, .pp-button-submit, .pp-product-name', {fontFamily: 'Helv'});
Cufon.replace('.contact_title, .box-heading-cat', {fontFamily:'Helv', fontSize:'14px', textTransform:'uppercase'});
Cufon.replace('.block-title span, h1, .h1', {fontFamily: 'Helv', fontSize:'27px', textTransform:'uppercase'});
Cufon.replace('.product-info-box-heading', {fontFamily: 'Helv', fontSize:'21px', textTransform:'uppercase'});
Cufon.replace('a.add-to-cart,.add-to li', {fontFamily: 'Helv', fontWeight:500, textTransform:'uppercase', hover:{color:'#ff6600'}});
Cufon.replace('.cart-count .link-checkout', {fontFamily: 'Helv', fontWeight:500, textTransform:'uppercase'});
Cufon.replace('.cufon-txt', {fontFamily: 'Helv', textTransform: 'uppercase'});


$(document).ready(function(){

if($('#pp-slideshow').length != 0){
	$('#pp-slideshow').nivoSlider({
        effect:'slideInLeft', // Specify sets like: 'fold,fade,sliceDown'
        slices:15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed:700, // Slide transition speed
        pauseTime:7000, // How long each slide will show
        startSlide:0, // Set starting Slide (0 index)
        directionNav:true, // Next & Prev navigation
        directionNavHide:true, // Only show on hover
        controlNav:true, // 1,2,3... navigation
        controlNavThumbs:false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel:false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav:true, // Use left & right arrows
        pauseOnHover:true, // Stop animation while hovering
        manualAdvance:false, // Force manual transitions
        captionOpacity:0.8, // Universal caption opacity
        prevText: 'Prev', // Prev directionNav text
        nextText: 'Next', // Next directionNav text
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
}

if($('.pp-link').length != 0){	
	$('.pp-link').click(function(event){
		
		$('.pp-links-menu li').each(function(){
			
			$(this).removeClass('pp-active-link');
			
		});
		
		$(this).parent().addClass('pp-active-link');
		
		var str = '#' + $(this).html();
		
		str = str.replace(/ /g, '-');
		
		$('.pp-content-menu li').each(function(){
			
			$(this).removeClass('pp-active');
			
		});
		
		//$('.pp-content-menu li:first').addClass('pp-active');
		
		$(str).addClass('pp-active');
		
		event.preventDefault();
		
	});
}	

	
	if ($('#search').length != 0){
		$('#search').focus(function(){
			if($('#search').val() == 'Search entire store'){
				$('#search').val('');
			}
		});
		
		$('#search').blur(function(){
			if($('#search').val() == ''){
				$('#search').val('Search entire store');
			}
		});
	}
	
	if ($('#address').length != 0){
		$('#address').focus(function(){
			if($('#address').val() == 'Enter your email address'){
				$('#address').val('');
			}
		});
		
		$('#address').blur(function(){
			if($('#address').val() == ''){
				$('#address').val('Enter your email address');
			}
		});
	}

}); 
