var JQ = jQuery.noConflict();

JQ(document).ready(function() {
	JQ("a.iframe").fancybox({
			'hideOnContentClick': false,
			'centerOnScroll': true,
			'overlayOpacity': .75,
			'width' : 455,
			'autoDimensions': true
	});

	JQ.post("ajaxAddToCart.php", {serviceid: "none"}, function(data){
		if(data.length >0) {

			JQ('#serviceCart').html(data);
		}
	});
	
	JQ('.category_container .category_toggle').click(function() {
		JQ(this).closest('.category_parent').find('.category_children').slideToggle();
		return false;
	});
	
	JQ('.category_container .category_children input').change(function() {
		JQ(this).closest('.category_parent').find('h3 .count').html('('+JQ(this).closest('ul').find('input:checked').length+')');
	});
	
	JQ('.category_container .category_children').each(function() {
		JQ(this).closest('.category_parent').find('h3 .count').html('('+JQ(this).find('input:checked').length+')');
	});
});

function addToCart(serviceID) {
	JQ('#serviceCart').animate({ backgroundColor: "yellow" }, 300, function() {
		JQ('#serviceCart').animate({ backgroundColor: "white" }, 1000);
	  });
	JQ.post("ajaxAddToCart.php", {serviceid: ""+serviceID+""}, function(data){
		if(data.length >0) {
			
			JQ('#serviceCart').html(data);
		}
	});
}



