
	// rimuove intere conversazioni
	function msgDropConversations( ) {
		var items = getSelectedMultiColumns2(2,"formselectconversation","chkselect");
		if ( items != "" ) {
			if (confirm(MESSAGESDROPCONVERSATIONSTEXT) == true ) {

				window.document.qmpautoform.command.value = "DROP";
				window.document.qmpautoform.qmpids.value = items;
				window.document.qmpautoform.submit( );
			}
			return false;
		} else {
			return false;
		}
	}

	function msgRevokePermission( ) {
		var items = getSelectedMultiColumns2(2,"formselectconversation","chkselect");
		if ( items != "" ) {
			window.document.qmpautoform.command.value = "DENY";
			window.document.qmpautoform.qmpids.value = items;
			window.document.qmpautoform.submit( );
			return false;
		} else {
			return false;
		}
	}			
			
	function msgOpenReceiptWindow(sender) {
		var win = window.open("receipt.asp?sender=" + sender,"winMessageReceipt","width=400,height=150");
		win.focus( );
	}				
	
	function msgOpenOptionWindow(brt) {
		var url = "Options.asp?brt=" + brt;
		var win = window.open(url,"winPreferences","width=550,height=420,top=50,left=50");
		return false;
	}	
	
	function msgOptionsSetMute( status ) {
		window.document.preferencesform.smsmute.value = status;
		window.document.preferencesform.submit( );
		return false;
	}

	
	// rimuove i messaggi selezionati
	function msgDropMessages(pagenum,sender) {
		var items = getSelected("window.document.formMarkMessage.chkselect" );
		if ( items != "" ) {
			if ( confirm(MESSAGESDROPMESSAGESTEXT) == true ) {

				window.document.formremovemessages.msgids.value = items;
				window.document.formremovemessages.submit( );
			}
			return false;
		} else {
			return false;
		}
	}
	
	function msgOpenPreviewWindow( ) {
		var win = window.open("","winPreview","width=600,height=430,top=60,left=60,scrollbars=yes");
		var editedbody = window.document.editform.message.value;
		window.document.previewform.body.value = editedbody;
		window.document.previewform.submit( );
		return false;
	}	
	
	// rimuove gli utenti dalle liste bloccate
	function msgGrantPermission( ) {
		var items = getSelectedMultiColumns2(2,"formselectusers","chkselect");
		if ( items != "" ) {
			window.document.formpagevalues.items.value = items;
			window.document.formpagevalues.submit( );
			return false;
		} else {
			return false;
		}
	}
	
	function msgAddSenderToMyQmpeople( ) {
		var items = getSelectedMultiColumns2(2,"formselectqmpeoplelist","chkselect");
		if ( items != "" ) {
			window.document.addtomyqmpeopleform.contact.value = items;
			window.document.addtomyqmpeopleform.submit( );
			return false;
		} else {
			return false;
		}
	}	
	
	function msgSendMessage(maxlength) {
		if ( window.document.editform.message.value.length > maxlength ) {
			var msg = MESSAGESSENDMESSAGEWARNINGTEXT1;
			msg = msg.replace("[maxlength]",maxlength);
			window.alert(msg);
			return false;
		} else if ( trim(window.document.editform.recipient.value) == "" ) {
			var msg = MESSAGESSENDMESSAGEWARNINGTEXT2;
			window.alert(msg);
			return false;
		} else {
			window.document.editform.submit( );
			return false;
		}
	}

	function commentSendComment(maxlength) {
	//	if ( window.document.editform.message.value.length > maxlength ) {
	//		var msg = MESSAGESSENDMESSAGEWARNINGTEXT1;
	//		msg = msg.replace("[maxlength]",maxlength);
	//		window.alert(msg);
	//		return false;
	//	} else if ( trim(window.document.editform.recipient.value) == "" ) {
	//		var msg = MESSAGESSENDMESSAGEWARNINGTEXT2;
	//		window.alert(msg);
	//		return false;
	//	} else {
			window.document.editform.submit( );
			return false;
	//	}
	}	
	
	function msgGoToProfile(brt) {
		var opener = window.opener;
		if ( opener != null ) {
			opener.document.location.href = _HTTP_HOST + "profile/profilecellphone.asp?brt=" + brt;
		}
		window.close( );
		return false;
	}
