// JavaScript Document

var TTOnLoadControlExtension = onload;
onload = function(e) {
	TTOnLoadControlExtension(e);

// Sound-Controls
	var objElement = document.getElementById("ttweItemSoundOn");
	TTAPI.objCBTControl.SetControl("ttweItemSoundOn", objElement );
	g_objCrossBrowserModel.AddEventListener(objElement, "mouseup", customOnControlSoundOnMouseup);

	objElement = document.getElementById("ttweItemSoundOff");
	TTAPI.objCBTControl.SetControl("ttweItemSoundOff", objElement);
	g_objCrossBrowserModel.AddEventListener(objElement, "mouseup", customOnControlSoundOffMouseup);
};

function customOnControlSoundOnMouseup(e) {
	var sEditMode = TTAPI.GetProperty("editmode");
	if(sEditMode == "wysiwyg") return;
	TTAPI.objCBTControl.OnSoundOnButtonPressed(e);

	TTAPI.objCBTControl.ShowControl("ttweItemSoundOn", false);
	TTAPI.objCBTControl.ShowControl("ttweItemSoundOff", true);

}
function customOnControlSoundOffMouseup(e) {

	var sEditMode = TTAPI.GetProperty("editmode");
	if(sEditMode == "wysiwyg") return;
	TTAPI.objCBTControl.OnSoundOffButtonPressed(e);

	TTAPI.objCBTControl.ShowControl("ttweItemSoundOn", true);
	TTAPI.objCBTControl.ShowControl("ttweItemSoundOff", false);
}