// 06/20/2008, jstrimpe
// launch new windoe for events app.

// define arbitrary function to call DHTML window
function openFileUpload()
{ //Define arbitrary function to run desired DHTML Window widget codes
	//ajaxwin=dhtmlwindow.open("ajaxbox", "ajax", "frmImageUpload.sfe", "Upload File", "width=450px,height=300px,left=300px,top=100px,resize=0,scrolling=0")
	imageWindow=dhtmlwindow.open("fileBox", "iframe", "frmUpload.sfe?action=open", "Upload File", "width=450px,height=200px,center=1,resize=0,scrolling=0")
	imageWindow.onclose=function()
	{         
		document.mainForm.filePath.value=window.frames["_iframe-fileBox"].document.fileUploadFrm.filePath.value;
		document.mainForm.fileName.value=window.frames["_iframe-fileBox"].document.fileUploadFrm.fileName.value;      		
		return true 
	} //Run custom code when window is about to be closed
}

function mainFormDeleteFile()
{
	var answer = confirm('Are you sure that you want to delete this file?');
	
	if (answer){   
		document.mainForm.mainFormPath.value="";;
		document.mainForm.mainFormFileName.value="";
		parent.document.getElementById('mainFormFile').innerHTML = "<span class=\"gray\">File Not Uploaded</span>";
		parent.document.getElementById('mainFormDeleteFile').innerHTML ="<span class=\"gray\">File Not Uploaded</span>";  
	}  
	else
	{
		// do something so window does not go to top
		document.getElementById('mainFormDeleteFile').innerHTML ="<a href=\"#\" onclick=\"mainFormDeleteFile(); return false\">Delete File</a>"; 
	}          
}  