
		function resizeContent(curr, next, opts){

			var product_detail_height = jQuery('#products-detail').find('.product-detail-wrap:visible').height();

			jQuery('#main').animate({
				height:		product_detail_height
			});

		}


		var starting_slide = 0;

		jQuery('.product_enquire_form .error_feedback').each(function(){

			jQuery(this).parent().show();
			starting_slide = jQuery(this).parent().parent().index();

			jQuery(this).parent().css({
				height:	'100%'
			});


		});


		jQuery('.product-detail-wrap').each(function(){
	
			if(jQuery(this).height() < 350){
	
				jQuery(this).css('height', '450px !important');
	
			}

		})



	    // init and stop the inner slideshows
	    var inners = jQuery('.main_image').cycle().cycle('stop');
	    
	    var slideshow = jQuery('#products-detail').cycle({
	        fx: 'scrollHorz',
	        speed: 600,
	        timeout: 0,
			startingSlide: starting_slide,
			slideExpr:	'.product-detail-wrap',
			pager:  '.products-list-group',
		    pagerAnchorBuilder: function(idx, slide) { 
		        // return selector string for existing anchor 
		        return '.products-list-group .product:eq(' + idx + ')'; 
		    },
	        after: function() {

				jQuery('.thumb_links a').each(function(){

					jQuery(this).remove();

				})

	            jQuery('.product-image .main_image', this).cycle({
	                fx: 'scrollHorz',
	                timeout: 0,
					speed:	500,
					pager:  '.thumb_links'
	            });
	        }
	    });



		if(jQuery('.products-list-group .product').length == 1){

			jQuery('.product-image .main_image', this).cycle({
				fx: 'scrollHorz',
				timeout: 0,
				speed:	500,
				pager:  '.thumb_links'
			});

		}


		jQuery('.enquire_button').click(function(){

			var form_height = jQuery(this).parent().parent().height();
			jQuery(this).parent().parent().find('.product_enquire_form').css({
				height:		form_height
			});

			jQuery(this).parent().parent().find('.product_enquire_form').fadeIn();

		});







		jQuery('.close').click(function(){

			jQuery(this).parent().fadeOut()

		});



 



		/*jQuery('.product').click(function(){

			var product_detail_height = jQuery('#products-detail').find('.product-detail-wrap:visible').height();

			//jQuery('#products-detail').

		})*/




	// apply anchor of child to parent
	$('.news_container').click(function(){
		link = jQuery(this).find('a').attr('href');
		window.location = link;
	});


	
	jQuery('.product-image').each(function(){

		var thumb_count = jQuery('.thumb_images a', this).length;

		if(thumb_count <= 1){
	
			jQuery('.thumb_images', this).hide();
	
		}

	});







