// JavaScript Document
function checkChars(field, fieldName) {

    var okchars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.-_"
    var ok = "yes";
    var temp;

    for (var i = 0; i < field.value.length; i++) {
      temp = "" + field.value.substring(i, i+1);
      if (okchars.indexOf(temp) == "-1") ok = "no";
    }

    if (ok == "no") {
    alert("The " + fieldName + " field must contain only alphabetic or numeric characters, please check for invalid characters.");
    field.focus();
    field.select();

    }

}

function valForm2(Form2){
		var ps = document.Form2.single_pw.value;
		var theAction = "http://vubiz.com/default.asp?vCust=CCHS2544&vId=" + ps + "&vSource=http://ccohs.ca/products/courses/login.html";
	    if (ps == "") {
       		alert("Please enter your password.");
       		document.Form2.single_pw.focus();
       	}

       	else {
			document.Form2.action = theAction;
       		document.Form2.submit();
       	}
}

function valForm3(Form3){
		var mps = document.Form3.multi_pw.value;
		var custID = document.Form3.Cust.value;
		var theAction = "http://vubiz.com/v5/default.asp?vCust= " + custID + " &vId= " + mps + "&vLang=EN" + "&vSource=http://ccohs.ca/products/courses/login.html";

if  (custID == "") {
		alert("Please type your Customer ID");
		document.Form3.Cust.focus();
		}
	else if  (mps == "") {
		alert("Please type your Multi User License password");
	    document.Form3.multi_pw.focus();
       }
	   else 
	   {
	    document.Form3.action = theAction;
		document.Form3.submit();
	}
}
