/*
	===========================================================
	Custom Wordpress Theme - UI Effects - "Crunch.js"
	Author: Foxtie, http://www.foxtie.com
	===========================================================
	Description: jQuery function initialization.
	===========================================================
*/

				
// Flash Functions

	/* Begin Functions That Need to be outside of jQuery */
	
	var footerBusy = 'complete';
		// Animation Status - sent from flash
		function notify(status){
			jQuery(function( $ ){	
				if (status=="complete"){
					$('.blurbs li').css('display','none');
					$('.blurbs li.'+newClass).css('display','block').animate({ opacity: 1 }, 200);
					$('.bannertop').css('background','url(/wp-content/themes/boxing/lib/img/footer-nav-topshadow.jpg)');
					$('.bannerfoot').css('background','url(/wp-content/themes/boxing/lib/img/footer-nav-topshadow.jpg)');
					$('.banner').css('background','url(/wp-content/themes/boxing/lib/img/home-flagbkg.jpg) top center repeat-y');
					$('#footerTranny').hide();
					$('#bodywrap').removeClass('notdone');
				}
			});
		}
		
	/* End Functions That Need to be outside of jQuery */


// This utility function resolves the string movieName to a Flash object reference based on browser type.

// TO DO: //

	// Get a reference to the player 
	var player = null;
	// Footer raise - send request to flash
	function footRaise() {
		$('#footerTranny').show();
		if (document.all) {
			
		} else {  
			player = document.getElementById("footerTranny");  
		
		}
		
		player.callRaise(); 
	}
	


// END TO DO //

jQuery(function( $ ){	
	
	// Establish Drop Vars
	var footerBusy = 'false';
	var busy = true;
	
	// Hide Content
	$('.blurbs li').css('display','none').animate({ opacity: 0 }, 1);
	$('.blurbs li.boxing').css('display','block').animate({ opacity: 1 }, 1);
	
	// Bind Banner Buttons
	$('ul.bannernav a').attr('href','#');
	$('ul.bannernav a').bind('click', function(){	
		if ( !$('#bodywrap').hasClass('notdone') ) {
			$('#bodywrap').addClass('notdone');
			newClass = $(this).attr('class');
			$('ul.bannernav a').parent().removeClass();
			$(this).parent().addClass('current_page_item');
			$('#pointerarrow').stop().animate({
				height: 5
			}, 500, function(){
				$('#pointerarrow').removeClass();			
				$('#pointerarrow').addClass("pointer-"+newClass);
				$('#pointerarrow').animate({ height: 46 }, 500);
			});
			$('.blurbs li').stop().animate({
				opacity: 0
			}, 200, function(){
				if (!$.browser.msie) {
					$('.bannertop').css('background','none');
					$('.bannerfoot').css('background','none');
					$('.banner').css('background','none');
					footRaise();
				}else{
					$('.blurbs li').css('display','none');
					$('.blurbs li.'+newClass).css('display','block').animate({ opacity: 1 }, 200);
					$('#bodywrap').removeClass('notdone');
				}
			});
		}
		return false;
	});


	// Put your Cufon Here
	Cufon.replace('h1',{ textShadow: '5px 4px 0 #000000' });
	Cufon.replace('.banner ul.blurbs li a.learnmore', { textShadow: '5px 4px 0 #000000', hover: true });
	Cufon.replace('h2,h3,h4,h5,h6');
	Cufon.replace('.banner ul.blurbs li h5', { textShadow: '5px 4px 0 #000000',hover:true });
	Cufon.replace('#navigation li a,#navigaiton .current_page_item a, a.shopclass, .wpsc_buy_button', {fontFamily:'Interstate', hover: true});
	Cufon.replace('.locationlist li a', {fontFamily:'Interstate', hover: true});
	Cufon.replace('.gallerysidebar ul li a.sidebarlink',{fontFamily:'Interstate', hover: true});
	Cufon.replace('.blog #sidebar ul li a',{fontFamily:'Interstate', hover: true});
	Cufon.replace('.archive #sidebar ul li a',{fontFamily:'Interstate', hover: true});
	Cufon.replace('#searcharea .findboxing form label',{ fontFamily: 'Interstate' });
	Cufon.replace('#myCarousel ul.testi li.name',{ fontFamily: 'Interstate' });
	Cufon.replace('#myCarousel ul.testi li.age',{ fontFamily: 'Interstate' });
	Cufon.replace('#myCarousel ul.testi li.location',{ fontFamily: 'Interstate' });	
	Cufon.replace('#myCarousel ul.testi li.city',{ fontFamily: 'Interstate' });
	Cufon.replace('.breadcrumb a','.breadcrumb p ',{ fontFamily: 'Interstate' });
	Cufon.replace('.shopping-cart-wrapper .gocheckout a',{ fontFamily: 'Interstate' });
	Cufon.replace('.shopping-cart-wrapper .wpsc_empty_the_cart a',{ fontFamily: 'Interstate' });
	Cufon.replace('span.emptycart a','span.gocheckout a',{ fontFamily: 'Interstate' });
	
	
// NextGEN Gallery

$('a.boxinginc').bind('click',function(){
		img = $(this).attr('href');	
		title = $(this).find('img').attr('alt');	
		desc = $(this).find('img').attr('title');
		
		$('#bigimage').fadeOut(500, function() {		
		$("#bigimage").attr('src',img).load(function () {
 			 $("#bigimage").fadeIn();
});
		
		});
		
		
		$('#biginfobox h2').empty().append(title);
		$('#biginfobox p').empty().append(desc);
		return false;
});



var player;
function playerReadyCallback(obj) {
	alert('the videoplayer '+obj['id']+' has been instantiated');
	player = document.getElementById(obj['id']);
};


$(".videothumbs a").click(function() {
		vidId = $(this).attr('id');	
		$("#video-holder div").hide().removeClass();
        $("#video-holder #vid-"+vidId).show();
		return false;
});


    $('#myCarousel').kidsCarousel({
        'delay' : 5000,
        'randomStart' : true,
		'panelNav': false,
        'relativeNavButtons' : ['Previous', 'Next']
    });






  
});
	
