BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, llwchar wc)
{

	switch( item->getType() )
	{
	case LLAssetType::AT_TEXTURE:
	  	openEmbeddedTexture( item, wc );
		return TRUE;

	case LLAssetType::AT_SOUND:
		openEmbeddedSound( item, wc );
		return TRUE;

	case LLAssetType::AT_NOTECARD:
		openEmbeddedNotecard( item, wc );
		return TRUE;

	case LLAssetType::AT_LANDMARK:
		openEmbeddedLandmark( item, wc );
		return TRUE;

	case LLAssetType::AT_LSL_TEXT:
	case LLAssetType::AT_CLOTHING:
	case LLAssetType::AT_OBJECT:
	case LLAssetType::AT_BODYPART:
	case LLAssetType::AT_ANIMATION:
	case LLAssetType::AT_GESTURE:
		showCopyToInvDialog( item, wc );
		return TRUE;
	default:
		return FALSE;
	}

}
void LLViewerTextEditor::openEmbeddedSound( LLInventoryItem* item, llwchar wc )
{
	// Play sound locally
	LLVector3d lpos_global = gAgent.getPositionGlobal();
	const F32 SOUND_GAIN = 1.0f;
	if(gAudiop)
	{
		gAudiop->triggerSound(item->getAssetUUID(), gAgentID, SOUND_GAIN, LLAudioEngine::AUDIO_TYPE_UI, lpos_global);
	}
	showCopyToInvDialog( item, wc );
}