= 0 || a.lastIndexOf(‘iPhone’) >= 0)
return 0;
if (a.lastIndexOf(‘iPad’) >= 0)
return 1;
if (a.lastIndexOf(‘Android’) >= 0)
return 2;
return 3;
}
var bw = browserType();
function setDatePublished(strDate)
{
var node = document.getElementById(‘date_published’);
var year = strDate.substr(0, 4);
var month = strDate.substr(4, 2);
var day = strDate.substr(6, 2);
var hour = strDate.substr(9, 2);
var min = strDate.substr(11, 2);
var secs = strDate.substr(13, 2);
var dd = new Date();
var offset;
dd.setUTCFullYear(year, month – 1, day);
dd.setUTCHours(hour, min, secs);
strDate = dd.toLocaleString();
offset = strDate.lastIndexOf(‘ UTC’);
if (offset > 0)
strDate = strDate.substring(0, offset);
node.textContent = strDate;
}
function VectorLength(x, y)
{
x = parseFloat(x);
y = parseFloat(y);
return Math.sqrt((x*x) + (y*y));
}
function VectorLengthNormalized(x, y)
{
x = parseFloat(x);
y = parseFloat(y);
var length = VectorLength(x, y);
x = x / length;
y = y / length;
return VectorLength(x, y);
}
function nearestMediaForSize(component, mediaSize)
{
var mediaVec = VectorLength(mediaSize.height, mediaSize.width);
var nearest = null;
var nearestVec = 0;
var elementChildren = component.firstElementChild;
var latest = elementChildren;
while (elementChildren != null && latest.nextElementSibling == null)
{
var item = elementChildren;
var width = parseFloat(item.getAttribute(‘width’), 10);
var height = parseFloat(item.getAttribute(‘height’), 10);
var role = item.getAttribute(‘role’);
var href = item.getAttribute(‘href’);
elementChildren = elementChildren.firstElementChild;
latest = item;
if (role != null)
{
if (role.search(‘@2x’) != -1)
{
width /= 2;
height /= 2;
}
var imgVec = VectorLength(height, width);
if (nearestVec == 0)
{
nearest = item;
nearestVec = imgVec;
}
else if (Math.abs(imgVec – mediaVec)
–
SHAUN CURRY
setImageWidth(“photo0”);
British cartoonist and illustrator Raymond Briggs called himself “a miserable old git”. Even his publisher said he was “the grumpiest of grumpy old men”.
But he will be forever associated with a joyous creation — “The Snowman”, which has enchanted generations of children since it was published in 1978.
The delicately drawn picture book, about a young, ginger-haired boy who builds a snowman that magically comes to life, was transformed into an animated film in 1982.
First shown on British TV, with an introduction by David Bowie in some later versions, the film and its memorable musical score has become synonymous with Christmas ever since.
Briggs, whose death aged 88 was announced Wednesday, himself famously disliked the festive season but the story,…