
jQuery(function( $ ){
	// Fading banner on homepage
	$('.banner01').cycle({fx:'fade', 
    				  timeout:4500});
					  
					  
var $title = $("#options-queue :selected").text();
$('#fancySelectBar').val($title);


/**
*   Change a date below to match your important date(s), format is year, month-1, day, hour(24), min, sec
    Also edit the comment to reflect the name of your important date ie: date="<edit name of date>".
**/
var dates = [
    // date = "Father's Day"
     date1 = {year:  2010,
                month:  9	-1, 
                day:    5, 
                hour:   0, 
                minute: 0, 
                second: 0   },
				
    // date = "CHRISTMAS"
     date2 = {year:   2010,
                 month:  12-1, 
                 day:    25, 
                 hour:   0, 
                 minute: 0, 
                 second: 0   },
				 
	// date = "New Years"
      date5 = {year:   2011,
                 month:  1-1, 
                 day:    1, 
                 hour:   0, 
                 minute: 0, 
                 second: 0   },
				
     // date = "Australia Day"
      date7 = {year:   2011,
                 month:  1-1, 
                 day:    26, 
                 hour:   0, 
                 minute: 0, 
                 second: 0   },
				 
     // date = "VALENTINE'S DAY"
      date4 = {year:  2011,
                 month:  2-1, 
                 day:    14, 
                 hour:   0, 
                 minute: 0, 
                 second: 0   },
     
     // date = "ST PADDY'S"
      date3 = {year:  2011,
                 month:  3-1, 
                 day:    17, 
                 hour:   0, 
                 minute: 0, 
                 second: 0   },
				 
      // date = "EASTER"
       date8 = {year:   2011,
                  month:  4-1, 
                  day:    2, 
                  hour:   0, 
                  minute: 0, 
                  second: 0   },   
				 
	 // date = "Mother's Day"
      date6 = {year:   2011,
                month:  5-1, 
                day:    9, 
                hour:   0, 
                minute: 0, 
                second: 0   },
				  
      // date = ""
       date9 = {year:   2010,
                   month:  1-1, 
                   day:    0, 
                   hour:   0, 
                   minute: 0, 
                   second: 0   }
				   
	];    
/**
*   Set countdown times for each option/important date
**/ 
for(var i=0;i<dates.length;i++){
	//alert (dates[1].year);    
    $('#countdownPane'+(i+1)).countdown({until: new Date(
	dates[i].year, dates[i].month, dates[i].day, dates[i].hour, dates[i].minute, dates[i].second
	), format: 'ODHMS'});
}	

/**
*   Identify which option has been selected and scroll to appropriate countdown pane and display the title in the fancySelectBar
**/
    var $paneOptions = $('#pane-options');
    
    if ($.browser.msie || $.browser.chrome || $.browser.safari) {
        $('#options-queue').change(function(){
            var $option = $("#options-queue option").index($("#options-queue option:selected"));
            $paneOptions.scrollTo( 'li:eq('+$option+')', 2000, { queue:true });
            var $title = $("#options-queue :selected").text();
            $('#fancySelectBar').val($title);
        });
    }
    else { // if firefox...
        $('#options-queue option').click(function(){
            var $option = $("#options-queue option").index($("#options-queue option:selected"));
            $paneOptions.scrollTo( 'li:eq('+$option+')', 2000, { queue:true });
            var $title = $("#options-queue :selected").text();
            $('#fancySelectBar').val($title);
        });
    }
    
    

});

