// Author: Kris Purdy
// Date: 20/07/2007
var g_This = null;
var g_Timeout = null;
var g_CloseTimeout = null;
//======================================================================
function initExpanders(divName) {
//pre: A HTML page.
//pst: Event handlers assigned inevery browser apart from Firefox.
// Firefox has a bug with sequencing of hover events.
jQuery.noConflict();
assignExpanders(".expArticle",divName);
assignExpanders(".featuredArticle",divName);
}
//======================================================================
function assignExpanders(a_Element,divName) {
//pre: All
.
//pst: onmouseover > expands artcleBoxHidden element.
jQuery(a_Element,divName).hover(function(){
if (jQuery(this).children(".artcleBoxHidden").css("display") == "none" ||
jQuery(this).children(".artcleBox").css("display") == "none") {
g_CloseTimeout = setTimeout("closeMenu()",300);
clearTimeout(g_Timeout);
g_This = jQuery(this);
g_Timeout = setTimeout("openMenu()",300);
}
},
function () {
clearTimeout(g_Timeout);
clearTimeout(g_CloseTimeout);
g_This = null;
g_Timeout = null;
g_CloseTimeout = null;
}
)
}
//======================================================================
function openMenu() {
//pre:
//pst:
if (g_This) {
g_This.css({background: "#eff6ff"});
g_This.children(".titleBox").children("img").attr({ src: "http://i.thisislondon.co.uk/i/std/siteimages/eveningstandard/arrowRight.jpg"});
if (g_This.attr("class") == "expArticle") {
g_This.children(".artcleBoxHidden").slideDown("normal");
} else {
g_This.children(".artcleBox").slideDown("normal");
}
}
}
//======================================================================
function closeMenu() {
//pre:
//pst:
jQuery(".artcleBoxHidden").each(function () {
if(jQuery(this).css("display") != "none") {
jQuery(this).slideUp("normal");
jQuery(this).parent().css({background: "#ffffff"});
jQuery(this).parent().children(".titleBox").children("img").attr({ src: "http://i.thisislondon.co.uk/i/std/siteimages/eveningstandard/arrowDown.jpg"});
}
}
);
jQuery(".artcleBox").each(function () {
if(jQuery(this).css("display") != "none") {
jQuery(this).slideUp("normal");
jQuery(this).parent().css({background: "#ffffff"});
jQuery(this).parent().children(".titleBox").children("img").attr({ src: "http://i.thisislondon.co.uk/i/std/siteimages/eveningstandard/arrowDown.jpg"});
}
}
);
}