﻿var arrHelp = new Array();
var message;

function addToHelp(index, description)
{
    var item = new Array();
    
    item.push(index);
    item.push(description);
    
    arrHelp.push(item);
}

function imgprev(leftpos, toppos, title, cale, content)
{
    title = 'Descriere produs';
    var index = content;
    content = arrHelp[content][1].toString();
    if (document.getElementById("helpdiv").children.length == 1)
        closehelp(srcHelp);
    
    if((index != '0')&&(content != ''))
    {
        var IE = document.all?true:false;
        var id = "srcHelp";
        var tempX = 0;
        var tempY = 0;
        
        var newdiv = top.document.createElement('div');
        newdiv.setAttribute('id', id);
        newdiv.style.left = leftpos;
        newdiv.style.top = toppos;
        newdiv.style.position = "absolute";
        newdiv.style.width = "200px";
        newdiv.style.height = "150px";
        newdiv.style.background ="#FEFFDA"
        newdiv.style.border = "solid 1px #FFC075"
        newdiv.innerHTML = "<table style='height:100%; width:100%;' cellpadding='0' cellspacing='0'><tr style='background-color:#F0B035;'><td style='padding:3px; font-family: arial,helvetica,sans-serif; font-size: 11px; color: #FFFFFF; font-weight: bold;'>"+ title +"</td><td style='height:18px; padding:3px;' align='right'><img src='"+ cale +"Images/Common/closehelp.gif' onclick='closehelp(srcHelp)' /></td></tr><tr><td colspan='2'>"+content+"</td></tr></table>";
        var existingDiv = top.document.getElementById("srcHelp");
        if (existingDiv == null)
            top.document.getElementById("helpdiv").appendChild(newdiv);        
        else
            newdiv = existingDiv;
      }
}

function closehelp(id)
{
      document.getElementById("helpdiv").removeChild(id);
}
