// sanki-acasa.js

var home_menu = _id('home-menu');
var home_links = home_menu.getElementsByTagName('a');
var home_stamps = _id('home-stamps').getElementsByTagName('a');

/*bubbles = [ 
            [ _id('bubble-volume'), 328, 115 ],
            [ _id('bubble-chestii'), 430, 490 ],
            [ _id('bubble-contact'), 85, 318 ]
          ];*/
          
var bubbles = [ _id('bubble-volume'), _id('bubble-chestii'), _id('bubble-contact') ];

function hover_volume()
{
  //var e = e || window.event;
  this.base.style.display = 'none';
  this.hover.style.display = 'inline';
  bubbles[this.i].style.display = 'inline';
  //bubbles[this.i][0].style.display = 'inline';
  //bubbles[this.i][0].style.left = absValLeft(bubbles[this.i][1]) + 'px';
  //bubbles[this.i][0].style.top = bubbles[this.i][2] + 'px';
  //bubbles[this.i][0].style.display = 'inline';
  //cur = getPosition(e);
  //bubbles[this.i][0].style.top = (cur.y - bubbles[this.i][1]) + 'px';
  //bubbles[this.i][0].style.left = (cur.x + 4) + 'px';
}

/*function move_volume(e)
{
  var e = e || window.event;
  cur = getPosition(e);
  bubbles[this.i][0].style.top = (cur.y - bubbles[this.i][1]) + 'px';
  bubbles[this.i][0].style.left = (cur.x + 4) +'px';
  //bubbles[this.i].style.display = 'block';
}*/

function leave_volume()
{
  bubbles[this.i].style.display = 'none';
  //bubbles[this.i][0].style.display = 'none';
  this.hover.style.display = 'none';
  this.base.style.display = 'inline';
}

// de la Beau's blog (hartshorne.ca)
/*function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}*/

function hover_stamp()
{
  this.base.style.display = 'none';
  this.hover.style.display = 'inline';
}

function leave_stamp()
{
  this.hover.style.display = 'none';
  this.base.style.display = 'inline';
}

//-------------------------------------------------------------------------
prepare_hover(home_links,'hover_volume','leave_volume',0);
prepare_hover(home_stamps,'hover_stamp','leave_stamp',0);
