// JavaScript Document

function dojobsearch(){
	document.getElementById('jsmethod').value = 'basic';
	document.jsearchform.submit();
}
function doadvjobsearch(){
	document.getElementById('jsmethod').value = 'adv';
	document.jsearchform.submit();
}

function advsearchshow(){
	document.getElementById('jsearchmore').style.display = 'block';
	document.getElementById('searchSubmit').style.display = 'none';
	document.getElementById('advsearchshow').style.display = 'none';
	//document.getElementById('advsearchshow').onclick = 'advsearchhide();';
}
function advsearchhide(){
	document.getElementById('jsearchmore').style.display = 'none';
	document.getElementById('searchSubmit').style.display = 'inline';	
	document.getElementById('advsearchshow').style.display = 'inline';
}

function showSubRegions(regionid, span){
	
	if (document.getElementById('subregions_' + regionid).style.display == 'none')
	{
		document.getElementById('subregions_' + regionid).style.display = 'block';
		span.innerHTML = '(hide sub-regions)';
	}
	else
	{
		document.getElementById('subregions_' + regionid).style.display = 'none';
		span.innerHTML = '(show sub-regions)';
	}	
}

function showSubSectors(sectorid, span){
	
	if (document.getElementById('subsector_' + sectorid).style.display == 'none')
	{
		document.getElementById('subsector_' + sectorid).style.display = 'block';
		span.innerHTML = '(hide sub-sectors)';
	}
	else
	{
		document.getElementById('subsector_' + sectorid).style.display = 'none';
		span.innerHTML = '(show sub-sectors)';
	}	
}

function saveSearch(url, divid){
	var ajaxurl = url + 'jobs.cfc?method=saveSearch' + '&rand=' + Math.random();
	
	ajaxSend(ajaxurl, divid);
}
