function JS_GeneratePassword() {

    if (parseInt(navigator.appVersion) <= 3) {
        alert("Sorry this only works in 4.0+ browsers");
        return true;
    }
    var length=8;
    var sPassword = "";
	var noPunction = 1;

    for (i=0; i < length; i++) {
        numI = getRandomNum();
        if (noPunction){ 
			while (checkPunc(numI)){ 
				numI = getRandomNum(); 
			} 
		}
        sPassword = sPassword + String.fromCharCode(numI);
    }
    return sPassword;
}

function getRandomNum() {

    // between 0 - 1
    var rndNum = Math.random()

    // rndNum from 0 - 1000
    rndNum = parseInt(rndNum * 1000);

    // rndNum from 33 - 127
    rndNum = (rndNum % 94) + 33;

    return rndNum;
}

function checkPunc(num) {

    if ((num >=33) && (num <=47)) { return true; }
    if ((num >=58) && (num <=64)) { return true; }
    if ((num >=91) && (num <=96)) { return true; }
    if ((num >=123) && (num <=126)) { return true; }

    return false;
}

function propose_reviewers(form_name, recommended_reviewers) {
	myString = new String(recommended_reviewers);
	splitString = myString.split(",");
	// First uncheck All checkboxes
	for (x = 0; x < document.forms[0].elements.length; x++) {
		if (document.forms[0].elements[x].name == form_name + '[]') {
			document.forms[0].elements[x].checked = false;
		}
	}

	// Then check the checkboxes that are associated with recommended reviewers
	for (x = 0; x < document.forms[0].elements.length; x++) {
		if (document.forms[0].elements[x].name == form_name + '[]') {
			for(i = 0; i < splitString.length; i++){
				if (document.forms[0].elements[x].value == splitString[i]) {
					document.forms[0].elements[x].checked = true;
				}
			}
		}
	}
}

function uncheck_all(form_name) {
	for (x = 0; x < document.forms[0].elements.length; x++) {
		if (document.forms[0].elements[x].name == form_name + '[]') {
			document.forms[0].elements[x].checked = false;
		}
	}
}