function addEvent(func){
      if (!document.getElementById | !document.getElementsByTagName) return
      var oldonload=window.onload
      if (typeof window.onload != 'function') {window.onload=func}
      else {window.onload=function() {oldonload(); func()}}
    }
    addEvent(hideAll)

    function hideAll(){
      var obj,nextspan,anchor,content

      // get all spans
      obj=document.getElementsByTagName('span')

      // run through them
      for (var i=0;i<obj.length;i++){

        // if it has a class of helpLink
        if(/helpLink/.test(obj[i].className)){

          // get the adjacent span
          nextspan=obj[i].nextSibling
          while(nextspan.nodeType!=1) nextspan=nextspan.nextSibling

           // hide it
          nextspan.style.display='none'

          //create a new link
          anchor=document.createElement('a')

          // copy original helpLink text and add attributes
          content=document.createTextNode(obj[i].firstChild.nodeValue)
          anchor.appendChild(content)
          anchor.href='#'
          anchor.title='Click to show choose'
          anchor.className=obj[i].className
          anchor.nextspan=nextspan
          anchor.onclick=function(){showHide(this.nextspan);changeTitle(this);return false}

          // replace span with created link
          obj[i].replaceChild(anchor,obj[i].firstChild)
        }
      }
    }

    function changeTitle(obj){    // used to flip helpLink title
      if(obj)
        obj.title = obj.title=='Click to show choose' ? 'Click to hide choose' : 'Click to show choose'
    }

    function showHide(obj){   // used to flip the display property
      if(obj)
        obj.style.display = obj.style.display=='none' ? 'inline' : 'none'
    }
/*    Must Filled in             */

function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false;}
else {return true}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_required(email,"Email must be filled out!")==false)
  {email.focus();return false;}
}
}
/* function ku sendiri */
function check_showhide(field)
{
	with (field)
		{
		obj=document.field.getElementsByTagName('title')
		if (obj=="Click to show choose")
			{
			alert(obj);
			} else {
			alert(obj);
			}
		}
}