jQuery(document).ready(function($) {
		    $('.carousel').cycle({
				fx: 'scrollBothWays',
				speed: 1000,
				timeout: 10000,
				pager: '#pager'			
			});
			
			$('#g1').click(function() {  
			    $('#c1').cycle(0);  
			    return false;  
			});
			
			$('#g2').click(function() {  
			    $('#c1').cycle(1);  
			    return false;  
			});
			
			$('#g3').click(function() {  
			    $('#c1').cycle(2);  
			    return false;  
			});
			
			$('#g4').click(function() {  
			    $('#c1').cycle(3);  
			    return false;  
			});
			
			$('#g5').click(function() {  
			    $('#c1').cycle(4);  
			    return false;  
			});
			
			$('.swipe').swipe({
				 threshold: { x: 100, y: 100 },
				 swipeLeft: function() { $('#c1').cycle('next') },
				 swipeRight: function() { $('#c1').cycle('prev') },
			})
			
			$('.carousel li img').hover(function() {
			  //$('.carousel li div').slideToggle('slow', function() {
			    // Animation complete.
			  //});
			});
			
			$('.lm_gallery li a').click(function() {
			  var img = $(this).attr("href");
			  $('.lm_gallery_main img').attr("src", img);
			  return false;
			});
			
		});
		
jQuery.fn.cycle.transitions.scrollBothWays = function(jQuerycont, jQueryslides, opts) {	
			jQuerycont.css('overflow','hidden');
			opts.before.push(jQuery.fn.cycle.commonReset);

			// custom transition fn (trying to get it to scroll forward and backward)
		
			opts.fxFn = function(curr, next, opts, cb, fwd) {
			
				var w = jQuerycont.width();	
				opts.cssFirst = { left: 0 };
				opts.animIn	  = { left: 0 };
		
				if(fwd){
					opts.cssBefore= { left: w, top: 0 };
					opts.animOut  = { left: 0-w };
				}else{
					opts.cssBefore= { left: -w, top: 0 };
					opts.animOut  = { left: w };
				};
		
				var jQueryl = jQuery(curr), jQueryn = jQuery(next);
				var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut, animOut = opts.animOut, animIn = opts.animIn;
		
				jQueryn.css(opts.cssBefore);
		
				var fn = function() {jQueryn.show();jQueryn.animate(animIn, speedIn, easeIn, cb);};
		
				jQueryl.animate(animOut, speedOut, easeOut, function() {
					if (opts.cssAfter) jQueryl.css(opts.cssAfter);
					if (!opts.sync) fn();
				});
				if (opts.sync) fn();
			};
		};
