function login_display()
 {
    document.getElementById('login_form').style.display = '';
    document.getElementById('register_form').style.display = 'none';
 }

function register_display()
 {
    document.getElementById('login_form').style.display = 'none';
    document.getElementById('register_form').style.display = '';
 }

function drawPatch(commander, height, width, html_code)
 {
    var pos_arr = findPos(commander);
    var top_offset = pos_arr[0];
    var left_offset = pos_arr[1];
    var box = '<div style="position: absolute; top: ' + (top_offset + 15) + '; left : ' + (left_offset + 10)+ '; height: '+ height + '; width : ' + width + '; background: #FDEEF4; border: 1px solid #FA58AC; padding: 3px 3px 3px 3px; font-family: Verdana; font-size: 14px;"><div style="text-align: right;"><a href="javascript:closePatch()" style="text-decoration: none;"><b>[X] </b></a></div><br>' + html_code + '</div>';
    var new_ele = document.getElementById("hook");
    new_ele.innerHTML = box;
    return;
 }

function findPos(obj) {
        var curleft = curtop = 0;
        var o = document.getElementById(obj);
        if (o.offsetParent) {
                curleft = o.offsetLeft;
                curtop = o.offsetTop;
                while (o = o.offsetParent) {
                        curleft += o.offsetLeft;
                        curtop += o.offsetTop;
                }
        }
        return [curtop,curleft];
}

function closePatch()
 {
   var h = document.getElementById('hook');
   h.innerHTML = '';
   return;
 }

function whatisphonenote(near_id)
 {
     drawPatch(near_id, 100, 300, '<span style="font-size: 10px; font-weight: weak;">You can call a FruitNotes phone number and record your voice over the phone as a voice note.<br><br> This is done automatically by our system and no human listens to your call in FruitNotes side.<span><br><br>');
 }
