// JavaScript Document

$(document).ready(function() {


$("#accordion ul li").addClass('start');

//if ($("#accordion ul li").is(':animated')) {
//			return false; // Don't click through
//		} 
//		
//	else {

	$("#accordion ul li").click(function(){
    if ($(':animated').length) { 
        return false; 
    } 

	
        $(this).css('backgroundPosition', '0 -476px');
        $("#accordion ul li").not(this).css('backgroundPosition', '0 0');
		
		
		if ($(this).is(".open")) {  //If it's already open then do nothing
		
			} 
			
		else {
			
			$("#accordion ul li").not(this).animate({'width':'156px'}, { queue:false, duration:880 });
			$("#accordion ul li").not(this).removeClass('open');
			$("#accordion ul li").not(this).addClass('start');
            $("#accordion ul li").find('.desc').not(this).hide();
			
			$(this).animate({'width':'648px'},{ queue:false, duration:880 });
			$(this).removeClass('start');
			$(this).addClass('open');
			$(this).animate({'width':'648px'},900);
            $(this).find('.desc').delay(900).fadeIn(0);
		}
		});
//	}


$("#accordion ul li").mouseover(function(){
		if ($(this).is(".open")) {
			return false; // Don't click through
			}
		else {
        	$(this).css('backgroundPosition', '0 -476px');
		}
		});
		
$("#accordion ul li").mouseout(function(){
		if ($(this).is(".open")) {
			return false; // Don't click through
			}
		else {
        	$(this).css('backgroundPosition', '0 0');
		}
		});

});//Close Function
