function busy() {
	document.body.className=(document.body.className== 'wait')?'':'wait';
}

function checkForm(	notEmptyFields, formid ) {
	if (formid==null) { formid = ""; } else { formid = "_"+formid; }
	var letop = document.getElementById("letop"+formid);
	var error = document.getElementById("error"+formid);

	var valid = true;
	//
	for (i=0; i<notEmptyFields.length; i++) { 
		// document.getElementById(notEmptyFields[i]).className = "";
		// document.getElementById(notEmptyFields[i]).onfocus = function() {};
		
  	if (document.getElementById(notEmptyFields[i]).value=="") {
  		if (valid) {
  			// Geef het eerste foute veld focus
  			document.getElementById(notEmptyFields[i]).focus();
  		}
  		document.getElementById(notEmptyFields[i]).className = "inputerror";
  		valid = false;
    } 
    else {
			document.getElementById(notEmptyFields[i]).className = "";    	
    }
  } 
  
	if (error!=null) {
		error.style.display = "none"; 
	}

	if (letop!=null) {
  	if (!valid) { 
  		// document.getElementById("letop").style.visibility = "visible";
  		letop.style.display = "block"; 
		}
		else {
  		// document.getElementById("letop").style.visibility = "hidden";
  		letop.style.display = "none"; 
		}
	}
  return (valid);
}

function submitCms(json) {
	var submitForm = null;
 	if (json.form!=null) { 
 		submitForm = document.getElementById(json.form);
	}
	if (submitForm==null) {
		submitForm = document.getElementById("ixpsform");
	}
	if (json.id!=null) { submitForm.id.value = json.id; }
	if (json.event!=null) { submitForm.event.value = json.event; }
	if (json.content!=null) { submitForm.cms_content.value = json.content; }
	if (json.uploads!=null) { submitForm.cms_uploads.value = json.uploads; }
	if (json.view!=null) { submitForm.view.value = json.view; }
	
 	submitForm.action= json.action;
 	submitForm.submit();
}




