jQuery(function(){
	
	$('#modal').load('/donations.html #modal-donation');
	
	//form focus styling
	 $('input[type="text"]').focus(function() {  
		 $(this).addClass("focusField");  
		 if (this.value == this.defaultValue){  
			 this.value = '';  
		 }  
		 if(this.value != this.defaultValue){  
			 this.select();  
		 }  
	 });  
	 $('input[type="text"]').blur(function() {  
		 $(this).removeClass("focusField");  
	 });
	 
	//email spam protection
    $('.email').each(function() {
		var $email = $(this);
		var address = $email.text()
        .replace(/\s*\[at\]\s*/, '@')
        .replace(/\s*\[dot\]\s*/g, '.');
		$email.html('<a href="mailto:' + address + '">'
        + address +'</a>');
    });
	
	//nav fixes
	$('#sideNav li:first').addClass('header');
	$('#sideNav .header').mouseover(function(){$(this).addClass('header')});
	$('#sideNav .header').mouseout(function(){$(this).addClass('header')});
	$('#topNav li:last').addClass('news').prev('li').addClass('noBorder');
	
	//tables
	$('.schedule tr.type').prev('tr').addClass('last');
	$("table.schedule strong").parents("tr").addClass("type");
  
	//checkout

	$(".productitemcell a").each(function(i){
	
		if($(this).attr("href") == "/_product_84517/Wilds_--A_Seating--"){
			discountShow1 = 1;
		}
		if($(this).attr("href") == "/_product_84517/Wilds_--B_Seating--"){
			discountShow1 = 1;
		}
		if($(this).attr("href") == "/_product_115231/Canvas_--A_Seating--"){
			discountShow2 = 1;
		}
		if($(this).attr("href") == "/_product_115231/Canvas_--B_Seating--"){
			discountShow2 = 1;
		}
	
	});
	
	if ( typeof(discountShow1) != "undefined" ) {
	
			if(discountShow1 == 1 && discountShow2 == 1) {
		    	$(".applydiscount").html('SEASON TICKETS DISCOUNT<br> Your order qualifies for the season tickets discount. <br>Thank you for purchasing the Season Package, please enter "<span style="color:#333333;">ST2010</span>" to receive the season discount of 20%');
				$('tr#discount-line').show();
			}	
	
	} 
  
  
  
if($("#animation").length > 0) {
	$('#animation').flash({ 
			src: '/pivoting.swf',
			width: 262,
			height: 412
		},
		{
			version: 8
	});
}
		
  
});
