// Build on 14/03/2010 5.02.21
var par_SITE_ONLINE_URL = "http://www.chatta.it/";
var par_SITE_FOTOPROFILO_URL = "http://stat.chatta.it/m/";
var par_SITE_RES_URL = "http://res.chatta.it/";
var par_SITE_BASE_URL = "http://www.chatta.it/";
var par_SITE_PROFILO_URL = "http://www.chatta.it/community/";
var par_SITE_MESSAGGI_URL = "http://posta.chatta.it/";
var par_SITE_MY_URL = "http://live.chatta.it/mychatta/";
var par_SITE_FOTO_URL = "http://foto.chatta.it/";
var par_SITE_FOTOALBUM_URL = "http://fotoalbum.chatta.it/";
var par_SITE_BLOG_URL = "http://blog.chatta.it/";
var par_SITE_AMICI_URL = "http://amici.chatta.it/";
var par_SITE_LIVE_URL = "http://live.chatta.it/";
var Adv = {}; Adv.FillSlot = function( slotid ){ Adv["x"+slotid]=true; };
Adv.SlotList = [];
Adv.SlotList.push ({ id:"728x90_TOP", special:true});
Adv.SlotList.push ({ id:"728x90_BOT", special:true});
Adv.SlotList.push ({ id:"300x250_MID", special:true});
Adv.SlotList.push ({ id:"160x600_LEF", special:true});
Adv.SlotList.push ({ id:"200x200_MID", special:true});
Adv.SlotList.push ({ id:"728x90_TOP_UNSOLD", special:true});
Adv.SlotList.push ({ id:"300x250_MID_UNSOLD", special:true});
Adv.SlotList.push ({ id:"160x600_LEF_UNSOLD", special:true});
Adv.SlotList.push ({ id:"234x60_MID", special:false});
Adv.SlotList.push ({ id:"300x250_SEC", special:false});
Adv.SlotList.push ({ id:"CUSTOM_960x30_STR", special:false});
Adv.getSlotErrataCorrige = function(){
return { "V1_234x60_MID_U_NoAge": { CorrectName:"V1_234X60_MID_U_NoAge" } }; }
var WebMessengerConfiguration = function () {}; WebMessengerConfiguration.EnableOnPageLoad = false;
//
// BaseLibrary
//
var BaseLibrary = {};

BaseLibrary.addEventHandler = function(obj, ev, fp)
{
    if (obj.addEventListener)
    {
        ev = (ev.indexOf("on") != -1) ? ev.substring(2, ev.length) : ev;
        obj.addEventListener(ev, fp, false);
    }
    else if (obj.attachEvent)
    {
        ev = (ev.indexOf("on") == -1) ? "on" + ev : ev;
        obj.attachEvent(ev, fp);
    }
};

BaseLibrary._pageStartupEvents = [];
BaseLibrary._pageStartupIsRegistered = false;
BaseLibrary._pageStartupComplete = false;
BaseLibrary.addPageStartupEvent = function(action)
{
    BaseLibrary._pageStartupEvents.push(action);
    if (!BaseLibrary._pageStartupIsRegistered)
    {
        BaseLibrary.addEventHandler(window, "onload", BaseLibrary.onPageStartup);
        BaseLibrary._pageStartupIsRegistered = true;
    }
};
BaseLibrary.onPageStartup = function()
{
    if (BaseLibrary._pageStartupComplete)
        return;
    for (var i = 0; i < BaseLibrary._pageStartupEvents.length; i++)
    {
        BaseLibrary._pageStartupEvents[i]();
    }
    BaseLibrary._pageStartupComplete = true;
};

BaseLibrary.onScriptError = function(msg, url, line)
{
    return true;
}
//window.onerror = BaseLibrary.onScriptError; // comment/uncomment this line to enable/disable JavaScript debug

BaseLibrary.addToFavorites = function(url, text)
{
    var u = (url) ? url : par_SITE_BASE_URL;
    var t = (text) ? text : "Chatta.it - Conoscersi oggi!";
    if (document.all)
    { window.external.AddFavorite(u, t); }
    else if (window.sidebar)
    { window.sidebar.addPanel(t, u, ""); }
};

BaseLibrary.addBookmark = function(url, text)
{
    var u = (url) ? url : document.location.href;
    var t = (text) ? text : document.title;
    document.location = par_SITE_BASE_URL + "bookmark/?u=" + escape(u) + "&t=" + escape(t);
};

BaseLibrary.sendFeedback = function(url, text)
{
    var u = (url) ? url : document.location.href;
    var t = (text) ? text : document.title;
    document.location = par_SITE_BASE_URL + "segnala/?u=" + escape(u) + "&t=" + escape(t);
};

BaseLibrary.fixIE6flicker = function()
{
    try { document.execCommand("BackgroundImageCache", false, true); } catch (e) { }
};

//
// event handler:
//
BaseLibrary.addEventHandler(window, "onload", BaseLibrary.fixIE6flicker);

//
// String.prototype
//
if (!String.prototype.replaceText)
{
    String.prototype.replaceText = function(pattern, substitute)
    {
        return this.split(pattern).join(substitute);
    };
};
if (!String.prototype.lTrim)
{
    String.prototype.lTrim = function()
    {
        var newstr = this + "";
        while (newstr.charAt(0) == " ")
            newstr = newstr.substring(1, newstr.length);
        return newstr;
    };
};
if (!String.prototype.rTrim)
{
    String.prototype.rTrim = function()
    {
        var newstr = this + "";
        while (newstr.charAt(newstr.length - 1) == " ")
            newstr = newstr.substring(0, newstr.length - 1);
        return newstr;
    };
};
if (!String.prototype.trim)
{
    String.prototype.trim = function()
    {
        var newstr = this + "";
        newstr = newstr.lTrim();
        newstr = newstr.rTrim();
        return newstr;
    };
};
if (!String.prototype.startsWith)
{
    String.prototype.startsWith = function(prefix)
    {
        return (this.indexOf(prefix) === 0);
    };
};
if (!String.prototype.endsWith)
{
    String.prototype.endsWith = function(suffix)
    {
        var startPos = this.length - suffix.length;
        if (startPos < 0)
            return false;
        return (this.lastIndexOf(suffix, startPos) == startPos);
    };
};

//
// Cookies management
//
BaseLibrary.setCookie = function(key, value, expirationdate)
{
    var c = key + "=" + escape(value) + ";";
    c += "path=/;";
    if (expirationdate)
        c += "expires=" + expirationdate.toUTCString() + ";";
    document.cookie = c;
}
BaseLibrary.getCookieList = function()
{
    var cl = document.cookie.split(";");
    var c = new Array();
    for (var i = 0; i < cl.length; i++)
    {
        var a = cl[i].split("=");
        if (a.length == 2)
            c[a[0].trim()] = escape(a[1].trim());
    }
    return c;
}
BaseLibrary.getCookie = function(key)
{
    return BaseLibrary.getCookieList()[key];
}

//
// ListView widget
//
BaseLibrary.initListView = function(tabstripId, containerId, defaultViewMode)
{
    var container = document.getElementById(containerId);
    var tabstrip = document.getElementById(tabstripId);
    if (container == null || tabstrip == null)
        return;
    var viewMode = BaseLibrary.getCookie("ListViewMode_" + containerId) + "";
    if (viewMode == "" || viewMode == "undefined")
        viewMode = defaultViewMode;
    container.className = viewMode;
    var tabButtons = tabstrip.getElementsByTagName("a");
    for (var i = 0; i < tabButtons.length; i++)
    {
        tabButtons[i].onclick = function() { BaseLibrary.setListView(tabstripId, containerId, defaultViewMode, this.className); };
        if (tabButtons[i].parentNode)
            tabButtons[i].parentNode.className = (tabButtons[i].className == viewMode) ? " active" : "";
    }
};
BaseLibrary.setListView = function(tabstripId, containerId, defaultViewMode, viewMode)
{
    BaseLibrary.setCookie("ListViewMode_" + containerId, viewMode);
    BaseLibrary.initListView(tabstripId, containerId, viewMode);
};

//
// DropDown utils
//
BaseLibrary.bindDropDown = function(dropDownObject, dataObjectlist, dataTextField, dataTextValue, firstOptionText)
{
    BaseLibrary.clearDropDown(dropDownObject, firstOptionText ? firstOptionText : null);
    for (var i = 0; i < dataObjectlist.length; i++)
    {
        var option = document.createElement("OPTION");
        dropDownObject.options.add(option);
        option.innerText = dataObjectlist[i][dataTextField];
        option.value = dataObjectlist[i][dataTextValue];
    }
}
BaseLibrary.clearDropDown = function(dropDownObject, emptyElementText)
{
    dropDownObject.innerHTML = "";
    if (emptyElementText != null)
    {
        var option = document.createElement("OPTION");
        dropDownObject.options.add(option);
        option.innerText = emptyElementText;
        option.value = "";
    }
}

//
// CollapsiblePanel widget (see: http://livedocs.adobe.com/en_US/Spry/SDG/)
// 
BaseLibrary.CollapsiblePanel = function(element, opts)
{
    this.element = this.getElement(element);
    this.enableAnimation = true;
    this.animator = null;
    this.contentIsOpen = true;
    BaseLibrary.CollapsiblePanel.setOptions(this, opts);
    this.attachBehaviors();
};
BaseLibrary.CollapsiblePanel.prototype.getElement = function(ele)
{
    if (ele && typeof ele == "string")
        return document.getElementById(ele);
    return ele;
};
BaseLibrary.CollapsiblePanel.prototype.setDisplay = function(ele, display)
{
    if (ele)
        ele.style.display = display;
};
BaseLibrary.CollapsiblePanel.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
    if (!optionsObj)
        return;
    for (var optionName in optionsObj)
    {
        if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
            continue;
        obj[optionName] = optionsObj[optionName];
    }
};
BaseLibrary.CollapsiblePanel.prototype.open = function()
{
    this.contentIsOpen = true;
    if (this.enableAnimation)
    {
        if (this.animator)
            this.animator.stop();
        this.animator = new BaseLibrary.CollapsiblePanel.PanelAnimator(this, true, { duration: this.duration, fps: this.fps, transition: this.transition });
        this.animator.start();
    }
    else
        this.setDisplay(this.getContent(), "block");
};
BaseLibrary.CollapsiblePanel.prototype.close = function()
{
    this.contentIsOpen = false;
    if (this.enableAnimation)
    {
        if (this.animator)
            this.animator.stop();
        this.animator = new BaseLibrary.CollapsiblePanel.PanelAnimator(this, false, { duration: this.duration, fps: this.fps, transition: this.transition });
        this.animator.start();
    }
    else
        this.setDisplay(this.getContent(), "none");
};
BaseLibrary.CollapsiblePanel.prototype.onTabClick = function(e)
{
    if (this.isOpen())
        this.close();
    else
        this.open();
    if (e.preventDefault) e.preventDefault();
    else e.returnResult = false;
    if (e.stopPropagation) e.stopPropagation();
    else e.cancelBubble = true;
    return false;
};
BaseLibrary.CollapsiblePanel.prototype.attachPanelHandlers = function()
{
    var tab = this.getTab();
    if (!tab)
        return;
    var self = this;
    BaseLibrary.CollapsiblePanel.addEventListener(tab, "click", function(e) { return self.onTabClick(e); }, false);
};
BaseLibrary.CollapsiblePanel.addEventListener = function(element, eventType, handler, capture)
{
    try
    {
        if (element.addEventListener)
            element.addEventListener(eventType, handler, capture);
        else if (element.attachEvent)
            element.attachEvent("on" + eventType, handler);
    }
    catch (e) { }
};
BaseLibrary.CollapsiblePanel.prototype.preorderTraversal = function(root, func)
{
    var stopTraversal = false;
    if (root)
    {
        stopTraversal = func(root);
        if (root.hasChildNodes())
        {
            var child = root.firstChild;
            while (!stopTraversal && child)
            {
                stopTraversal = this.preorderTraversal(child, func);
                try { child = child.nextSibling; } catch (e) { child = null; }
            }
        }
    }
    return stopTraversal;
};
BaseLibrary.CollapsiblePanel.prototype.attachBehaviors = function()
{
    var panel = this.element;
    var tab = this.getTab();
    var content = this.getContent();
    if (this.contentIsOpen)
    {
        this.setDisplay(content, "block");
        this.contentIsOpen = true;
    }
    else
    {
        this.setDisplay(content, "none");
        this.contentIsOpen = false;
    }
    this.attachPanelHandlers();
};
BaseLibrary.CollapsiblePanel.prototype.getTab = function()
{
    return this.getElementChildren(this.element)[0];
};
BaseLibrary.CollapsiblePanel.prototype.getContent = function()
{
    return this.getElementChildren(this.element)[1];
};
BaseLibrary.CollapsiblePanel.prototype.isOpen = function()
{
    return this.contentIsOpen;
};
BaseLibrary.CollapsiblePanel.prototype.getElementChildren = function(element)
{
    var children = [];
    var child = element.firstChild;
    while (child)
    {
        if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
            children.push(child);
        child = child.nextSibling;
    }
    return children;
};
BaseLibrary.CollapsiblePanel.PanelAnimator = function(panel, doOpen, opts)
{
    this.timer = null;
    this.interval = 0;
    this.fps = 60;
    this.duration = 500;
    this.startTime = 0;
    this.transition = BaseLibrary.CollapsiblePanel.PanelAnimator.defaultTransition;
    this.onComplete = null;
    this.panel = panel;
    this.content = panel.getContent();
    this.doOpen = doOpen;
    BaseLibrary.CollapsiblePanel.setOptions(this, opts, true);
    this.interval = Math.floor(1000 / this.fps);
    var c = this.content;
    var curHeight = c.offsetHeight ? c.offsetHeight : 0;
    this.fromHeight = (doOpen && c.style.display == "none") ? 0 : curHeight;
    if (!doOpen)
        this.toHeight = 0;
    else
    {
        if (c.style.display == "none")
        {
            c.style.visibility = "hidden";
            c.style.display = "block";
        }
        c.style.height = "";
        this.toHeight = c.offsetHeight;
    }
    this.distance = this.toHeight - this.fromHeight;
    this.overflow = c.style.overflow;
    c.style.height = this.fromHeight + "px";
    c.style.visibility = "visible";
    c.style.overflow = "hidden";
    c.style.display = "block";
};
BaseLibrary.CollapsiblePanel.PanelAnimator.defaultTransition = function(time, begin, finish, duration) { time /= duration; return begin + ((2 - time) * time * finish); };
BaseLibrary.CollapsiblePanel.PanelAnimator.prototype.start = function()
{
    var self = this;
    this.startTime = (new Date).getTime();
    this.timer = setTimeout(function() { self.stepAnimation(); }, this.interval);
};
BaseLibrary.CollapsiblePanel.PanelAnimator.prototype.stop = function()
{
    if (this.timer)
    {
        clearTimeout(this.timer);
        this.content.style.overflow = this.overflow;
    }
    this.timer = null;
};
BaseLibrary.CollapsiblePanel.PanelAnimator.prototype.stepAnimation = function()
{
    var curTime = (new Date).getTime();
    var elapsedTime = curTime - this.startTime;
    if (elapsedTime >= this.duration)
    {
        if (!this.doOpen)
            this.content.style.display = "none";
        this.content.style.overflow = this.overflow;
        this.content.style.height = this.toHeight + "px";
        if (this.onComplete)
            this.onComplete();
        return;
    }
    var ht = this.transition(elapsedTime, this.fromHeight, this.distance, this.duration);
    this.content.style.height = ((ht < 0) ? 0 : ht) + "px";
    var self = this;
    this.timer = setTimeout(function() { self.stepAnimation(); }, this.interval);
};

//
// Do Login - wrapper sul form - 
//
BaseLibrary.DoLogin = function(u, p)
{
    var o = document.getElementById("frmLogin");
    if (o)
    {
        document.getElementById("returnUrl").value = document.location.href;
        if (u) { document.getElementById("txtUsername").value = u; };
        if (p) { document.getElementById("txtPassword").value = p; };
        o.submit();
    }
};


//
// dialogWindow
//
var dialogWindow = {};

dialogWindow.modalHtmlTemplate =
            "<div class=\"dialogWindow\" style=\"text-align: left; z-index: 1000; position: absolute; left: 0px; top: 0px; padding: 10px; background-color: #fff; display:none;border:3px solid #000;\">" +
            "    <div class=\"dwTitle\" style=\"min-height: 25px; margin-bottom: 5px;\">" +
            "        <h2 style=\"margin: 0; padding: 0;\">Titolo della box</h2>" +
            "        <a href=\"javascript:void(0);\" title=\"chiudi\" class=\"dxCloseButton\" style=\"position:absolute;top:10px;left:0;color:#777;text-decoration:none;font-size:10px;\">chiudi <span style=\"font-size:14px; font-weight: bold;\">X</span></a>" +
            "    </div>" +
            "    <div class=\"dwContent\" style=\"margin-bottom: 10px; min-width: 400px; min-height: 30px;padding-top: 5px;border-top:1px solid #000;\"></div>" +
            "    <div class=\"dwActions\">" +
            "        <a href=\"javascript:void(0);\" class=\"btn specialbutton dwOkAction\" style=\"display:none;\">Ok</a>" +
            "        <a href=\"javascript:void(0);\" class=\"btn specialbutton dwConfirmAction\" style=\"display:none;\">Conferma</a>" +
            "        <a href=\"javascript:void(0);\" class=\"btn dwCancelAction\" style=\"display:none;\">Annulla</a>" +
            "    </div>" +
            "</div>";

dialogWindow.alert = function(title, message, onClose)
{
    var modal = $(dialogWindow.modalHtmlTemplate);
    modal.find(".dwTitle H2").html(title);
    modal.find(".dwContent").html(message);
    if (onClose != null)
        modal.find(".dwTitle .dxCloseButton").click(onClose);
    modal.find(".dwTitle .dxCloseButton").click(dialogWindow.hideModal).show();
    if (onClose != null)
        modal.find(".dwOkAction").click(onClose);
    modal.find(".dwOkAction").click(dialogWindow.hideModal).show();
    dialogWindow._showModal(modal);
};

dialogWindow.confirm = function(title, message, onClose, onConfirm, onCancel)
{
    var modal = $(dialogWindow.modalHtmlTemplate);
    modal.find(".dwTitle H2").html(title);
    modal.find(".dwContent").html(message);
    if (onClose != null)
        modal.find(".dwTitle .dxCloseButton").click(onClose);
    modal.find(".dwTitle .dxCloseButton").click(dialogWindow.hideModal).show();
    if (onConfirm != null)
        modal.find(".dwConfirmAction").click(onConfirm);
    modal.find(".dwConfirmAction").click(dialogWindow.hideModal).show();
    if (onCancel != null)
        modal.find(".dwCancelAction").click(onCancel);
    modal.find(".dwCancelAction").click(dialogWindow.hideModal).show();
    dialogWindow._showModal(modal);
};

dialogWindow.iFrameModal = function(title, iFrameUrl, onClose, iFrameWidth, iFrameHeight)
{
    var contentWidth = iFrameWidth ? iFrameWidth : 400;
    var contentHeight = iFrameHeight ? iFrameHeight : 200;
    var modal = $(dialogWindow.modalHtmlTemplate);
    modal.find(".dwTitle H2").html(title);
    if (onClose != null)
        modal.find(".dwTitle .dxCloseButton").click(onClose);
    modal.find(".dwTitle .dxCloseButton").click(dialogWindow.hideModal).show();
    modal.find(".dwContent").css({ "width": contentWidth + "px", "height": contentHeight + "px" });
    var $iFrameContent = $("<iframe frameborder=\"0\">")
                        .css({ "width": contentWidth + "px", "height": contentHeight + "px", "border": "1px solid #fff" })
                        .attr("src", iFrameUrl)
                        .attr("width", contentWidth)
                        .attr("height", contentHeight)
                        .attr("scrolling", "auto")
                        .attr("marginheight", 0)
                        .attr("marginwidth", 0);
    modal.find(".dwContent").html('').append($iFrameContent);
    dialogWindow._showModal(modal);
};

dialogWindow.htmlModal = function(title, html, onClose)
{
    var modal = $(dialogWindow.modalHtmlTemplate);
    modal.find(".dwTitle H2").html(title);
    if (onClose != null)
        modal.find(".dwTitle .dxCloseButton").click(onClose);
    modal.find(".dwTitle .dxCloseButton").click(dialogWindow.hideModal).show();
    $htmlContent = $(html);
    modal.find(".dwContent").append($htmlContent);
    dialogWindow._showModal(modal);
};

dialogWindow.hideModal = function()
{
    dialogWindow._hideModal();
};

//
// special dialogs:
//
dialogWindow.writeTo = function(userId, alwaysInPopUp)
{
    var url = par_SITE_MESSAGGI_URL + "contatta.aspx?contact=" + userId;
    if (alwaysInPopUp || !dialogWindow._enableModal || $(window).height() < 570)
        window.open(url, "ComposeNewMessage", "width=640px,height=500px,toolbar=no,resizable=yes,scrollbars=yes,titlebar=no,menubar=no,location=no,status=no");
    else
        dialogWindow.iFrameModal("Scrivi nuovo messaggio", url, null, 640, 500);
};

//private
dialogWindow._enableModal = false;
$(document).ready(function() { dialogWindow._enableModal = true; });

dialogWindow._$activeModal = null;
dialogWindow._showModal = function(modal)
{
    if (!dialogWindow._enableModal)
        return;
    dialogWindow._showOverlay();
    dialogWindow._$activeModal = $(modal);
    $("body").append(dialogWindow._$activeModal);
    var color = $("h2").css("color");
    dialogWindow._$activeModal.css("border-color", color);
    dialogWindow._$activeModal.find("div.dwContent").css("border-color", color);
    dialogWindow._repositionModal();
    $(window).resize(dialogWindow._repositionModal).scroll(dialogWindow._repositionModal);
    dialogWindow._$activeModal.show();
};
dialogWindow._repositionModal = function()
{
    if (dialogWindow._$activeModal == null)
        return;
    var l = ($(window).width() - dialogWindow._$activeModal.width()) / 2;
    var t = (($(window).height() - dialogWindow._$activeModal.height()) / 2) + $(window).scrollTop();
    dialogWindow._$activeModal.css("left", (l > 0 ? l : 0)).css("top", (t > 0 ? t : 0));
    dialogWindow._$activeModal.find(".dxCloseButton").css("left", dialogWindow._$activeModal.width() - 40);
};
dialogWindow._hideModal = function()
{
    dialogWindow._$activeModal.remove();
    dialogWindow._$activeModal = null;
    $(window).unbind("resize", dialogWindow._repositionModal).unbind("scroll", dialogWindow._repositionModal);
    dialogWindow._hideOverlay();
};

dialogWindow._$overlay = null;
dialogWindow._showOverlay = function()
{
    //IE6 partial fix
    if ($.browser.msie && $.browser.version.substr(0, 1) == "6")
        $("#cmbToolbarSetOnlineUserStatus").hide();

    dialogWindow._$overlay = $("<div>")
                             .click(dialogWindow.hideModal)
                             .css({ "z-index": "999", "position": "absolute", "left": "0", "top": "0", "background-color": "#000", "filter": "alpha(opacity=50)", "opacity": "0.5", "-moz-opacity": "0.5" });
    $("body").append(dialogWindow._$overlay);
    dialogWindow._resizeOverlay();
    $(window).resize(dialogWindow._resizeOverlay).scroll(dialogWindow._resizeOverlay);
    return false;
};
dialogWindow._resizeOverlay = function()
{
    if (dialogWindow._$overlay == null)
        return;
    var $w = $(window);
    // Note: using "position:fixed" instead of "position: absolute" remove top and left reset
    dialogWindow._$overlay.css({ "width": $w.width(), "height": $w.height(), "top": $w.scrollTop(), "left": $w.scrollLeft() });
};
dialogWindow._hideOverlay = function()
{
    //IE6 partial fix
    if ($.browser.msie && $.browser.version.substr(0, 1) == "6")
        $("#cmbToolbarSetOnlineUserStatus").show();

    if (dialogWindow._$overlay == null)
        return;
    dialogWindow._$overlay.remove();
    $(window).unbind("resize", dialogWindow._resizeOverlay).unbind("scroll", dialogWindow._resizeOverlay);
    dialogWindow._$overlay = null;
};

// Highlight new sections/contents:
BaseLibrary._newContentHighlightId = "_NewContentHighlight";
BaseLibrary.createNewContentHighlight = function()
{
    if ($("div.mainmenu ul li.bacheche").length == 0)
        return;
    var obj = $("<img />").attr("id", BaseLibrary._newContentHighlightId).attr("src", "http://res.chatta.it/img/new.gif").attr("alt", "Novit?!").appendTo($("body")).hide();
    BaseLibrary.moveNewContentHighlight();
    obj.fadeIn("slow");
};
BaseLibrary.moveNewContentHighlight = function()
{
    var menuItem = $("div.mainmenu ul li.bacheche");
    if (menuItem.length == 0)
        return;
    var t = menuItem.offset().top - 10;
    var l = menuItem.offset().left + menuItem.width() - 25;
    $("img#" + BaseLibrary._newContentHighlightId).css({ "position": "absolute", "top": t + "px", "left": l + "px" });
};
$(document).ready(BaseLibrary.createNewContentHighlight);
$(window).resize(BaseLibrary.moveNewContentHighlight);
