= 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)
setImageWidth(“photo0”);
Uniquely among Soviet leaders, Mikhail Gorbachev made no secret of his warm and supportive relationship with his wife Raisa, an elegant woman who often appeared in public with him and whose premature death from cancer was a devastating blow.
Her confident air and sense of style made Raisa a celebrity, boosting Gorbachev’s image in the West.
She defied stereotypes of dowdy, retiring Soviet leaders’ wives and clearly demonstrated that her husband represented a new generation.
But to Gorbachev she was much more, a partner and confidante, who travelled with him as he brought about momentous changes to the Soviet Union.
“We walked through our whole life holding hands,” Gorbachev said in a 2012 documentary. “She had something magnificent about her… she was like a princess.”
The couple met as…