

$(document).ready(function() {
  	// Form swaps class on input fields whcih changes the input color
	
	//Create an associative array to hold the default hint values
	//The  index is the ID of the element and the value is the hint
	
	var hintArr = new Array()
		hintArr["fname"] = "First Name";
		hintArr["lname"] = "Last Name";
		hintArr["doc-search"] = "Enter a Search Query...";
	
	$("input.initval").each(function(){
		id = $(this).attr("id");
		hint = hintArr[id];
		$(this).attr("value", hint);
												   
	});
	
	$('.initval').focus(function() {
		if($(this).hasClass("initval")){
			$(this).attr("value", "").removeClass("initval");
		}
	});
	
	$('.cha_form input, #doc-search input').blur(function() {
		currentval = $(this).attr("value");		
		if( currentval == undefined || currentval == " "){
			id = $(this).attr("id");
			hint = hintArr[id];
			$(this).addClass("initval").attr("value", hint);
		}
	});
	$(".cha_form h4").hide();
	

	

  
 });//EOF


