tinyMCE.init({
  mode : "textareas",
  theme : "simple"
});
function CheckProfile(enquiryForm){
  var telnum=/[\d\D]+$/;
  var doc = document.enquiryForm;	
  var strsecuritycode = doc.email_securitycode.value;
  var strEmail = doc.email_from.value;
  var strCC = doc.email_cc.value;
  var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
  if(strEmail != "" && strFirstName != "" && strLastName != "" && strMessage != "" && strsecuritycode != "" ){
    var testresults = true;
    if(!telnum.test(strsecuritycode)){
      alert("Security Code does not match!");
      testresults=false;
    }
    if(!filter.test(strEmail)){
      alert("Invalid Email Address. Please try again!");
      testresults=false;
    }
    if(!filter.test(strEmail)){
      alert("Invalid Email Address. Please try again!");
      testresults=false;
    }
  }else{
    var strAlert = "Please fill infomation in the blank field";
    if(strsecuritycode == ""){
      strAlert = strAlert + " - Security Code";
    }	
    if(!doc ){
      strAlert = strAlert + "Unable to find form: '" + enquiryForm + "'\n";
    }
    if(doc.email_fname.value==""){
      strAlert = strAlert + "Please enter your first name\n";
      document.getElementById('fnlabel').style.color='red';
    }
    if(doc.email_lname.value==""){
      strAlert = strAlert + "Please enter your last name\n";
      document.getElementById('lnlabel').style.color='red';
    }
    if(doc.email_from.value==""){
      strAlert = strAlert + "Please enter your email address\n";
      document.getElementById('elabel').style.color='red';
    }
    if(doc.email_subject.value==""){
      strAlert = strAlert + "Please enter a subject\n";
      document.getElementById('sublabel').style.color='red';
    }
    if(doc.email_enquiry.value==""){
      strAlert = strAlert + "Please provide a comment\n";
      document.getElementById('msglabel').style.color='red';
    }
    if(doc.email_securitycode.value==""){
      strAlert = strAlert + "Please enter the security code\n";
      document.getElementById('seclabel').style.color='red';
    }
    alert(strAlert);
    testresults=false;
  }
  return (testresults);
}

function divScroll(divId, value)
{
	var element = document.getElementById(divId);
	element.scrollTop += value;
	
}

function divScrollTop(divId, value)
{
	var element = document.getElementById(divId);
	element.scrollTop -= value;
}
