<!--
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
function Checkval(val,validchars)
{
	var	errorFound = -1
	var returnGood = true;
	for (i = 0; i < val.length; i++)
	{
		target = val.substr(i,1)
		if (validchars.indexOf(target) != -1)
		{
			//found a valid character 
		}
		else
		{
			// found an invalid character i
			errorFound = i;
			returnGood = false;
			break;
		}
	}
	return (returnGood);
}
var	NotokToSubmit = 1;
var	errorNumber = 0;
var	errorMSG = "";
function SK_ValidateForm(myform)
{
	NotokToSubmit = 1;
	errorNumber = 0;
	errorMSG = "";
	
	validateBusinessDetails(myform);    
	validateContactDetails(myform);
	
	if(NotokToSubmit == 0)
	{
		//
		document.all.errorMessages.innerHTML = errorMSG;
		alert("Unable to Submit - Please Check Your Details!")
		return false;
	}
	else
	{
		document.all.errorMessages.innerHTML = "";
		alert("Form is Valid. Press OK to submit");
		return true;
	}

	
}

function SK_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=SK_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  { 
  	test=args[i+2]; 
	val=MM_findObj(args[i]);
    if (val) 
	{ 
		nm=val.name; 
		if ((val=val.value)!="") 
		{
			if (test.indexOf('isPhone')!=-1) 
			{ 
				check = Checkval(val,"()+01234567890 ");
				if (check!= true) 
				{
					errors+='- '+nm+' must contain an valid Phone number (characters allowed = ()+0123456789).\n';
				}
			}
			if (test.indexOf('isCHAR')!=-1) 
			{ 
				check = Checkval(val,"()+1234567890 ,;.-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
				if (check!= true) 
				{
					errors+='- '+nm+' contains characters that are not allowed (characters allowed = ()+1234567890 ,;.-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ).\n';
				}
			} 
			if (test.indexOf('isEmail')!=-1) 
			{ 
				p=val.indexOf('@');
				if (p<1 || p==(val.length-1)) 
				{
					errors+='- '+nm+' must contain an e-mail address.\n';
				}
			} 
			if (test.indexOf('isNUM')!=-1) 
			{ 
				num = parseFloat(val);
				if (isNaN(val)) 
				{
					errors+='- '+nm+' must contain a number.\n';
				}
				
				if (test.indexOf('inRange') != -1) 
				{ 
					p=test.indexOf(':');
					min=test.substring(8,p); 
					max=test.substring(p+1);
					if (num<min || max<num) 
					{
						errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
					}
				} 
			}
		} 
		else if (test.charAt(0) == 'R') 
		{
			errors += '- '+nm+' is required.\n'; 
		}
	}
  } 
  if (errors) 
  {
  	return (errors);
  }
  return (true);
}
//-->
