function PictureChange(fld, dir) {
	var img = eval('document.images.img' + fld);
	var o = eval('document.forms[0].' + fld + '.options');
	for (i=0; i< o.length; i++) {
		if (o[i].selected) {
			if (o[i].value == '') 
				img.src = '/_Images/1x1.gif';
			else
				img.src = dir + o[i].value;
			return
		}
	}
}
function CheckDel() {
  if (confirm("Are you sure you want to delete this entry?\nThis operation cannot be undone."))
    return true;
  else
    return false;
}

function JSTrim(s) {
	var i, FirstPos = 0, LastPos;

	if (typeof(s) != 'string') {
		return s;
	}
	
	LastPos = s.length;
	
	for (i = 0; i < s.length; i++) {
		if (s.charAt(i) != ' ') {
			break;
		}
		FirstPos++;
	}
	
	for (i = s.length - 1; i >= 0; i--) {
		if (s.charAt(i) != ' ') {
			break;
		}
		LastPos--;
	}
	
	if (LastPos == 0) {
		return "";
	} else {
		return s.substring(FirstPos, LastPos);
	}
	
}
function FieldOk(fld, fname) {
	if (JSTrim(fld.value) == '') {
		alert('Please provide a value for: ' + fname);
		fld.focus();
		return false;
	}
	return true;
}
function wopen(url) {
	var w = window.open('http://' + url, 'w', 'toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=500,top=50,left=50')
	w.focus();
	return false;
}

function popwin(url)  
{ 
   popw = window.open(url,'Menu','toolbar=0,width=555,height=185,location=0,directories=0,top=300,left=200,status=0,menubar=0,scrollbars=1,resizable=0')
   popw.focus()
}
