jQuery(document).ready(function() {
          if(jQuery("#carousel-main")){
        	  jQuery("#carousel-main li").css('display', 'block');
	        jQuery("#carousel-main").jcarousel({
	          scroll: 1,
	          auto: 18,
	          wrap: 'circular',
	          initCallback: carousel_main_init,
	          buttonNextHTML: null,
	          buttonPrevHTML: null
	        });
	        
          }

		if(jQuery("#carousel-offer")){
			jQuery("#carousel-offer li").css('display', 'block');
        	jQuery("#carousel-offer").jcarousel({
              scroll: 1,
              wrap: 'circular',
              initCallback: carousel_offer_init,
              buttonNextHTML: null,
              buttonPrevHTML: null
          	});
		}
		
		if(jQuery("#carousel-shops")){
			jQuery("#carousel-shops li").css('display', 'block');
		        jQuery("#carousel-shops").jcarousel({
		          scroll: 1,
		          wrap: 'circular',
		          initCallback: carousel_init,
		          buttonNextHTML: null,
		          buttonPrevHTML: null
		        });
		}
		
		imgCheckbox();
});



function imgCheckbox(){
	// check for what is/isn't already checked and match it on the fake ones
	jQuery("input:checkbox").each( function() {
		jQuery('<a href="#'+this.id+'" class="fakecheck" id="fake'+this.id+'" style="position:relative; top:10px; left:10px;"></a>').insertBefore(jQuery(this));
		(this.checked) ? jQuery("#fake"+this.id).addClass('fakechecked') : jQuery("#fake"+this.id).removeClass('fakechecked');
		jQuery(this).css('visibility', 'hidden');
		jQuery(this.parentNode).css('padding-left', '30px');
		
		var t = this;
		jQuery(this.parentNode).find('label').click(function(){
			(!t.checked) ? jQuery("#fake"+t.id).addClass('fakechecked') : jQuery("#fake"+t.id).removeClass('fakechecked');
		});
	});
	
	// function to 'check' the fake ones and their matching checkboxes
	jQuery(".fakecheck").click(function(){
		(jQuery(this).hasClass('fakechecked')) ? jQuery(this).removeClass('fakechecked') : jQuery(this).addClass('fakechecked');
		jQuery(this.hash).trigger("click");
		return false;
	});
}
