function cekKlik(words)
{	if (!document.agreement.agree.checked)
		alert(words);
	else 
		document.agreement.submit();
		
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


function prepareInputsForHints(idx) {
	var inputs = document.getElementsByTagName("input");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[idx]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[idx].style.display = "inline";
			}
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[idx].style.display = "none";
			}
		}
	}
	// repeat the same tests as above for selects
	var selects = document.getElementsByTagName("select");
	for (var k=0; k<selects.length; k++){
		if (selects[k].parentNode.getElementsByTagName("span")[idx]) {
			selects[k].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[idx].style.display = "inline";
			}
			selects[k].onblur = function () {
				this.parentNode.getElementsByTagName("span")[idx].style.display = "none";
			}
		}
	}
}

function userAgree() {
		if (document.agreement.agree.checked == 0) {
			//document.frmdaftar.btndaftarorange.disabled=true;
			alert('Kamu harus menyetujui persetujuan pengguna terlebih dahulu sebelum dapat mendaftar di cintasekolah.com !');
			return false;
		} else {
			//document.frmdaftar.btndaftarorange.disabled=false;
			return true;
		}
	}
