function validateCommentsForm(theForm) {
    var retval = true;
    if ($(theForm).find("#comment").val().trim() == "") {
        retval = false;
        alert("Please enter *SOMETHING* as your comments.");
    }

    return retval;
}
function textCounter(field, countfield, maxlimit) {
    /*
    * The input parameters are: the field name;
    * field that holds the number of characters remaining;
    * the max. numb.	of characters.
    */
    if (field.value.length > maxlimit) // if the current length is more than allowed
        field.value = field.value.substring(0, maxlimit); // don't allow further input
    else
        countfield.value = maxlimit - field.value.length;
}
function validateGenericForm(theForm) {
    var retval = true;
    //$.each($(theForm).serializeArray(), function (i, field) {
    //    values[field.name] = field.value;
    //});
    var $inputs = $(theForm).find(":input");

    // not sure if you wanted this, but I thought I'd add it.
    // get an associative array of just the values.
    var values = {};
    $inputs.each(function () {
        //values[this.name] = $(this).val();
        if ($(this).attr("class") == "required") {
            if ($(this).val() == "") {
                retval = false;
                alert($(this).attr("name") + " is required.");
            }
        }
    });
    return retval;
}
function validateGenericForm_PayPal(theForm) {
    var retval = true;
    //$.each($(theForm).serializeArray(), function (i, field) {
    //    values[field.name] = field.value;
    //});
    var $inputs = $(theForm).find(":input");
	var paypalURL = ""
    // not sure if you wanted this, but I thought I'd add it.
    // get an associative array of just the values.
    var values = {};
    $inputs.each(function () {
        //values[this.name] = $(this).val();
        if ($(this).attr("class") == "required") {
            if ($(this).val() == "") {
                retval = false;
                alert($(this).attr("name") + " is required.");
            }
        }
    });
	if(retval == true)
	{
		//paypalURL += "https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=rosemary%2eburk%40veteransoutreachcenter%2eorg&item_name=Veterans%20Outreach%20Center%2c%20Inc%2e&item_number=Contribution&amount=";
		//paypalURL += $("#Amount").val() ;
		//paypalURL += "&no_shipping=2&return=http%3a%2f%2fwww%2eveteransoutreachcenter%2eorg&cn=Additional%20Notes&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8"
		window.open ('https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=rosemary%2eburk%40veteransoutreachcenter%2eorg&item_name=Veterans%20Outreach%20Center%2c%20Inc%2e&item_number=Contribution&amount='+$("#Amount").val()+'&no_shipping=2&return=http%3a%2f%2fwww%2eveteransoutreachcenter%2eorg&cn=Additional%20Notes&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8','','width=,height=,location=1,menubar=1,scrollbars=1,status=1,toolbar=1,resizable=1');
		//window.open (paypalURL,"Donate to VOC through Paypal","location=1,status=1,scrollbars=1"); 
	}
    return retval;
}
