// -----------------------------------------------------------------------------

var currentObj;

function swapMenuImage(obj, state) {

  if (state != "") {
    if (state == 2) {
      var pos = obj.src.lastIndexOf(".");
      var ext = obj.src.substr(pos + 1);
      var newloc = obj.src.substr(0, pos) + "_o." + ext;
      //obj.src = "/images/buttons/button_" + obj.name + "_o.jpg";
      obj.src = newloc
    } else if (state == 1) {
      var pos = obj.src.lastIndexOf(".");
      var ext = obj.src.substr(pos + 1);
      var newloc = obj.src.substr(0, pos - 2) + "." + ext;
      obj.src = newloc //"/images/buttons/button_" + obj.name + ".jpg";
    }

    if (currentObj != null) {
      var pos = currentObj.src.lastIndexOf(".");
      var ext = currentObj.src.substr(pos + 1);
      var newloc = currentObj.src.substr(0, pos) + "_o." + ext;
      //currentObj.src = "/images/buttons/button_" + currentObj.name + "_o.jpg";
      currentObj.src = newloc
    }
  }
}

// -----------------------------------------------------------------------------

function swapMenuImage2(obj, state) {
  if (state != "") {
    if (state == 2) {
      obj.src = "/images/buttons/button_" + obj.name + "_o.gif";
    } else if (state == 1) {
      obj.src = "/images/buttons/button_" + obj.name + ".gif";
    }

    if (currentObj != null) {
      currentObj.src = "/images/buttons/button_" + currentObj.name + "_o.gif";
    }
  }
}

// -----------------------------------------------------------------------------
function limitChars(textareaObject, limit) {

  //if (textareaObject.value.length > 7501)
  //  alert('Maximale tekstlengte bereikt!');

  if (textareaObject.value.length > limit)
    textareaObject.value = textareaObject.value.substring(0, limit);
}

// -----------------------------------------------------------------------------
function PopUp(target, width, height)
{
  win = window.open(target,'Ondernemersvereniging','width=' + width + ',height=' + height+',location=0,menubar=0,status=0,resizable=0,resizeable=no,scrollbars=no');
	if (!win.opener) win.opener = self;
	if (win.focus) win.focus();
}
window.pup = PopUp;

// -----------------------------------------------------------------------------
function PopUpScroll(target, width, height)
{
  scrollwindow = window.open(target,'Ondernemersvereniging','width=' + width + ',height=' + height+',location=0,menubar=0,status=1,resizable=1,resizeable=yes,scrolling,scrollbars=yes');
	if (!scrollwindow.opener) scrollwindow.opener = self;
	if (scrollwindow.focus) scrollwindow.focus();
}
window.pupscroll = PopUpScroll;

// -----------------------------------------------------------------------------