Perfect, how did I not notice that. Works perfectly now and here is the final code.
If you have no objection I would like to blog my experience of creating this, including of course references to this site, discussion and of course the fact that I wouldn't have got to here without your help.
<html>
<table>
<tr>
<td>
<a href="/lists/opportunities/newform.aspx?source=/" onMouseOver="return changeImage()" onMouseOut= "return changeImageBack()" onMouseDown="return handleMDown()"
onMouseUp="return handleMUp()"><img name="jsbutton" src="/AnimFrog/AnimInitial.jpg" width="110" height="260" border="0"
alt="javascript button"></a>
<script language="JavaScript">
upImage = new Image();
upImage.src = "/AnimFrog/AnimHover.jpg";
downImage = new Image();
downImage.src = "/AnimFrog/AnimClick.jpg"
normalImage = new Image();
normalImage.src = "/AnimFrog/AnimInitial.jpg";
function changeImage()
{
document.images["jsbutton"].src= upImage.src;
return true;
}
function changeImageBack()
{
document.images["jsbutton"].src = normalImage.src;
return true;
}
function handleMDown()
{
document.images["jsbutton"].src = downImage.src;
return true;
}
function handleMUp()
{
changeImage();
return true;
}
</script>
</td>
<td>
<center><b>Opportunities for this week:<p><span id="frogItemCount"></span></center></b>
<script type="text/javascript" src="/scripts/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="/scripts/jquery.SPServices-2014.01.min.js"></script>
<script language="JavaScript">
$(document).ready()
var itemCount;
var daysFromSunday = (new Date()).getDay(),
dateOffset = (
daysFromSunday > 0 ? " OffsetDays='-" + daysFromSunday + "'" : ""
),
query;
var daysToSunday = 7 - daysFromSunday;
var query = "<Query>" +
"<Where>" +
"<And>" +
"<Geq>" +
"<FieldRef Name='CreateDate' />" +
"<Value Type='DateTime'>" +
"<Today OffsetDays='-" + daysFromSunday + "'/>" +
"</Value>" +
"</Geq>" +
"<Leq>" +
"<FieldRef Name='CreateDate' />" +
"<Value Type='DateTime'>" +
"<Today OffsetDays='" + daysToSunday + "'/>" +
"</Value>" +
"</Leq>" +
"</And>" +
"</Where>" +
"</Query>";
$().SPServices({
operation: "GetListItems",
listName: "Opportunities",
CAMLQuery: query,
async: false,
completefunc: function(xData, Status) {
itemCount = $(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
}
});
$("#frogItemCount").html(itemCount);
</script>
</td>
</tr>
</table>
Big thank you for everyone's help it is much appreciated.If you have no objection I would like to blog my experience of creating this, including of course references to this site, discussion and of course the fact that I wouldn't have got to here without your help.