// ====================================
// = CORE.JS =
// ====================================

$(document).ready(function() {
	
	// ====================================
	// = Global =
	// ====================================
	
	// Header testimonials cycle
	$(document).ready(function() {
    	$('.slideshow').cycle({
		fx: 'fade'
		});
	});
	
	
	// ====================================
	// = Homepage =
	// ====================================
	
	// Fade in itsSwitch on load
	//jQuery( '.itsSwitch' ).fadeIn(2000);
	
	// Publication Switches
	
	// ITS Switch
	jQuery('#its-switch-show').ready(this).css('color', '#3755A4'); // Because this is the first 'panel shown'
	jQuery('#its-switch-show').click(function() {
   		jQuery('.restaurantSwitch, .accommSwitch, .verticalSwitch, .prSwitch, .inthesnowjetSwitch').fadeOut(0);
		jQuery('.itsSwitch').fadeIn(1000);
	 	jQuery(this).css('color', '#3755A4');
		jQuery('#pr-switch-show, #restaurant-switch-show, #accomm-switch-show, #vertical-switch-show, #inthesnowjet-switch-show').css('color', 'inherit');
		document.title = 'ITS Magazine | In The Snow';
    return false;
  	});
	
	// Snowjet Switch 
	jQuery('#inthesnowjet-switch-show').click(function() {
		jQuery('.itsSwitch, .restaurantSwitch, .accommSwitch, .verticalSwitch, .prSwitch').fadeOut(0);
		jQuery('.inthesnowjetSwitch').fadeIn(1000);
	 	jQuery(this).css('color', '#3755A4');
		jQuery('#its-switch-show, #pr-switch-show, #restaurant-switch-show, #accomm-switch-show, #vertical-switch-show').css('color', 'inherit');
		document.title = 'InTheSnowJet | In The Snow';
	return false;
		});
	
	// PR Switch 
  	jQuery('#pr-switch-show').click(function() {
   		jQuery('.itsSwitch, .accommSwitch, .verticalSwitch, .restaurantSwitch, .inthesnowjetSwitch').fadeOut(0);
		jQuery('.prSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#its-switch-show, #restaurant-switch-show, #accomm-switch-show, #vertical-switch-show, #inthesnowjet-switch-show').css('color', 'inherit');
	 	document.title = 'Powder Retreats | In The Snow';
    return false;
  	});
	
	// Restaurant Switch 
  	jQuery('#restaurant-switch-show').click(function() {
   		jQuery('.itsSwitch, .accommSwitch, .verticalSwitch, .prSwitch, .inthesnowjetSwitch').fadeOut(0);
		jQuery('.restaurantSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#pr-switch-show, #its-switch-show, #accomm-switch-show, #vertical-switch-show, #inthesnowjet-switch-show').css('color', 'inherit');
	 	document.title = 'South Tyrol | In The Know';
    return false;
  	});
	
	// Accommodation Switch 
  	jQuery('#accomm-switch-show').click(function() {
   		jQuery('.itsSwitch, .restaurantSwitch, .verticalSwitch, .prSwitch, .inthesnowjetSwitch').fadeOut(0);
		jQuery('.accommSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#pr-switch-show, #restaurant-switch-show, #its-switch-show, #vertical-switch-show, #inthesnowjet-switch-show').css('color', 'inherit');
	 	document.title = 'Ultimate Accommodation Guide | In The Snow';
    return false;
  	});
	
	// Vertical Switch 
  	jQuery('#vertical-switch-show').click(function() {
   		jQuery('.itsSwitch, .accommSwitch, .restaurantSwitch, .prSwitch, .inthesnowjetSwitch').fadeOut(0);
		jQuery('.verticalSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#pr-switch-show, #restaurant-switch-show, #accomm-switch-show, #its-switch-show, #inthesnowjet-switch-show').css('color', 'inherit');
	 	document.title = 'Vertical Drop | In The Snow';
    return false;
  	});
	
	
	// ====================================
	// = Meet the Team Page =
	// ====================================
	
	// Author Switches
	
	// Dominic Switch 
	jQuery('#dom-switch-show').ready(this).css('color', '#3755A4'); // Because this is the first 'panel shown'
  	jQuery('#dom-switch-show').click(function() {
   		jQuery('.benSwitch, .patSwitch').fadeOut(0);
		jQuery('.domSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#pat-switch-show, #ben-switch-show').css('color', 'inherit');
	 	document.title = 'Dominic Killinger | Meet the Team | In The Snow';
    return false;
  	});
	
	// Patrick Switch 
  	jQuery('#pat-switch-show').click(function() {
   		jQuery('.benSwitch, .domSwitch').fadeOut(0);
		jQuery('.patSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#dom-switch-show, #ben-switch-show').css('color', 'inherit');
	 	document.title = 'Patrick Thorne | Meet the Team | In The Snow';
    return false;
  	});
	
	// Ben Switch 
  	jQuery('#ben-switch-show').click(function() {
   		jQuery('.domSwitch, .patSwitch').fadeOut(0);
		jQuery('.benSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#dom-switch-show, #pat-switch-show').css('color', 'inherit');
	 	document.title = 'Ben Clatworthy | Meet the Team | In The Snow';
    return false;
  	});
	
	
	// ====================================
	// = Other Publications Page =
	// ====================================
	
	// Publication Switches
	
	// Golf News Switch
	jQuery('#golf-switch-show').ready(this).css('color', '#3755A4'); // Because this is the first 'panel shown'
  	jQuery('#golf-switch-show').click(function() {
   		jQuery('.ultGolfSwitch').fadeOut(0);
		jQuery('.golfSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#ultGolf-switch-show').css('color', 'inherit');
	 	document.title = 'Golf News | Other Publications | In The Snow';
    return false;
  	});
	
	// Ultimate Guide Switch 
  	jQuery('#ultGolf-switch-show').click(function() {
   		jQuery('.golfSwitch').fadeOut(0);
		jQuery('.ultGolfSwitch').fadeIn(1000);
		jQuery(this).css('color', '#3755A4');
		jQuery('#golf-switch-show').css('color', 'inherit');
	 	document.title = 'Ultimate Golf Guide | Other Publications | In The Snow';
    return false;
  	});
	
	
	// ====================================
	// = Subscription Pages =
	// ====================================
	
	// ITS Subscription Option 1
	jQuery('#its-free-subscribe-show').click(function() {
   		jQuery('.its-hardcopy-subscribe, .its-hardcopy-paid').fadeOut(0);
		jQuery('.its-free-subscribe').fadeIn(1000);
	 	document.title = 'FREE E-Subscribe | Subscribe to InTheSnow | In The Snow';
    return false;
  	});
	
	// ITS Subscription Option 2
	jQuery('#its-hardcopy-subscribe-show').click(function() {
   		jQuery('.its-free-subscribe, .its-hardcopy-paid').fadeOut(0);
		jQuery('.its-hardcopy-subscribe').fadeIn(1000);
	 	document.title = 'Hardcopy Subscription | Subscribe to InTheSnow | In The Snow';
    return false;
  	});
	
	// ITS Subscription Option 3
	jQuery('#its-hardcopy-paid-show').click(function() {
   		jQuery('.its-free-subscribe, .its-hardcopy-subscribe').fadeOut(0);
		jQuery('.its-hardcopy-paid').fadeIn(1000);
	 	document.title = 'Paid Hardcopy Subscription | Subscribe to InTheSnow | In The Snow';
    return false;
  	});
	
	
	
});

// END
