rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
	rnd.seed = (rnd.seed*9301+49297) % 233280;
	return rnd.seed/(233280.0);
}

function rand(number) {
	var n = Math.ceil(rnd()*33);
	if (n > 33){
		n = 33;
	}
	if (n < 1){
		n = 1;
	}
	//alert("This is just a debugging tool.\n\nPicture Number:" + n);
	return n;
}
function leader_rand() {
	var n = Math.ceil(rnd()*5);
	if (n > 5){
		n = 5;
	}
	if (n < 1){
		n = 1;
	}
	//alert("This is just a debugging tool.\n\nPicture Number:" + n);
	return n;
}


function location_rand() {
	var n = Math.ceil(rnd()*9);
	if (n > 9){
		n = 9;
	}
	if (n < 1){
		n = 1;
	}
	//alert("This is just a debugging tool.\n\nPicture Number:" + n);
	return n;
}

function calPop() {
		stats='resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,width=10,height=10';
		calendarWindow = window.open ("","calendarWindow",stats);
		
		stats='resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=yes,menubar=no,width=800,height=600';
		remoteScript = "<script language = \"javascript\">\n";
		remoteScript += "calWin = window.open (\"http://calendar.webster.edu:6785/command.shtml?view=monthview&calid=CfPD&tzid=America/Chicago&security=1\",\"calWin\",\"" + stats + "\");\n";
		remoteScript += "</script>\n";

		calendarWindow.document.write (remoteScript);
 }

function newPop (URL, winname, height, width) {
		var stats = "resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,width=" + width + ",height=" + height;
		eval (windname + " = window.open ('" + url + "','" + winname + "','" + stats + "')");
	return false;
	}
	
function popUp(URL) {
        day = new Date();
        id = day.getTime();
        eval("page" + id + " = window.open(URL, '" + id +
        "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=230,left=300,top=200');");
}

function verify(){
        radioflag = false;
        if (document.form.searchwords.value == ""){
                alert("Please enter your searchwords.");
                document.form.searchwords.focus();
                return false;
        }
        for (i=0; i<document.form.searchcategory.length; i++){
                if (document.form.searchcategory[i].checked == true){
                        radioflag = true;
                }
        }
        if (! radioflag){
                alert("Please select a search category.");
                return false;
        }

        return true;
}

function verify2(){
        if (document.form.name.value == ""){
                alert("Please enter some name that we can address you by.");
                document.form.name.focus();
                return false;
        }
        if (document.form.from.value == ""){
                alert("Please enter your e-mail address.");
                document.form.from.focus();
                return false;
        }
        if(document.form.from.value.indexOf("@") == -1){
                alert("Please enter a valid e-mail address.");
                document.form.from.focus();
                return false;
        }
        if(document.form.from.value.indexOf(".") == -1){
                alert("Please enter a valid e-mail address.");
                document.form.from.focus();
                return false;
        }
        if (document.form.subject.value == ""){
                alert("Please select a subject.");
                document.form.subject.focus();
                return false;
        }
        if (document.form.body.value == ""){
                alert("Please enter a message in the body section.");
                document.form.body.focus();
                return false;
        }

        return true;
}

