function funcdir(curelem) {
  if (document.getElementById) {
		thisdir = document.getElementById(curelem).style;
		if (thisdir.display=="block") {
		  thisdir.display = "none";
		} else {
			thisdir.display = "block";
		}
		return false;
  } else {
	  return true;
  }
}


function selectState(pCountry) {
	if (pCountry=="Malaysia") {
		alert("You must select an option for State.");
	} else {
		alert("Please enter your country.");
	}
}

function funcvalcontact(contactus) {
  if (contactus.IName.value=="") {
		alert("You must enter your name.");
		contactus.IName.focus();
		return false;
  }

  if (contactus.IEmailAdd.value=="") {
		alert("You must enter your email address.");
		contactus.IEmailAdd.focus();
		return false;
  }

  chkbutton = -1;
  for (i=0;i<contactus.RCountry.length;i++) {
		if(contactus.RCountry[i].checked) {
		  chkbutton = i;
		}
  }
  if (chkbutton==-1) {
		alert("You must choose a button.");
		return false;
  }

  if (contactus.RCountry[0].checked && contactus.SMyState.value=="") {
		alert("You must enter your State.");
		contactus.SMyState.focus();
		return false;
  } 

	if (contactus.RCountry[0].checked && contactus.SMyState.value!="") {
		contactus.ICountry.value="Malaysia";
	}

  if (contactus.RCountry[1].checked && contactus.ICountry.value=="") {
		alert("You must enter your country.");
		contactus.ICountry.focus();
		contactus.SMyState.value="";
		return false;
  }

  if (contactus.RCountry[1].checked && contactus.ICountry.value!="") {
		contactus.SMyState.value="";
  }

  if (contactus.TComments.value=="") {
		alert("You should enter some words as comments or suggestion.");
		contactus.TComments.focus();
		return false;
  }
}


function NewWindow(eaddress) {
OpenNewWindow = this.open(eaddress, "NewWindow", "toolbar=no,menubar=no,location=yes,scrollbars=yes,resizable=yes,width=700,height=560");
}

