﻿// JavaScript File
function EditFilterSettings()
{
}

var _oldColor;

function SetNewColor(source)
{
    _oldColor = source.style.backgroundColor;
    source.style.backgroundColor = '#D1DDF1';
    source.style.cursor = 'hand';
}

function SetOldColor(source)
{
    source.style.backgroundColor = _oldColor;
    source.style.cursor = 'default';
}

function DownloadFile(fileid)
{
    navigate('downloadfile.aspx?fileid=' + fileid);
}


function ShowRemainingChars(source, maxlength)
{
  divRemainingChars.innerText = maxlength - source.value.length;
}

function CheckRemainingChars(source, maxlength)
{
  if (event.type == "paste") {
    var txtToPaste = window.clipboardData.getData("Text")
    window.event.returnValue = !((source.value.length + txtToPaste.length) > maxlength)
  } else {
    window.event.returnValue = !(source.value.length >= maxlength)
  }
}

function ResetForm()
{
  aspnetForm.reset();
  divRemainingChars.innerText = '500';  
}

function setStatusMessage(strMessage)
{
    if (strMessage == 0)
    {
        setStatus("Welkom bij 4PS - de marktleider in de bouw- en installatiebranche met Microsoft Business Solutions");
    }
    else
    {
        setStatus(strMessage);
    }
}