
function load(frameId){
	getIFrameDocument(frameId).designMode = "On";
	//if (document.getElementById(id).contentDocument)
	//	
	//else
	if (navigator.appName.indexOf('Microsoft') != -1)
		getIFrameDocument("editFrame").focus();
	else
		document.getElementById(frameId).contentWindow.focus();
	getIFrameDocument("editFrame").execCommand ('fontname', '' , "Tahoma");
	getIFrameDocument("editFrame").execCommand ('fontsize', '' , "2");
	
}

function init(){
	document.getElementById("editFrame").contentWindow.focus();
	getIFrameDocument("editFrame").execCommand ('fontname', '' , "Tahoma");
	getIFrameDocument("editFrame").execCommand ('fontsize', '' , "2");
}

function getIFrameDocument(id){ 
	if (document.getElementById(id).contentDocument){  
		return document.getElementById(id).contentDocument;
	} else {
		return document.frames[id].document;
	}
}

function clearText(frameId){
	getIFrameDocument(frameId).body.innerHTML="";
}

function link(frameId){
	getIFrameDocument(frameId).execCommand ('createlink', true, null);
	document.getElementById(frameId).contentWindow.focus ();
}

function changeEditFrame(command, frameId){
	getIFrameDocument(frameId).execCommand (command, false, null);
	document.getElementById(frameId).contentWindow.focus ();
}

function changeFontSize(frameId, selectId){
	theSize = document.getElementById(selectId).value ;
	getIFrameDocument(frameId).execCommand('fontsize', false, theSize);
	document.getElementById(frameId).contentWindow.focus ();
}

function changeFont(frameId, selectId){
	theName=document.getElementById(selectId).value ;
	getIFrameDocument(frameId).execCommand ('fontname', false , theName);
	document.getElementById(frameId).contentWindow.focus ();
}

function changeFontColor(frameId){
	theSize = ctrl.options[ctrl.selectedIndex].value ;
	getIFrameDocument(frameId).execCommand ('forecolor', false, color);
	document.getElementById(frameId).contentWindow.focus ();
}




