function hidelayer(a_id) {
    /*var elm = $('#homeitem'+a_id);
    if (elm) {
        elm.hide();
    }*/
    $('div.homeitem').each(function() {
        $(this).hide();
    });
};
function showlayer(a_id, a_index) {
    var elm = $('#homeitem'+a_id);
    if (elm) {
        var pos = $('#pagecontent').position();
        //var pos = $('#pagecontent').offset();
        //alert('show : '+a_id+" "+a_index+" posTop: "+pos.top+" posLeft: "+pos.left);
        elm.css('top', -$('#pagecontent').height()+12); //pos.top);
        elm.css('left', pos.left);
        elm.show();
    }
};
$(document).ready(
    function() {
        $('div#pagecontent a').each(function() {
            //var $href = this.href;
            //this.title = $href;
            //this.href = "javascript:;";
            //$(this).mouseover(function() { window.status = ""+this.title; return true; });
            //$(this).mouseout(function() { window.status = ""; return true; });
            $(this).click(function() {
                showlayer(this.rel);
                return false;
            });
        });
        
        $('div.homeitem a').each(function() {
            $(this).click(function() {
                hidelayer();
                return false;
            });
        });
    }
);