var j = jQuery.noConflict();


j(document).ready(function(){

	
	j('#color1value').keyup(function() {
	  var getValue1 = j(this).val();
	  j('#gcitem1').val('Gorilla Coat Color 1 : ' + getValue1);
	  
	});
	j('.gorillaPrimeField').remove();
	
	
	
	y=0;
	
j('#addColor').click(function(e,i){
	
	
		
		var getPrimer = j('.gorillaPrimeField').length;
		
		var i = j(".newGCproduct").length;
		
		if (i <= 1) {
              var x = 2;
          }
			var x = i++;
	
		j('#tableFormValues').append('<tr class="newGCproduct"><td class="getRowNumber">#'+i+'</td><td><input type="hidden" id="gcitem'+i+'" name="item_name_'+i+'" value="Gorilla Coat Color '+i+' : "><input type="hidden" name="amount_'+i+'" value="250"><input type="text" id="color'+i+'value" name="color'+i+'value" value="" style="width:300px"></td><td><input type="text" name="quantity_'+i+'" value="" style="width:50px;"></td></tr>	');
		
		
		
	var getColorValue = '#color' + i + 'value';
	var appendColorField = '#gcitem' + i;
	var gorillaCoatColor = 'Gorilla Coat Color ' + i + ' : ';
	
	j(getColorValue).keyup(function() {
	  var getValueOfField = j(this).val();
	  j(appendColorField).val(gorillaCoatColor + getValueOfField);
	  
	});
		
		
		//Set Gorilla Coat Count # to add to PayPal
		
		y = (i++)+1;
		
if (getPrimer===1){
	j('.gorillaPrimeField').remove();
	j('#gorillaPrimeTable').append('<tr class="gorillaPrimeField"><td><input type="hidden" name="item_name_'+y+'" value="Gorilla Prime"><input type="hidden" name="amount_'+y+'" value="200"><input type="text" name="quantity_'+y+'" value="" style="width:50px;"></td></tr>');
}else{j('.gorillaPrimeField').remove();}
	
	e.preventDefault();
return false;
	
});

j('#addPrime').click(function(z){
	
	var m = j(".newGCproduct").length;
	
if (m === 1) {
            
			  y=2
          }
		 
	
	j('#gorillaPrimeTable').append('<tr class="gorillaPrimeField"><td><input type="hidden" name="item_name_'+y+'" value="Gorilla Prime"><input type="hidden" name="amount_'+y+'" value="200"><input type="text" name="quantity_'+y+'" value="" style="width:50px;"></td></tr>');

j('#addPrime').css("visibility","hidden");
		z.preventDefault();
		return false;
		
});


j('fieldset.custom_text legend').hide();
j('fieldset.custom_text p').hide();
j('.wpsc_buy_button_container').css('position','relative')

	
/*	j('#color2value').keyup(function() {
  var getValue2 = j(this).val();
  j('#gcitem2').val('Gorilla Coat Color 2 : ' + getValue2);
});

j('#color3value').keyup(function() {
 	 var getValue3 = j(this).val();
  j('#gcitem3').val('Gorilla Coat Color 3 : ' + getValue3);
});*/
	
});

