var clearOnce = new Array(false,false);
function focusKeyword(){
  	if(clearOnce[0]) return;
  	$("#keywordsfield").attr("value","");
  	$("#keywordsfield").removeClass("hintstyle");
  	$("#keywordsfield").addClass("inputstyle");
    clearOnce[0] = true;  	
}
function focusLocation(){
  	if(clearOnce[1]) return;
  	$("#locationsfield").attr("value","");
  	$("#locationsfield").removeClass("hintstyle");
  	$("#locationsfield").addClass("inputstyle");
    clearOnce[1] = true;  	
}
function hideAdvanced(){
	$("#advancedsearch").slideUp(1200,function(){
		$("#advancedtoggle").unbind("click");
	    $("#advancedtoggle").click(showAdvanced);
	    $("#advancedtoggle").text(advancedShowMessage); 
	});	    
}

function showAdvanced(){  
	$("#advancedsearch").slideDown(1200,function(){
		$("#advancedtoggle").unbind("click"); 
	    $("#advancedtoggle").click(hideAdvanced);
	    $("#advancedtoggle").text(advancedHideMessage); 
	});	    
}
function openSaveSearch() {
	$("#popup").css("opacity",0.90);
	$("#popup").fadeIn('slow');
	$("#mywindow").fadeIn('slow');
}
function closeSaveSearch() {
	$("#popup").fadeOut('fast');
	$("#mywindow").fadeOut('fast');
}
function clearSearch(){
	document.mysearchform.jobcategory.selectedIndex=0;
	document.mysearchform.jobindustry.selectedIndex=0;
	$("#keywordsfield").attr("value",document.mysearchform.keyworddefault.value);	
  	$("#keywordsfield").removeClass("inputstyle");
  	$("#keywordsfield").addClass("hintstyle");
  	$("#locationsfield").attr("value",document.mysearchform.locationdefault.value);
  	$("#locationsfield").removeClass("inputstyle");
  	$("#locationsfield").addClass("hintstyle");
  	clearOnce[0] = false;
  	clearOnce[1] = false;
}
