$(function()
{
	if(showq == "yes")
	{
		$('.submitBtn').animate({opacity:.4});
		$('.submitBtn_clutch').animate({opacity:.4});
		$('.submitBtn_throttle').animate({opacity:.4});
		$('.submitBtn_idle').animate({opacity:.4});
		$('.submitBtn_desupper').animate({opacity:.4});
		$('.submitBtn_desupper_abs').animate({opacity:.4});
		$('.submitBtn_singledisk').animate({opacity:.4});
		$('.submitBtn_swivelfit').animate({opacity:.4});
		$('.submitBtn_rearbrake').animate({opacity:.4});
		$('.submitBtn_ignitionwires').animate({opacity:.4});
		
	}
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR PRODUCT PAGE/////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(purchaseable != "true")
		{
		//console.log(purchaseable);
			jAlert('Please answer all questions before you purchase.', 'Alert Dialog');
			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function() 
	
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR SBB CLUTCH /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_clutch').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(clutchable != "true")
		{
			jAlert('Please answer all Clutch questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Clutch questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_clutch').slideDown();
			    } else
			    {
			    	clutchable = "true";
			    	showQuestions('_clutch');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_clutch').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function()
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR SBB THROTTLE /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_throttle').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(throttleable != "true")
		{
			jAlert('Please answer all Throttle questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Throttle questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_throttle').slideDown();
			    } else
			    {
			    	throttleable = "true";
			    	showQuestions('_throttle');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_throttle').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function()
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR SBB IDLE /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_idle').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(idleable != "true")
		{
			jAlert('Please answer all Idle questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Idle questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_idle').slideDown();
			    } else
			    {
			    	idleable = "true";
			    	showQuestions('_idle');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_idle').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function()
	
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR DESUPPER IDLE /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_desupper').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(desupperable != "true")
		{
			jAlert('Please answer all Designer Upper Assembly questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Designer Upper Assembly questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_desupper').slideDown();
			    } else
			    {
			    	desupperable = "true";
			    	showQuestions('_desupper');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_desupper').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function() 
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR DESUPPER ABS IDLE /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_desupper_abs').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(desupperabsable != "true")
		{
			jAlert('Please answer all Designer Upper ABS Assembly questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Designer Upper ABS Assembly questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_desupper_abs').slideDown();
			    } else
			    {
			    	desupperabsable = "true";
			    	showQuestions('_desupper_abs');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_desupper_abs').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function() 
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR SINGLE DISK IDLE /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_singledisk').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(singlediskable != "true")
		{
			jAlert('Please answer all Front Single Disc Brake questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Front Single Disc Brake questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_singledisk').slideDown();
			    } else
			    {
			    	singlediskable = "true";
			    	showQuestions('_singledisk');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_singledisk').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function() 
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR SWIVELFIT  /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_swivelfit').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(swivelfitable != "true")
		{
			jAlert('Please answer all Swivel Fit questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Swivel Fit questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_swivelfit').slideDown();
			    } else
			    {
			    	swivelfitable = "true";
			    	showQuestions('_swivelfit');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_swivelfit').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function() 
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR REARBRAKE  /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_rearbrake').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(rearbrakeable != "true")
		{
			jAlert('Please answer all Rear Brake questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Rear Brake questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_rearbrake').slideDown();
			    } else
			    {
			    	rearbrakeable = "true";
			    	showQuestions('_rearbrake');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_rearbrake').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function() 
	
	//////////////////////////////////////////////////////////////////////////////////////
	//FOR IGNITION WIRES  /////////////////////////////////////////////////////////////////////////
	//////////////////////////////////////////////////////////////////////////////////////
	
	$('.submitBtn_ignitionwires').click(function()
	{
		var me = $(this);
		var theID = $(this).attr('rel');
		
		////console.log("Purchaseable: " + purchaseable);
		if(ignitionwiresable != "true")
		{
			jAlert('Please answer all Ignition Wire questions before you purchase.', 'Alert Dialog');
			
			jConfirm('You need to answer all Ignition Wire questions before purchasing. To skip the questions click "Cancel".', 'Confirmation Dialog', function(r) {
			    
			    
			    if(r)
			    {
			    	$('#qContainer_ignitionwires').slideDown();
			    } else
			    {
			    	ignitionwiresable = "true";
			    	showQuestions('_ignitionwires');
			    	jAlert('Buy Now Buttons Activated, you may now purchase.', 'Alert Dialog');
			    	$('#_ignitionwires').fadeOut();
			    }
			    
			    
			});

			
		} else
		{
			$('#'+theID+'con').html('<img src="images/ajax-loader.gif"/>');
		
			$('#'+theID).ajaxSubmit(
			{
				success: function()
				{
					$('#'+theID+'con').html('<a href="shopping_cart.php" target="_parent">Added to Cart</a>');
					
				} //success: function()
				
			}); //$('#'+theID).ajaxSubmit(
		}
		
		
		return false;
		
	}); //$('.submitBtn').click(function() 
	


});