/* Author: Matthew Hale | mhale0@gmail.com
*/
/* uning jQuery.noconflict to prevent conflicts with protoype in the store pages 
			using jQuery instead of $ until we get to the ready functions
*/
jQuery.noConflict();

// remove the no js detector class
jQuery('html').removeClass('nojs');
// remove the notie detector class if the browser IS ie
if(jQuery.browser.msie){
	jQuery('html').removeClass('notie');
	jQuery('html').addClass('ie');
}

// change tips
function changeTip(index) {
	jQuery("#tips .current-tip").animate({height:'0'}).removeClass("current-tip");
	jQuery("#tips li a.current").removeClass("current");
	jQuery("#"+index).delay(1000).addClass("current-tip").animate({height:'270px'});
	jQuery("#tips li a."+index+"-trig").addClass("current");
}

// navigate between tips
function navClick(){
	var index = jQuery(this).attr("href").replace('#','');
	changeTip(index);
}

jQuery(document).ready(function($) { // start root, switch back to $ for jQuery

// nav link color transition
$("#major li").mouseenter(function() {
  $(this).stop(true, true).animate({
  	backgroundColor: 'rgb(237,87,28)'
  }, 'fast');
}).mouseleave(function() {
  $(this).stop(true, true).animate({
  	backgroundColor: 'rgb(237,28,36)'
  }, 'fast');
});

// home page video link color transition
$(".notie #home #video-link a").mouseenter(function() {
  $(this).stop(true, true).animate({
  	opacity: 0
  }, 'fast');
}).mouseleave(function() {
  $(this).stop(true, true).animate({
  	opacity: 100
  }, 'fast');
});
// home page video link colorbox
$("#home-vid-trigger").colorbox({iframe:true, innerWidth:660, innerHeight:500});

// home page link bump
$("#home #links a").mouseenter(function() {
  $(this).stop(true, true).animate({
  	top: -48
  }, 'fast');
}).mouseleave(function() {
  $(this).stop(true, true).animate({
  	top: -36
  }, 'fast');
});

// fan club page link bump
$("#fan #link-bar a.bounce").mouseenter(function() {
  $(this).stop(true, true).animate({
  	top: -12
  }, 'fast');
}).mouseleave(function() {
  $(this).stop(true, true).animate({
  	top: 0
  }, 'fast');
});

// bir tabs
$("#attractions").tabs();

// live popup info
$("#bir-video-link").colorbox({iframe:true, innerWidth:660, scrolling:false, innerHeight:530});
// $("#stage-show-link").colorbox({innerWidth:600, innerHeight:400, inline:true, href:"#stage-show-detail"});
// $("#parade-link").colorbox({innerWidth:600, inline:true, href:"#parade-detail"});
// $("#meet-link").colorbox({innerWidth:600, inline:true, href:"#meet-detail"});
// $("#ticket-link").colorbox({innerWidth:600, innerHeight:400, inline:true, href:"#ticket-detail"});
// $("#bir-welcome").colorbox({innerWidth:600, innerHeight:400, inline:true, href:"#bir-welcome", open:true});

// fan club character profiles
$("#profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#bixby-profile", scrolling: false});
$(".bixby-profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#bixby-profile", scrolling: false});
$(".bookworm-profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#bookworm-profile", scrolling: false});
$(".skelly-profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#skelly-profile", scrolling: false});
$(".rewind-profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#rewind-profile", scrolling: false});
$(".nico-profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#nico-profile", scrolling: false});
$(".mj-profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#mj-profile", scrolling: false});
$(".kate-profile-link").colorbox({innerWidth:800, innerHeight:600, inline:true, href:"#kate-profile", scrolling: false});

// fan club tell bixby form
$("#tell-bixby-link").colorbox({innerWidth:600, innerHeight:416, inline:true, href:"#tell-bixby-form", scrolling: false});

// bir page gallery
$("a.ss[rel='gallery']").colorbox({
						slideshow : true,
	slideshowSpeed : 4000
});

// change tip visibility
$("#tips li a").click(navClick);
$(".tip").css('height',0);
$("#tips li a.init").addClass("current");
$("#tip-wrap .init").addClass("current-tip").animate({height:'270px'});

}); // end root
