

function SaveLayer(){	
this.frmTestar.contentSP.value = document.getElementById('contentS').innerHTML;

document.frmTestar.submit();
}


function AddImage(){	
	imagePath = prompt('Ange web adressen till bilden', 'http://');				

	var obj = MM_findObj("contentS")	
	if ((imagePath != null) && (imagePath != "")){	
		obj.focus(); 				
		obj.document.execCommand('InsertImage', false, imagePath);
	}
	frames.message.focus();			
}


function FormatText(command, option){
	var obj = MM_findObj("contentS")
	obj.focus();
  	obj.document.execCommand(command, false, option);
  	obj.focus();
}

function setColor(color){
	if (document.selection.type == "Control"){ 
    	var oControlRange = document.selection.createRange();
    	for (i = 0; i < oControlRange.length; i++){
      	if (oControlRange(i).tagName == "TABLE")
       		if(colorCMD=='BackColor') oControlRange(i).bgColor=color;
		}	
		}
	if (document.selection.type == "Text"){
 	document.execCommand(colorCMD,false,color);
	}


}

function colorDlg(hexcolor){
var sColor

	sColor=dlgHelper.ChooseColorDlg(sColor);
	sColor = sColor.toString(16);
	if (sColor.length < 6) {
  		var sTempString = "000000".substring(0,6-sColor.length);
  		sColor = sTempString.concat(sColor);
	}	
	return sColor;

}


