
			google.load("jquery", "1.3.2");
google.setOnLoadCallback(function() {
			// Place init code here instead of $(document).ready()
				var addCenter = '205px';
				var removeCenter = '195px'
				var upClicked = false;

				$(window).resize(function() {
					var w = $(window).width( );
			
	
					if( w <= 1000 )
					{
						w = w - 1000;
					}
					else
					{
						w = 0;
					}
				  $('#buy_now_button').css('right', w );
				});
				
				
				function fc_PreProcess() {
				        // do something here before opening the cart... maybe some form error checking?
				        // if you don't want the cart to open, say for example if there were some data validation problems you
				        // want your customer to fix, then return false from this function instead of true.
				        return true;
				}
				

				function fc_BuildFoxyCart() {

				        fc_FoxyCart = "";
				        for (i=0;i<fc_json.products.length;i++) {
				                // BEGIN DO NOT EDIT
				                fc_BuildFoxyCartRow(fc_json.products[i].name,fc_json.products[i].id,fc_json.products[i].options,fc_json.products[i].code,fc_json.products[i].quantity,fc_json.products[i].price_each,fc_json.products[i].price, fc_json.total_price);
				        	// END DO NOT EDIT
				        }

				        // fc_FoxyCart is a javascript variable that now holds your shopping cart data

				        // if you have some products in your cart, why not display it?
				        if (fc_json.products.length > 0) {
				                $("#fc_cart #cart_content").html(fc_FoxyCart);
								$('#fc_checkout_link').css( 'visibility', 'visible');
							
							
								$("#buy_now_button").css('background-position', '-44px 0px')
								
				        } else {
				                $("#fc_cart #cart_content").html("");
								$('#total').attr('innerHTML', "$0.00"); 
								
								$('#fc_checkout_link').css( 'visibility', 'hidden');
								
				        }
						
						$('#buy_now_button').animate( { right: 0}, 1000, function(){});
						$('#loading').remove();
						$('.up').click( function(){ 
							upClicked = true;
							addItem( $(this).attr( 'id').split( "-")[1] ) });
						$('.down').click( function(){ removeItem( $(this).attr( 'id').split( "-")[2] ) });
						
						
				}//end fc_BuildFoxyCart
				
				
				// This function is called by fc_BuildFoxyCart() for each product in your cart.
				// Feel free to edit this function as needed to display each row of your cart.
				function fc_BuildFoxyCartRow(fc_name,fc_id,fc_options,fc_code,fc_quantity,fc_price_each,fc_price, fc_total) {
		
					var fun =  "<div class='up' id='up-"+fc_code+"-"+fc_id+"'>+</div>";
					var down = "<div class='down' id='down-"+fc_code+"-"+fc_id+"'>-</div>";
					fc_FoxyCart += "<tr class=\"order_item\">";
				    fc_FoxyCart += "<td class=\"item_t\">" + fc_name + "</td>";
				//      fc_FoxyCart += "<td>" + fc_options + "</td>";
				//      fc_FoxyCart += "<td>" + fc_code + "</td>";
				         fc_FoxyCart += "<td class=\"quantity_t\">" + fc_quantity + fun + down +"</td>";
						
				        fc_FoxyCart += "<td class=\"price_t\">$" + fc_price_each + "</td>";
				        fc_FoxyCart += "<td class=\"total_t\">$" + fc_price.toFixed(2) + "</td>";
				        fc_FoxyCart += "</tr>";
				
					var total = '$' + fc_total.toFixed( 2 );
					
					$('#total').attr('innerHTML', total); 
				
				}
			
			function openClick()
			{
				var right = $('.shopping_cart').css("right");
				if( right.split( "px" )[0] > -488 )
				{
					right = "-488px";
				}
				else
				{
					right = "-246px";
				}
				$('.shopping_cart').animate({right: right}, 500); 
		
			}//end openclick
			
			function addItem( i )
			{
				
				if( upClicked )
				{
					
					upClicked = false;
					$("<div id='loading'>Adding to cart</div>").appendTo($('#cart_content'));
					$('#loading').css('margin-left', addCenter);
				}
				
				var item = i;
				var id = item;
				var weight = .74;
				$('#fc_checkout_link').css( 'visibility', 'visible');
				
				switch( item )
				{
						case "cobalt_blue":
							item = "Cobalt Blue Clear Shot";
							itemID = 1;
							price = 19.95;
							
							break;
						case "racing_red":
							item = "Racing Red Clear Shot";
							itemID = 2;
							
							price = 19.95;
							break;
						case "safety_orange":
							item = "Safety Orange Clear Shot";
							itemID = 3;
							
							price = 19.95;
							break;
						case "matte_silver":
							item = "Matte Silver Clear Shot";
							itemID = 4;
							
							price = 19.95;
							break;
						case "grab_n_go":
							item = "Grab-n-Go Kit";
							itemID = 5;
							weight = 0.32;
							price = 10.95;
							break;
						case "refill_kit":
							item = "Fluid Refill Kit";
							itemID = 6;
							weight = 0.77;
							price = 16.95;
							break;
						case "cloths":
							item = "Extra Cloth Kit";
							itemID = 7;	
							weight = 0.32;
							price = 12.95;
							break;
				}
				
				$.getJSON("http://clearshot.foxycart.com/cart?name="+item+"&code="+id+"&price="+price+"&weight="+weight+"&output=json&callback=?"+ fc_AddSession(), function(data){
						// do something with `data`
					
					fc_json = data;
						fc_BuildFoxyCart( );
					
					});
				
			}//end addItem
			
			function removeItem( j )
			{
				$("<div id='loading'>Removing from cart</div>").appendTo($('#cart_content'));
				$('#loading').css('background-position', '95px 2px');
				$('#loading').css('width', '115px');
				$('#loading').css('margin-left', removeCenter);
				
				 for (i=0;i<fc_json.products.length;i++)
				 {
				
			                // BEGIN DO NOT EDI
						if( fc_json.products[i].id == j ) 
				  		{
							var quant = fc_json.products[i].quantity - 1;
						
						$.getJSON("https://clearshot.foxycart.com/cart?output=json&cart=update&id="+j+"&quantity="+quant+"&callback=?"+ fc_AddSession(), function( data )
						{
							fc_json = data;
							fc_BuildFoxyCart( );
						});
			       }
				 }
			
			}//end removeItem
			
			$.getJSON("http://clearshot.foxycart.com/cart?&output=json&callback=?"+ fc_AddSession(), function(data){
						// do something with `data`
					
					fc_json = data;
						fc_BuildFoxyCart( );

					});
					
			$('#buy_now').click(  function(){openClick( );}
			
			);
			$('#place_order').click( function(){ $('.shopping_cart').animate({right: '0px'}, 500);});
			
			
			$('.product_item').click( function(){ 
				var h = $(this).height( );
				
				$("<div id='loading'>Adding to cart</div>").appendTo($(this));
				$('#loading').css('margin-top', '-15px');
				addItem( $(this).attr('id') ); });
			function addLoadingGif( )
			{
			
				
				
				
			}
			function buildSimpleCart( ){
				
				  fc_FoxyCart = "";
			     var items = "<p>Items: " + fc_json.product_count + "</p>";
			 $('#mini_cart').html(items);
			
		
			}
			
});
			
			