// getTwitters('tweet', {
//     id: 'calenp',
//     count: 1,
//     enableLinks: false,
//     ignoreReplies: true,
//     clearContents: true,
//     template: '%text%'
// });

$(function() {
// run the code in the markup!
    $('#slideshow').cycle({ 
		fx:    'fade', 
		speed:    3000, 
		timeout:  2000  
	});

	$('#toplogo').click(function(){
		$('.active').removeClass('active');
		$(this).addClass('active');
		$('.activepanel').fadeOut(200,function(){
			$('.activepanel').removeClass('activepanel');
			$('#getstarted').addClass('activepanel');
			$('#getstarted').fadeIn(200);
			$('#loadcontents').fadeOut(function(){
				$('.scrollContainer').css('height','360px');
				$('.activepanel').fadeIn(100);
				$('#campaign').show();
				$('#toppanel').fadeIn();				
			});
		});
	})

	$('#nav_what_is_calenp').click(function(){
		$('.active').removeClass('active');
		$(this).addClass('active');
		$('.activepanel').fadeOut(200,function(){
			$('.activepanel').removeClass('activepanel');
			$('#what_is_calenp').addClass('activepanel');
			$('#what_is_calenp').fadeIn(200);
			$('#loadcontents').fadeOut(function(){
				$('.scrollContainer').css('height','360px');
				$('.activepanel').fadeIn(100);
				$('#campaign').show();
				$('#toppanel').fadeIn();				
			});
		});
	})
	
	$('#nav_how_to_order').click(function(){
		$('.active').removeClass('active');
		$(this).addClass('active');
		$('.activepanel').fadeOut(200,function(){
			$('.activepanel').removeClass('activepanel');
			$('#how_to_order').addClass('activepanel');
			$('#how_to_order').fadeIn(200);
			$('#loadcontents').fadeOut(function(){
				$('.scrollContainer').css('height','360px');
				$('.activepanel').fadeIn(100);
				$('#campaign').show();
				$('#toppanel').fadeIn();				
			});
		});
	})

	$('#nav_about_payment').click(function(){
		$('.active').removeClass('active');
		$(this).addClass('active');
		$('.activepanel').fadeOut(200,function(){
			$('.activepanel').removeClass('activepanel');
			$('#about_payment').addClass('activepanel');
			$('#about_payment').fadeIn(200);
			$('#loadcontents').fadeOut(function(){
				$('.scrollContainer').css('height','360px');
				$('.activepanel').fadeIn(100);
				$('#campaign').show();
				$('#toppanel').fadeIn();				
			});
		});
	})
	
	$('#nav_about_delivery').click(function(){
		$('.active').removeClass('active');
		$(this).addClass('active');
		$('.activepanel').fadeOut(200,function(){
			$('.activepanel').removeClass('activepanel');
			$('#about_delivery').addClass('activepanel');
			$('#about_delivery').fadeIn(200);
			$('#loadcontents').fadeOut(function(){
				$('.scrollContainer').css('height','360px');
				$('.activepanel').fadeIn(100);
				$('#campaign').show();
				$('#toppanel').fadeIn();				
			});
		});
	})
	
	$('#nav_about_price').click(function(){
		$('.active').removeClass('active');
		$(this).addClass('active');
		$('.activepanel').fadeOut(200,function(){
			$('.activepanel').removeClass('activepanel');
			$('#about_price').addClass('activepanel');
			$('#about_price').fadeIn(200);
			$('#loadcontents').fadeOut(function(){
				$('.scrollContainer').css('height','360px');
				$('.activepanel').fadeIn(100);
				$('#campaign').show();
				$('#toppanel').fadeIn();				
			});
		});
	})

	$('#closebrowsercheck').click(function(){
		$('#browsercheck').hide();
	})
	
	$('#sliderlink li a').click(function(){
		$('#nav_getstarted').css('visibility','visible');
	})
	
	$('#nav_getstarted').click(function(){
		$('.active').removeClass('active');
		$(this).addClass('active');
		
		$('.activepanel').fadeOut(200,function(){
			$('.activepanel').removeClass('activepanel');
			$('#getstarted').addClass('activepanel');
			$('#getstarted').fadeIn(200);
		});
	})
	
	$('#termsofuse').click(function(){
		
		$('.scrollContainer').css('height','50px');
		$('.activepanel').fadeOut(100);
		$('#toppanel').fadeOut(function(){
			$('#campaign').hide();
			$('#cancelpage').show();
			$('#loadcontents').fadeIn();
			$('#loadcontents').load("termsofuse.php");
			
		});
	})
	
	$('#privacypolicy').click(function(){
		$('.scrollContainer').css('height','50px');
		$('.activepanel').fadeOut(100);
		$('#toppanel').fadeOut(function(){
			$('#campaign').hide();
			$('#cancelpage').show();
			$('#loadcontents').fadeIn();
			$('#loadcontents').load("privacypolicy.php");
			
		});
	})
	
	$('#tokushouhou').click(function(){
		$('.scrollContainer').css('height','50px');
		$('.activepanel').fadeOut(100);
		$('#toppanel').fadeOut(function(){
			$('#campaign').hide();
			$('#cancelpage').show();
			$('#loadcontents').fadeIn();
			$('#loadcontents').load("tokushouhou.php");
			
		});
	})
	
	$('#cancelpage').click(function(){
		$(this).hide();
		$('#loadcontents').fadeOut(function(){
			$('.scrollContainer').css('height','360px');
			$('.activepanel').fadeIn(100);
			$('#campaign').show();
			$('#toppanel').fadeIn();				
		});
	})
});
