







// runs on pageload

function RunOnLoad()
{
	FixExternalLinks();
}







function changeBagStyle(theForm)
{
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);
	var theInputStyle = forms_getInputObjectByNameAndFormObject("style", theForm);
	var theInputColorCanvas2 = forms_getInputObjectByNameAndFormObject("colorCanvas2", theForm);
	var theInputColorCanvas3 = forms_getInputObjectByNameAndFormObject("colorCanvas3", theForm);
	var theInputColorCanvas4 = forms_getInputObjectByNameAndFormObject("colorCanvas4", theForm);
	
	var theStyle = theInputStyle.value;
	
	if (theStyle == 'Solid')
	{
		theInputColorCanvas2.value = '';
		theInputColorCanvas3.value = '';
		theInputColorCanvas4.value = '';
		$('#formcolorrowcanvas2').addClass('hiderow');
		$('#formcolorrowcanvas3').addClass('hiderow');
		$('#formcolorrowcanvas4').addClass('hiderow');
	}
	else if (theStyle == '1DiagStripe')
	{
		$('#formcolorrowcanvas2').removeClass('hiderow');
		theInputColorCanvas3.value = '';
		theInputColorCanvas4.value = '';
		$('#formcolorrowcanvas3').addClass('hiderow');
		$('#formcolorrowcanvas4').addClass('hiderow');	
	}
	else if (theStyle == 'Sunburst')
	{
		$('#formcolorrowcanvas2').removeClass('hiderow');
		$('#formcolorrowcanvas3').removeClass('hiderow');
		$('#formcolorrowcanvas4').removeClass('hiderow');	
	} 
	else
	{
		$('#formcolorrowcanvas2').removeClass('hiderow');
		$('#formcolorrowcanvas3').removeClass('hiderow');
		if (theInputItemName.value == 'Pannier Messenger Hybrid Bag') {
			$('#formcolorrowcanvas4').removeClass('hiderow');
		} else {
			theInputColorCanvas4.value = '';
			$('#formcolorrowcanvas4').addClass('hiderow');
		}	
	}
}



function changeBagStyleMedi(theForm)

{

	var theInputStyle = forms_getInputObjectByNameAndFormObject("style", theForm);

	var theInputColorCanvas2 = forms_getInputObjectByNameAndFormObject("colorCanvas2", theForm);

	var theInputColorCanvas3 = forms_getInputObjectByNameAndFormObject("colorCanvas3", theForm);

	var theInputColorCanvas4 = forms_getInputObjectByNameAndFormObject("colorCanvas4", theForm);

	

	var theStyle = theInputStyle.value;

	

	if (theStyle == 'MEDISOL')

	{

		theInputColorCanvas2.value = '';

		theInputColorCanvas3.value = '';

		theInputColorCanvas4.value = '';

		$('#formcolorrowcanvas2').addClass('hiderow');

		$('#formcolorrowcanvas3').addClass('hiderow');

		$('#formcolorrowcanvas4').addClass('hiderow');

	}

	else if (theStyle == 'MEDI1DS')

	{

		$('#formcolorrowcanvas2').removeClass('hiderow');

		theInputColorCanvas3.value = '';

		theInputColorCanvas4.value = '';

		$('#formcolorrowcanvas3').addClass('hiderow');

		$('#formcolorrowcanvas4').addClass('hiderow');	

	}

	else if (theStyle == 'MEDIABT')

	{

		theInputColorCanvas2.value = '';

		theInputColorCanvas3.value = '';

		theInputColorCanvas4.value = '';

		$('#formcolorrowcanvas2').addClass('hiderow');

		$('#formcolorrowcanvas3').addClass('hiderow');

		$('#formcolorrowcanvas4').addClass('hiderow');

	}

	else if (theStyle == 'MEDISB')

	{

		$('#formcolorrowcanvas2').removeClass('hiderow');

		$('#formcolorrowcanvas3').removeClass('hiderow');

		$('#formcolorrowcanvas4').removeClass('hiderow');	

	} 

	else

	{

		$('#formcolorrowcanvas2').removeClass('hiderow');

		$('#formcolorrowcanvas3').removeClass('hiderow');

		theInputColorCanvas4.value = '';

		$('#formcolorrowcanvas4').addClass('hiderow');	

	}

}



function changeBackpackStyle(theForm)

{

	var theInputStyle = forms_getInputObjectByNameAndFormObject("style", theForm);

	var theInputColorCanvas2 = forms_getInputObjectByNameAndFormObject("colorCanvas2", theForm);

	var theInputColorCanvas3 = forms_getInputObjectByNameAndFormObject("colorCanvas3", theForm);

	var theInputColorCanvas4 = forms_getInputObjectByNameAndFormObject("colorCanvas4", theForm);

	

	var theStyle = theInputStyle.value;

	

	if (theStyle == 'BKPKSTR')

	{

		theInputColorCanvas4.value = '';

		$('#formcolorrowcanvas4').addClass('hiderow');

	}

	else

	{

		$('#formcolorrowcanvas2').removeClass('hiderow');

		$('#formcolorrowcanvas3').removeClass('hiderow');

		$('#formcolorrowcanvas4').removeClass('hiderow');

	}

}



function changeBagStrap(theForm)

{

	var theInputStrapPad = forms_getInputObjectByNameAndFormObject("strappad", theForm);

	var theInputStrapPadColor = forms_getInputObjectByNameAndFormObject("colorStrapPad", theForm);

	

	var theStrapPad = theInputStrapPad.value;

	

	if (theStrapPad != 'StrapPad')

	{

		theInputStrapPadColor.value = '';

		$('#formcolorrowstrappad').addClass('hiderow');

	}

	else

	{

		$('#formcolorrowstrappad').removeClass('hiderow');

	}

}

											

function clickBuyNowForBag(theForm)
{
	var sError = '';

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);
	var theInputPrice = forms_getInputObjectByNameAndFormObject("amount", theForm);

	var bPetite = false;
	var bPannier = false;
	var fBasePrice = 90;

	if (theInputItemName.value == 'Petite Bag')
	{
		bPetite = true;
		fBasePrice = 90;
	}
	else if (theInputItemName.value == 'Standard Bag')
	{
		fBasePrice = 115;
	}
	else if (theInputItemName.value == 'Standard Wide Bag')
	{
		fBasePrice = 130;
	}
	else if (theInputItemName.value == 'Pannier Messenger Hybrid Bag')
	{
		bPannier = true;
		fBasePrice = 135;
	}
	
	//alert(theInputItemName + '...' + theInputItemName.value + '...' + fBasePrice);

	var theInputStyle = forms_getInputObjectByNameAndFormObject("style", theForm);
	var theInputColorCanvas = forms_getInputObjectByNameAndFormObject("colorCanvasMain", theForm);
	var theInputColorCanvas2 = forms_getInputObjectByNameAndFormObject("colorCanvas2", theForm);
	var theInputColorCanvas3 = forms_getInputObjectByNameAndFormObject("colorCanvas3", theForm);
	var theInputColorCanvas4 = forms_getInputObjectByNameAndFormObject("colorCanvas4", theForm);
	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);
	var theInputShoulder = forms_getInputObjectByNameAndFormObject("shoulder", theForm);
	if (!bPannier) {
		var theInputStabilizer = forms_getInputObjectByNameAndFormObject("stabilizer", theForm);
		var theInputReflector = forms_getInputObjectByNameAndFormObject("reflector", theForm);
		var theInputStrapPad = forms_getInputObjectByNameAndFormObject("strappad", theForm);
		var theInputStrapPadColor = forms_getInputObjectByNameAndFormObject("colorStrapPad", theForm);
	}
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theStyle = theInputStyle.value;
	var theColorCanvas = theInputColorCanvas.value;
	var theColorCanvas2 = theInputColorCanvas2.value;
	var theColorCanvas3 = theInputColorCanvas3.value;
	var theColorCanvas4 = theInputColorCanvas4.value;
	var theColorVinyl = theInputColorVinyl.value;
	var theShoulder = theInputShoulder.value;
	if (!bPannier) {
		var theStabilizer = theInputStabilizer.value;
		var theReflector = theInputReflector.value;
		var theStrapPad = theInputStrapPad.value;
		var theStrapPadColor = theInputStrapPadColor.value;
	}
	var theQty = theInputQty.value;


	if (theInputStyle !== false)
	{
		if (theStyle == '')
		{
			sError = sError + ' Style is required.';
		}	
	}

	if (theInputColorCanvas !== false)
	{
		if (theColorCanvas == '')
		{
			sError = sError + ' Canvas Color is required.';
		}	
	}
	
	if (theStyle != 'Solid')
	{
		if (theInputColorCanvas2 !== false)
		{
			if (theColorCanvas2 == '')
			{
				sError = sError + ' Canvas Color #2 is required.';
			}	
		}
		
		if (theStyle != '1DiagStripe')
		{
			if (theInputColorCanvas3 !== false)
			{
				if (theColorCanvas3 == '')
				{
					sError = sError + ' Canvas Color #3 is required.';
				}	
			}
		}
		
		if (theStyle == 'Sunburst' || bPannier)
		{
			if (theInputColorCanvas4 !== false)
			{
				if (theColorCanvas4 == '')
				{
					sError = sError + ' Canvas Color #4 is required.';
				}	
			}
		}				
	}

	if (theInputColorVinyl !== false)
	{
		if (theColorVinyl == '')
		{
			sError = sError + ' Vinyl Color is required.';
		}	
	}

	if (!bPannier) {
		if (theStrapPad == 'StrapPad')
		{
			if (theInputStrapPadColor !== false)
			{
				if (theStrapPadColor == '')
				{
					sError = sError + ' Strap Pad Color is required.';
				}	
			}
		}
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
			
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theStyle !== '')
		{
			theInputItemName.value = theInputItemName.value + ', ' + theStyle;
		}

		if (theColorCanvas !== '')
		{
			theInputItemName.value = theInputItemName.value + ':' + theColorCanvas;
		}

		if (theStyle != 'Solid')
		{		
			if (theColorCanvas2 !== '')
			{
				theInputItemName.value = theInputItemName.value + ',' + theColorCanvas2;
			}
	
			if (theStyle != '1DiagStripe')
			{
				if (theColorCanvas3 !== '')
				{
					theInputItemName.value = theInputItemName.value + ',' + theColorCanvas3;
				}
			}
			
			if (theStyle == 'Sunburst')
			{
				if (theColorCanvas4 !== '')
				{
					theInputItemName.value = theInputItemName.value + ',' + theColorCanvas4;
				}			
			}
		}
		
		if (theStyle == '1DiagStripe')
		{
			fBasePrice = fBasePrice + 10;		
		}
		else if (theStyle == '2DiagStripe')
		{
			fBasePrice = fBasePrice + 20;
		}
		else if (theStyle == '2VertStripe')
		{
			fBasePrice = fBasePrice + 20;
		}
		else if (theStyle == 'Sunburst')
		{
			fBasePrice = fBasePrice + 30;
		}
		else if (theStyle == 'BkCnvStripe')
		{
			if (bPannier) {
				fBasePrice = fBasePrice + 40;
			} else {
				fBasePrice = fBasePrice + 55;
			}
		}
						
		if (theColorVinyl !== '')
		{
			theInputItemName.value = theInputItemName.value + ',' + theColorVinyl;
		}

		if (theShoulder !== '')
		{
			theInputItemName.value = theInputItemName.value + ' +' + theShoulder;
		}
		
		if (!bPannier) {					
			if (theStabilizer !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theStabilizer;
			}
			
			if (theReflector !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theReflector;
			}
			
			if (theStrapPad !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theStrapPad;
			}
			
			if (theStrapPad == 'StrapPad')
			{
				theInputItemName.value = theInputItemName.value + ':' + theStrapPadColor;
				fBasePrice = fBasePrice + 10;
			}
		}
		
		theInputPrice.value = fBasePrice;
		document.location = 'messenger-bags.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}	
}




function clickBuyNowForBagMedi(theForm)

{

	var sError = '';



	var theInputStyle = forms_getInputObjectByNameAndFormObject("style", theForm);

	var theInputColorCanvas = forms_getInputObjectByNameAndFormObject("colorCanvasMain", theForm);

	var theInputColorCanvas2 = forms_getInputObjectByNameAndFormObject("colorCanvas2", theForm);

	var theInputColorCanvas3 = forms_getInputObjectByNameAndFormObject("colorCanvas3", theForm);

	var theInputColorCanvas4 = forms_getInputObjectByNameAndFormObject("colorCanvas4", theForm);

	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);

	var theInputStabilizer = forms_getInputObjectByNameAndFormObject("stabilizer", theForm);

	var theInputShoulder = forms_getInputObjectByNameAndFormObject("shoulder", theForm);

	var theInputReflector = forms_getInputObjectByNameAndFormObject("reflector", theForm);

	var theInputStrapPad = forms_getInputObjectByNameAndFormObject("strappad", theForm);

	var theInputStrapPadColor = forms_getInputObjectByNameAndFormObject("colorStrapPad", theForm);

	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);

	

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theInputPrice = forms_getInputObjectByNameAndFormObject("amount", theForm);



	var theStyle = theInputStyle.value;

	var theColorCanvas = theInputColorCanvas.value;

	var theColorCanvas2 = theInputColorCanvas2.value;

	var theColorCanvas3 = theInputColorCanvas3.value;

	var theColorCanvas4 = theInputColorCanvas4.value;

	var theColorVinyl = theInputColorVinyl.value;

	var theStabilizer = theInputStabilizer.value;

	var theShoulder = theInputShoulder.value;

	var theReflector = theInputReflector.value;

	var theStrapPad = theInputStrapPad.value;

	var theStrapPadColor = theInputStrapPadColor.value;

	var theQty = theInputQty.value;

	

	var fBasePrice = 100;

	

	if (theInputStyle !== false)

	{

		if (theStyle == '')

		{

			sError = sError + ' Style is required.';

		}	

	}

	

	if (theInputColorCanvas !== false)

	{

		if (theColorCanvas == '')

		{

			sError = sError + ' Canvas Color is required.';

		}	

	}

	

	if (theStyle !== 'MEDISOL' && theStyle !== 'MEDIABT')

	{

		if (theInputColorCanvas2 !== false)

		{

			if (theColorCanvas2 == '')

			{

				sError = sError + ' Canvas Color #2 is required.';

			}	

		}

		

		if (theStyle !== 'MEDI1DS')

		{

			if (theInputColorCanvas3 !== false)

			{

				if (theColorCanvas3 == '')

				{

					sError = sError + ' Canvas Color #3 is required.';

				}	

			}

		}

		

		if (theStyle == 'MEDISB')

		{

			if (theInputColorCanvas4 !== false)

			{

				if (theColorCanvas4 == '')

				{

					sError = sError + ' Canvas Color #4 is required.';

				}	

			}

		}				

	}



	if (theInputColorVinyl !== false)

	{

		if (theColorVinyl == '')

		{

			sError = sError + ' Vinyl Color is required.';

		}	

	}



	if (theStrapPad == 'StrapPad')

	{

		if (theInputStrapPadColor !== false)

		{

			if (theStrapPadColor == '')

			{

				sError = sError + ' Strap Pad Color is required.';

			}	

		}

	}

	

	if (theInputQty !== false)

	{													

		if (theQty == '')

		{

			sError = sError + ' QTY is required.';

		}

		else if (!IsNumeric(theQty))

		{

			sError = sError + ' QTY must be numeric.';

		}

	}

			

	// if no errors update form fields so paypal gets correct prod info and price info												

	if (sError == '')

	{

		if (theStyle !== '')

		{

			theInputItemName.value = theInputItemName.value + ', ' + theStyle;

		}

		

		if (theColorCanvas !== '')

		{

			theInputItemName.value = theInputItemName.value + ':' + theColorCanvas;

		}



		if (theStyle !== 'MEDISOL' && theStyle !== 'MEDIABT')

		{		

			if (theColorCanvas2 !== '')

			{

				theInputItemName.value = theInputItemName.value + ',' + theColorCanvas2;

			}



			if (theStyle !== 'MEDI1DS')

			{

				if (theColorCanvas3 !== '')

				{

					theInputItemName.value = theInputItemName.value + ',' + theColorCanvas3;

				}

			}

			

			if (theStyle == 'MEDISB')

			{

				if (theColorCanvas4 !== '')

				{

					theInputItemName.value = theInputItemName.value + ',' + theColorCanvas4;

				}			

			}

		}

		

		if (theStyle == 'MEDIBTStrp')

		{

			fBasePrice = fBasePrice + 55;		

		}

		else if (theStyle == 'MEDIABT')

		{

			fBasePrice = fBasePrice + 59;

		}

		else if (theStyle == 'MEDISTR')

		{

			fBasePrice = fBasePrice + 15;

		}

		else if (theStyle == 'MEDI1DS')

		{

			fBasePrice = fBasePrice + 10;

		}

		else if (theStyle == 'MEDI2DS')

		{

			fBasePrice = fBasePrice + 20;

		}

		else if (theStyle == 'MEDI2VS')

		{

			fBasePrice = fBasePrice + 20;

		}

		else if (theStyle == 'MEDISB')

		{

			fBasePrice = fBasePrice + 30;

		}

						

		if (theColorVinyl !== '')

		{

			theInputItemName.value = theInputItemName.value + ',' + theColorVinyl;

		}

					

		if (theStabilizer !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theStabilizer;

		}

		

		if (theShoulder !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theShoulder;

		}

		

		if (theReflector !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theReflector;

		}

		

		if (theStrapPad !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theStrapPad;

		}

		

		if (theStrapPad == 'StrapPad')

		{

			theInputItemName.value = theInputItemName.value + ':' + theStrapPadColor;

			fBasePrice = fBasePrice + 10;

		}

		

		theInputPrice.value = fBasePrice;

		document.location = 'messenger-bags.php';

		return true;

	}

	else

	{

		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);

		return false;

	}	

}



function clickBuyNowForBackpack(theForm)
{
	var sError = '';

	var theInputSize = forms_getInputObjectByNameAndFormObject("size", theForm);
	var theInputStyle = forms_getInputObjectByNameAndFormObject("style", theForm);
	var theInputColorCanvas = forms_getInputObjectByNameAndFormObject("colorCanvasMain", theForm);
	var theInputColorCanvas2 = forms_getInputObjectByNameAndFormObject("colorCanvas2", theForm);
	var theInputColorCanvas3 = forms_getInputObjectByNameAndFormObject("colorCanvas3", theForm);
	var theInputColorCanvas4 = forms_getInputObjectByNameAndFormObject("colorCanvas4", theForm);
	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);
	var theInputShoulder = forms_getInputObjectByNameAndFormObject("shoulder", theForm);
	var theInputReinforced = forms_getInputObjectByNameAndFormObject("reinforced", theForm);
	var theInputHangingLoop = forms_getInputObjectByNameAndFormObject("hangingloop", theForm);
	var theInputReflector = forms_getInputObjectByNameAndFormObject("reflector", theForm);
	var theInputStabilizer = forms_getInputObjectByNameAndFormObject("stabilizer", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);
	var theInputPrice = forms_getInputObjectByNameAndFormObject("amount", theForm);

	var theSize = theInputSize.value;
	var theStyle = theInputStyle.value;
	var theColorCanvas = theInputColorCanvas.value;
	var theColorCanvas2 = theInputColorCanvas2.value;
	var theColorCanvas3 = theInputColorCanvas3.value;
	var theColorCanvas4 = theInputColorCanvas4.value;
	var theColorVinyl = theInputColorVinyl.value;
	var theShoulder = theInputShoulder.value;
	var theReinforced = theInputReinforced.value;
	var theHangingLoop = theInputHangingLoop.value;
	var theReflector = theInputReflector.value;
	var theStabilizer = theInputStabilizer.value;
	var theQty = theInputQty.value;
	
	var fBasePrice = 150;
	
	if (theInputSize !== false)
	{
		if (theSize == '')
		{
			sError = sError + ' Size is required.';
		}	
	}
		
	if (theInputStyle !== false)
	{
		if (theStyle == '')
		{
			sError = sError + ' Style is required.';
		}	
	}
	
	if (theInputColorCanvas !== false)
	{
		if (theColorCanvas == '')
		{
			sError = sError + ' Canvas Color is required.';
		}	
	}
	
	if (theInputColorCanvas2 !== false)
	{
		if (theColorCanvas2 == '')
		{
			sError = sError + ' Canvas Color #2 is required.';
		}	
	}
	
	if (theInputColorCanvas3 !== false)
	{
		if (theColorCanvas3 == '')
		{
			sError = sError + ' Canvas Color #3 is required.';
		}	
	}
	
	if (theStyle !== 'BKPKSTR')
	{
		if (theInputColorCanvas4 !== false)
		{
			if (theColorCanvas4 == '')
			{
				sError = sError + ' Canvas Color #4 is required.';
			}	
		}
	}				

	if (theInputColorVinyl !== false)
	{
		if (theColorVinyl == '')
		{
			sError = sError + ' Vinyl Color is required.';
		}	
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
			
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theSize !== '')
		{
			theInputItemName.value = theInputItemName.value + ', ' + theSize;
		}
	
		if (theStyle !== '')
		{
			theInputItemName.value = theInputItemName.value + ', ' + theStyle;
		}
		
		if (theColorCanvas !== '')
		{
			theInputItemName.value = theInputItemName.value + ':' + theColorCanvas;
		}

		if (theColorCanvas2 !== '')
		{
			theInputItemName.value = theInputItemName.value + ',' + theColorCanvas2;
		}

		if (theColorCanvas3 !== '')
		{
			theInputItemName.value = theInputItemName.value + ',' + theColorCanvas3;
		}
		
		if (theStyle !== 'BKPKSTR')
		{
			if (theColorCanvas4 !== '')
			{
				theInputItemName.value = theInputItemName.value + ',' + theColorCanvas4;
			}			
		}

		if (theSize == 'Long')
		{
			fBasePrice = fBasePrice + 15;		
		}
	
		if (theStyle == 'BKPKBT')
		{
			fBasePrice = fBasePrice + 20;		
		}
		else if (theStyle == 'BKPKSB')
		{
			fBasePrice = fBasePrice + 10;
		}
						
		if (theColorVinyl !== '')
		{
			theInputItemName.value = theInputItemName.value + ',' + theColorVinyl;
		}
					
			if (theShoulder !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theShoulder;
			}
			
			if (theReinforced !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theReinforced;
				fBasePrice = fBasePrice + 25;
			}
			
			if (theHangingLoop !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theHangingLoop;
				fBasePrice = fBasePrice + 5;
			}

			if (theReflector !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theReflector;
			}
				
			if (theStabilizer !== '')
			{
				theInputItemName.value = theInputItemName.value + ' +' + theStabilizer;
			}
			
		theInputPrice.value = fBasePrice;
		document.location = 'backpacks.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}	
}



function clickBuyNowForTubeBag(theForm)
{

	var sError = '';



	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);

	var theInputStabilizer = forms_getInputObjectByNameAndFormObject("stabilizer", theForm);

	var theInputShoulder = forms_getInputObjectByNameAndFormObject("shoulder", theForm);

	var theInputReflector = forms_getInputObjectByNameAndFormObject("reflector", theForm);

	var theInputStrapPad = forms_getInputObjectByNameAndFormObject("strappad", theForm);

	var theInputStrapPadColor = forms_getInputObjectByNameAndFormObject("colorStrapPad", theForm);

	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);

	

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theInputPrice = forms_getInputObjectByNameAndFormObject("amount", theForm);



	var theColorVinyl = theInputColorVinyl.value;

	var theStabilizer = theInputStabilizer.value;

	var theShoulder = theInputShoulder.value;

	var theReflector = theInputReflector.value;

	var theStrapPad = theInputStrapPad.value;

	var theStrapPadColor = theInputStrapPadColor.value;

	var theQty = theInputQty.value;

	

	var fBasePrice = 155;

	if (theInputItemName.value == 'Petite Bike Tube Bag')

	{

		fBasePrice = 155;

	}

	else if (theInputItemName.value == 'Medi Bike Tube Bag')

	{

		fBasePrice = 165;

	}

	else if (theInputItemName.value == 'Standard Bike Tube Bag')

	{

		fBasePrice = 180;

	}

	else if (theInputItemName.value == 'Standard Wide Bike Tube Bag')

	{

		fBasePrice = 195;

	}

	

	if (theInputColorVinyl !== false)

	{

		if (theColorVinyl == '')

		{

			sError = sError + ' Vinyl Color is required.';

		}	

	}



	if (theStrapPad == 'StrapPad')

	{

		if (theInputStrapPadColor !== false)

		{

			if (theStrapPadColor == '')

			{

				sError = sError + ' Strap Pad Color is required.';

			}	

		}

	}

	

	if (theInputQty !== false)

	{													

		if (theQty == '')

		{

			sError = sError + ' QTY is required.';

		}

		else if (!IsNumeric(theQty))

		{

			sError = sError + ' QTY must be numeric.';

		}

	}

			

	// if no errors update form fields so paypal gets correct prod info and price info												

	if (sError == '')

	{

		if (theColorVinyl !== '')

		{

			theInputItemName.value = theInputItemName.value + ',' + theColorVinyl;

		}

					

		if (theStabilizer !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theStabilizer;

		}

		

		if (theShoulder !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theShoulder;

		}

		

		if (theReflector !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theReflector;

		}

		

		if (theStrapPad !== '')

		{

			theInputItemName.value = theInputItemName.value + ' +' + theStrapPad;

		}

		

		if (theStrapPad == 'StrapPad')

		{

			theInputItemName.value = theInputItemName.value + ':' + theStrapPadColor;

			fBasePrice = fBasePrice + 10;

		}

		

		theInputPrice.value = fBasePrice;

		document.location = 'recycled-bike-tube-gear.php';

		return true;

	}

	else

	{

		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);

		return false;

	}	

}



function clickBuyNowForBikeTubeHipPouch(theForm)

{

	var sError = '';



	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);

	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);

	

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);



	var theColorVinyl = theInputColorVinyl.value;

	var theQty = theInputQty.value;

	

	if (theInputColorVinyl !== false)

	{

		if (theColorVinyl == '')

		{

			sError = sError + ' Vinyl Color is required.';

		}	

	}

	

	if (theInputQty !== false)

	{													

		if (theQty == '')

		{

			sError = sError + ' QTY is required.';

		}

		else if (!IsNumeric(theQty))

		{

			sError = sError + ' QTY must be numeric.';

		}

	}

			

	// if no errors update form fields so paypal gets correct prod info and price info												

	if (sError == '')

	{

		if (theColorVinyl !== '')

		{

			theInputItemName.value = 'Recycled Bike Tube Hip Pouch' + ',' + theColorVinyl;

		}

					

		document.location = 'recycled-bike-tube-gear.php';

		return true;

	}

	else

	{

		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);

		return false;

	}	

}




function clickBuyNowForBikeTubeBelt(theForm) {
	var sError = '';

	var theInputSize = forms_getInputObjectByNameAndFormObject("size", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theSize = theInputSize.value;
	var theQty = theInputQty.value;
	
	if (theInputSize !== false)
	{													
		if (theSize == '')
		{
			sError = sError + ' Size is required.';
		}
		else if (!IsNumeric(theSize))
		{
			sError = sError + ' Size must be numeric.';
		}
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
	
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theSize !== '')
		{
			theInputItemName.value = theInputItemName.value + ', Size:' + theSize;
		}
					
		document.location = 'recycled-bike-tube-gear.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}		
}




function clickBuyNowForStrapPad(theForm) {
	var sError = '';

	var theInputCanvasColor = forms_getInputObjectByNameAndFormObject("colorCanvas", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theCanvasColor = theInputCanvasColor.value;
	var theQty = theInputQty.value;
	
	if (theInputCanvasColor !== false)
	{													
		if (theCanvasColor == '')
		{
			sError = sError + ' Canvas Color is required.';
		}
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
	
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theCanvasColor !== '')
		{
			theInputItemName.value = theInputItemName.value + ', CanvasColor:' + theCanvasColor;
		}
					
		document.location = 'accessories.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}		
}





function clickBuyNowForCellPouch(theForm) {
	var sError = '';

	var theInputCanvasColor = forms_getInputObjectByNameAndFormObject("colorCanvas", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theCanvasColor = theInputCanvasColor.value;
	var theQty = theInputQty.value;
	
	if (theInputCanvasColor !== false)
	{													
		if (theCanvasColor == '')
		{
			sError = sError + ' Canvas Color is required.';
		}
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
	
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theCanvasColor !== '')
		{
			theInputItemName.value = theInputItemName.value + ', CanvasColor:' + theCanvasColor;
		}
					
		document.location = 'accessories.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}		
}






function clickBuyNowForBikeTubeCellphonePouch(theForm)

{

	var sError = '';



	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);

	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);

	

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);



	var theColorVinyl = theInputColorVinyl.value;

	var theQty = theInputQty.value;

	

	if (theInputColorVinyl !== false)

	{

		if (theColorVinyl == '')

		{

			sError = sError + ' Vinyl Color is required.';

		}	

	}

	

	if (theInputQty !== false)

	{													

		if (theQty == '')

		{

			sError = sError + ' QTY is required.';

		}

		else if (!IsNumeric(theQty))

		{

			sError = sError + ' QTY must be numeric.';

		}

	}

			

	// if no errors update form fields so paypal gets correct prod info and price info												

	if (sError == '')

	{

		if (theColorVinyl !== '')

		{

			theInputItemName.value = 'BTCELL Recycled Bike Tube Cellphone Pouch' + ',' + theColorVinyl;

		}

					

		document.location = 'recycled-bike-tube-gear.php';

		return true;

	}

	else

	{

		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);

		return false;

	}	

}




function clickBuyNowForTShirt(theForm)

{
	var sError = '';

	var theInputSize = forms_getInputObjectByNameAndFormObject("size", theForm);
	var theInputNeck = forms_getInputObjectByNameAndFormObject("neck", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theSize = theInputSize.value;
	var theNeck = theInputNeck.value;
	var theQty = theInputQty.value;

	if (theInputSize !== false)
	{
		if (theSize == '')
		{
			sError = sError + ' Size is required.';
		}	
	}
	
	if (theInputNeck !== false)
	{
		if (theNeck == '')
		{
			sError = sError + ' Neck Style is required.';
		}	
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
			
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theSize !== '')
		{
			theInputItemName.value = theInputItemName.value + ', size:' + theSize;
		}
		
		if (theNeck !== '')
		{
			theInputItemName.value = theInputItemName.value + ', neck style:' + theNeck;
		}
					
		document.location = 'accessories.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}	
}





function clickBuyNowForTopTubeCover(theForm)

{
	var sError = '';

	var theInputColorCanvas = forms_getInputObjectByNameAndFormObject("colorCanvas", theForm);
	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theColorCanvas = theInputColorCanvas.value;
	var theColorVinyl = theInputColorVinyl.value;
	var theQty = theInputQty.value;

	if (theInputColorCanvas !== false)
	{
		if (theColorCanvas == '')
		{
			sError = sError + ' Canvas Color is required.';
		}	
	}
	
	if (theInputColorVinyl !== false)
	{
		if (theColorVinyl == '')
		{
			sError = sError + ' Vinyl Color is required.';
		}	
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
			
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theColorCanvas !== '')
		{
			theInputItemName.value = theInputItemName.value + ', canvas:' + theColorCanvas;
		}
		
		if (theColorVinyl !== '')
		{
			theInputItemName.value = theInputItemName.value + ', vinyl:' + theColorVinyl;
		}
					
		document.location = 'accessories.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}	
}




function clickBuyNowForBikeTubePurse(theForm)
{
	var sError = '';

	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theColorVinyl = theInputColorVinyl.value;
	var theQty = theInputQty.value;
	
	if (theInputColorVinyl !== false)
	{
		if (theColorVinyl == '')
		{
			sError = sError + ' Vinyl Color is required.';
		}	
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
			
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theColorVinyl !== '')
		{
			theInputItemName.value = 'BTPURS Recycled Bike Tube Purse,' + theColorVinyl;
		}
					
		document.location = 'recycled-bike-tube-gear.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}	
}



function clickBuyNowForBikeTubeToolBag(theForm)
{
	var sError = '';

	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theColorVinyl = theInputColorVinyl.value;
	var theQty = theInputQty.value;
	
	if (theInputColorVinyl !== false)
	{
		if (theColorVinyl == '')
		{
			sError = sError + ' Vinyl Color is required.';
		}	
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
			
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theColorVinyl !== '')
		{
			theInputItemName.value = 'BTTOOLBG Bike Tube Tool Bag,' + theColorVinyl;
		}
					
		document.location = 'recycled-bike-tube-gear.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}	
}


function clickBuyNowForWBikeTubePurse(theForm)
{
	var sError = '';

	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);
	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);
	
	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);

	var theColorVinyl = theInputColorVinyl.value;
	var theQty = theInputQty.value;
	
	if (theInputColorVinyl !== false)
	{
		if (theColorVinyl == '')
		{
			sError = sError + ' Vinyl Color is required.';
		}	
	}
	
	if (theInputQty !== false)
	{													
		if (theQty == '')
		{
			sError = sError + ' QTY is required.';
		}
		else if (!IsNumeric(theQty))
		{
			sError = sError + ' QTY must be numeric.';
		}
	}
			
	// if no errors update form fields so paypal gets correct prod info and price info												
	if (sError == '')
	{
		if (theColorVinyl !== '')
		{
			theInputItemName.value = 'WBTPURS Woven Bike Tube Purse,' + theColorVinyl;
		}
					
		document.location = 'recycled-bike-tube-gear.php';
		return true;
	}
	else
	{
		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);
		return false;
	}	
}



function clickBuyNowForBikeTubeLaptopBag(theForm)
{

	var sError = '';



	var theInputColorVinyl = forms_getInputObjectByNameAndFormObject("colorVinyl", theForm);

	var theInputSize = forms_getInputObjectByNameAndFormObject("size", theForm);

	var theInputQty = forms_getInputObjectByNameAndFormObject("quantity", theForm);

	

	var theInputItemName = forms_getInputObjectByNameAndFormObject("item_name", theForm);



	var theColorVinyl = theInputColorVinyl.value;

	var theSize = theInputSize.value;

	var theQty = theInputQty.value;

	

	if (theInputColorVinyl !== false)

	{

		if (theColorVinyl == '')

		{

			sError = sError + ' Vinyl Color is required.';

		}	

	}

	

	if (theSize !== false)

	{

		if (theSize == '')

		{

			sError = sError + ' Size is required.';

		}	

	}

	

	if (theInputQty !== false)

	{													

		if (theQty == '')

		{

			sError = sError + ' QTY is required.';

		}

		else if (!IsNumeric(theQty))

		{

			sError = sError + ' QTY must be numeric.';

		}

	}

			

	// if no errors update form fields so paypal gets correct prod info and price info											

	if (sError == '')

	{

		if (theColorVinyl !== '')

		{

			theInputItemName.value = 'BTLAP Recycled Bike Tube Laptop Bag' + ',' + theColorVinyl;

		}

		

		if (theSize !== '')

		{

			theInputItemName.value = theInputItemName.value + ',' + theSize;

		}

					

		document.location = 'recycled-bike-tube-gear.php';

		return true;

	}

	else

	{

		alert('PLEASE CORRECT THE FOLLOWING ISSUES AND RESUBMIT:' + sError);

		return false;

	}	

}



function IsNumeric(sText)

{

	var ValidChars = "0123456789.";

	var IsNumber=true;

	var Char;

	

	

	for (i = 0; i < sText.length && IsNumber == true; i++) 

	{ 

		Char = sText.charAt(i); 

		if (ValidChars.indexOf(Char) == -1) 

		{

			IsNumber = false;

		}

	}

	return IsNumber;

}

   


