{% load i18n %}

<form id="search" action="{{ search_url }}" method="get">
    <div style="float: right">
        <input id="listSearch" type="text" name="q" value="{% trans "Search" %}" />
        <button type="submit">
            <img src="{{ MEDIA_URL }}pinax/img/silk/icons/zoom.png" />
        </button>
    </div>
</form>
<script type="text/javascript">
	$('#listSearch').bind("focus", function (evt) {
		if ($(this).val() == $(this).data("text")) {
			$(this).data("text", $(this).val());
			$(this).val("");
		}
	});
	$('#listSearch').bind("blur", function (evt) {
		if ($(this).val().length == 0)
			$(this).val($(this).data("text"));
	});
	$('#listSearch').data("text", $('#listSearch').val());

</script>


{% load i18n %}

<form id="search" action="{{ search_url }}" method="get">
    <div style="float: right">
        <input id="listSearch" type="text" name="q" value="{% trans "Search" %}" />
        <button type="submit">
            <img src="{{ MEDIA_URL }}pinax/img/silk/icons/zoom.png" />
        </button>
    </div>
</form>
<script type="text/javascript">
	$('#listSearch').bind("focus", function (evt) {
		if ($(this).val() == $(this).data("text")) {
			$(this).data("text", $(this).val());
			$(this).val("");
		}
	});
	$('#listSearch').bind("blur", function (evt) {
		if ($(this).val().length == 0)
			$(this).val($(this).data("text"));
	});
	$('#listSearch').data("text", $('#listSearch').val());
	$('#listSearch').attr("id", "listSearch-" + Math.random());

</script>


Rename listSearch after setting attributes on it since it appears multiple times on some pages
Rename listSearch after setting attributes on it since it appears multiple times on some pages
