function preview( id, url )
{
    var el=document.getElementById( 'iprev'+id );
    if ( el )
    {
        el.parentNode.removeChild(el);
    }
    else
    {
        el=document.createElement("iframe");
        el.setAttribute('id','iprev'+id);
        el.setAttribute('width','100%');
        el.setAttribute('height',200);
        el.setAttribute('src',url);
        el.setAttribute('class','preview');
        el.setAttribute('frameborder','0');
        var pel=document.getElementById('dprev'+id);
        pel.appendChild(el);
     }
     return false;
}

function showToolTip( tooltip, e )
{
    var el = document.getElementById( 'tooltip' );
    if ( !el )
    {
        return;
    }
    if ( !e )
    {
        e = window.event;
    }
    
    var x,y;
    
    if ( e.pageX )
    {
        x = e.pageX;
        y = e.pageY;
    }
    else if ( document.body.scrollLeft )
    {
        x = e.clientX + document.body.scrollLeft;
        y = e.clientY + document.body.scrollTop;
    }
    else
    {
        x = e.clientX + document.documentElement.scrollLeft;
        y = e.clientY + document.documentElement.scrollTop;
    }
    el.style.top = ( y + 20 ) + 'px';
    el.style.left = ( x + 20 ) + 'px';
    el.innerHTML = tooltip;
    el.style.display = '';
}

function hideToolTip()
{
    var el = document.getElementById( 'tooltip' );
    if ( !el )
    {
        return;
    }
    el.style.display = 'none';
}
