//Searchbox Clear/Restore
$.fn.searchclear=function(){
	return this
	.focus(function(){if(this.value==this.defaultValue){this.value=""};})
	.blur(function(){if(!this.value.length){this.value=this.defaultValue};})
};

// Searchbox Validate
$.fn.validsearch=function(status, textbox){
	return this.submit(function(){
		var dvalue = $(textbox).attr("defaultValue");var value = $(textbox).attr("value");var error = "Please enter a query before submitting.";
		if(dvalue==value){$(status).html(error).fadeIn(300);setTimeout('$("' + status + '").fadeOut()', 2000);return false;};
	});
};

//Searchbox Clear/Restore
$.fn.pwclear=function(){
	return this
	.focus(function(){$(this).removeClass('pwbox');})
	.blur(function(){if(!this.value.length){$(this).addClass('pwbox')};})
};

//COMMON INITIALIZE
$(document).ready(function() {
	//keyword validation
	$("#keywordform").validsearch(".tryagain", "#kwords");
	$("#kwords, #txt_username").searchclear();
	$("#txt_password").pwclear();
	
});

//COMMON INITIALIZE
$(document).ready(function() {
	//keyword validation
	$("#jobsearchform").validsearch(".jobstryagain", "#jobkwords");
	$("#jobkwords, #txt_username").searchclear();
	$("#txt_password").pwclear();
	
});
