// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function gotoRegistration(form)
{
	location.href = "https://www.keagtc.com/register/" + form.option.value + "/";
}

function submitRegistration(form)
{
	form.submit();
}

function submitLogin(form)
{

		form.submit();
}

function submitReset(form)
{

		form.submit();
}


function submitSave(form, apply)
{
		if(apply)
		{
			form.action = form.action + "?apply=1"
		}
		form.submit();
}


function submitDeleteAccount(form)
{
	var agree=confirm("WARNING: You have choosen to delete your account.\n\nThis will permanently remove your details from the system including your login account.\n\nAre you sure?");
	if (agree)
	{
		location.href ="/talentcentre/details/delete/";
	}	
}


function submitSearch(form)
{
	form.submit();
}

function submitRemoveSearch(form)
{
	form.submit();
}


function deleteCandidate(userId)
{
	var agree=confirm("You have chosen to delete this candidate record. Are you sure?");
	if (agree)
	{
		location.href ="/admin/candidate_delete/" + userId + "/";
	}	

}



function deleteEmployer(userId)
{
	var agree=confirm("You have chosen to delete this employer record. Are you sure?");
	if (agree)
	{
		location.href ="/admin/employer_delete/" + userId + "/";
	}	

}



function deleteRecruiter(userId)
{
	var agree=confirm("You have chosen to delete this recruiter record. Are you sure?");
	if (agree)
	{
		location.href ="/admin/recruiter_delete/" + userId + "/";
	}	

}




