function checkGiftBox(x) {
	if (x==1) {
		$("#GiftMessageField").show();
		$("#noOptions").removeAttr("disabled");
		$("#checkTextArea").removeAttr("disabled", "disabled");		
	} else {	
		$("#GiftMessageField").hide();
		$("#noOptions").attr("disabled", "disabled");
		$("#checkTextArea").attr("disabled", "disabled");
	}
}
      
$("input[@name='Gift Box']:nth(0)").attr("checked","checked");  			
$("#GiftMessageField").hide();
checkGiftBox(0);

$(document).ready(function() {
	$("#main_form").submit(function(){	
	 	var the_value;
	 	the_value = $('#main_form input:radio:checked').val();
	
		if (the_value) {
			if(the_value != "No Options"){
				if($("#checkTextArea").val() ==""){
					alert("Please type a \"Gift Message\" in the text field.");
					return false;
				}
			}	
		}	
		return true;
  })
});

