function check_remarks(){
	if (document.autosave.remarks.value==""){
		alert("Please enter your remarks.")
	}
	else{
		document.autosave.submit();
	}
}
function check_upload() 
{
	var good;

	if ( document.doc_upload.file_title.value != ""){
		good = 1;
	}
	else
	{
		alert("Please enter a title for the file.");
		good = 0;
	}
	if ( (document.doc_upload.doc.value.indexOf('.doc', 0) != -1) || (document.doc_upload.doc.value.indexOf('.DOC', 0) != -1) || (document.doc_upload.doc.value.indexOf('.xls', 0) != -1) || (document.doc_upload.doc.value.indexOf('.XLS', 0) != -1) || (document.doc_upload.doc.value.indexOf('.ppt', 0) != -1) || (document.doc_upload.doc.value.indexOf('.PPT', 0) != -1) || (document.doc_upload.doc.value.indexOf('.jpg', 0) != -1) || (document.doc_upload.doc.value.indexOf('.jpg', 0) != -1) || (document.doc_upload.doc.value.indexOf('.JPG', 0) != -1) || (document.doc_upload.doc.value.indexOf('.gif', 0) != -1) || (document.doc_upload.doc.value.indexOf('.GIF', 0) != -1) || (document.doc_upload.doc.value.indexOf('.tif', 0) != -1) || (document.doc_upload.doc.value.indexOf('.TIF', 0) != -1) || (document.doc_upload.doc.value.indexOf('.pdf', 0) != -1) || (document.doc_upload.doc.value.indexOf('.PDF', 0) != -1)  || (document.doc_upload.doc.value.indexOf('.wmv', 0) != -1) || (document.doc_upload.doc.value.indexOf('.WMV', 0) != -1)  || (document.doc_upload.doc.value.indexOf('.mov', 0) != -1) || (document.doc_upload.doc.value.indexOf('.MOV', 0) != -1) || (document.doc_upload.doc.value.indexOf('.mpg', 0) != -1) || (document.doc_upload.doc.value.indexOf('.MPG', 0) != -1) || (document.doc_upload.doc.value.indexOf('.mpeg', 0) != -1) || (document.doc_upload.doc.value.indexOf('.MPEG', 0) != -1) || (document.doc_upload.doc.value.indexOf('.mp3', 0) != -1) || (document.doc_upload.doc.value.indexOf('.MP3', 0) != -1) ){
		good_ext = 1;
	}
	else
	{
		alert("The file must have a proper extension.");
		good_ext = 0;
	}	

	if(good == 1 && good_ext == 1)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function signout()
{	
	location.href = "index.php?goto=logout";
}

function autoSave(){
	if(document.getElementById('autosave'))
	{
		document.getElementById('autoSave').value = "1";
		
		if(document.getElementById('autosave').onsubmit)
		{
			document.getElementById('autosave').onsubmit();
		}
		document.autosave.submit();
		//var waitFlag = true;
		//window.setTimeout("waitFlag=false", 40 * 1000);
		pause(2000);
	}
}	

function pause(millis) 
{
        var date = new Date();
        var curDate = null;

        do { curDate = new Date(); } 
        while(curDate-date < millis)
} 

function jumptourl()  {
			tt = document.getElementById('selectarchive').value;
			nextpage = 'index.php?id='+tt+'&page=deliv&start=1';
			nextpageurl = nextpage;
			autoSave();
			document.location = url;
		}

