// Set jQuery into no conflict mode
// Doesn't seem to work here
//var $jq = jQuery.noConflict();

$().ready(function() {
  // Sets the Kwicks Accordion in motion
  $('.kwicks').kwicks({	max : 340, spacing : 2, duration:700});
  $('#fav-quote').show();
});

$(document).ready(function() {
	// Hover effect for the Kwicks accordion	
	$('.kwicks li div.accordion-overlay').hover(		
		function(){			
			$(this).children('div.accordion-textbox').stop().animate({top: '50px'}, 600, 'easeOutCubic');},			
		function(){			
			$(this).children('div.accordion-textbox').stop().animate({top: '300px'}, 1000, 'easeOutCubic');
	});
	
	$('.kwicks li div.accordion-overlay').hover(		
		function(){			
			$(this).children('span.modern-position').stop(true,true).animate({left: '-170px'}, 600);
			$(this).children('span.ie-position').stop(true,true).animate({left: '-34px'}, 300);
		},			
		function(){			
			$(this).children('span.modern-position').stop(true,true).animate({left: '-134px'}, 600);
			$(this).children('span.ie-position').stop(true,true).animate({left: '0px'}, 300);
	});	
	
	// Browse-specific code to make accordion degrade gracefully 
	if (jQuery.browser.msie) { 
		if(parseInt(jQuery.browser.version) == 8) { 
			$('span.accordion-title').removeClass('modern-position').addClass('ie-position'); 
		} 
	} 
	if (jQuery.browser.msie) { 
		if(parseInt(jQuery.browser.version) == 7) { 
			$('span.accordion-title').removeClass('modern-position').addClass('ie-position'); 
		} 
	} 	
			
	if(jQuery.browser.safari && parseInt(jQuery.browser.version.substr(0,3))<528){
		 $('span.accordion-title').hide(300);
	}
	
	if(jQuery.browser.opera) {
		 $('span.accordion-title').hide(300);
	}
			
	if(jQuery.browser.mozilla && jQuery.browser.version <= "1.9") {
		 $('span.accordion-title').hide(300);
	}

	$('#kwick0').hover(
	  function(){
	    $('#fav-quote').fadeTo(300,1);
	  },
	  function(){
	    $('#fav-quote').fadeTo(300,0);
	  });
});
