

function loadPageOnConfirm($question, $link)
{
  if(confirm($question)) 
  {
      location.href = $link;
  }
}

function twoDigits(n)
{
	var str = "00" + n;
    str = str.substring(str.length - 2);
    return str;
}

function now2Timestamp()
{
	var now = new Date();
    var day = twoDigits(now.getDate());
    var month = twoDigits(now.getMonth() + 1);
    var year = now.getFullYear();
    var hours = twoDigits(now.getHours());
    var minutes = twoDigits(now.getMinutes());
    var seconds = twoDigits(now.getSeconds());
    return day + "." + month + "." + year + " " + hours + ":" + minutes + ":" + seconds;
}

String.prototype.trim = function () {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

function isEmpty(s)
{
	return ((s == null) || (s.trim().length == 0) || (s.trim() == ''));
}

