function validate_upload(thisform)
{		
	//if (thisform.pdfdocument.value=="")
  	//{
	//	alert("Please select a PDF document to upload.");
	//	thisform.pdfdocument.focus();
	//	return false;
	//}
	//if (thisform.pdfdocument.value.indexOf(".pdf") == -1)
	//{
	//	alert("Invalid file type. Please select a PDF document to upload.");
	//	thisform.pdfdocument.focus();
	//	return false;
	//}
	if (thisform.file_date.value=="")
  	{
		alert("Please enter a date for this content item.");
		thisform.file_date.focus();
		return false;
	}		
	var objRegExp = /\d{4}\-\d{2}\-\d{2}/;
	if(!objRegExp.test(thisform.file_date.value))
	{
		alert("Please use the correct date format. (i.e. 2007-09-24)");
		thisform.file_date.focus();
		return false;
	}

	if (thisform.linkname.value=="")
  	{
		alert("Please enter a link name for this content item.");
		thisform.linkname.focus();
		return false;
	}	
//	if (thisform.filedesc.value=="")
// 	{
//		alert("Please enter a file description for this content item.");
//		thisform.filedesc.focus();
//		return false;
//	}
//	if (thisform.author.value=="")
// 	{
//		alert("Please enter author(s) for the uploaded document.");
//		thisform.author.focus();
//		return false;
//	}	

	var found = false;
	for ( var i = 0; i < thisform.category.length; i++ )
	{
		if ( thisform.category.options[i].selected )
		{
			found = true;
		}
	}
	if (!found)
	{
		alert("Please select one or more pages.");
		return false;
	}

	found = false;
	for ( var i = 0; i < thisform.block.length; i++ )
	{
		if ( thisform.block.options[i].selected )
		{
			found = true;
		}
	}
	if (!found)
		alert("Please select one or more blocks/resource pages.");
	return found;
/*
	if (thisform.block.value=="")
	{
		alert("Please select a section.");
		thisform.block.focus();
		return false;
	}
	var found = false;
	for ( var i = 0; i < thisform.state.length; i++ )
	{
		if ( thisform.state.options[i].selected )
		{
			found = true;
		}
	}
	if (!found)
		alert("Please select a state or specify none.");
	return found;	
*/
}

function showstateinfo(state) {
	var tDate = new Date();
	uVal = tDate.getTime(); 
	dest_state = "state_info/stateInfo.php?state=" + state;
	dest_state += "&rnd" + uVal;
	try { xmlhttp_state = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (e) {  alert(e); }
	xmlhttp_state.onreadystatechange = triggered_state;
	xmlhttp_state.open("GET", dest_state, true);
	xmlhttp_state.send(null);
}

function triggered_state() {
	if ((xmlhttp_state.readyState == 4) && (xmlhttp_state.status == 200)) {
		document.getElementById('stateinfo').innerHTML =xmlhttp_state.responseText;
	}
}
