function confirmDelete(delUrl) {
	var answer = confirm("Are you sure you want to delete?")
 	if (answer) {
		window.location = delUrl;
	}
}

function FilePicker(returnTo, bp, retFullPath) {
	if (!document.getElementById) return false;
	if (!bp) bp = '';
	retFullPath = retFullPath ? 1 : 0;
	var r2 = document.getElementById(returnTo);
	var cVal = r2.value;

	if( cVal != '') {
		if ( cVal.indexOf('/') > -1 )
			bp = cVal.substring( cVal.lastIndexOf('/') );
		else
			cVal = bp + cVal;
	}
	
	fp = '/!admin/FileUpload/default.asp?RetVal='+cVal+'&returnTo='+returnTo+'&path='+bp+'&returnPath='+retFullPath;
	return PopWin(fp,'picker',800,500);
}

var wini; //Reference to a window

function PopWin(url, name, width, height) {
	h = (height) ? height : 500;
	w = (width) ? width : 600;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =  'height='+ h +',width='+ w +',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable';

	wini = window.open(url,name,settings);
	if (wini) wini.focus();
	return ( !wini )
}// PopWin()

function uploadImg(formname,inputname) {
	var w = 600; var h = 200;
	var l = (screen.width - w) / 2;
	var t = (screen.height - h) / 2;
	var url = "/pilot/photos/upload.aspx?formname="+formname+"&inputname="+inputname;
	newwin = window.open(url,"","width="+w+",height="+h+",left="+l+",top="+t+",resizable");
}
