// Career Seeker JavaScript Functions


// ACCORDIONS - USES MOOTOOLS LIBRARY
  
			window.addEvent('domready', function() {
			
				// MY SEEKER ACCORDION
				var accordion1 = new Accordion('li.accountMore', 'div.expand', {
					opacity: false,
					alwaysHide: true,
					start:'all-close'
					
				}, $('accountWrapper'));
				
				
				
				
				// CUSTOMISED TOOLTIPS
				var Tips4 = new Tips($$('.tip'), {
					className: 'tooltip'
				});
				
				
				
				
	
			});
		
 			
		
	
	
	
// PANIC BUTTON

function takeMeHome()
{
  if (parent.window.home) {
    parent.window.home();
  } else {
    window.location.href = 'about:home';
  }
} 
	

// CLEAR DEFAULT FORM INPUT VALUES ON FOCUS

// ADD TO FAVOURITES SCRIPT
function bookmarkthis(title,url) {
  if (window.sidebar) { // firefox
     window.sidebar.addPanel(title, url, "");
  } else if (document.all) { // IE
     window.external.AddFavorite(url, title);
  } else if (window.opera && window.print) { // opera
     var elem = document.createElement('a');
     elem.setAttribute('href',url);
     elem.setAttribute('title',title);
     elem.setAttribute('rel','sidebar');
     elem.click();
  }
}



// CLEAR FORM FIELD SCRIPT
function clearText(thefield){
	if (thefield.defaultValue==thefield.value)
	thefield.value = "";
}


// QUICK SEARCH VALIDATION
function checkform()
{
	if(document.quickSearch.searchKeyword.value == '' && document.quickSearch.searchSector.options [document.quickSearch.searchSector.selectedIndex].value == '0' && document.quickSearch.searchPostcode.value == '' && document.quickSearch.searchSalaryFrom.value == 'From' && document.quickSearch.searchSalaryTo.value == 'To'){
		
		document.getElementById('quickSearchError').style.display='block';
		
		return false;
	}
	return true;
}
function closeSearchError()
{
		document.getElementById('quickSearchError').style.display='none';
}

