
function storeButtonDisabled(){
               	var nodes = $$('.rich-message-label');
               	var disabled = false;
               	for(var i = 0; i < nodes.length; i++){
               	var node = nodes[i];
               	  if(node.innerHTML != ""){
               	  	disabled = true;
               	  	break;
               	  }
               	}
               	return disabled;
               }
               
function selectAllFiles(f) {
	for (var i = 0; i < filesCount; i++) {
		var b = $('mainform:files:'+i+':file_selected');
		if (b) {
			b.checked = f;
		}
		
	}
}

function onselectFileClick(el) {
	if (!el.checked) {
		$('select_all').checked = false;
	}else {
		var b = true;
		for (var i = 0; i < filesCount; i++) {
		var d = $('mainform:files:'+i+':file_selected');
			if (!d.checked) {
				b = false;
				break;
			}
		}
		if (b) {
			$('select_all').checked = true;
		}
		
	}
}

function onSearchPanelMouseOut(e, elt) {
	var relTarg = e.relatedTarget || e.toElement;
	if (relTarg == elt) {
		hideSearch();
	}
}