if (!pageHandler)
{
    var pageHandler = {};
}

pageHandler.getId = function()
{
    return this.id;
};

pageHandler.getRef = function()
{
    return this.ref;
};

pageHandler.getLang = function()
{
    return this.lang;
};

pageHandler.getTitle = function()
{
    return this.title;
};

pageHandler.getAuthor = function()
{
    return this.author;
};

pageHandler.getKeywords = function()
{
    return this.keywords;
};

pageHandler.getThread = function()
{
    return this.thread;
};

pageHandler.getTags = function()
{
    return this.tags;
};

pageHandler.hasTag = function(tag)
{
    return (this.tags.indexOf(tag) != -1);
};

pageHandler.getTopic = function()
{
    return this.topic;
};

pageHandler.setTopic = function(topic)
{
    this.topic = topic;
};

pageHandler.getMarker = function()
{
    return this.marker;
};

pageHandler.setMarker = function(marker)
{
    this.marker = marker;
};

pageHandler.setMarkerParameter = function(name, value)
{
    if (typeof this.marker != "object")
    {
        this.marker = {};
    }

    this.marker[name] = value;
};

pageHandler.getMarkerParameter = function(name)
{
    if (typeof this.marker == "object")
    {
        return this.marker[name];
    }

    return null;
};

function accessiblePopup(elt, width, height)
{
    if (!width)
    {
        width = screen.width;
    }

    if (!height)
    {
        height = screen.height;
    }

    var left = Math.floor((screen.width - width) / 2);
    var top = Math.floor((screen.height - height) / 2);
    var popupWindow = window.open(
        elt.getAttribute('href'),
        "popup",
        "top=" + top + ", left=" + left + ", width=" + width + ", height=" + height + ", location=yes, menubar=yes, toolbar=yes, resizable=yes, scrollbars=yes"
    );

    popupWindow.focus();

    return false;
}

function accessiblePrint(elt)
{
    if (window.print)
    {
        window.print();
    }
    else if (elt)
    {
        window.location.href = elt.getAttribute('href');
    }

    if (elt)
    {
        return false;
    }
}

function accessibleAddToFavorite(elt)
{
    if (window.sidebar && window.sidebar.addPanel)
    {
        window.sidebar.addPanel(document.title, document.location.href, '');
    }
    else if (document.all && window.external)
    {
        window.external.AddFavorite(document.location.href, document.title);
    }
    else if (elt)
    {
        window.location.href = elt.getAttribute('href');
    }

    if (elt)
    {
        return false;
    }
}

function getFieldValueByName (aFieldName)
{
    var value = '';

    var field = $("[name='formParam[" + aFieldName + "]']");

    if (field && field.length)
    {
        value = field[0].value;
    }

    return value;
}


sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

