// JavaScript Document

$(document).ready(function() {
						   
	// map/photo toggle (listing page)
	$(".butPhotos").click(function() {
		$("#mapWrap").hide();
		$("#photoWrap").show();
			return false;
	});
	$(".butMap,#linkShowMap").click(function() {
		$("#photoWrap").hide();
		$("#mapWrap").show();
			return false;
	});
						   
	// form fields
	function clearField(targetField) {
	  var defText = $(targetField).attr('title');
	  if ($(targetField).val() == defText) {
		$(targetField).val(""); 
		$(targetField).css({'color' : '#000'});
	  }
	}
	function fillField(targetField) {
	  var defText = $(targetField).attr('title');
	  if ($(targetField).val() == "") {
		$(targetField).val(defText); 
		$(targetField).css({'color' : '#ccc'});
	  }
	}
	
	
	$(".boxContactOwner .name,.boxContactOwner .email,.boxEmailAlerts .name,.boxEmailAlerts .email,.boxMoreInfo .name,.boxMoreInfo .email,.boxAlerts .name,.boxAlerts .email,.boxContactOwner .msg,.boxMoreInfo .msg").focus(function() {
      clearField(this);
    });
	$(".boxContactOwner .name,.boxContactOwner .email,.boxEmailAlerts .name,.boxEmailAlerts .email,.boxMoreInfo .name,.boxMoreInfo .email,.boxAlerts .name,.boxAlerts .email,.boxContactOwner .msg,.boxMoreInfo .msg").blur(function() {
      fillField(this);
    });
	
	
	
	
});

