function updateBadge() {
    
    // TODO - make this dynamic
    var controlNamePrefix = "cchEventRegistration7_";

    // test to make sure the page support the given controls
    if (document.getElementById(controlNamePrefix + "prefix")) {
    
        // input control handles
//        var prefixControl = document.getElementById(controlNamePrefix + "prefix");
        var firstNameControl = document.getElementById(controlNamePrefix + "firstName");
       // var middleNameControl = document.getElementById(controlNamePrefix + "middleName");
        var lastNameControl = document.getElementById(controlNamePrefix + "lastName");
        var suffixControl = document.getElementById(controlNamePrefix + "suffix");
        var titleControl = document.getElementById(controlNamePrefix + "title");
        var organizationControl = document.getElementById(controlNamePrefix + "organization");
        
        // output control handles
        var badgeFirstNameControl = document.getElementById("badgeFirstName");
        var badgeNameControl = document.getElementById("badgeName");
        var badgeTitleControl = document.getElementById("badgeTitle");
        var badgeOrganizationControl = document.getElementById("badgeOrganization");
   

        // capture all the relavant form fields
//        var prefix = "";
//        if (prefixControl.value != "")  { prefix = prefixControl.value + " "; }

        var firstName = "";
        if (firstNameControl.value != "")  { firstName = firstNameControl.value + " "; }

       // var middleName = "";
      //  if (middleNameControl.value != "")  { middleName = middleNameControl.value + " "; }

        var lastName = "";
        if (lastNameControl.value != "")  { lastName = lastNameControl.value; }

        var suffix = "";
        if (suffixControl.value != "")  { suffix = ", " + suffixControl.value + " "; }

        var title = "";
        if (titleControl.value != "")  { title = titleControl.value; }

        var organization = "";
        if (organizationControl.value != "")  { organization = organizationControl.value; }
        
        // update the first name
        var badgeFirstName = firstName;
        if (badgeFirstName != "") { badgeFirstNameControl.innerHTML = firstName; }
        
        // update the full name
        var badgeName = firstName + lastName + suffix;
        //var badgeName = prefix + firstName + middleName + lastName + suffix;
        if (badgeName != "") { badgeNameControl.innerHTML = badgeName; }
        
        // update the title
        if (title != "") { badgeTitleControl.innerHTML = title; }
                    
        // update the organization
        if (organization != "") { badgeOrganizationControl.innerHTML = organization; }
    }
}


$(document).ready(function(){
	$('div.registrationWrapper table.checkboxList tr:odd').addClass('odd');
	
	var allWorkshopsChk = $('div.registrationWrapper table.checkboxList input');
	$(allWorkshopsChk).change( function(){
		var checkBoxIndex = $(allWorkshopsChk).index($(this));
		//console.log(checkBoxIndex);
		if(checkBoxIndex%2 == 0){
			//if item exists
			checkBoxIndex++;
		} else {
			checkBoxIndex--;
		}
		//console.log((checkBoxIndex%2 == 0) + "-" + checkBoxIndex);
		if($(this).attr('checked')){
			if($(allWorkshopsChk[checkBoxIndex])){
				$(allWorkshopsChk[checkBoxIndex]).attr('checked', false);
			}
		}
	});
});

