function hideControl(obj)
{
	var item = document.getElementById(obj);
	if (item != null)
	{
	    item.style.visibility = 'hidden'; 
	}
	return true;
}

function clearTextbox(obj)
{
	var item = document.getElementById(obj);
	if (item != null)
	{
	    item.value = '';
	}	
	return true;
}

function resetDDLSelectedIndex(obj)
{
	var item = document.getElementById(obj);
	item.selectedIndex = 0;
}

/*function resetSelectedIndex(obj)
{
	var item = document.getElementById(obj);
	if (item != null)
	{
	    var item = document.getElementById(obj);
	    item.selectedIndex = -1;
	}
}
*/

function clearCheckbox(obj) {
    var item = document.getElementById(obj);
    if (item != null) {
        item.checked = false;
    }
    return true;
}

function clearRadioButtonList(obj)
{
	var radList = document.getElementById(obj);
	if (radList != null)
	{
	    var inputElementArray = radList.getElementsByTagName('input');
	    for (var i = 0; i < inputElementArray.length; i++)
	    {
	        var inputElement = inputElementArray[i];
	        inputElement.checked = false;
	    }
	}
	
}


function clearForm() {
    
    clearTextbox('NameTextbox');
    clearTextbox('ZipTextbox');
    clearTextbox('AddressTextbox');
    clearTextbox('PhoneTextbox');
    clearTextbox('CityTextbox');
    clearTextbox('EmailTextbox');
    clearTextbox('StateTextbox');
    clearTextbox('ReferredByTextbox');
	
	resetDDLSelectedIndex('PositionDDL');

	clearTextbox('PosNameTextbox');
	clearTextbox('StartDateTextbox');
	
	clearRadioButtonList('Employed');
  	
	clearRadioButtonList('ContactEmployer');
	clearTextbox('EmployerPhoneTextbox');
	
	clearRadioButtonList('AppliedBefore');
	clearTextbox('WhenTextbox');
	clearTextbox('WhereTextbox');
	
	//__doPostBack('UpdatePanel1', '');
	//document.setTimeout(__doPostBack('Employed$1', ''), 0);

	clearTextbox('GrammarSchoolTextbox');
	clearTextbox('GrammarYearsTextbox');
	clearCheckbox('GrammarGraduateCheckbox');
	clearTextbox('GrammarSubjectsStudiedTextbox');

	clearTextbox('HighSchoolSchoolTextbox');
	clearTextbox('HighSchoolYearsAttendedTextbox');
	clearCheckbox('HighSchoolGraduateCheckbox');
	clearTextbox('HighSchoolSubjectsStudiedTextbox');

	clearTextbox('CollegeSchoolTextbox');
	clearTextbox('CollegeYearsAttendedTextbox');
	clearCheckbox('CollegeGraduateCheckbox');
	clearTextbox('CollegeSubjectsStudiedTextbox');

	clearTextbox('OtherSchoolTextbox');
	clearTextbox('OtherYearsAttendedTextbox');
	clearCheckbox('OtherGraduateCheckbox');
	clearTextbox('OtherSubjectsStudiedTextbox');

	clearRadioButtonList('knowEmployeeRad');
	clearTextbox('employeeRelationshipTextBox');

	resetDDLSelectedIndex('MilitaryServiceDDL');
	clearTextbox('MilitaryServiceRankTextbox');

	clearTextbox('Reference1NameTextbox');
	clearTextbox('Reference1AddressTextbox');
	clearTextbox('Reference1BusinessTextbox');
	clearTextbox('Reference1YearsTextbox');

	clearTextbox('Reference2NameTextbox');
	clearTextbox('Reference2AddressTextbox');
	clearTextbox('Reference2BusinessTextbox');
	clearTextbox('Reference2YearsTextbox');

	clearTextbox('Reference3NameTextbox');
	clearTextbox('Reference3AddressTextbox');
	clearTextbox('Reference3BusinessTextbox');
	clearTextbox('Reference3YearsTextbox');

	clearTextbox('Reference4NameTextbox');
	clearTextbox('Reference4AddressTextbox');
	clearTextbox('Reference4BusinessTextbox');
	clearTextbox('Reference4YearsTextbox');

	clearTextbox('RemarksTextbox');
	clearCheckbox('careersFormAgreeCheckbox');				
}
