// JavaScript Document
function popUp(url){
	
	
	window.open(url,'1','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=400,height=138');

}
function noteUpload(form,field){
	var fieldValue = field.value;
	var fieldName = form.name + "." + field.name + "_uploaded";
	field = eval(fieldName);
	//alert("fieldValue:"+fieldValue + "  before:" + field.value);
	if (fieldValue == ""){
		field.value = 0;
	} else {
		field.value = 1;
	}
	//alert("fieldValue:"+fieldValue + "  after:" + field.value);
}

function openNesProfileWindow(queryString){
//open the profile item in a javascript window with the sent query string that might be a contactID, userID, or email address
	window.open('index.cfm?function=profile' + queryString,'profileWindow','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=no, scrollbars=yes, width=780,height=525');
}

function openHelpWindow(fileName,height,width){
//open a help file in a specific window.
	window.open('/help/' + fileName,'helpwindow','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=no, scrollbars=yes, width=' + width + ',height=' + height);
}

function toggleAdvanced(object) {
  var advanced = document.getElementById(object);
    if (advanced.style.display == 'none')
        show(object);
    else 
        hide(object);
}

function show(object) {
   var advanced = document.getElementById(object);
   advanced.style.display = 'block';
}

function hide(object) {
    var advanced = document.getElementById(object);
   advanced.style.display = 'none';
}

function delete_confirm(msg,id) {
	if(confirm(msg)) {
		location.href='default.php?function=note_list&act=delete&noteID='+id;
	} else {
		return false;
	}
}
function ChangeColor(DivId)
{
	var Obj = document.getElementById(DivId);
	Obj.setAttribute('class','button_hover');	
}
