function zinko9(ba,aa,ap,dl,st,by){
	var a,b,c,aaa,ppp,ds,db,e
	//ba=stuff before the <at>;  //aa=stuff after the <at>;  //ap=stuff after the <period>
	//dl=text to display as link;  //st=subject in case you want to predefine it
	//by=body in case you want to predefine it
	a = '<a href=\"mai'
	c = '\">'
	aaa = '@'
	ppp = '.'
	if (st){
		ds = '?sub'
		ds += 'ject=\''
		ds += st+'\''
		} else {
		ds = ''
	}
	if (by){
		db = '&bo'
		db += 'dy=\''
		db += by+'\''
		} else {
		db = ''
	}
	a += 'lto:'
	a += ba
	a += aaa
	a += aa
	a += ppp
	a += ap
	e='</a>'
	b += aa
	b += '.'
	b += ap
	if (!dl) {
		dl = ba+aaa+aa+ppp+ap
	}
	//document.write(a+ds+db+c+dl+e)

	var zookie9 = a+ds+db+c+dl+e; 
	return zookie9;

///// *********************************////
/// -- DON'T EDIT ANYTHING ABOVE HERE ---//
///// *********************************////

// instructions - inside each '' pair in the zinko9('','','','','',''); below enter
//   first '' pair: the stuff before the <at> symbol in your email address
//   second '' pair: the stuff after the <at> symbol in your email address
//   third '' pair: the stuff after the first <period> in your email address
//   fourth '' pair: what you want as the displayed link - leave blank and your email address will be link
//   fifth '' pair: if you want to have an automatic subject - enter here - otherwise leave the ''
//   sixth '' pair: if you want to have an automatic body - enter here - otherwise leave the ''
// sample below:
// <script>document.write(zinko9('your.name','DomainName','net','Your Name','this is the subject','this is the body'));</script>
}


function get_background_color(){
	var background_color	= "#FFDA56";
	return background_color;
}
function get_border_color(){
	var border_color		= "#153F6F";
	return border_color;
}
function get_border_width(){
	var border_width		= "1px";
	return border_width;
	
}


function validate_cycle(required_inputs){

	var background_color	= get_background_color();
	var border_color		= get_border_color();
	var border_width		= get_border_width();

	var err_found = false;
	for (i=0;i<required_inputs.length;i++){
		document.getElementById(required_inputs[i]).style.backgroundColor = '';
		document.getElementById(required_inputs[i]).style.borderColor = '';
		document.getElementById(required_inputs[i]).style.borderWidth = '';
	}
	for (i=0;i<required_inputs.length;i++)
	{
		if (document.getElementById(required_inputs[i]).value == "") {
			err_found = true;
			document.getElementById(required_inputs[i]).style.backgroundColor = background_color;
			document.getElementById(required_inputs[i]).style.borderColor = border_color;
			document.getElementById(required_inputs[i]).style.borderWidth = border_width;
		}
	}
	
	return err_found;
}







function verify_add(section){


	$('#processing').show('slow');

	switch (section){
	case "contact":
		var required_inputs = new Array(
			'name',
			'email',
			'comments'
		);
		break;
	case "job":
		var required_inputs = new Array(
			'client_guid',
			'job_title',
			'public_job_description',
			'internal_job_description',
			'start_date',
			'job_profession_id',
			'job_specialty_id',
			'job_type_id',
			'city',
			'job_state_id',
			'active',
			'degree_required',
			'visa_accepted'
		);
		break;
	case "candidate":
		var required_inputs = new Array(
			'first_name',
			'last_name',
			'title',
			'candidate_add_profession_id',
			'candidate_add_specialty_id',
			'sub_specialty',
			'degree',
			'residency',
			'address',
			'city',
			'candidate_state_id',
			'zip',
			'email',
			'phone',
			'cell_phone',
			'pager',
			'area_of_interest',
			'desired_city',
			'licensed_state_id',
			'board_certified',
			'board_eligible',
			'when_available',
			'work_status',
			'visa_required',
			'candidate_practice_type_id',
			'call_schedule',
			'salary_expectations',
			'interview_activity',
			'other_info',
			'references',
			'notes',
			'source',
			'public_description',
			'internal_description',
			'additional_contact_info',
			'best_time_day_2_call',
			'significant_other_name',
			'significant_other_need_job',
			'family_resides',
			'foreign_language_info',
			'esl_skill',
			'citizenship_status',
			'profile',
			'comments',
			'responsible_employee_guid',
			'active',
			'current_practice_setup_call_coverage',
			'why_leaving_present_job',
			'desired_placement_type',
			'location_preferences',
			'why_did_choose_location',
			'desired_community',
			'desired_compensation_package',
			'any_license_privilege_problems',
			'any_malpractice_suits',
			'past_drug_alcohol_abuse_treatment',
			'national_practitioner_dbase_report'

		);
		break;
	case "candidate_cv":
		var required_inputs = new Array(
			'first_name',
			'last_name',
			'candidate_add_profession_id',
			'candidate_add_specialty_id',
			'address',
			'city',
			'candidate_state_id',
			'zip',
			'email',
			'file_cv',
			'phone',
			'best_time_day_2_call'

		);
		break;
	case "info_request":
		var required_inputs = new Array(
			'title',
			'first_name',
			'last_name',
			'email',
			'city',
			'state',
			'phone',
			'best_time',
			'recruitment_needs'
		);
		break;
	case "employee":
		var required_inputs = new Array(
			'title',
			'first_name',
			'last_name',
			'access_level_id',
			'username',
			'password',
			'phone',
			'email',
			'active'
		);
//		var next_index	= required_inputs.length;
//		if (document.getElementById('password2').value != ""){ // if submitted new password
//			required_inputs[next_index] = "password_edit";
//		}
		break;
	
	}

	var err_found = false;
	var err_msg = "\n\nto continue, please complete the highlighted entries:\n\n";

	err_found = validate_cycle(required_inputs);

	switch(section){
		case "employee":
			// need to ensure both passwords match
			if ( $('#password').val() != "") {
				if ($('#password').val() != $('#password2').val()  ) {
					err_found = true;
					err_msg += "- also ensure passwords match.\n\n";
				}
			}
			break;
		case "contact":
		case "info_request":
			// need to ensure both emails match
			if ( $('#email').val() != "") {
				if ($('#email').val() != $('#email2').val()  ) {
					err_found = true;
					err_msg += "- also ensure emails match.\n\n";
				}
			}
			break;
	}


	if (err_found) {
		$('#processing').hide('slow');
		alert(err_msg);
		return false;

	} else {
		switch (section){
		case "client":
			alert(section);
			//xajax_User.createClient(xajax.getFormValues('form_add_edit_client') )
			break;
		case "job":
			//alert(section);
			xajax_Job.createJob(xajax.getFormValues('form_add_job') )
			break;
		case "candidate":
			alert(section);
			//xajax_User.createCandidate(xajax.getFormValues('form_add_candidate') )
			break;
		case "candidate_cv":
			//alert(section);
			//xajax_User.createCandidate(xajax.getFormValues('form_add_candidate') )
			$('#addgonzo').attr("action", "candidates_cv.php");
			$("form:addgonzo").submit();
			break;
		case "contact":
			$('#form_contact').attr("action", "info_request");
			$("form:#form_contact").submit();
			break;
		case "employee":
			alert(section);
			//xajax_User.createEmployee(xajax.getFormValues('form_add_employee') )
			break;
		}
	}

}



// ################## jQuery ################################

// STUFF THAT AUTOMATICALLY LOADS WHEN DOC IS READY TO BE MANIPULATE
$(document).ready(function(){




});
