
 

	$(".emailOptinOptions").hide();
	
	  var fieldClass = new Array();
	    fieldClass[0] = ".optinEmailField";
		
	  var fieldValue = new Array();
	    fieldValue[0] = "Email";
				
	  var fieldCount = fieldClass.length;	  	  
	  
	  for(f=0; f<fieldCount;f++) {
		$(fieldClass[f]).val(fieldValue[f]);
		$(fieldClass[f]).css("color", "#aaaaaa");
		
		$(fieldClass[f]).click(function() {
		  $(".emailOptinOptions").show();
		  var thisValue = $(this).val();
		  $(this).css("color", "#000000");
		  if(thisValue == "Email") { $(this).val(""); }
		  if(thisValue == "Zip") { $(this).val(""); }
		}); 		
		
	  }	  
	  
		$(fieldClass[0]).blur(function() {
		  var thisValue = $(this).val();
		  if(thisValue == "") { $(this).val(fieldValue[0]); $(this).css("color", "#aaaaaa"); }
		}); 

   
 	
	$(".autocomplete").live("focus", function() {
	  var sourceURL = $(this).attr("rel");
	  $(this).autocomplete({
		source: sourceURL, 
		minLength: 2
	  });
	});
   
