// keeping the session alive
$(document).ready(function() {
    $.jheartbeat.set({
        url: "/vezeltest/heartbeat",
        delay: 600000
    }, function () {
        // Callback Function
    });

    $('DIV.tooltipbutton').each(function() 
    {
        $(this).qtip({
            show : {ready: false, when: 'mouseover',solo : true},
            hide: { when: 'mouseout', fixed: true },
            content: $(this).attr('name'),
            position: {corner: {tooltip: 'rightMiddle',target: 'leftMiddle'}, adjust : { screen:false }},
            style: {
                padding : 12,
                background : 'transparent',
                backgroundImage : 'url('+imgPath+'tooltip_gradient.png)',
                border: {
                    radius : 1,
                    width: 1,
                    color : '#ed7d00'
                }, 
                color : '#ed7d00',
                padding: 10, 
                textAlign: 'left', 
                tip: true
            }
            
        });

    });
    
});

function calcFiber(val, obj)
{
  var value = parseFloat(obj.value.replace(",","."));
  var totaal = (value * val);
  
  totaal = totaal.toString().replace(".",",");
  if (totaal=='NaN')
  {
    $('#' + obj.id + '_tot').html('');
  }
  else
  {
    $('#' + obj.id + '_tot').html(totaal);
  }
  
}
function showTT(obj, id)
{
    var p = $(obj).position();
    $(id).css("left", Math.round(p.left)-150 + 'px').css("top", Math.round(p.top)-40 + "px");
    $(id).show();
}

function hideTT(id)
{
    $(id).hide();
}


function submitForm()
{
    $('FORM').submit(function(){
        return validateForm(document.getElementById('form'));
    });
    $('FORM').submit();
}
