$(document).ready(function() {
// Preload Images
 $.preloadCssImages();

// Menu Odd and Even Colours
$('.zebra li:even').addClass('stripe-even'); 
$('.zebra li:odd').addClass('stripe-odd'); 

/* Cycle through the Quotes
$('#testimoniallist').cycle({
	fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	speed:  4000
});*/

 $('#featureboxes').innerfade({ 
  speed: 'slow', 
  timeout: 4000, 
  type: 'sequence', 
  containerheight: '160px' 
 }); 

 $('#specialbox').innerfade({ 
  speed: 'slow', 
  timeout: 4000, 
  type: 'sequence', 
  containerheight: '160px' 
 }); 

 $('#quotes').innerfade({ 
  speed: 'slow', 
  timeout: 4000, 
  type: 'sequence', 
  containerheight: '48px' 
 }); 

 $('#testimoniallist').innerfade({ 
  speed: 'slow', 
  timeout: 10000, 
  type: 'sequence', 
  containerheight: '400px' 
 }); 
 
// Set Background of First Sliding Box
  $('.expand:first').css('background-position','0% 100%');
  $('div em:first').css('visibility','hidden');

// Sliding
  $('#insidemiddlepanel:eq(0)> div.greenbox:gt(0)').hide();
  $('#insidemiddlepanel:eq(0)> a.expand').click(function() {
  var currentId = $(this).attr('id');
  $('.expand').css('background-position','0% 0%');
  $(this).css('background-position','0% 100%');
  $('.click').css('visibility','visible');
  $('#click'+currentId).css('visibility','hidden');
  $(this).next('div:hidden').slideDown('fast').siblings('div:visible').slideUp('fast');

switch(currentId) {
case 'b5':
  $('#hero').css('background-image','url(images/adult.jpg)');
break;
case 'b6':
  $('#hero').css('background-image','url(images/child.jpg)');
break;
case 'b7':
  $('#hero').css('background-image','url(images/elderly.jpg)');
break;
case 'b8':
  $('#hero').css('background-image','url(images/pregnant.jpg)');
break;
case 'b9':
  $('#hero').css('background-image','url(images/other.jpg)');
break;
case 'b10':
  $('#hero').css('background-image','url(images/design/spacer.gif)');
break;
}
 });

// Sliding2
  $('#insidemiddlepanel2:eq(0)> div.greenbox:gt(0)').hide();
  $('#insidemiddlepanel2:eq(0)> a.expand').click(function() {
  var currentId = $(this).attr('id');
  $('.expand').css('background-position','0% 0%');
  $(this).css('background-position','0% 100%');
  $('.click').css('visibility','visible');
  $('#click'+currentId).css('visibility','hidden');
  $(this).next('div:hidden').slideDown('fast').siblings('div:visible').slideUp('fast');  
 });

// this one liner handles all the examples on this page 
  $('a.media').media();

});

var myDate = new Date ();
function getdate() {
document.userInput.name.value=myDate;
}