<!--

	// buyItem - adds an item to the shopping basket
	function buyItem()
	{
		// set up variables for message riders

		var whichitem = "Photo Riders"
		var qty = Photoqty;
		size = Signsize;

		// reinit this hidden field
		document.Photoriderform.hidden_colorPhoto.value = null;	
		document.Photoriderform.hidden_sizePhoto.value = null;	
		itemNo = document.Photoriderform.Photorider_style.value;

		// hard codes color variables as name rider colors do not change
		color = Lettercolor;
		bgcolor = "white";

		// copy1 is used for agent name
		copy1 = document.Photoriderform.Photorider_name.value

		// copy2 variable is used for phone number
		copy2 = document.Photoriderform.Photorider_phone1.value;

		// sets Photoqty counter for Photorider prices
		oldCart = getCookie('ShopCart');
		newCart = "["+itemNo+"|"+whichitem+"|"+size+"|"+color+"|"+bgcolor+"|"+copy1+"|"+copy2+"|"+qty+"]";
		cartFull = oldCart + newCart;
		setCookie('ShopCart',cartFull);
		self.location.href="shop_view_cart.htm"
	}
	
	// validates form fields and adds rider info
	function addRider()
	{
		Photoqty = document.Photoriderform.Photorider_qty.value;
		Agentname = document.Photoriderform.Photorider_name.value;
		Phone1 = document.Photoriderform.Photorider_phone1.value;
	        Lettercolor = document.Photoriderform.hidden_colorPhoto.value;	
	        Signsize = document.Photoriderform.hidden_sizePhoto.value;	  
				 
		// validates Photorider style
		if (document.Photoriderform.Photorider_style.value == 'null') 
		{
			alert('Please select a sign style.');
			return;
		} 
				 
		// validates photorider Color Option
		if (Lettercolor == "" || Lettercolor == " ") 	 
		{
			alert('Please select the letter color.');
			return;
		} 

		// validates photorider Name 
		if (Agentname == "" || Agentname == " ") 
		{
			alert('Please enter an agent name.');
			return;
		} 

		// validates Photoqty
		if (Photoqty == "" || Photoqty == " ")	{
			alert('Please enter a quantity.');
			document.Photoriderform.Photorider_qty.focus();
			return;
		}

		// validates phone1
		if (Phone1 == "" || Phone1 == " ")	{
			alert('Please enter the agent phone number.');
			document.Photoriderform.Photorider_phone1.focus();
			return;
		}	
	
		isNo = chkForNum(Photoqty);
		if (!isNo)	{
			alert('Please enter only numeric values');
			document.Photoriderform.Photorider_qty.focus();
			return;
		}

                var PhotoqtyNum = Photoqty;
                if (PhotoqtyNum >= 5)
		{
 			// adds rider info into cart
			 buyItem()
                }
                else {
			alert('Quantity must be greater than 4.');
			document.Photoriderform.Photorider_qty.focus();
			return;
		}                   
	}
	
	// updates hidden form variable for color
	function colorBlk()
	{
		thisColor = "Black";
                document.Photoriderform.hidden_colorPhoto.value = thisColor;
		return;
	}	
	
	// updates hidden form variable for color
	function colorRed()
	{
		thisColor = "Red";
                document.Photoriderform.hidden_colorPhoto.value = thisColor;
		return;
	}	
	
	// updates hidden form variable for size
	function sizeSmall()
	{
		thisSize = "6x24";
                document.Photoriderform.hidden_sizePhoto.value = thisSize;
		return;
	}	
	
	// updates hidden form variable for size
	function sizeLarge()
	{
		thisSize = "8x24";
                document.Photoriderform.hidden_sizePhoto.value = thisSize;
		return;
	}		

	// goes to view cart
	
	function viewCart()
	{
		self.location.href="shop_view_cart.htm"
	}

	
// -->	