var readem = 0;

function okIreadit(){
	window.open('terms.cfm', 'Terms', 'width=590,height=500,toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,maginwidth=15');
	readem = 1;
}

function verifyit(theform){
	if (theform.name.value == ''){
		alert('You must enter your name');
		theform.name.focus();
		return false;
	}
	else if (theform.email.value == ''){
		alert('You must enter your email address');
		theform.email.focus();
		return false;
	}
	else if (theform.comment.value == ''){
		alert('You must enter a comment');
		theform.comment.focus();
		return false;
	}
	else if (readem != true){
		alert('You must read the terms and conditions');
		return false;
	}
	else if (theform.agree.checked != true){
		alert('You must agree to the terms and conditions');
		theform.agree.focus();
		return false;
	}
	else{
		return true;
	}
}


function UpdateAndShutIt(formname,fname1,fvalue1,fname2,fvalue2,fname3,fvalue3,fname4,fvalue4){
	if (fname1 != null){
		formfieldID = eval("window.opener.document." + formname + "." + fname1); 
		formfieldID.value = fvalue1;
	}
	if (fname2 != null){
		formfieldtxt = eval("window.opener.document." + formname + "." + fname2); 
		formfieldtxt.value = fvalue2;
	}
	if (fname3 != null){
		formfieldtxt = eval("window.opener.document." + formname + "." + fname3); 
		formfieldtxt.value = fvalue3;
	}
	if (fname4 != null){
		formfieldtxt = eval("window.opener.document." + formname + "." + fname4); 
		formfieldtxt.value = fvalue4;
	}
	top.self.close();
}

function OpenWin(url,name){
 window.open( url, name, 'width=530,height=450,toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,maginwidth=0');
}


function calswitch(cal,date,uid){
	new Ajax.Updater(cal, 'calendar.cfm?uid='+uid+'&calmonth='+date, {asynchronous:true, evalScripts:true});
}